Talk:Initramfs - make your own

From Gentoo Wiki
Jump to:navigation Jump to:search
Before creating a discussion or leaving a comment, please read about using talk pages. In particular, sign comments using ~~~~ and add new discussions at the bottom of the page. New discussions should be made visible with {{Talk|date = 2024-05-18}}.
== Discussion title ==

{{Talk|date = 2024-05-13}}

A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC)
: A reply [[User:Sally|Sally]] 11:29, 14 May 2024 (UTC)
:: Another reply [[User:Larry|Larry]] 11:32, 18 May 2024 (UTC)
:: Your reply ~~~~

Navigate to first:

They are probably not required with modern DEVTMPFS in the kernel

Talk status
This discussion is still ongoing.

You MUST have "nod /dev/console" (and "dir /dev") as I explained in User:Pietinger/Tutorials/Initramfs_Overview#Why_do_I_need_an_additional_line_when_using_an_embedded_initramfs_.3F

-- pietinger 14:01, 15 June 2023 (UTC)

I've got mine working with just the /dev dir, and it just mounts a devtmpfs there
This defines the structure my script makes, the mounts are fstab based, and some of the first lines in the init script are it mounting those things[1]
Zen desu (talk) 14:11, 15 June 2023 (UTC)
Do you use a (external) CPIO ? I have a built an embedded initramfs and I have needed this line. (both are explained in my link). -- pietinger 14:24, 15 June 2023 (UTC)
Mine is embedded, I did it like this, using that script i have on github to generate the directory: Full_Disk_Encryption_From_Scratch_Simplified#Embedding_the_initramfs
I've used that method with dracut and with my totally custom ones, mostly so i can sign the whole kernel/initramfs for secure boot. (and have done both with EFI stubs)
Zen desu (talk) 14:28, 15 June 2023 (UTC)
You do embedding with a directory and not with a file-list (as I did). Maybe there is a difference. I only can tell it was necessary to have this line when I did my embedded initramfs with a file-list.
pietinger 14:44, 15 June 2023 (UTC)

Alternate construction methods

I think the current info is helpful, but I prefer the process of embedding the initramfs into the kernel, so it's all one file, and fewer steps. I'm not sure how to go about mixing the info. I think it makes sense for each style to have it's own section, maybe a subpage? this stuff can get really complex and messy, and I think breaking it into a page describing the why/how/what and then pages showing different methods makes more sense.
Maybe there should be a section showing the process of building the initramfs in /usr/src/initramfs, and then a section for using that with cpio or with the kernel build, but i feel it's important to demonstrate that using cpio means it doesn't have to be built in one directory, im not sure why you'd want it to be a separate file, if you want to use the same initramfs across kernels, can't you just have them keep using the same source directory? Maybe that makes sense when using a bootloader, but leaving an archive that can't really be signed sitting around, that controls my boot process, scares me. I also like that there is less variability when combining it all, if a kernel+initramfs image boots, that probably won't break easily. That also helps solve the issue of modules being tied to a kernel version.
Zen desu (talk) 15:28, 16 June 2023 (UTC)