Welcome! Log In Create A New Profile

Advanced

Latest Debian FS on Older U-Boot

Posted by mikeh49 
Latest Debian FS on Older U-Boot
December 11, 2016 12:47PM
I'm repurposing a Pogo E02 and would like to use the latest Debian FS. I built the FS using the embedded DTB (I think) and it would not boot. The Pogo has an older u-boot that I think is Jeff Doozan's work. Kernel and u-boot info:

root@BIZ02:~# uname -a
Linux BIZ02 2.6.39.4-vamp #8 PREEMPT Wed Jan 23 22:18:57 EST 2013 armv5tel GNU/Linux
root@BIZ02:~# grep -a --null-data U-Boot /dev/mtd0ro
U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02U-Boot
** Invalid partition type "%.32s" (expect "U-Boot")
U-Boot BUG at %s:%d!

Environment:

root@BIZ02:~# fw_printenv
ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_init=run usb_scan
usb_device=0:1
usb_root=/dev/sda1
usb_rootfstype=ext2
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
ethaddr=00:25:31:00:BD:CF
machid=dd6

I don't want to mess with the u-boot or crack open the case to connect serial if not necessary. Hopefully someone can guide me through creating the latest kernel and file system to work with the existing u-boot. I think some adjustments to the environment is need but not sure where.

Thanks in advance.
Re: Latest Debian FS on Older U-Boot
December 11, 2016 04:18PM
mikeh49,

Your u-boot is old, but it should boot USB rootfs without problem. Create a USB rootfs following the instruction in:
http://forum.doozan.com/read.php?2,12096

Scroll down to section:

Quote

Updated 20 Feb 2016:

This Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is to keep in sync with kernel Linux-4.4.0-kirkwood-tld-1.

Basic minimal Debian Kirkwood rootfs for most Kirwood plugs:

- tarball size: 137M
- install size: 398M
- a basic jessie rootfs.
- The init system used in this rootfs is sysvinit . To boot with systemd, see note 2 below.
- Installed packages: nano, avahi, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, dialog, bzip2, nfs server/client, iperf, ethtool, sysvinit-core, sysvinit, and sysvinit-utils.
- see LED controls in /etc/rc.local, and /etc/init.d/halt
- see some useful aliases in /root/.profile
- root password: root

You need to append the DTB to uImage, i.e. do section 4

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Skip this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-4.4.0-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-pogo_e02 >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.4.0-kirkwood-tld-1 -d zImage.fdt uImage
sync

- And your box is Pogo E02, so I've corrected the bold line above.

- Now the instruction said you should use Ext3 for the USB rootfs. Follow that for now. Your u-boot envs specified Ext2, but it should boot OK. Once you've booted into Debian, you can adjust the evns further, and then upgrade the kernel to 4.8.3.

Because you don't have serial console (and don't want to connect it), any u-boot envs adjustment need to be done very carefully. So before you attempt, you could post the commands you about to run to set u-boot envs in Debian, and I'll doublecheck for you.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Latest Debian FS on Older U-Boot
December 11, 2016 08:52PM
Thanks Bodhi. I think I followed the instructions as you describe in appending the DTB for E02 to zimage, but I'll start over. I'm suspicious of the USB drive, so I'll try another.

The instructions say to do the steps as "root". I'd doing it from Terminal on a Linux Mint box, so I think I just "login" using "su" and then should be root. I noticed the prompt turned red so figured that made sense. Is this right?
Re: Latest Debian FS on Older U-Boot
December 11, 2016 11:38PM
mikeh49 Wrote:
-------------------------------------------------------
> Thanks Bodhi. I think I followed the instructions
> as you describe in appending the DTB for E02 to
> zimage, but I'll start over. I'm suspicious of
> the USB drive, so I'll try another.
>
> The instructions say to do the steps as "root".
> I'd doing it from Terminal on a Linux Mint box, so
> I think I just "login" using "su" and then should
> be root. I noticed the prompt turned red so
> figured that made sense. Is this right?

Right. In Mint, when the prompt turns red, you are root. But it's always good to check:

whoami

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Latest Debian FS on Older U-Boot
December 12, 2016 07:30PM
OK, worked this time. Thanks! I think perhaps I messed up the file names when I did the kernel commands. But, all good now. Is it important to upgrade the kernel from the 4.4.0 that came with the 4.4.0 filesystem?

For the u-boot environment, from what I can tell, I'd only need to change the usb_rootfstype to ext3 (I changed the fstab entry as specified in the instructions, and I think ext3 is preferred for power glitch tolerance.) Or is this even necessary? Or, are other changes needed?

fw_setenv usb_rootfstype ext3

Also, do I need to think about systemd, sysvinit or whatever? Those really confuse me. :(



Edited 2 time(s). Last edit at 12/12/2016 09:01PM by mikeh49.
Re: Latest Debian FS on Older U-Boot
December 12, 2016 09:49PM
mikeh49,

> For the u-boot environment, from what I can tell,
> I'd only need to change the usb_rootfstype to ext3
> (I changed the fstab entry as specified in the
> instructions, and I think ext3 is preferred for
> power glitch tolerance.) Or is this even
> necessary? Or, are other changes needed?

> fw_setenv usb_rootfstype ext3

Yes, in your installed u-boot, the above change will make sure the ext3 rootfs is mounted properly. It is crucial to do.

>
> Also, do I need to think about systemd, sysvinit
> or whatever? Those really confuse me. :(

Research more to understand if you want to run systemd. What you have right now is sysvinit, which is great for small headless embedded Linux systems.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Latest Debian FS on Older U-Boot
December 12, 2016 10:01PM
Small, headless, more or less embedded linux is where I'm at. So I think we're set.

I'll make the environment setting.

Again, thanks. You do good things here!
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: