[SOLVED] Rebuilding of init gets Kernel Panic every time!

Post questions about how to make a customized SystemRescueCd, and if you have problems to install new packages. Please read the handbook first.
kks3311
Posts: 5
Joined: 26 Mar 2016, 19:38

[SOLVED] Rebuilding of init gets Kernel Panic every time!

Postby kks3311 » 26 Mar 2016, 20:03

Im pulling my hair out. Lost whole day searching for the causes of the problem, but I have no more patience. Please help guys :(

I tried to make some changes in init file to make sysrcd.dat load from other directory (and i have no problem with that). It turned out fast that every time i try to boot with rebuilded initram.igz i get kernel panic errors. So i made simple initram.igz extraction/rebuild without any file changes to se if it was me who screwed, but no - I had the same result. I followed SystemRescueCD manual from here:
https://www.system-rescue-cd.org/Sysres ... _initramfs

in brief:

When i extract initram.igz and rebuild it back according to SysRecCD manual, i get Kernel Panic errors, even when i didnt make any changes to initram archive files.


This is what i type for extraction:
cat initram.igz | xz -d | cpio -id


And this is what i type for rebuild:
find . | cpio -H newc -o | xz --check=crc32 --x86 --lzma2 > /usr/src/initram.igz


As you see it's the same as in the manual, and every time im doing this the such made initram.igz wont load, dropping an Kernel Panic error like this:

[ 4.053675] Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.


The problem is I DONT MAKE ANY CHANGES to extracted files! So even when they are 100% unchanged, why am i getting an error everytime?
I tried to unpack/build it on ext3 formated pendrive and that didnt help either. cpio extractions shows 71040 blocks, and no errors. Packing it up shows the same 71040 blocks and still no errors. Just the output archive seems to be a little (few KB) smaller than the original. What goes wrong? no errors and cant run it. i dont get it. Is this the problem with symbolic link points?

I found that two other users had the same problem and resolved it, but i dont understand how they made it - their solutions are unclear to me. Maybe someone could look under these topics and help me out?

viewtopic.php?f=25&t=5335&p=16723#p16723
viewtopic.php?f=25&t=5320


edit: tried to build it with "busybox cpio" - no changes... still error :(
Last edited by kks3311 on 30 Mar 2016, 17:06, edited 2 times in total.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: Rebuilding of initramfs gets Kernel Panic every time!

Postby gernot » 27 Mar 2016, 07:14

kks3311 wrote:And this is what i type for rebuild:
find . | cpio -H newc -o | xz --check=crc32 --x86 --lzma2 > /usr/src/initram.igz

Make sure that you are in the initrd_root directory while executing this command.
in this directory is the missed init script.
Check also for problems unpackeing the initrd while booting.

Which sysrcd version use you?

Gernot

kks3311
Posts: 5
Joined: 26 Mar 2016, 19:38

Re: Rebuilding of initramfs gets Kernel Panic every time!

Postby kks3311 » 28 Mar 2016, 14:42

tried it on 4.7.1 and 4.2.0.
im am in this directory while packing it up. My rebuild gives the proper structure after extracting:
initram.igz ->
initram ->
-> ./bin
./dev
./etc
./lib
./sbin
./usr
./init

I'll try tu build it tomorrow on different distro and different computer. I dunno whats going on :0

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: Rebuilding of initramfs gets Kernel Panic every time!

Postby gernot » 28 Mar 2016, 17:12

Make sure you use a ext filesystem to hold the unpacked inird files. You loose attributes on Fat or ntfs filesystems.

Compare the output of this command with the old and the new initrd.
xz -l -v -v /mnt/isolinux/initram.igz

Just made a test with a fresh installd sysrescuecd 4.2.0 on usbstick using a actual debian 7 system:

Code: Select all

mkdir tttt
cd tttt
xz -d </media/SYSRESC/syslinux/initram.igz|cpio -iv

#modify init as test....

find . | cpio -H newc -o | xz --check=crc32 --x86 --lzma2 > /media/SYSRESC/syslinux/initram.igz


It worked well

Gernot

kks3311
Posts: 5
Joined: 26 Mar 2016, 19:38

Re: Rebuilding of initramfs gets Kernel Panic every time!

Postby kks3311 » 28 Mar 2016, 18:10

thank you very much for help, i'll try it out and write back as soon as i get it right :)

kks3311
Posts: 5
Joined: 26 Mar 2016, 19:38

Re: Rebuilding of initramfs gets Kernel Panic every time!

Postby kks3311 » 30 Mar 2016, 17:00

it seems it works now. finally i built a working version of initram.igz. but the way to achieve that was followed by some problems.

first of, i installed fresh centos 7 - tried to build on that, and it went bad every time. Couldnt make it work. I started to suspect that the file system was the problem again. it turned out that i overlooked manual partitioning during OS installation, and the default filesystem type was XFS (didnt know it's choosen as default). Probably this was the cause of errors. why? i dont know... XFS supposedly can handle symbolic links, so i really dont see any incompatibilities. Nevermind.

After a few tries i surrendered, installed clean Debian 8 (minimal install iso) on ext3 file system and... BAM!!! Success after first rebuild :)

So for everyone interested in modifying initram.igz and omitting unnecessary problems:

DO NOT rebuild initram.igz on SystemRescueCd booted from CD/USB storage. Choose other stationary (installed on hdd) linux distro with ext3 file system.


Thank You Gernot! Youre the MAN! :D

(damn it! so many wasted hours!)

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: [SOLVED] Rebuilding of init gets Kernel Panic every time

Postby gernot » 01 Apr 2016, 10:05

very good.
I dont know why sysresccd environment not work for this. May be that aufs breaks something.
Building on a ext formated device (USB or loop) should work.
Not tested...

Gernot


Return to “Customization and installing new packages”

Who is online

Users browsing this forum: No registered users and 1 guest