Welcome! Log In Create A New Profile

Advanced

Dockstar booting probllem

Posted by h1ro 
Dockstar booting probllem
December 03, 2015 04:12PM
Hey

after a long time my dockstar rebooted and I realized that I must have left the kernel in limbo :)
to fix everything I reverted to some backup and then from there installed the latest u-boot. in netconsole i can boot the old kernel (3.16) when I run setenv dtb_file.
can't get any new stuff to work though.
U-Boot 2015.10-tld-1 (Nov 06 2015 - 15:56:21 -0800)
Seagate FreeAgent DockStar
gcc (Debian 4.9.2-10) 4.9.2
GNU ld (GNU Binutils for Debian) 2.25
Hit any key to stop autoboot:  0 
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	63        	22585281  	23a6c3e4-01	83 Boot
  2	22585344  	4192256   	23a6c3e4-02	82
  3	26777600  	-414715904	23a6c3e4-03	05 Extd
  5	26779648  	-414717952	23a6c3e4-05	83
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 336 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
3147200 bytes read in 413 ms (7.3 MiB/s)
loading uInitrd ...
5589530 bytes read in 713 ms (7.5 MiB/s)
loading DTB /boot/dts/kirkwood-dockstar.dtb ...
10398 bytes read in 610 ms (16.6 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.2.0-kirkwood-tld-1
   Created:      1970-01-01   0:15:29 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3147136 Bytes = 3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.2.0-kirkwood-tld-1
   Created:      1970-01-01   0:17:12 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5589466 Bytes = 5.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000


Starting kernel ...
At this point there's a solid orange LED for 4s or so and then solid green light. With both kernels USB hard drive stops spinning once the kernel is loaded.. With old kernel a short time after the green light the kernel mounts the hdd again, and init commences indicated by hard drive access. boot finishes successfully as I can log in.
But with new kernel there is no access to the HDD any more after the orange and then green light go on.

Any ideas?
DockStar> print
print
arcNumber=2998
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_exec=mw 0x800000 0 1; run load_uimage; if run load_initrd; then if run load_dtb; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 0x1100000; fi; else if run load_dtb; then bootm 0x800000 - 0x1c00000; else bootm 0x800000; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-dockstar.dtb
ethact=egiga0
ethaddr=00:10:75:DD:DD:DD
if_netconsole=ping $serverip
ipaddr=192.168.1.100
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; ext2load $bootdev $device 0x1c00000 $dtb_file
load_initrd=echo loading uInitrd ...; ext2load $bootdev $device 0x1100000 /boot/uInitrd
load_uimage=echo loading uImage ...; ext2load $bootdev $device 0x800000 /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
nc_ready=1
ncip=192.168.1.53
partition=nand0,2
preboot=run preboot_nc
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if ext2load $dev $disknum:1 0x800000 /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.1.53
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
uenv_import=echo importing envs ...; env import -t 0x810000
uenv_init_devices=setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x810000 /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_ready_retry=15

Environment size: 2847/131068 bytes



Edited 1 time(s). Last edit at 12/03/2015 04:51PM by bodhi.
Re: Dockstar booting probllem
December 03, 2015 06:20PM
h1ro,

You might have missed a step during u-boot installiion: Is the rootfs partition on the USB labeled as rootfs?

BTW, the LED light behavior indicated that the kernel has started but could not mount the rootfs. And one of the reason could be the partition label was not set.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/03/2015 06:28PM by bodhi.
Re: Dockstar booting probllem
December 04, 2015 06:56AM
hey, thanks for your quick answers and super long persistence on this project.
i have labeled it as rootfs. the strange thing is that the same kind of lighting sequence happens even in the working scenario. for this i just have to replace uImage and initrd and disable that dtb_file variable.
to clarify: in both cases i see green blinking, then for 4 seconds orange solid, then green solid and hdd starts to spin up again. in the working case a short time after spinning back up the rootfs seems to be mounted correctly cause i notice a lot of drive access as the init script commences and in the end i can ssh in. in the non working case the hdd spins back up but isn't accessed any more. so i agree it might be that the rootfs doesn't get mounted, but i don't see why it would only happen with the new kernel.
sorry for not realising i should have started a new thread



Edited 1 time(s). Last edit at 12/04/2015 06:59AM by h1ro.
Re: Dockstar booting probllem
December 04, 2015 03:12PM
h1ro,

I think retracing your step to see what did you miss after installing new u-boot and new default envs:

Quote

r1. There must be only one partition among all partitions from all drives that contains the kernel files. The 2 kernel files are /boot/uImage and /boot/uInitrd.
r2. The partition that contains the 2 kernel files must be partition 1 in a disk drive
r3. The partition that contains the rootfs must be labeled rootfs
r4. The rootfs partition is recommended to be type Ext3 (this is not a hard requirement, ext4 should boot OK, but Ext3 will ensure no problem).

In installing new kernel 4.2, make sure step 4a was used:

Quote

4a. Boot with DTB file (standard way to boot FDT kernel). Recommended.

When in doubt, regenerate the uImage to make sure that the DTB is not embedded:

mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.2.0-kirkwood-tld-1 -d vmlinuz-4.2.0-kirkwood-tld-1 uImage

The LED booting behavior indicated these possible problems with rootfs:

- The uImage has DTB embedded, but the kernel also received the separate DTB.
- The rootfs has error, this should be checked by doing fsck on booting Linux box. You can boot 3.16 on a different stick, and then fsck this 4.2 rootfs

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dockstar booting probllem
December 04, 2015 03:38PM
The mkimage command you posted above is exactly the one I used yesterday to generate the uImage.
Also I have linux on my laptop and fsck is the first thing I tried from there when nothing else seemed to work ;)



Edited 1 time(s). Last edit at 12/04/2015 03:41PM by h1ro.
Re: Dockstar booting probllem
December 04, 2015 03:53PM
Since you don't have serial console, but have netconsole:

http://forum.doozan.com/read.php?2,9522

See how far it boots. At least we'll know that is not DTB problem if we can see the kernel has booted (I believe it did).

If all else fails, download and use the 3.18.5 rootfs as is, and boot with it? after that, upgrade the kernel to 4.2.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dockstar booting probllem
December 04, 2015 05:08PM
I managed to get a running 4.2 kernel.
This time I went back to a kernel way before 3.16 (2.6.x) and avoided a bunch of uas errors that i noticed today while looking through /var/log/messages.
It might be that while the filesystem has been fixed yesterday the files were still corrupted unnoticeable to fsck. Perhaps they got corrupted while being written during a uas error. I'm not sure. The only other thing I changed today was that I also installed the kernel headers before running depmod -a and creating the uImage.
Thanks for your considerations. Without your ideas I wouldn't have known where to start and needed the encouragement to repeatedly make sure the kernel file is in order.
Thanks for this nice new shiny kernel :)

Oh, and many thanks for linking the instructions to the linux netconsole thing. Very appreciated, I will enable it just in case something will go wrong in the future.



Edited 1 time(s). Last edit at 12/04/2015 05:10PM by h1ro.
Re: Dockstar booting probllem
December 04, 2015 10:07PM
Cool! glad to hear it's all working now!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: