Talk:Initramfs
From Gentoo Linux Wiki
Note that packing the image using the commandline or using gen_init_cpio gives an image with a different size on my computer (smaller with gen_init_cpio), and that the gen_init_cpio archive does not seem to be a .cpio.gz file (anymore?). I have not found any further info about format changes nor anything so if sbdy knows, I would gladly learn.
Synss 08:35, 19 December 2006 (UTC)
[edit] genkernel expansion
Hideeboo: I stripped out the '--no-gensplash' and '--no-bootsplash' - they aren't valid options now. Just use '--no-splash'.
The Wiki formatting seems to be OK but I can't get the internal link to the "Tech Tip: initramfs" to work.
I've tried to follow the model in Wiki formatting but it seems to want to go to an, as yet uncreated, Wiki page.
--Wynn 21:18, 28 December 2006 (UTC)
Forgot to say that there is more to come on "genkernel" and I've added a Work in Progress tag.
--Wynn 22:28, 28 December 2006 (UTC)
There may be a gap now while I try and get the genkernel kernel to boot. At present, it's failing with VFS error: unknown-block(3,3) probably because the IDE chipset driver is a module — but I thought genkernel took care of this, loading the modules, mounting the root fs and then switching root. It will probably need a good look at init (slink linuxrc). This will segue nicely into the next phase which is a guided tour of genkernel's init (the LiveCD/LiveDVD init is practically identical, just a couple of lines of suspend2/resume).
--Wynn 18:52, 29 December 2006 (UTC)
It boots now and, in the course of getting it to boot, it has become clear that if the high level IDE drivers are modules, the kernel can't detect the hard disk. If the high level drivers are compiled in but the chipset driver is a module then it can detect the disk but can't optimize its settings, that is, no DMA. Boots with initramfs: high level IDE and the IDE chipset drivers compiled in, all filesystem drivers, including the one for the root fs, are modules.
On to the guided tour.
--Wynn 18:29, 1 January 2007 (UTC)
The first draft of the guided tour finished. It will be left for a while before returning and polishing it. On to "Modifying the init script" which will require a bit of experimentation and may therefore only make slow progress.
--Wynn 20:13, 2 January 2007 (UTC)
"Reconfiguring busybox" complete except for polishing (like the "Guided tour").
"Modifying the init script" nearly finished, two example init scripts to be written and tested: the first to mount a root fs specified by device name (real_root=/dev/hdXN), LABEL (real_root=LABEL=2006.1-root) or UUID (real_root=UUID=9c6dbd37-e231-4625-b88a-4ce5f3d7170b) with both the high and low level disk drivers as modules, not built in. Surprised to find that this works!
The second example will be a small embedded system using Busybox's init and a version of the example inittab which goes with it. It should end up with two or three consoles and a network connection.
Most of the work for the first example is done but the second is still just an idea.
--Wynn 14:59, 20 January 2007 (UTC)
A script which contains closing braces has been put in a Box Code environment and the closing braces within have caused the last couple of lines to be put outside the box. I'll try and find out how to use closing braces inside a Box but if anyone else knows and can correct it I would be grateful.
--Wynn 21:07, 31 January 2007 (UTC)
The cause of the above unexpected formatting is the </pre> occurring in the last echo. I'll try and find out how to get this tag to appear in an open pre ... close pre environment.
--Wynn 11:15, 1 February 2007 (UTC)
A very nasty half hour: the heading "Index of Query_String" in one of the scripts had got separated from the echo and this created two new top level sections with the above title and containing everything from "Reconfiguring BusyBox" to the end. I seem to have managed to remove these spurious headings while leaving everything else as it was.
The closing pre mentioned above has been rendered innocuous by separating the slash from the pre and adding a comment pointing this out.
--Wynn 12:07, 1 February 2007 (UTC)
Made a few changes to "Booting a kernel made by genkernel" and the "Index of Query_String" heading has appeared again and a lot of stuff from the end of "Reconfiguring BusyBox" has disappeared.
I don't know what's going on.
--Wynn 20:17, 1 February 2007 (UTC)
Well, a theory as to what is happening is that, on saving a page, the Wiki program picks out the heading "Index of Query_String" from within open-pre/close-pre tags and within quotes on the echo line in the index.cgi script, makes it into a header for a new section of the page and pulls in a lot of the following text, sometimes all of it.
This header has now been hidden by replacing all the brokets (lt/gt) by escape sequences which echo should be able to cope with.
Before this was done, an attempt was made to remove the overnight Query_String header; on saving the result another two query_string headers appeared. After editing the echo string as described above, the two query_string headers and accompanying text were removed. The broket replacement seems to have done the trick: when last seen, there were no query_string headers and everything seemed back the way it was.
I feel a curious reluctance to edit anything...
--Wynn 10:46, 2 February 2007 (UTC)
With genkernel-3.4.6 (and, presumably, later) the individual cpio archives which are concatenated together to make the initramfs are no longer saved but are appended to the initramfs file as they are created.
As these files no longer exist, the section describing them has been removed and the two scripts creating the initramfs files have been changed to create the directories from scratch.
--Wynn 15:57, 5 February 2007 (UTC)
[edit] Error in "A guided tour around the init script": root=LABEL=label is working
In the section "A guided tour around the init script" it is stated:
real_root=LABEL=label real_root=UUID=uuid
either of these settings will cause findfs (from e2fsprogs), findfs (from busybox) and blkid (e2fsprogs) to be run to find the partition with the given LABEL or UUID. However, e2fsprogs is not part of genkernel's initramfs image and busybox is not configured to compile either findfs or blkid so this won't work.
I have checked the sources of genkernel-3.4.5-r1 and the program blkid of the e2fsprogs is added to the initramfs if you use the command line switch --disklabel.
--85.181.61.206 21:55, 24 January 2007 (UTC)
Thank you for your correction. The wording has been changed, please review it if you get the opportunity.
Having changed that, it seemed that the arguments "real_root=luks:/dev/hdx real_root=luks:/dev/sdx" should been replaced by "crypt_root=/dev/hdx crypt_root=/dev/sdx<//tt>" as this is the current form (from version 3.4.4). Changed and a note has been added at the end of the paragraph to say that it was different before.
--Wynn 10:41, 25 January 2007 (UTC)
The part for --disklabel looks ok. I can't say anything about --luks
--85.181.53.42 00:41, 27 January 2007 (UTC)
[edit] why there is no mkinitramfs tool in gentoo?
please devels please bundle mkinitramfs!it is very useful!59.93.22.112 10:50, 4 April 2008 (UTC)
