linux - Is there a way to wait until root filesystem is mounted? -
i have statically linked code(not module) in kernel should launch kernel thread after root file system mounted. problem don't know how without modifying prepare_namespace() kernel function. thought it's possible via initcalls they're executed before kernel takes care rootfs. know best way this?
update [1]: @benvoigit suggested following solution in comments: seems should open /proc/mounts , poll_wait on it. see source `mounts_poll'
update [2]: looked @ rsbac patches, rsbac modifies prepare_namespace() function make actions after filesystem mounted. seems easiest way.
well, current linux images big fit pc boot sector. modern bootloaders grub mount small filesystem in ram before real one.
to understand happening under hood, can open disk image located under /boot. example, in ubuntu:
mkdir test cd test zcat /boot/initrd.img-2.6.35-24-generic > image.cpio cpio -i < image.cpio vim init
in end, it's bunch of shell scripts - simplicity poetic.
Comments
Post a Comment