Boot problem with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi on Dockstar

I am trying to boot Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi on my Dockstar without success.
I did extract Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 to a blank usb drive formatted as ext3 with 1 partition.
I have generated the uImage with DTB for the Dockstar embedded inside. The kernel starts booting and then the dockstar stucks. The LED lights solid amber.

Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi is working fine. I have generated the uImage with DTB for the Dockstar embedded inside. Kernel gets loaded and the LED lights green.
I also can ssh to the dockstar.

login as: root
root@192.168.0.16's password:
Linux debian 4.4.0-kirkwood-tld-1 #1 PREEMPT Mon Jan 25 20:35:24 PST 2016 armv5tel
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Feb 4 05:51:11 2018 from einstein.fritz.box
root@debian:~#

Note: I have an usb smartcardreader attached to the dockstar.

I thought maybe the reader has a problem with the Debian-4.12.1 rootfs/kernel.
So I unplugged the reader from the dockstar.

> I have checked the file system and it is clean.
>
> What's going on here? I don't get it. Even with
> ext2 or ext3 formatted fs. I also have modified
> fstab to ext2or3 properly.
>
> I don't think I have a bad USB thumb drive because
> I used different ones. They can't be all
> broken...
>
> Partitioning, formatting and copying the data did
> not show any error or data corruption.
>
> Still very strange issues after all...

It's not that strange. Your installed Marvell u-boot is very old, and the usb driver had problems. Perhaps it is the drive.

In the old days (5,6 years ago), we just tried different USB thumb drive until we found one that worked. Sandisk is my favorite brand, it is quite resilient and never fail to boot. If you have Sandisk brand, try that.

> is it possible that you built me a new rootfs
> (4.12.1 or maybe later) with the DTB embedded for
> my dockstar and netconsole enabled (for
> debugging)?
>

No need to, because:

1. You can boot with Debian-4.4.0-kirkwood-tld-1 rootfs, so you can run that, chroot into the 4.12.1 and create the new initramfs (search for chroot instruction, quite easy to do).
2. Netconsole setup in Debian will not help in trouble shooting this problem. You need serial console.

There were no change regarding MTD from kernel Linux-4.10.9-kirkwood-tld-1 to kernel Linux-4.11.3-kirkwood-tld-1. So that error does not ring any bell for me.

I would suggest that:

- Use the rootfs that you can boot (e.g. 4.4. or whatever).
- Clone it to another USB drive.
- And upgrade the kernel on the clone USB drive to the latest kernel (linux-4.14.1-kirkwood-tld-1).
- If this cloned drive works, then start using it as your rootfs.

This way you won't chase a seemingly mysterious problem. Again, if you install serial console, whatever the issue is, it can be solved in a few minutes.

> I have now a working system with Debian 9 and the
> 4.10.9-kirkwood-tld-1 kernel.
> What about flashing the new u-boot?
>
> Do I have to look for something special?
>
> These are my bad blocks in mtd0:
>
>

>
>
> (I need to enter the backticks? I mean the ' -> is
> this correct?)
>

It is not a back tick. It is a single quote.

>
> ->xx my real ethaddr here
>
> What about the DTB file?
>
> Right now it is embedded in my
> 4.10.9-kirkwood-tld-1 kernel because of the old
> u-boot.
>
> So I leave the fw_setenv dtb_file empty right?

No. You should restore the original uImage. Rembember when you create the rootfs, you have saved the original uImage:

Quote4b. Boot with DTB file embedded in the kernel image (no U-Boot envs changes are needed if your system already booting on USB or HDD)

Again, please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box.

>
>
> *with my old embedded kernel I leave the line like
> dtb_file =
> otherwise with a new kernel with the path and
> filename

No need to use uEnv.txt. Just set the env to boot with separate DTB

fw_setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'

Ok. Be very careful, because the Dockstar does not have UART booting capability. And you don't have serial console either. A tiny mistate could make the box semi-bricked and you will need to connect serial console to recover.

If the u-boot image flashing failed, you will need to stop and post the log here.

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.

1. Format a new USB drive with a single Ext3 partition, and label it rootfs. If you are running the latest U-Boot for Kirkwood then you can use Ext4.

2. Mount the drive on a Linux box. cd to top level directory and extract it. It is assuming the USB drive is mounted at /media/sdb1
cd /media/sdb1
tar -xjf Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2

3. Adjust fstab (optional).

Edit /media/sdb1/etc/fstab entry for root device to match the rootfstype of your rootfstype if you use Ext4 or Ext2. However, you can keep it as is without problem in booting since the kernel will figure out which file system the rootfs was formatted.

LABEL=rootfs / ext3 noatime,errors=remount-ro 0 1

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 for the exact spelling of your Kirkwood box name).

5. Done. Take this USB rootfs to your plug and cold start. After booted into Debian, see Note1 and Note2 below. It is very important that you do Note1 steps to secure your box.

Note1:

After logging in this rootf the first time, remember to generate new SSH key to make it your own unique rootfs. And also update your rootfs to get the latest Debian package security updates:
rm /etc/ssh/ssh_host*
ssh-keygen -A

apt-get update
apt-get upgrade

Warning: Watch the apt-get upgrade progress. If the apt-get upgrade results in a new initramfs, the log would shows this message:

- Or, if you are booting with my latest u-boot images you can also use the uEnv.txt capability to do this. In the default envs, custom_params is a variable that allows you to add extra bootargs. So add the following line to uEnv.txt:
custom_params=init=/bin/systemd

If that's still not possible to run systemd, you might want to install it again:
apt-get install systemd

For netconsole, replace the 2 numbers below with your real IP addresses in your network. ipaddr is one you want to assign to the Dockstar (client). serverip is one you will use to as netconsole server to monitor the Dockstar boot progress (it could be your laptop IP or which ever box that can run netconsole server).

I am in the same position (ie. Dockstar) and followed the steps in the uboot-tutorial and compared the output to this thread. Flashing etc. seemed to work fine (no reboot yet), my new uboot envs looks like:

To be honest, I have no idea whether any error is embedded or not. In contrast to the old uboot envs, there are differences:

- the old one had a part about the rescue system in the NAND (which worked till now very well!) -> does this still works with the new environment or do I have to change/ add variables?
- stderr, stdin, stdout are now "serial", in the old one it was "nc" -> I have no serial console installed and always used 'nc' via a remote server (which worked very well, too) -> but I assume this is "normal" now and 'nc' works due to the 'preboot' command? And the older 'ncip' variable is not necessary anymore?
- with newer kernel I can skip completely the steps from the rootfs tutorial to generate the uImage with DTB embedded inside, because the uboot envs already points to that file? So I can just extract the tarball and use it (straightforward)?
- I had to use your external uboot flashing utilities, because although fw_printenv/ fw_setenv are there,the flashing utilities are missing. Is there a reason why Debian does not have them? I use the older 4.4.0 rootfs and was not able to find it with 'find'.

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.