Welcome! Log In Create A New Profile

Advanced

[Dockstar] Installing Debian without rescue image

Posted by OlegH 
[Dockstar] Installing Debian without rescue image
December 09, 2022 05:42PM
Hey there,

I had Arch Linux running on my old Dockstar for a long time. But since a couple of years the box was stored in the shelf and I cannot find the USB storage device any longer. So I was trying to install Debian on a usb key and boot it but without success. I have access to the serial console and also managed to setup the netconsole for uboot.

The current uboot environment reads like:
arcNumber=2097
baudrate=115200
bootargs=console=ttyS0,115200 root=/dev/sda1 rootdelay=10 rootfstype=ext2 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) loglevel=7 netconsole=6666@192.168.178.200/eth0,6666@192.168.178.215/00:24:d7:4e:af:1c
bootcmd=run bootcmd_usb; usb stop; run rescue_bootcmd; reset
bootdelay=10
console=ttyS0,115200
ethact=egiga0
ethaddr=00:10:75:1A:DC:CE
fileaddr=1000000
filesize=1BA0000
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
if_netconsole=ping $serverip
init=/usr/lib/systemd/systemd
ipaddr=192.168.178.200
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
ncip=192.168.178.100
partition=nand0,2
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
preboot=run if_netconsole start_netconsole
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
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
serverip=192.168.178.100
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
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
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
usb=0:1
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
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_custom_params=loglevel=7 netconsole=6666@192.168.178.200/eth0,6666@192.168.178.215/00:24:d7:4e:af:1c
usb_device=0:1
usb_init=run usb_scan
usb_root=/dev/sda1
usb_root_label=my-rootfs
usb_rootdelay=10
usb_rootfs=UUID=d65382b6-c396-4a42-a42e-512e25edb2af
usb_rootfstype=ext2
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_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_scan_list=1 2 3 4
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params

When I execute run usb_boot I receive:
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!

The usb device has been prepared with an ext2 filesystem and I copied https://github.com/pepaslabs/bodhi-kirkwood-rootfs-mirror/releases/tag/4.12.1 onto it.

Any ideas what I should do/check?

Cheers
Oleg

P.S. Forgot to mention that the device is currently not booting anything. When I just let uboot run through I get
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 
## Error: "bootcmd_usb" not defined
stopping USB..
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS: ........  read_nand_cached: error reading nand off 0x1348400 size 8192 bytes
read_nand_cached: error reading nand off 0x1480000 size 8192 bytes                                                                     done.
read_nand_cached: error reading nand off 0x1348c00 size 8192 bytes
### JFFS2 load complete: 524288 bytes loaded to 0x800000
## Starting application at 0x00800200 ...



Edited 1 time(s). Last edit at 12/09/2022 05:44PM by OlegH.
Re: [Dockstar] Installing Debian without rescue image
December 09, 2022 06:04PM
OlegH,

Your u-boot is very old, so it should treated as stock u-boot.

1. On another Linux box, create the Debian rootfs using Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2
https://forum.doozan.com/read.php?2,12096

2. Boot Kirkwood rootfs with stock u-boot:
https://forum.doozan.com/read.php?2,102054,105374#msg-105374

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: [Dockstar] Installing Debian without rescue image
December 11, 2022 03:49PM
Thanks for the very fast response and the helpful links.

I tried to follow the docs but run into
boot
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **
Loading file "/boot/uImage" from usb device 0
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:0 **
Loading file "/boot/uInitrd" from usb device 0
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..
resetting ...

I tried both ext2 and ext3 but with the same result.
Re: [Dockstar] Installing Debian without rescue image
December 11, 2022 04:05PM
Oleg,

Quote

Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **

This error is usually either,

1. Because the disk partition was not created properly. Try using fdisk command to wipe the disk and create a new partition..... And follow the Debian rootfs instruction very closely. You could capture and post this log (from your Linux terminal) and post here. And don't use GUI to do this, all rootfs creation steps should be done in Linux command line.

2. Some USB flash drives are not good for booting, so try using a different USB flash drive. IMO, the best brands for booting are Sandisk, Transcend, Kingston( in that order).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: [Dockstar] Installing Debian without rescue image
December 11, 2022 05:06PM
I tried with a different usb key but the same result. I also just ordered a Sandisk usb key to test with this.

What I did in preparation:
┌─[oleg@applecore] - [~] - [2022-12-11 11:20:41]
└─[0] <> sudo cfdisk /dev/sda

Syncing disks.
┌─[oleg@applecore] - [~] - [2022-12-11 11:20:56]
└─[0] <> sudo mkfs.ext3 /dev/sda1
mke2fs 1.46.5 (30-Dec-2021)
Creating filesystem with 252416 4k blocks and 63104 inodes
Filesystem UUID: c820b629-89d0-4079-b0de-f12ecec01982
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
                                                                                        
┌─[oleg@applecore] - [~] - [2022-12-11 11:21:38]
└─[0] <> sudo mount /dev/sda1 /mnt/external
┌─[oleg@applecore] - [~] - [2022-12-11 11:21:41]
└─[0] <> sudo tar xjf Downloads/Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2 -C /mnt/external
┌─[oleg@applecore] - [~] - [2022-12-11 11:35:33]
└─[0] <> cat /mnt/external/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
┌─[oleg@applecore] - [~] - [2022-12-12 12:00:10]
└─[0] <> cd /mnt/external/boot 
┌─[oleg@applecore] - [/mnt/external/boot] - [2022-12-12 12:00:19]
└─[0] <> sudo cp -a zImage-5.13.6-kirkwood-tld-1  zImage.fdt
[sudo] password for oleg: 
┌─[oleg@applecore] - [/mnt/external/boot] - [2022-12-12 12:00:33]
└─[0] <> sudo -s
applecore# cat dts/kirkwood-dockstar.dtb >> zImage.fdt 
applecore# 
┌─[oleg@applecore] - [/mnt/external/boot] - [2022-12-12 12:00:56]
└─[0] <> sudo mv uImage uImage.orig
┌─[oleg@applecore] - [/mnt/external/boot] - [2022-12-12 12:00:59]
└─[0] <> sudo mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.13.6-kirkwood-tld-1 -d zImage.fdt  uImage 
Image Name:   Linux-5.13.6-kirkwood-tld-1
Created:      Mon Dec 12 00:01:03 2022
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    5445894 Bytes = 5318.26 KiB = 5.19 MiB
Load Address: 00008000
Entry Point:  00008000
┌─[oleg@applecore] - [/mnt/external/boot] - [2022-12-12 12:01:07]
└─[0] <> sync

No GUI tools (except for the terminal emulator) involved.



Edited 1 time(s). Last edit at 12/11/2022 05:06PM by OlegH.
Re: [Dockstar] Installing Debian without rescue image
December 11, 2022 05:14PM
OlegH,

You must be root user. As instructed in the rootfs installation:

https://forum.doozan.com/read.php?2,12096

Quote

Download at Dropbox:

Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (Bitly short link, use this if you can)
Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (Direct Dropbox URL)

md5:
3414d7ad038b402836f232a575d3433f
sha256:
ab11b7ca5a85b22f44a0fd8d204a837705711509b8cde0bc338e97228767f0c7

And remember to check the hash of what you download, as always.

Installation:

Installation can be done on any Linux box, with a fresh USB drive (SD card or HDD would work fine too).

Note: all steps below must be done while logging in as root user (not sudo). If you are not the root user then don't continue, because the rootfs will not work.

To become root:

su -
double check it,
whoami

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



Edited 1 time(s). Last edit at 12/11/2022 05:16PM by bodhi.
Re: [Dockstar] Installing Debian without rescue image
December 11, 2022 05:17PM
What's wrong with sudo instead?
Re: [Dockstar] Installing Debian without rescue image
December 12, 2022 03:13PM
Okay, actually it turned out that it was neither an issue with the usb device nor the rootfs but the partition type. It should have been dos but was gpt.
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: