[SOLVED] uboot install on E02 fails, kernel doesn't boot

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

[SOLVED] uboot install on E02 fails, kernel doesn't boot

Postby schmug » Sat Jun 13, 2020 12:54 am

I've got a pogoplug E02 that's been happily running ALARM since installed back in 2013 (important as this is prior to the new U-Boot). It's running the latest linux-kirkwood kernel, 4.4.219-1-ARCH.

Today, on reboot after pacman updates, haveged service failed to start. In diagnosing the haveged issue, I found that there is alternative kernel, linux-kirkwood-dt, but, as the PKGBUILD states, this kernel requires a new version of U-Boot.

Looking at U-Boot, I went ahead and installed the uboot-pogo_e02 package and said yes to flashing the update to NAND:

Code: Select all
A new U-Boot version needs to be flashed to NAND.
Do you want to do this now? [y|N]
y
Erasing 128 Kibyte @ 60000 -- 100 % complete
Erasing 128 Kibyte @ c0000 -- 100 % complete
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 6 at offset 0xc0000


On reboot, the pogoplug is unresponsive.

I got netconsole working, here's what it says:

Code: Select all
U-Boot 2016.09.01-1 (Oct 10 2016 - 23:12:58 -0600) Arch Linux ARM
Pogo E02
gcc (GCC) 6.2.1 20160830
GNU ld (GNU Binutils) 2.27
Hit any key to stop autoboot:  0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

USB device 0:
    Device 0: Vendor: SanDisk  Rev: 1.26 Prod: Cruzer Fit     
            Type: Hard Disk
            Capacity: 15267.0 MB = 14.9 GB (31266816 x 512)
... is now current device
usb found on device 0
Checking for: /boot/uEnv.txt ...
** File not found /boot/zImage **
4623320 bytes read in 353 ms (12.5 MiB/s)
loading /boot/dtbs/kirkwood-pogo_e02.dtb ...
** File not found /boot/dtbs/kirkwood-pogo_e02.dtb **
7764291 bytes read in 486 ms (15.2 MiB/s)
Booting uImage with initrd
## Booting kernel from Legacy Image at 00810000 ...
   Image Name:   Linux-4.4.219-1-ARCH
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4623256 Bytes = 4.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK


And that's it.

I've read thru many forum posts and the closest issue I found was https://archlinuxarm.org/forum/viewtopic.php?f=53&t=7742&start=10. As mentioned there, I mounted the drive (USB flash) on a different computer and used journalctl to see if the kernel was booting and what activity might have been logged, but nothing has been logged since the journal stopped when I rebooted after U-Boot flashed to NAND. While mounted, I also confirmed that /boot/uImage is identical the same file from the package.

Here's the U-Boot env from netconsole (with some value redacted):

Code: Select all
bootcmd=run startboot;run bootubi
bootdir=/boot
bootfilem=uImage
bootfilez=zImage
bootubi=echo Trying to boot from NAND ...;if run mountubi; then ubifsload ${loadaddr} /boot/zImage;ubifsload ${fdtaddr} /boot/dtbs/${fdtfile};ubifsumount; setenv bootargs console=${console} ubi.mtd=1 root=ubi0:rootfs ro rootfstype=ubifs  rootwait ${mtdparts};bootz ${loadaddr} - ${fdtaddr};fi
console=ttyS0,115200
ethact=egiga0
fdtaddr=0x800000
fdtdir=/boot/dtbs
fdtfile=kirkwood-pogo_e02.dtb
loadaddr=0x810000
loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilez} || load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilem}
loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}
mainargs=setenv bootargs console=${console} ${mtdparts} root=${root} rw rootwait ${optargs} ${ncargs}
mountubi=ubi part rootfs; ubifsmount ubi0:rootfs
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
ncip=10.10.10.5
ncipk=10.10.10.4
netconsole=on
rdaddr=0x1100000
rdfile=initramfs-linux.img
startboot=usb start; for devtype in usb ; do  setenv devnum 0; while ${devtype} dev ${devnum}; do  echo ${devtype} found on device ${devnum}; setenv bootpart ${devnum}:1; echo Checking for: ${bootdir}/uEnv.txt ...; if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then  load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt; env import -t ${loadaddr} ${filesize}; echo Loaded environment from ${bootdir}/uEnv.txt; echo Checking if uenvcmd is set ...; if test -n ${uenvcmd}; then  echo Running uenvcmd ...; run uenvcmd; fi; fi; if run loadimage; then if env exists root; then echo root has been defined by user; else part uuid ${devtype} ${bootpart} uuid; setenv root PARTUUID=${uuid}; fi;  run mainargs; if run loadfdt; then  if run loadrd; then  bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr}; else  bootz ${loadaddr} - ${fdtaddr}; fi; else  if run loadrd; then echo Booting uImage with initrd;  bootm ${loadaddr} ${rdaddr}:${filesize}; else  bootm ${loadaddr}; fi; fi; else  echo No kernel found; fi; setexpr devnum ${devnum} + 1; done; done;
ethaddr=00:xx:xx:xx:xx:xx
serverip=xxx.xxx.xxx.xxx
ipaddr=xxx.xxx.xxx.xxx
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
preboot=run if_netconsole start_netconsole


Note that the correct ethaddr is set in the env.

Is there anything I can do from netconsole to see where things are failing? Kernel command line?

TIA
Last edited by schmug on Sat Jun 13, 2020 5:12 am, edited 1 time in total.
schmug
 
Posts: 5
Joined: Sat Jun 13, 2020 12:25 am

Re: uboot install on E02 fails, kernel doesn't boot

Postby moonman » Sat Jun 13, 2020 1:29 am

From the looks of it there is nothing wrong with U-Boot = Your device is not bricked and this is completely recoverable.

What is the boot dive layout? Do you have boot partition and rootfs partition separate?
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3264
Joined: Sat Jan 15, 2011 3:36 am

Re: uboot install on E02 fails, kernel doesn't boot

Postby schmug » Sat Jun 13, 2020 1:36 am

I went ahead and installed ArchLinuxARM-kirkwood-latest.tar.gz on a separate USB flash drive and it boots up fine. Interestingly, netconsole gives the exact same output as with the original USB flash drive.
schmug
 
Posts: 5
Joined: Sat Jun 13, 2020 12:25 am

Re: uboot install on E02 fails, kernel doesn't boot

Postby schmug » Sat Jun 13, 2020 1:38 am

Sorry moonman, didn't see your reply before I replied...

Drive layout is a single ext3 partition.
schmug
 
Posts: 5
Joined: Sat Jun 13, 2020 12:25 am

Re: uboot install on E02 fails, kernel doesn't boot

Postby moonman » Sat Jun 13, 2020 1:55 am

That's good. Does it have PARTUUID? you can check with blkid command.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3264
Joined: Sat Jan 15, 2011 3:36 am

Re: uboot install on E02 fails, kernel doesn't boot

Postby schmug » Sat Jun 13, 2020 2:24 am

Hmmm, the non-booting flash partition (/dev/sdc1 below) does not have a PARTUUID, but the booting one (sdd1) does:

Code: Select all
/dev/sdc1: UUID="dd36b136-0c27-484b-945e-1e1bab490a9a" BLOCK_SIZE="4096" TYPE="ext3"
/dev/sdd1: UUID="3086b291-1a4c-452a-b76e-d59c520af133" BLOCK_SIZE="4096" TYPE="ext3" PARTUUID="0a2bcae7-01"


Not too surprising, but in fdisk /dev/sdc does not have a Disk Identifier, but /dev/sdd does (0x0a2bcae7, which jibes with the PARTUUID)
schmug
 
Posts: 5
Joined: Sat Jun 13, 2020 12:25 am

Re: uboot install on E02 fails, kernel doesn't boot

Postby moonman » Sat Jun 13, 2020 2:41 am

Well, that is the problem. This U-Boot passes root=PARTUUID= to the kernel so without PARTUUID kernel can't find the rootfs partition.

You can add PARTUUID with fdisk as outlined here: https://unix.stackexchange.com/question ... to-dos-mbr

You can also use ext4 instead of ext3 as this U-Boot supports it.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3264
Joined: Sat Jan 15, 2011 3:36 am

Re: uboot install on E02 fails, kernel doesn't boot

Postby schmug » Sat Jun 13, 2020 5:11 am

I was just reading that same stackexchange when it clicked. I set a disk id with fdisk and my little pogo is back up and running my weather station.

Thanks very much moonbeam, way to zero in on the issue. How can I send you beer?
schmug
 
Posts: 5
Joined: Sat Jun 13, 2020 12:25 am

Re: [SOLVED] uboot install on E02 fails, kernel doesn't boot

Postby moonman » Sat Jun 13, 2020 6:09 am

Glad it's working. If you wish to donate you can donate to the project as a whole: https://archlinuxarm.org/about/donate
Cheers
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3264
Joined: Sat Jan 15, 2011 3:36 am


Return to ARMv5

Who is online

Users browsing this forum: No registered users and 4 guests