Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding iso-scan feature to kiwi-live dracut module #585

Merged
merged 1 commit into from
Jan 22, 2018

Conversation

davidcassany
Copy link
Collaborator

This commit adds the iso-scan scripts to kiwi-live module_setup
if the former files are found in the system inside the dmsquash-live
dracut module directory.

Fixes #574 and is related to #521

This commit adds the iso-scan scripts to kiwi-live module_setup
if the former files are found in the system inside the dmsquash-live
dracut module directory.

Fixes #574 and is related to #521
@davidcassany
Copy link
Collaborator Author

With this change is it possible to boot from an iso (regardless of using flags="overlay" or flags="dmsquash") with a grub2 menu entry like this:

menuentry 'Live openSUSE' --class suse --class gnu-linux --class gnu --class os {
        set isolabel=CDROM
        set isofile="/boot/iso/LimeJeOS-tumbleweed.x86_64-1.99.1.iso"
        loopback loop $isofile
        linux (loop)/boot/x86_64/loader/linux boot=isolinux iso-scan/filename=$isofile root=live:CDLABEL=$isolabel ro rd.live.image rhgb
        initrd (loop)/boot/x86_64/loader/initrd
}

Also managed to boot from a vfat usb using the live-fat-stick command and adjusting syslinux bootloader config afterwards:

host:~> sudo live-fat-stick LimeJeOS-tumbleweed.x86_64-1.99.1.iso /dev/sdc1

Where /dev/sdc1 is the vfat partition of the USB stick. Later I updated the <usbmountpoint>/boot/syslinux/syslinux.cfg file to include the iso-scan/filename=/LimeJeOS-tumbleweed.x86_64-1.99.1.iso root=live:CDLABEL=CDROM parameters to the append line, something like:

LABEL LimeJeOS-tumbleweed.x86_64-1.99.1.iso
        kernel linux-LimeJeOS-tumbleweed.x86_64-1.99.1.iso
        append initrd=initrd-LimeJeOS-tumbleweed.x86_64-1.99.1.iso isofrom=/dev/disk/by-uuid/5E0C-AA8A:/LimeJeOS-tumbleweed.x86_64-1.99.1.iso isofrom_device=/dev/disk/by-uuid/5E0C-AA8A isofrom_system=/LimeJeOS-tumbleweed.x86_64-1.99.1.iso loader=syslinux splash=silent   quiet showopts iso-scan/filename=/LimeJeOS-tumbleweed.x86_64-1.99.1.iso root=live:CDLABEL=CDROM 

About #521 I am not sure that much more can be done from KIWI perspective, as moving the ISO to a vfat stick and set the bootloader and other parameters is out if the scope of KIWI, but there is the great live-fat-stick tool for that matter.

Persistent COW files are not part of this PR and I believe it should be handled in another PR in order to facilitate reviewing and tests.

Copy link
Collaborator

@schaefi schaefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great and again we participate from what dracut already provides :)

Regarding live-fat-stick I think it would be worth mentioning in the documentation

@schaefi schaefi merged commit 867c022 into master Jan 22, 2018
@schaefi schaefi deleted the make_isos_bootable branch January 22, 2018 08:55
@davidcassany
Copy link
Collaborator Author

Yes, I was afraid that iso-scan scripts would be somehow coupled with dmsquash-live module, but it turned out that it is pretty simple and atomic.

Sure, live-fat-stick should be mentioned in the documentation, this is true.

@cyberorg
Copy link
Contributor

There is https://software.opensuse.org/package/live-grub-stick using grub2(works with all partitions supported by grub2) instead of syslinux(only vfat), and https://software.opensuse.org/package/live-usb-gui script that act as gui frontend to both those scripts.

@cyberorg
Copy link
Contributor

Tried with http://widehat.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-Rescue-CD-x86_64-Snapshot20180129-Media.iso get just dracut shell, there is no /var/log/boot.kiwi, what should I be looking for to check if this patch is included in the initrd?

@davidcassany
Copy link
Collaborator Author

@cyberorg In order to see if the patch is included you should check the dracut modules version, as I can see the patch should be in any dracut-kiwi-live package equal or higher than v9.12.0. You can check the installed version from the packages file produced by kiwi.

Also you can check /usr/lib/dracut/modules.d/90kiwi-live/module_setup.sh script from the dracut shell, there should be something like that:

dmsquashdir=$(find "${dracutbasedir}/modules.d" -name "*dmsquash-live")     
if [ -n "${dmsquashdir}" ] && \                                             
    [ -f "${dmsquashdir}/parse-iso-scan.sh" ] && \                          
    [ -f "${dmsquashdir}/iso-scan.sh" ]; then                               
    inst_hook cmdline 31 "${dmsquashdir}/parse-iso-scan.sh"                 
    inst_script "${dmsquashdir}/iso-scan.sh" "/sbin/iso-scan"               
fi

This is the patch I did to include iso-scan.sh script, which basically looks for the iso in devices and loop mounts it. If this part is there then the patch is included into the iso.

@cyberorg
Copy link
Contributor

cyberorg commented Feb 3, 2018

Works, tested using images here: https://build.opensuse.org/project/show/openSUSE:Factory:Live

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants