|
|
Subscribe / Log in / New account

Dracut looks to replace the initramfs patchwork

Dracut looks to replace the initramfs patchwork

Posted Feb 5, 2009 2:07 UTC (Thu) by miffe (subscriber, #24478)
Parent article: Dracut looks to replace the initramfs patchwork

Hmm, my util-linux already contains a pivot_root, itn't that what the proposed switch_root woudld do?

Or am I missing something?


to post comments

Dracut looks to replace the initramfs patchwork

Posted Feb 5, 2009 3:22 UTC (Thu) by jbailey (guest, #16890) [Link] (1 responses)

pivot_root requires an older-style initrd. It doesn't work with an
initramfs at all.

Dracut looks to replace the initramfs patchwork

Posted Feb 5, 2009 8:18 UTC (Thu) by jengelh (guest, #33263) [Link]

That is because initramfs is extracted to the 'rootfs' (some instance of an ramfs), and rootfs is not supposed to be pivoted. Instead, you remove all files and then do a normal chroot. In other words:

$myothercommands;
LD_LIBRARY_PATH=/mnt/lib /mnt/lib64/ld-linux-x86-64.so.2 /mnt/bin/rm -Rf /$everythingButMnt;
exec /mnt/lib64/ld-linux-x86-64.so.2 --library-path "/mnt/lib:/mnt/usr/lib" /mnt/usr/bin/chroot /mnt /sbin/init "$@";

something like that. Of course you can wrap that into a nice C program, but if it works without, you'll probably spare the extra binary.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds