I've read all the forum posts here that mention 'kexec', and I'm pretty sure I'm doing everything correctly. I also saw that support for kexec was added back in 3.2.18 but it's just not working for me.
When I run
The system shuts down normally, then I get a message about trying to load the new kernel, but I never get any messages from that new kernel at all.
Code: Select all
sudo kexec --append "$(</proc/cmdline)" /boot/kernel.img
I've exhausted every possible test I could think of, but nothing works. I'm running the very latest (as of yesterday) firmware/kernel that I downloaded using the rpi-update script, and it definitely has kexec support built in.
I've also tried changing around the kernel boot parameters, omitting some, adding others (particularly debug, loglevel=7, and initcall_debug) but I still don't get a peep out of the new kernel. In all cases it just hangs and I have to power cycle.
At one point early on I did manage to get kexec to come up with "Bye" after trying to load the new kernel, but I don't know how to reproduce that behaviour. Not that that would be of any use, but I thought I should mention it anyway.
Here's a dump of all the relevant info I can think of from the system:
I'd really love to get this working so that I can move on to writing my boot manager. I know that I can just have my boot kernel modify the startup scripts to boot into raspbian, but then I have to have that system change the boot parameters back again afterwards and it's really messy. The solution with the jumpered GPIO automatically booting into the emergency kernel (and having that kexec the real kernel unless it detects it has to stick around and let me do maintenance) is so much neater since it none of the system config files need to be changed, apart from my emergency kernel image. So, sorry if this is a bit long, but I'd really appreciate if someone could help figure out why kexec isn't working and what can be done to fix it.
Code: Select all
$ uname -a Linux hamilton 3.2.27+ #307 PREEMPT Mon Nov 26 23:22:29 GMT 2012 armv6l GNU/Linux $ zcat /proc/config.gz | grep -i kexec CONFIG_KEXEC=y $ cat /proc/cmdline dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708.boardrev=0xe bcm2708.serial=0x282fc977 smsc95xx.macaddr=B8:27:EB:2F:C9:77 sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0x1c000000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait $ cat /proc/cpuinfo BogoMIPS : 697.95 (no overclock) Revision : 000e $ free total used free shared buffers cached Mem: 448948 92088 356860 0 11392 60276 $ perl -nle 'print if /^\d+[= ]/' /boot/config.txt (no output: I'm using default config with no edits) $ md5sum /boot/* # emergency kernel is mine, the rest are from rpi-update a990c6bcb62a26880609b805ca9e71bb /boot/bootcode.bin a51b441bfdde643f237ad2fa77027052 /boot/cmdline.txt 65b1f32223e8609ff5d0e80afb435285 /boot/config.emergency 5a17b9828796861050b3b17465a8ab1d /boot/config.txt 7c25ed1c16092063bc5fd0c64d5a0661 /boot/fixup_cd.dat 1935f75fdf989a78a9f99dc738e09626 /boot/fixup.dat 68ccad657720710325ce5c3890860a02 /boot/issue.txt 6227ede075298b5f6d124b8bfcad3032 /boot/kernel_cutdown.img d574ffcbfbe87d9ca40fbb3caab0086f /boot/kernel_emergency.img a27b345e85ab3e1d8db530bd805356dc /boot/kernel_emergency.old c13c0fa41d86cb4f397129b11214ce65 /boot/kernel_emergency.sav 1794be00832e1f909b39c2412fb759e4 /boot/kernel.img 6e5296cb3f82310d7e8ac535bcbb387f /boot/start_cd.elf 5d192f847eb1aa55967ed6727f9e80aa /boot/start.elf
Thanks for reading!