Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • 1
    @PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC. Commented Mar 22, 2019 at 2:04
  • 5
    Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed. Commented Mar 22, 2019 at 5:37
  • 1
    @IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed). Commented Mar 22, 2019 at 17:23
  • 1
    @pizdelect If you believe the vast majority of documentation "is wrong", that should tell you something about your own understanding. /init is part of the startup phase which is why the line of code you refer to talks about the ramdisk ramdisk_execute_command. /init is NOT on the root file system. Sure /init could hang and never complete it's job, but on a well functioning system (like 99.9999%) it completes and at the end calls something like switch_root man7.org/linux/man-pages/man8/switch_root.8.html Or you could just ps -ef and see which process is PID 1 Commented Mar 26, 2019 at 18:13
  • 1
    Not attacking you. Apologies if you think I am. The information I have provided is intended to give touch points onto people's understanding in order to explain the requirement for a file system. Not provide a definitive guide to booting Linux on every distribution. I deliberately trimmed out long discussion of initrd because it's not relavent. The mechanism for how /sbin/init is called from /init on initrd is also not relavent. The permutations of booting android, osx an every other Linux is irrelevant. The fact that the kernel calls a user space program on a filesystem is relavent. Commented Mar 26, 2019 at 22:47