FS#10381 - [kernel26] mkinitcpio image causes kernel panic
Attached to Project:
Arch Linux
Opened by Paul Sadauskas (rando) - Saturday, 10 May 2008, 05:50 GMT
Last edited by Andrea Scarpino (BaSh) - Monday, 15 June 2009, 07:11 GMT
Opened by Paul Sadauskas (rando) - Saturday, 10 May 2008, 05:50 GMT
Last edited by Andrea Scarpino (BaSh) - Monday, 15 June 2009, 07:11 GMT
|
Details
Description:
I get a kernel panic from the image mkinitcpio builds. If I copy over the img from the install cd, and add a grub entry to boot from it using the same kernel, that one works. I've tweaked several of the mkinitcpio modules/hooks, but I always get the same error message: :: Loading Initramfs export: 36: X: bad variable name Kernel panic - not syncing: Attempted to kill init! I can't decipher that error message, and the svn server for mkinitcpio mentioned on the wiki page seems to be down, do I can't check the source. I extracted both the cd and my .img files, and did a diff on the init file, but they looked pretty similar. grepping for 'export' didn't reveal anything obvious. The only difference of consequence I saw was the cd's image had a #!/bin/bash, while mine was #!/bin/sh Additional info: Tried with both the mkinitcpio available from the 2008.03-3 CD and the latest available core (0.5.18.1-1). The error was different (same "export" and "bad variable name", but a different line(?) number. The hwd -e output is available here: http://bbs.archlinux.org/viewtopic.php?id=47996 |
This task depends upon
Closed by Andrea Scarpino (BaSh)
Monday, 15 June 2009, 07:11 GMT
Reason for closing: Not a bug
Additional comments about closing: No responses in 10 months. Please reopen if necessary.
Monday, 15 June 2009, 07:11 GMT
Reason for closing: Not a bug
Additional comments about closing: No responses in 10 months. Please reopen if necessary.
My kernel commandline is pretty uninteresting:
root (hd2,0)
kernel /vmlinuz26 root=/dev/sdc3 ro
initrd /kernel26.img
Where is that error from, exactly? Is it actually in init line 36? Or am I looking in the wrong place entirely?
What about the fallback image? Are you using grub or lilo? Are you sure /boot is mounted?
I recommend putting "echo"s all over the initcpio init script (located in /usr/lib/initcpio/) to see if you can track down WHERE this error actually occurs. The only export actually used is when parsing the kernel command line...
Can you please do me a favor and use an unmodified mkinitcpio 0.5.18.1 or mkinitcpio from git (as long as you tell me which one), reproduce the error and post it here again? The "version from the CD" is not worth too much I'm afraid, as I have no idea which one it is. Your whole mkinitcpio.conf would also be nice to see. And the initramfs file (kernel26.img).
@Aaron: Can you point me at some instructions to pack the init back up into a .img? I'm using the zcat method from here http://wiki.archlinux.org/index.php/Mkinitcpio#Getting_under_the_hood to unpack it. Thanks
kernel26.img (619.9 KiB)
...
Uising IPI No-Shortcut mode
Freeing unused kernel memory: 292k freed
:: Loading Initramfs
export: 36: *X: bad variable name
Kernel panic - not syncing: Attempted to kill init!
* Where I put the asterisk above is actually a solid box. I'm assuming its printing some char that my console font can't display.
I'm posting this from my laptop, so I can read the error message exactly. I'll attach the .img in the next comment.
@Aaron: I missed your comment about where to find the init, and was attemting to repack the one that I had unpacked. I got it figured out, though, so disregard my earlier question.
I haven't modified my menu.lst from install except to remove extraneous comments, and add the one entry to boot off the cd init img. Its a UNIX file.
Also attached is my modified init, with the "*X" being echoed.
===================
% file /boot/grub/menu.lst
/boot/grub/menu.lst: ASCII English text
% cat /boot/grub/menu.lst
# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst
# general configuration:
timeout 5
default 0
color light-blue/black light-cyan/blue
# (0) Arch Linux
title Arch Linux
root (hd2,0)
kernel /vmlinuz26 root=/dev/sdc3 ro
initrd /kernel26.img
# (1) Arch Linux
title Arch Linux Fallback
root (hd2,0)
kernel /vmlinuz26 root=/dev/sdc3 ro
initrd /kernel26-fallback.img
# (1) Arch Linux
title Arch Linux Install CD initrd
root (hd2,0)
kernel /vmlinuz26 root=/dev/sdc3 ro
initrd /kernel26.img.cd
:: Loading Initramfs
mounting
reading cmdline
modprobe
CMDLINE=*X
cmd=*X
export: 41: *X: bad variable name
Kernel panic - not syncing: Attempted to kill init!
mv menu.lst menu.borked
cat menu.borked > menu.lst
And try that one
# Config file for GRUB - The GNU GRand Unified Bootloader$
# /boot/grub/menu.lst$
$
# general configuration:$
timeout 5$
default 0$
color light-blue/black light-cyan/blue$
$
# (0) Arch Linux$
title Arch Linux$
root (hd2,0)$
kernel /vmlinuz26 root=/dev/sdc3 ro$
initrd /kernel26.img$
$
# (1) Arch Linux$
title Arch Linux Fallback$
root (hd2,0)$
kernel /vmlinuz26 root=/dev/sdc3 ro$
initrd /kernel26-fallback.img$
$
# (1) Arch Linux$
title Arch Linux Install CD initrd$
root (hd2,0)$
kernel /vmlinuz26 root=/dev/sdc3 ro$
initrd /kernel26.img.cd$
$
# (1) Windows$
title Windows$
rootnoverify (hd0,0)$
makeactive$
chainloader +1$
Also attached the output. Additionally:
# cd /boot/grub/
# mv menu.lst menu.bad
# cat menu.bad > menu.lst
# diff menu.bad menu.lst
(no output)
Instead of returning your kernel command line, "read CMDLINE </proc/cmdline" returns complete nonsense. This could be a problem in the kernel or in klibc or dash (the klibc shell). I have no idea where to go from here.
Sure would be awesome to know what was screwing up, though. `cat /proc/cmdline` returns that same bogus "*X" after I boot. (This is using zsh).
<83>X^C
If that's not the problem... how about printing out some other /proc fields to make sure it's all ok.
I upgraded the RAM in this a few months ago, and ran an overnight memtest when I did, it all checked out. I also haven't had any other issues developing or compiling on it.
My guess would be that it has to have something to do with grub passing bogus stuff to the kernel, but I have no idea how. Maybe I should give lilo a shot, see what happens.
The weird part is, I downgraded to 2.6.24.4 and it STILL persisted.
When I get home I'm going to add a super early break and then do all the init steps by hand, to see if I can figure this out.
read CMDLINE </proc/cmdline
to
CMDLINE="$(/bin/cat /proc/cmdline)"
This was suggested by Dan and may actually be worth a shot.
I'll summarize what I know where, maybe it'll help you figure out where to go next.
The number that's printed with the error is the line number of the init script where the error occurs. For me, it was the "done" at the end for the "for cmd in ${CMDLINE}" loop. I think that's because dash (or anything else) can loop over the invalid chars in /proc/cmdline.
It either has to be the kernel screwing up /proc/cmdline, or grub munging it up when passing it into the kernel. The kernel on the install CD (2008-03) works, but I'm not sure if that uses grub or something else for booting.