Trouble recreating initram.iqz [Solved]

Topics about the system utilities that are not related to Hard-disk and storage
vanepp
Posts: 85
Joined: 22 Jun 2012, 02:24

Trouble recreating initram.iqz [Solved]

Postby vanepp » 08 Oct 2014, 03:42

Using the 4.3.1 code base I'm trying to make a change to the init script to change the kernel log levels. As
a start to that I extracted the files from a 4.3.1 distribution on to /mnt/custom and then followed the instructions on the build your own kernel page to extract and recreate (with no changes) the initram.igz file. Unfortunately that doesn't work for some reason. The new file is smaller than the distributed one and the kernel doesn't boot when the recreated file replaces the current initram.igz file. Can someone tell me what I'm doing wrong here? I'm not replacing the kernel (yet, that is another problem, it won't build :-)) just the initram.iqz file and I don't see any reason this shouldn't work (but there obviously is one!).

[email protected] /mnt/custom/sources % mkdir intiramfs
[email protected] /mnt/custom/sources % cd intiramfs
[email protected] /mnt/custom/sources/intiramfs % cat /mnt/custom/customcd/isoroot/isolinux/initram.igz |xz -d | cpio -id
52702 blocks
[email protected] /mnt/custom/sources/intiramfs % ls
bin dev etc init lib sbin usr
[email protected] /mnt/custom/sources/intiramfs % find . | cpio -H newc -o | xz --check=crc32 --x86 --lzma2 >/mnt/custom/sources/initram.igz
52702 blocks
[email protected] /mnt/custom/sources/intiramfs % ls -l /mnt/custom/customcd/isoroot/isolinux/initram.igz
-rw-r--r-- 1 root root 12092952 Sep 10 05:12 /mnt/custom/customcd/isoroot/isolinux/initram.igz
[email protected] /mnt/custom/sources/intiramfs % ls -l /mnt/custom/sources/initram.igz
-rw-r--r-- 1 root root 12048344 Oct 7 20:19 /mnt/custom/sources/initram.igz

As we see the new file is 50K or so smaller than the original file and more importantly doesn't boot. Can someone point out what I'm doing wrong here please?

Peter Van Epp

vanepp
Posts: 85
Joined: 22 Jun 2012, 02:24

Re: Trouble recreating initram.iqz [Solved]

Postby vanepp » 27 Oct 2014, 06:00

RTFF (forums instead of manual :-)) solved this one.

viewtopic.php?f=25&t=5335

Covers the same issue with a solution but with more poking about to understand the problem I think there is an underlying bug. It appears zsh has an alias for cpio to cpio -L (which follows symlinks instead of inserting the symlink). I haven't found where that alias is as yet (it isn't in /root/.zsh/rc/alias.rc so it must be somewhere else). The result is that a symlink in initramfs doesn't get created and that appears to be fatal. A work
around until the alias gets fixed is to fully qualify cpio in the command:

cd initramfs

find . | /bin/cpio -H newc -o | xz --check=crc32 --x86
-lzma2 > /mnt/custom/src/initram.igz

which gets the unaliased version of cpio which works correctly. I'll report the alias as a bug in 4.4.0-beta003 as thats what I'm currently using. I suspect this is why I can't build a kernel as well as I expect the kernel is using cpio and runs in to the same problem.

Peter Van Epp


Return to “System software”

Who is online

Users browsing this forum: No registered users and 1 guest