Bad Magic Number

John Lee john_lee at openmoko.com
Thu Feb 14 04:55:37 CET 2008


On Wed, Feb 13, 2008 at 12:36:47PM +0800, John Lee wrote:
> 
> After I installed/devirginated gta0{1,2} with the latest u-boot,
> booting for the first time goes fine, but after that u-boot sometimes
> tells me "Bad Magic Number" and refuses to boot kernel.
> 
> 'nand erase kernel & dfu-util -a kernel' helps, but I'm wondering is
> this a common problem, or it's just me?
> 
> I have seen this on gta01, gta02v4, gta02v5.

To reply myself:

(Thanks Werner for the idea) The postinst script of kernel-image:

if test "x$D" != "x"; then
        exit 1
else
	if [ -f /etc/default/flashkernel ] ; then
		echo "Upgrading Kernel in Flash"
		echo "DO NOT stop this process"

		MTD_KERNEL_PARTITION=`cat /proc/mtd | grep kernel | cut -d':' -f1`
		MTD_KERNEL_PARTITION=/dev/$MTD_KERNEL_PARTITION

		if [ "x$MTD_KERNEL_PARTITION" = "x" ] ; then
			exit 1
		fi

		/usr/bin/flash_eraseall $MTD_KERNEL_PARTITION
		/usr/bin/nandwrite -p $MTD_KERNEL_PARTITION /boot/uImage-2.6.24-moko11
	else
		touch /etc/default/flashkernel
	fi
fi

So, in my case, an problematic kernel-image ipkg with nothing under
/boot will cause problem after the first booting.  It seems the kernel
version we flashed via dfu-util better match the version we put in
rootfs, and we must not turn off the neo while it's first booting.

Cheers,
John




More information about the openmoko-kernel mailing list