• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Unable to boot after apt-get dist-upgrade  (Read 2249 times)
cisco
Newbie
*

Karma: 0
Posts: 5


View Profile
« on: August 23, 2009, 05:35:15 AM »

Hi,

i  have installed debian with Martins tar-file on /dev/mmcblk0. After installing the tar i was able to boot the system without any problems. But after a apt-get dist-upgrade i'm unable to boot the system again. The error message: Bad Magic Number.

Any Ideas?

The bootlog is attached.

* bootlog.txt (31.56 KB - downloaded 179 times.)
Logged

TheGrue
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #1 on: August 23, 2009, 07:45:52 AM »

Hello,

I can second this: I have exactly the same problem...

Here come some more information:
Code:
markus@haktar:~$ sudo fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 8017 MB, 8017412096 bytes
4 heads, 16 sectors/track, 244672 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0xed505013

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *           1      195526     6256831+  83  Linux
/dev/mmcblk0p2          195527      228302     1048832   83  Linux
/dev/mmcblk0p3          228303      244672      523840   82  Linux swap / Solaris

Code:
Marvell>> printenv
baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
netmask=255.255.0.0
CASset=min
MALLOC_len=1
ethprime=egiga0
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
serverip=10.10.0.2
ipaddr=10.10.0.1
cesvcid=ULULULULULULPPULULULULULDA
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethaddr=00:50:43:01:D3:26
run_diag=no
arcNumber=2097
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0x100000@0(uboot)ro,0x0@0x100000(uImage),0x1ff00000@0x100000(rootfs)rw
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
bootargs_root=root=/dev/mmcblk0p1 rootdelay=10
bootcmd_mmc=mmcinit; ext2load mmc 0 0x0800000 /boot/uInitrd; ext2load mmc 0 0x400000 /boot/uImage
bootcmd=setenv bootargs $(console) $(bootargs_root); run bootcmd_mmc; bootm 0x400000 0x0800000
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x100000@0(uboot)ro,0x0@0x100000(uImage),0x1ff00000@0x100000(rootfs)rw root=/dev/mmcblk0p1 rootdelay=10
filesize=894

Environment size: 1519/131068 bytes

Code:
         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|
 ** MARVELL BOARD: SHEEVA PLUG LE

U-Boot 1.1.4 (Apr 29 2009 - 13:10:05) Marvell version: 3.4.16

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CF100

Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB
DRAM CS[1] base 0x10000000   size 256MB
DRAM Total size 512MB  16bit width
Flash:  0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0
SDHC found. Card desciption is:
Manufacturer:       0x6f, OEM "\x00\x00"
Product name:       "SMI  ", revision 1.0
Serial number:      2902
Manufacturing date: 6/2009
CRC:                0x00, b0 = 0

552 bytes read

2196 bytes read
## Booting image at 00400000 ...
Bad Magic Number
Marvell>>


I hope someone can help...

BTW: Do you have a pointer to u-boot documentation? This seems quite ok for me, but I didn't find the "mainlineLinux" variable: http://www.denx.de/wiki/bin/view/DULG/Manual
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #2 on: August 23, 2009, 08:45:13 AM »

http://www.denx.de/wiki/U-Boot is the official home of uboot. The marvell version is patched.

You are loading two files of the mmc into memory (ext2load mmc 0 0x0800000 /boot/uInitrd; ext2load mmc 0 0x400000 /boot/uImage). Those should be the initrd and the kernel. But from the output what you load is never ever the whole thing (552 bytes and 2196 bytes). If you are using kernel+initrd sizes should be more like 1M and 2-3M.

So if it is possible, mount the sdcard on another system and look what is at /boot/uInitrd and /boot/uImage. I would guess those are now symlinks and uboot fails to load them correctly.
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #3 on: August 23, 2009, 09:07:09 AM »

I think fragfutter has put his finger on the problem, but may I ask...

The original Uboot that came with the plug was dated "Mar 19 2009 - 16:06:59".

The Uboot with SDcard and FAT32 support (and part of the Alpha-6 distribution) was dated "May 13 2009 - 13:10:52".

Can you give us some info on your Uboot, which is dated "Apr 29 2009 - 13:10:05"?

(Thanks in advance)
Logged

cisco
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #4 on: August 23, 2009, 09:50:48 AM »

Hi,

this u-boot version is the version linked here: http://www.cyrius.com/debian/kirkwood/sheevaplug/unpack.html#uboot

in my case there are 0 bytes read.

My /boot directory:

Code:
drwxr-xr-x  3 root root    4096 23. Aug 17:27 .
drwxr-xr-x 21 root root    4096 26. Apr 12:03 ..
-rw-r--r--  1 root root   71750 18. Mai 09:22 config-2.6.29-2-kirkwood
lrwxrwxrwx  1 root root      28 23. Aug 16:55 initrd.img -> initrd.img-2.6.29-2-kirkwood
-rw-r--r--  1 root root 4262836 23. Aug 17:27 initrd.img-2.6.29-2-kirkwood
-rw-r--r--  1 root root 4257355 19. Mai 20:38 initrd.img-2.6.29-2-kirkwood.bak
drwxr-xr-x  2 root root    4096 26. Apr 11:47 lost+found
-rw-r--r--  1 root root  866050 18. Mai 09:22 System.map-2.6.29-2-kirkwood
-rw-r--r--  1 root root 1720340 23. Aug 17:27 uImage
-rw-r--r--  1 root root 1720340 19. Mai 20:38 uImage.bak
-rw-r--r--  1 root root 4262900 23. Aug 17:27 uInitrd
-rw-r--r--  1 root root 4257419 19. Mai 20:38 uInitrd.bak
lrwxrwxrwx  1 root root      25 23. Aug 16:55 vmlinuz -> vmlinuz-2.6.29-2-kirkwood
-rw-r--r--  1 root root 1720268 18. Mai 09:22 vmlinuz-2.6.29-2-kirkwood

Should i remove the vmlinuz link and rename vmlinuz-2.6.29-2-kirkwood?
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #5 on: August 23, 2009, 12:48:34 PM »

as you can see in
Code:
ext2load mmc 0 0x0800000 /boot/uInitrd; ext2load mmc 0 0x400000 /boot/uImage
you are not trying to load vmlinuz.

As for the uboot version, it should be sufficiently new because it can initialize the sdcard. I did not follow the patches to see if anything nice came up later.

could you try to boot up to the uboot prompt and then try to load the different kernels and tell us how many bytes uboot could read
Code:
mmcinit
ext2load mmc 0 0x400000 /boot/uImage.bak
ext2load mmc 0 0x400000 /boot/uImage
[code]

it might be, that the uboot is not able to load from higher inodes so the good old small boot partition at the beginning of the disk comes back again. But this is only a wild uneducated guess.

[/code]
Logged

cisco
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #6 on: August 23, 2009, 02:56:15 PM »

Hmm, I'm NOT a guru in booting linux, especially with u-boot.

I try to create a small boot partition the following way.

I create the following disk layout:
Code:
Disk /dev/mmcblk0: 16.0 GB, 16070475776 bytes
4 heads, 16 sectors/track, 490432 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x7b62de81

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *           1        1954       62520   83  Linux
/dev/mmcblk0p2            1955      490000    15617472   83  Linux
/dev/mmcblk0p3          490001      490432       13824   82  Linux swap / Solaris

My fstab:
Code:
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/mmcblk0p2  /               ext3    errors=remount-ro 0       1
/dev/mmcblk0p1  /boot           ext2    defaults        0       2
/dev/mmcblk0p3  none            swap    sw              0       0

The errormeesage if i try to boot:
Code:
Marvell>> setenv bootargs_root 'root=/dev/mmcblk0p2'
Marvell>> setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /boot/uInitrd; ext2load mmc 0 0x400000 /boot/uImage'
Marvell>> setenv bootcmd 'setenv bootargs $(console) $(bootargs_root); run bootcmd_mmc; bootm 0x400000 0x0800000'
Marvell>>  saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> run bootcmd
SDHC found. Card desciption is:
Manufacturer:       0x6f, OEM "\x00\x00"
Product name:       "SMI  ", revision 1.0
Serial number:      378
Manufacturing date: 7/2009
CRC:                0x00, b0 = 0

** Unable to read "/boot/uInitrd" from mmc 0:1 **

** Unable to read "/boot/uImage" from mmc 0:1 **
## Booting image at 00400000 ...
Bad Magic Number
Marvell>>

What's wrong?
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #7 on: August 23, 2009, 04:28:16 PM »

<Guessing>
  Your boot line mentions /boot/uInitrd and /boot/uImage, but you've got these on a partition that gets mounted as /boot.  So I expect these are actually /uInitrd and /uImage wrt to the actual partition they are one.
Try redoing the bootcmd_mmc setting.
</Guessing>
Logged

cisco
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #8 on: August 23, 2009, 10:49:35 PM »

Hi,

many thanks to all. Now my plug is booting after an dist-upgrade.

It seems to be a problem for u-boot to handle large SDHC-Cards (In my case 16GB).

Solution: Great a small boot-partition and set the correct u-boot command.

Code:
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'


Are there any upgrades to u-boot planned for the next time? Is this a bug?
Logged

TheGrue
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #9 on: August 24, 2009, 12:07:59 AM »

Hello,

after reading your suggestions I tried to experiment a little. The dist-upgrade created a uInitrd and a uInitrd.bak for the old kernel. Look what happens:

Code:
Marvell>> mmcinit
SDHC found. Card desciption is:
Manufacturer:       0x6f, OEM "\x00\x00"
Product name:       "SMI  ", revision 1.0
Serial number:      2902
Manufacturing date: 6/2009
CRC:                0x00, b0 = 0
Marvell>> ext2load mmc 0 0x0800000 /boot/uInitrd

552 bytes read
Marvell>>
Unknown command '' - try 'help'
Marvell>> ext2load mmc 0 0x0800000 /boot/uInitrd.bak

4257419 bytes read

So, loading the .bak succeeds while loading the new file fails... The same is true for uImage and uImage.bak. The new files were created near the end of the dist-upgrade process, so they are located on a block far behind their *.bak brothers (can someone tell me how to find the first block of a file in ext2? debugfs?) . As some of you said, maybe u-boot can't reach them any more...

Oh, by the way: my sd card is 8GB big (never can have too much free space  Wink )

So I'll try to create a small /boot, too and report the outcome. Thank you for your help!
Logged

TheGrue
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #10 on: August 24, 2009, 06:53:28 AM »

Creating a small /boot worked for me, too Smiley

Thanks!
Logged

Pages: [1]
Print
Jump to: