Re: initramfs: is it supposed to work?

From: H. Peter Anvin (hpa_at_zytor.com)
Date: 12/31/04

  • Next message: Arjan van de Ven: "Re: kernel panic: Attempted to kill init!"
    To: linux-kernel@vger.kernel.org
    Date:	Fri, 31 Dec 2004 08:06:03 +0000 (UTC)
    
    

    Followup to: <41D4A2A6.3060607@tls.msk.ru>
    By author: Michael Tokarev <mjt@tls.msk.ru>
    In newsgroup: linux.dev.kernel
    >
    > o And finally, when booting the "right way", using initramfs where
    > /init gets executed with pid=1 and should do the same pivot_root
    > and things like that, before the umount loop mentioned above,
    > it looks almost right:
    > rootfs /initrd rootfs ro 0 0
    > /dev/hda1 / ext3 rw 0 0
    > (this is where eg umount from busybox chokes, also entering
    > endless loop.. but tha's a different story, it's an obvious
    > bug in busybox.. however in order to fix it properly one have
    > to know which cases like the 3 mentioned above are possible).
    >

    You don't pivot_root initramfs, because initramfs *IS* rootfs.

    Instead, use the run-init program from the klibc distribution, or
    something similar. It cleans up the initramfs contents and overmounts
    it with the new root filesystem.

            -hpa

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Arjan van de Ven: "Re: kernel panic: Attempted to kill init!"

    Relevant Pages

    • Re: pivot_root broken in 2.6.15-rc1-mm2
      ... > (Another is that calling chroot and such after deleting their binaries out of ... > initramfs but before the paths are adjusted so that the ones in the new root ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC] Reliable video POSTing on resume
      ... > Perhaps only emu86 should be used, to have a well-debugged codepath on ... Well, if it has to live in initramfs, it better be really small. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: swsusp: allow resume from initramfs
      ... >> where swap is on a logical volume. ... In that case, the initramfs needs to ... > a little more closely - perhaps we can get some shared code going that ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Initramfs
      ... > pass a cpio image into the standard initrd memory space. ... kernel option, so the name of the option shouldn't change. ... an initramfs image loaded into initrd space should be ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: udev: whats up with old /dev ?
      ... Control reaches the above code after an initramfs is unpacked, ... control reaches /init in an initramfs after the above code executes. ... Being inside the kernel at this point, it seems to me there ought to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)