[arch-projects] [mkinitcpio] Booting from ISO on NTFS
On Wed, Mar 06, 2019 at 06:28:36PM +0000, Hietanen Jussi wrote:
Hello!
I've been trying to find for an answer for my problem from the arch wiki, IRC channel and from the google for the last a couple of days.
My problem: I'm creating a live Arch build which could boot from a .iso image located on a Windows NTFS partition. I've successfully created a initramfs that has ntfs-3g and is able to mount the NTFS partition, BUT the mkinitcpio lacks tools to create an init script which could boot from a file from a filesystem.
My boot procedure would be following;
Boot the customized initramfs
initramfs mounts the NTFS partition
initramfs mounts the .ISO image as a loop device,
initramfs changes the new root to the loop mounted .ISO
the late userspace starts
Can this be achieved by simply adding initcpio hooks or do I need to rewrite the whole early init script?
cc'ing the arch-projects list where this belongs. Let's just get this out of the way up front: this sounds shaky at best. You'd be better off booting the ISO directly from your bootloader if that's an option. I'm not really sure if this is possible in the current implementation of mkinitcpio. You'd need to, at a minimum, override the mount_handler to mount your NTFS partition containing the ISO, and then setup the loopback mounted ISO on /new_root. After that, you'll have to `mount --move` the NTFS filesystem somewhere into the new system root, or do the incredibly hacky thing of lazily umounting it (because you have an open file handle to the ISO). Good luck, dR
participants (1)
-
Dave Reisner