Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.

Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It is strongly recommended to keep it on PC-style hardware with lots of hotpluggable peripherals. On the other hand, it makes a lot of sense to boot an embedded device without any initramfs, with a kernel that just supports the particular hardware configuration it's built for.

The kernel of course needs to boot to a filesystem: there has to be some way for it to load whatever application you want to run. If you aren't going to run anything, then you might as well keep the machine powered off.

If you don't want to use an initramfs, just tell your bootloader not to pass one. Also don't include one in the output of kernel build, of course — how this happens if at all is architecture- and bootloader-dependent: for example, vmlinux and bzImage don't include the initramfs (they're the raw and compressed kernel respectively), but uImage (for U-Boot) packs both the kernel and the initramfs if there is one.

(Technically, as mikeservmikeserv notes, there's always an initramfs — but by default, it's an empty, 134-byte archive. What you're seeing, and wanting to get rid of, is a “true”, non-empty initramfs created by your build process and containing tools which are then used to mount the root filesystem.)

Mind you, an initramfs can be a reasonable way of making a single-application system with no persistent data: put all of your application into the initramfs, boot that and keep it. This makes it easier to organize your persistent storage or boot image (all you need is the kernel and initramfs, which can be bundled). There are downsides to this approach however: all data in the initramfs will be stored in RAM permanently, and you can't easily modify the files in the boot image, you have to rebuild the archive.

The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.

Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It is strongly recommended to keep it on PC-style hardware with lots of hotpluggable peripherals. On the other hand, it makes a lot of sense to boot an embedded device without any initramfs, with a kernel that just supports the particular hardware configuration it's built for.

The kernel of course needs to boot to a filesystem: there has to be some way for it to load whatever application you want to run. If you aren't going to run anything, then you might as well keep the machine powered off.

If you don't want to use an initramfs, just tell your bootloader not to pass one. Also don't include one in the output of kernel build, of course — how this happens if at all is architecture- and bootloader-dependent: for example, vmlinux and bzImage don't include the initramfs (they're the raw and compressed kernel respectively), but uImage (for U-Boot) packs both the kernel and the initramfs if there is one.

(Technically, as mikeserv notes, there's always an initramfs — but by default, it's an empty, 134-byte archive. What you're seeing, and wanting to get rid of, is a “true”, non-empty initramfs created by your build process and containing tools which are then used to mount the root filesystem.)

Mind you, an initramfs can be a reasonable way of making a single-application system with no persistent data: put all of your application into the initramfs, boot that and keep it. This makes it easier to organize your persistent storage or boot image (all you need is the kernel and initramfs, which can be bundled). There are downsides to this approach however: all data in the initramfs will be stored in RAM permanently, and you can't easily modify the files in the boot image, you have to rebuild the archive.

The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.

Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It is strongly recommended to keep it on PC-style hardware with lots of hotpluggable peripherals. On the other hand, it makes a lot of sense to boot an embedded device without any initramfs, with a kernel that just supports the particular hardware configuration it's built for.

The kernel of course needs to boot to a filesystem: there has to be some way for it to load whatever application you want to run. If you aren't going to run anything, then you might as well keep the machine powered off.

If you don't want to use an initramfs, just tell your bootloader not to pass one. Also don't include one in the output of kernel build, of course — how this happens if at all is architecture- and bootloader-dependent: for example, vmlinux and bzImage don't include the initramfs (they're the raw and compressed kernel respectively), but uImage (for U-Boot) packs both the kernel and the initramfs if there is one.

(Technically, as mikeserv notes, there's always an initramfs — but by default, it's an empty, 134-byte archive. What you're seeing, and wanting to get rid of, is a “true”, non-empty initramfs created by your build process and containing tools which are then used to mount the root filesystem.)

Mind you, an initramfs can be a reasonable way of making a single-application system with no persistent data: put all of your application into the initramfs, boot that and keep it. This makes it easier to organize your persistent storage or boot image (all you need is the kernel and initramfs, which can be bundled). There are downsides to this approach however: all data in the initramfs will be stored in RAM permanently, and you can't easily modify the files in the boot image, you have to rebuild the archive.

note that initramfs-only can be viable for an appliance with no persistent data; note that there's always an initramfs, even if it isn't used and not taking significant space
Source Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k

The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.

Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It is strongly recommended to keep it on PC-style hardware with lots of hotpluggable peripherals. On the other hand, it makes a lot of sense to boot an embedded device without any initramfs, with a kernel that just supports the particular hardware configuration it's built for.

The kernel of course needs to boot to a filesystem: there has to be some way for it to load whatever application you want to run. If you aren't going to run anything, then you might as well keep the machine powered off.

If you don't want to use an initramfs, just tell your bootloader not to pass one. Also don't include one in the output of kernel build, of course — how this happens if at all is architecture- and bootloader-dependent: for example, vmlinux and bzImage don't include the initramfs (they're the raw and compressed kernel respectively), but uImage (for U-Boot) packs both the kernel and the initramfs if there is one.

(Technically, as mikeserv notes, there's always an initramfs — but by default, it's an empty, 134-byte archive. What you're seeing, and wanting to get rid of, is a “true”, non-empty initramfs created by your build process and containing tools which are then used to mount the root filesystem.)

Mind you, an initramfs can be a reasonable way of making a single-application system with no persistent data: put all of your application into the initramfs, boot that and keep it. This makes it easier to organize your persistent storage or boot image (all you need is the kernel and initramfs, which can be bundled). There are downsides to this approach however: all data in the initramfs will be stored in RAM permanently, and you can't easily modify the files in the boot image, you have to rebuild the archive.

The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.

Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It is strongly recommended to keep it on PC-style hardware with lots of hotpluggable peripherals. On the other hand, it makes a lot of sense to boot an embedded device without any initramfs, with a kernel that just supports the particular hardware configuration it's built for.

The kernel of course needs to boot to a filesystem: there has to be some way for it to load whatever application you want to run. If you aren't going to run anything, then you might as well keep the machine powered off.

If you don't want to use an initramfs, just tell your bootloader not to pass one. Also don't include one in the output of kernel build, of course — how this happens if at all is architecture- and bootloader-dependent: for example, vmlinux and bzImage don't include the initramfs (they're the raw and compressed kernel respectively), but uImage (for U-Boot) packs both the kernel and the initramfs if there is one.

The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.

Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It is strongly recommended to keep it on PC-style hardware with lots of hotpluggable peripherals. On the other hand, it makes a lot of sense to boot an embedded device without any initramfs, with a kernel that just supports the particular hardware configuration it's built for.

The kernel of course needs to boot to a filesystem: there has to be some way for it to load whatever application you want to run. If you aren't going to run anything, then you might as well keep the machine powered off.

If you don't want to use an initramfs, just tell your bootloader not to pass one. Also don't include one in the output of kernel build, of course — how this happens if at all is architecture- and bootloader-dependent: for example, vmlinux and bzImage don't include the initramfs (they're the raw and compressed kernel respectively), but uImage (for U-Boot) packs both the kernel and the initramfs if there is one.

(Technically, as mikeserv notes, there's always an initramfs — but by default, it's an empty, 134-byte archive. What you're seeing, and wanting to get rid of, is a “true”, non-empty initramfs created by your build process and containing tools which are then used to mount the root filesystem.)

Mind you, an initramfs can be a reasonable way of making a single-application system with no persistent data: put all of your application into the initramfs, boot that and keep it. This makes it easier to organize your persistent storage or boot image (all you need is the kernel and initramfs, which can be bundled). There are downsides to this approach however: all data in the initramfs will be stored in RAM permanently, and you can't easily modify the files in the boot image, you have to rebuild the archive.

Source Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k

The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.

Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It is strongly recommended to keep it on PC-style hardware with lots of hotpluggable peripherals. On the other hand, it makes a lot of sense to boot an embedded device without any initramfs, with a kernel that just supports the particular hardware configuration it's built for.

The kernel of course needs to boot to a filesystem: there has to be some way for it to load whatever application you want to run. If you aren't going to run anything, then you might as well keep the machine powered off.

If you don't want to use an initramfs, just tell your bootloader not to pass one. Also don't include one in the output of kernel build, of course — how this happens if at all is architecture- and bootloader-dependent: for example, vmlinux and bzImage don't include the initramfs (they're the raw and compressed kernel respectively), but uImage (for U-Boot) packs both the kernel and the initramfs if there is one.