Welcome! Log In Create A New Profile

Advanced

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

Posted by Tom74 
Re: Boot problem with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi on Dockstar
June 11, 2018 04:39PM
lcg,

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

You will need to retrofit those rescue envs to the new envs. This could be done after you have rebooted into Debian.

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

Those stdin/out/err are set to default to serial. After you have started netconsole once, they will be set to nc.

> - 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)?

Correct. With new u-boot, the DTB file is set up to be loaded separately. So there is no need to embedded it inside uImage. And it must not be embedded in uImage if you already loaded it separately.

> - 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'.
>

You need to install mtd-utils to get all those utilities

apt-get install mtd-utils

-bodhi
===========================
Forum Wiki
bodhi's corner
lcg
Re: Boot problem with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi on Dockstar
June 12, 2018 01:58AM
Thanks bodhi,

so I will prepare a new rootfs to match the new handling of the DTB file, try the reboot, and add the rescue variables.
Thanks for pointing out the proper package for the utilities.

best,
lcg
lcg
Re: Boot problem with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi on Dockstar
June 12, 2018 03:25AM
Thanks again bodhi, worked pretty well :-) and booted into the rootfs. However, for the rescue system, using the previous variables does not work and the rescue system does not boot:

# nc -lu 6666

U-Boot 2017.07-tld-1 (Oct 24 2017 - 22:32:36 -0700)
Seagate FreeAgent DockStar
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot:  0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide
Unknown command 'ide' - try 'help'
device ide 0:1
** Bad device ide 0 **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
Scan device mmc
Unknown command 'mmc' - try 'help'
device mmc 0:1
** Bad device mmc 0 **
device mmc 1:1
** Bad device mmc 1 **
device mmc 2:1
** Bad device mmc 2 **
device mmc 3:1
** Bad device mmc 3 **
loading uImage ...
** Bad device usb 0 **
loading uInitrd ...
** Bad device usb 0 **
loading DTB /boot/dts/kirkwood-dockstar.dtb ...
** Bad device usb 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
DockStar>

The relevant entries from the previous old uboot related to the rescue sytem are

...
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
...
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=1
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
...

These were added but do not seem to be sufficient. All other variables are from the original uboot envs flash (except for the nc part). So what has to be changed? Thanks!

best wishes,
lcg



Edited 1 time(s). Last edit at 06/12/2018 03:26AM by lcg.
Re: Boot problem with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi on Dockstar
June 12, 2018 03:54AM
lcg,

> Thanks again bodhi, worked pretty well :-) and
> booted into the rootfs.

Cool!

> However, for the rescue
> system, using the previous variables does not
> work and the rescue system does not boot:

Yes, a little bit more needed to be done to retrofit the rescue envs.

Boot into Debian and then,

fw_setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run rescue_bootcmd'
fw_setenv bootcmd_exec 'if run load_uimage; then; 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; fi'

Explanation:

The 1st fw_setenv enables the fallback to boot rescue system when the normal boot fails. The 2nd fw_setenv is what I should have scripted the bootcmd env to allow booting to stock or rescue easier (will incorporate in the next u-boot release).

-bodhi
===========================
Forum Wiki
bodhi's corner
lcg
Re: Boot problem with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi on Dockstar
June 12, 2018 04:49AM
Thanks! It worked :-) - now I can use the dockstar(s) for another decade...

best,
lcg
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: