Welcome! Log In Create A New Profile

Advanced

Help with Docstar 2017.07 U-Boot Kirkwood installation

Posted by rolfep 
Help with Docstar 2017.07 U-Boot Kirkwood installation
July 01, 2018 11:22AM
Howdy,
I run Linux and have a couple of D-Link, DNS323 and DNS320, NAS on the Lan, running Alt-F firmware. Recently, I picked up a STDSA10G-RK Dockstar in an unopened box and was able to disable the phone-home pogoplug firmware update, thanks to info hereabouts: http://www.rudiswiki.de/wiki/DockStarOverview It's been a bit challenging finding the best path forward, using google, the details are fuzzy, but approximately:

  • Followed Jeff Doozan's instructions to change uBoot, here: http://projects.doozan.com/uboot/
  • Installed Wheezy on a USB portable flash storage according to instructions at rudiswiki/here, after running down the rootfs, finally, here: NSA320quickstart.tar.gz
    I can't find the page that linked that tarball, atm. Using Old Debian Versions In Your sources.list showed me how to alter sources.list so I could install a rescue uBoot, the next step.
  •   rescue:~# cat /etc/rescue.version  20110217
    Now, I've got to here.

I've got an adapter like is shown in rudiswiki, Dockstar_USB_adapter and my plan is to run Debian from this according to the howtos around here and serve/store files with NFS on USB-attached enclosures to the LAN.

I'm thinking I need to have Linux Kernel 4.17.2 Kirkwood package and Debian rootfs on my portable flash and, likely, this 2017.07 U-Boot Kirkwood on the dockstar nand.

In the case of flashing this uBoot, I've got a couple of questions.

rescue:~# dmesg | grep -i 'bad'
[    0.676623] Scanning device for bad blocks
[    0.717547] Bad eraseblock 992 at 0x000007c00000
[    0.757542] Bad eraseblock 1946 at 0x00000f340000
[    0.913360] UBI: number of bad PEBs:         0
[    0.945511] UBI: number of PEBs reserved for bad PEB handling: 2
rescue:~#

There was a warning not to flash if a bad block was found in an area the flash writes. This looks to my untrained eye to be higher in the memory than would be a concern but I would like some reality on that.

Quote

2. Make sure ethaddr is set in uBoot env. It must be set before rebooting the system. However, if you plan to flash the default envs image in step 8 (Flashing default u-boot envs image), then no need to worry about it now. It can be set after you've booted in to Linux. The MAC address will be set to a valid randomly generated local address.


As is, I've got ethaddr set to the MAC address of the dockstar and use it for a static dhcp address in my router so I know where to go for ssh. I'd like to keep it that way, don't know if flashing default envs will give me a problem, don't know if I need to do that.

rescue:~# cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd0         0xc0000       0x20000   0x20000
rescue:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "rootfs"
mtd3: 0db00000 00020000 "data"
rescue:~# 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_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:10:RE:DA:CT:ED  #don't know if I need to hide this but, in case
serverip=192.168.1.101
ipaddr=192.168.1.166
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
arcNumber=2998
rescue_installed=1
rescue:~#

I did set up netconsole but don't know how to use it. Hopefully, ssh will always be there.

WRT Linux Kernel 4.17.2 Kirkwood package and Debian rootfs, I'd like to keep my key with NSA320 updated Wheezy in case I get other dockstar(s) to do this. I suppose I could clone to another drive with gparted and update to this package or install to a new medium, optionally having re-flashed uBoot and would like some pointers on the way to go.

Thanks.
Rolf



Edited 1 time(s). Last edit at 07/01/2018 04:38PM by bodhi.
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 01, 2018 05:11PM
Rolf,

> In the case of flashing this uBoot, I've got a
> couple of questions.
>
>
> rescue:~# dmesg | grep -i 'bad'
> [    0.676623] Scanning device for bad blocks
> [    0.717547] Bad eraseblock 992 at
> 0x000007c00000
> [    0.757542] Bad eraseblock 1946 at
> 0x00000f340000
> [    0.913360] UBI: number of bad PEBs:         0
> [    0.945511] UBI: number of PEBs reserved for
> bad PEB handling: 2
> rescue:~#
>
>
> There was a warning not to flash if a bad block
> was found in an area the flash writes. This looks
> to my untrained eye to be higher in the memory
> than would be a concern but I would like some
> reality on that.

Yes, ift is safe to flash u-boot. These 2 bad blocks are far away from the first 8 blocks, where u-boot is.

>
>
Quote

2. Make sure ethaddr is set in uBoot env.
> It must be set before rebooting the system.
> However, if you plan to flash the default envs
> image in step 8 (Flashing default u-boot envs
> image), then no need to worry about it now. It can
> be set after you've booted in to Linux. The MAC
> address will be set to a valid randomly generated
> local address.
>
>
> As is, I've got ethaddr set to the MAC address of
> the dockstar and use it for a static dhcp address
> in my router so I know where to go for ssh. I'd
> like to keep it that way, don't know if flashing
> default envs will give me a problem, don't know if
> I need to do that.

Flashing the default envs image will set the MAC address to a local MAC address. So if you have yours defined in the router, you should set this Dockstar to the correct one right away after flashing envs image. But if you forget to do this, it is OK. You can swith to use dynamic IP in your rootfs temporarily, and set the correct MAC addr and IP again after booting into Debian.

>
>
> rescue:~# cat /etc/fw_env.config
> # MTD device name       Device offset   Env. size 
>      Flash sector size       Number of sectors
> /dev/mtd0         0xc0000       0x20000   0x20000
> rescue:~# cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00100000 00020000 "u-boot"
> mtd1: 00400000 00020000 "uImage"
> mtd2: 02000000 00020000 "rootfs"
> mtd3: 0db00000 00020000 "data"
> rescue:~# 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_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:10:RE:DA:CT:ED  #don't know if I need
> to hide this but, in case
> serverip=192.168.1.101
> ipaddr=192.168.1.166
> 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
> arcNumber=2998
> rescue_installed=1
> rescue:~#
>

The above are good settings for Jeff's old u-boot.

>
> I did set up netconsole but don't know how to use
> it. Hopefully, ssh will always be there.

You can set it up after you are in Debian. This is a rescue mechanism where you run nc (netcat) on another box and interact with u-boot using ethernet.

>
> WRT Linux Kernel 4.17.2 Kirkwood package and
> Debian rootfs, I'd like to keep my key with NSA320
> updated Wheezy in case I get other dockstar(s) to
> do this. I suppose I could clone to another drive
> with gparted and update to this package or install
> to a new medium, optionally having re-flashed
> uBoot and would like some pointers on the way to
> go.
>

Yes, you should clone your NSA320 rootfs to a new USB drive later and update that rootfs. In the mean time, I would recommend starting from scrtach with the released rootfs
Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 to make booting this Dockstar after installing u-boot easier. While in the new Debian rootfs, you can clone the NSA320 to another USB drive.

Starting with a brand new Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 will eliminate all problems with differences between your old system (I assume you are running older kernel on the NSA320 based on what you described) and the new FDT kernel which has separate DTB file loading.

But you could try booting the NSA320 clone right away, too. u-boot 2017.07 will figure out your rootfs and boot it according ly.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 01, 2018 06:37PM
Thanks for the direction, bodhi, I'll work on it.
Rolf
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 03, 2018 11:37AM
Howdy-

rescue:~# cat /etc/rescue.version  20110217

First, I tried installing Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 to a 16GB microSD card in a reader on my desktop computer, per: https://forum.doozan.com/read.php?2,12096 then booting with the old uboot on the Dockstar.

The card was formatted ext3, label rootfs. I followed the steps carefully, I think, copied below, and, when it did not boot, I toggled the boot flag on, in case.

[root@z68x rootfs]# tar -xjf /home/rolf/info/computer/dockstar/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 
[root@z68x rootfs]# ls
bin/   dev/  home/  lost+found/  mnt/  proc/  run/   srv/  tmp/  var/
boot/  etc/  lib/   media/       opt/  root/  sbin/  sys/  usr/
[root@z68x rootfs]# cat etc/fstab 
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
LABEL=rootfs    /               ext3    noatime,errors=remount-ro 0 1
tmpfs          /tmp            tmpfs   defaults          0       0
[root@z68x rootfs]# cd boot/
[root@z68x boot]# ls
config-4.12.1-kirkwood-tld-1                       uImage
dts/                                               uInitrd
initrd.img-4.12.1-kirkwood-tld-1                   vmlinuz-4.12.1-kirkwood-tld-1
linux-headers-4.12.1-kirkwood-tld-1_1.0_armel.deb  zImage-4.12.1-kirkwood-tld-1*
System.map-4.12.1-kirkwood-tld-1
[root@z68x boot]# cp -a zImage-4.12.1-kirkwood-tld-1 zImage.fdt
...
[root@z68x boot]# cat dts/kirkwood-dockstar.dtb >> zImage.fdt
[root@z68x boot]# mv uImage uImage.orig
[root@z68x boot]# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.12.1-kirkwood-tld-1 -d zImage.fdt  uImage
Image Name:   Linux-4.12.1-kirkwood-tld-1
Created:      Tue Jul  3 08:44:24 2018
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3831924 Bytes = 3742.11 kB = 3.65 MB
Load Address: 00008000
Entry Point:  00008000
[root@z68x boot]# sync
[root@z68x boot]# exit
exit
[rolf@z68x ~]$

The card is seen in rescue and the partition can be mounted. So, I surmised I needed the newer uboot to boot this Debian. Following here: https://forum.doozan.com/read.php?3,12381

rescue:~# mount /dev/sda1 /mnt/
rescue:~# ls /mnt
bin         etc         lost+found  opt         run         sys         var
boot        home        media       proc        sbin        tmp
dev         lib         mnt         root        srv         usr
rescue:~# cd /mnt/
rescue:/mnt# mkdir rescue-backup
rescue:/mnt# cd rescue-backup/
rescue:/mnt/rescue-backup# nanddump --noecc --omitoob -l 0x80000 -f mtd0 /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00080000...
rescue:/mnt/rescue-backup# ls -l
total 516
-rw-------    1 root     root        524288 Jul  3 16:03 mtd0
rescue:/mnt/rescue-backup# fw_printenv > current_envs.txt
rescue:/mnt/rescue-backup# cat current_envs.txt 
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_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:10:...
serverip=192.168.1.101
ipaddr=192.168.1.166
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
arcNumber=2998
rescue_installed=1
rescue:/mnt/rescue-backup# cat /etc/rescue.version 
20110217
rescue:/mnt/rescue-backup#

IIANM, I have performed the initial steps to save a copy of the older rescue mtd0 and environment settlings. I believe that, as before, I need to flash uBoot 2017.07 from a Debian boot and all I have is the updated wheezy on NSA-320. Before I go forward with this plan, I wanted to check in for some oversight, please.

FWIW, the nc output during the latest failure to boot 4.12.1-kirkwood follows.
Thanks.

[rolf@z68x ~]$ nc -l -u -p 6666

U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... cannot reset port 1!?
2 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
** Block device usb 0 not supported

** Invalid boot device **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            219 MiB
UBI: number of good PEBs:        1750
UBI: number of bad PEBs:         2
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             1729
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
** Block device usb 0 not supported
** Block device usb 1 not supported
** Block device usb 2 not supported
** Block device usb 3 not supported
** Block device usb 0 not supported
** Block device usb 0 not supported
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..

NAND read: device 0 offset 0x100000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-2.6.32.18-dockstar
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3236180 Bytes = 3.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...



Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 03, 2018 02:17PM
Rolf,

Quote

IIANM, I have performed the initial steps to save a copy of the older rescue mtd0 and environment settlings. I believe that, as before, I need to flash uBoot 2017.07 from a Debian boot and all I have is the updated wheezy on NSA-320. Before I go forward with this plan, I wanted to check in for some oversight, please.

You are right. The card read was not recognized by old u-boot.

Quote

2 USB Device(s) found
scanning bus for storage devices... 0 Storage Device(s) found

The new u-boot should be better. However, you'd have to try to know for sure. In general, U-boot works with USB card reader, but there is always a special case where a "bad" card reader is not detected.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 03, 2018 10:06PM
Howdy,
I've booted the good ol' NSA-320 *squeeze* and performed the 2017.07 U-Boot Kirkwood installation steps all the way up to
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
but
root@debian-kirkwood-wide:/tmp# fw_setenv ethaddr '00:10:75:1A:48:72'
Can't overwrite "ethaddr"
root@debian-kirkwood-wide:/tmp# fw_printenv | grep ethaddr
ethaddr=52:3b:20:9c:11:51
root@debian-kirkwood-wide:/tmp# fw_setenv ethaddr 00:10:75:1A:48:72
Can't overwrite "ethaddr"
root@debian-kirkwood-wide:/tmp#
so
root@debian-kirkwood-wide:/tmp# fw_printenv
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
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
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
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 load $dev $disknum:1 $load_uimage_addr /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.0.220
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=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
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_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
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15
arcNumber=2998
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
root@debian-kirkwood-wide:/tmp#
Thanks.



Edited 1 time(s). Last edit at 07/03/2018 10:08PM by rolfep.
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 03, 2018 11:03PM
I've run the given commands to set up netconsole with IP addresses that are working now.
root@debian-kirkwood-wide:/tmp# fw_printenv
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
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
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
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 load $dev $disknum:1 $load_uimage_addr /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
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=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
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_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
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15
arcNumber=2998
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
serverip=192.168.1.101
ipaddr=192.168.1.166
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
preboot=run preboot_nc
root@debian-kirkwood-wide:/tmp#

I can't imagine why ethaddr won't change, unless inasmuch as it's already registered on the LAN? I've thought to remove the static DHCP in the router using this IP address, possibly switching the associated MAC to what is immutable in the uBoot firmware, atm. How to change dockstar to DHCP? Also,
/tmp# uname -r
3.3.2-kirkwood-dg

and

Quote

In the special case when you are booting with a non-FDT kernel 3.16 or earlier, or if you have appended the DTB to uImage. Remove the DTB file env. If not sure please post question before continuing.

Right now, only squeeze is booting for me. If I clear dtb_file, would Debian-4.12.1-kirkwood be able to boot? Currently,
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb

Thanks.
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 04, 2018 12:50AM
Rolfep,

The reason you could not modify ethaddr in Debian because your kernel is too old (3.3.2-kirkwood-dg). This is because mtd0 was locked to prevent ethaddr beign changed. You can use the local MAC address ethaddr=52:3b:20:9c:11:51for now. Once you have booted into the new rootfs Debian-4.12.1-kirkwood-tld-1 ethaddr will be modifiable.


> Right now, only squeeze is booting for me. If I
> clear dtb_file, would Debian-4.12.1-kirkwood be
> able to boot?

The new u-boot envs should boot an old kernel such as 3.3.2-kirkwood-dg. As long as you clear the DTB env, make sure arcNumber and machid are correct for this box, which you did.

> Currently,
> dtb_file=/boot/dts/kirkwood-pogo_e02.dtb

This the wrong DTB for Dockstar. Should be

dtb_file=/boot/dts/kirkwood-dockstar.dtb

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 04, 2018 11:16AM
Thanks, bodhi,
I changed the dtb_file setting, shut down, and the second USB key with a copy of Debian-4.12.1-kirkwood booted, along with nc is also working with the previous IP addresses configured. The associated Dockstar IP address on the LAN was different, revealed in Fing on my phone, and ssh is also working.

root@debian:~# date
Wed Jul  4 09:05:45 PDT 2018

That's pretty impressive, to me. ;)

I'm on my way. Thanks, again.
Rolf
Re: Help with Docstar 2017.07 U-Boot Kirkwood installation
July 04, 2018 04:25PM
Cool!

BTW, Dockstar runs quite hot. You might need the use 4 felt pads as feet to raise the box up a little.

-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: