livecd-tools / livecd-tools

Tools for building live CDs using DNF
GNU General Public License v2.0
234 stars 113 forks source link

editliveos doesn't run in mock #124

Closed khoitd1997 closed 5 years ago

khoitd1997 commented 5 years ago

Hi, when I try to run editliveos in mock, it complains about no loop devices. I can use livemedia-creator just fine, the command that I ran is:

editliveos -n test -o . -k fedora-kd-cinnamon.ks -d --extra-space-mb 500 ../build/fedora-kd-cinnamon.iso

I can also run editliveos outside mock, but it fails with a different issue when parsing repo:

LiveOS edit has completed.
Process duration: 00:04:12
Traceback (most recent call last):
  File "/usr/bin/editliveos", line 2392, in <module>
    sys.exit(main())
  File "/usr/bin/editliveos", line 2306, in main
    editor.install_rpms()
  File "/usr/bin/editliveos", line 2063, in install_rpms
    (name, baseurl, mirrorlist, proxy, inc, exc, cost) = repo
ValueError: too many values to unpack (expected 7)

Also is it possible to use editliveos to edit an iso to add/remove rpm packages? I want to be able to build an iso and then use it as the base iso to reduce build time for subsequent iso. Thank you for your help.

FGrose commented 5 years ago

-d is not an option in editliveos.

I don't use kickstarts, so this feature has not been tested since the conversion from edit-livecd, so code updates are needed in that area. Help wanted.

The kickstart feature is intended to allow adding rpm packages. When the program breaks to a shell, any packages added or removed will be reflected in the final .iso build.

khoitd1997 commented 5 years ago

Hi, do you have a pointer on where I should start for updating the code? I'm interested in getting this feature to work.

FGrose commented 5 years ago

Yes, https://github.com/livecd-tools/livecd-tools/blob/a2d4f4ae7a288818b0ec6b9c1d294b363025867c/tools/editliveos#L2097

is called in the section after https://github.com/livecd-tools/livecd-tools/blob/a2d4f4ae7a288818b0ec6b9c1d294b363025867c/tools/editliveos#L2337

editor._run_post_scripts() calls this function: https://github.com/livecd-tools/livecd-tools/blob/a2d4f4ae7a288818b0ec6b9c1d294b363025867c/imgcreate/creator.py#L744

khoitd1997 commented 5 years ago

Hi, thanks for the pointer, I ran into an error where it complained that it has to be local repo. What should I do to make it support remote repo too? Should I look at functions from the livemedia-creator or does editliveos already have that?

FGrose commented 5 years ago

The livemedia-creator code should be helpful.

khoitd1997 commented 5 years ago

Hello, I managed to get the edit script to run somewhat well by copying and modifying the install function from creator.py and adding a couple of arguments to the files. My fork is here if you want to check on the progress. However, there are a couple of questions I have, there is an excerpt in editliveos: https://github.com/livecd-tools/livecd-tools/blob/a2d4f4ae7a288818b0ec6b9c1d294b363025867c/tools/editliveos#L2349-L2351 I noticed that this would run post script twice, the kickstart module already has a function for obtaining pre-script, should I fix it to correctly run pre? In addition when using the fill_sack function call, I have these dnf output:

Start fill sack # my custom comment
repo: downloading from remote: fedora
fedora                             3.1 MB/s |  62 MB     00:20    
not found other for: 
not found modules for: 
not found deltainfo for: 
not found updateinfo for: 
fedora: using metadata from Wed 24 Oct 2018 03:20:15 PM PDT.
repo: downloading from remote: updates
updates                            1.7 MB/s |  25 MB     00:14    
not found other for: 
not found modules for: 
updates: using metadata from Fri 12 Apr 2019 11:23:56 PM PDT.
Last metadata expiration check: 0:00:13 ago on Sat 13 Apr 2019 01:14:02 AM PDT.
No module defaults found
Done fill sack # my custom comment

I'm not sure why the not found deltainfo for: and similar field was blank where there usually is a repo name there. I will keep testing the output of the command to make sure there is no issue and will keep you posted on the progress.

FGrose commented 5 years ago

Resolved by #127 and 82548ae30312003d81ec53ed585f97860da934b8.