How to install uBoot

Anyone know how to install uBoot if it has been zapped?

I am able to boot via kwboot but not to a command prompt.

What can I do once I stop 'autoboot'?

http://manpages.ubuntu.com/manpages/bionic/man1/kwboot.1.html

1 Like

kwboot will start the system, but does not boot Linux.

I guess I need to figure out what to put on my USB stick...

@balanga,

I really hope you're not making a new thread because you're unsure on how to count the flash space in Hex to fix your GoFlex Home.

I asked in that thread if you had flashed over the original bootloader. That's important information, and you haven't answered yet - but since you "zapped" the booatloader, it doesn't matter much now.

It would also help to know your original uBoot environment variables.


  • Do you have a backup of the bootloader and environment variables that you 'zapped'!?!?
  • Did you backup the original image on the device?
1 Like

I followed the instructions here:-

which said:-

Backup

If you want to restore the original firmware at a later point use this guide to make a backup. You need to login to the original firmware via ssh first. Another method beside using “dd” is nanddump. To be on the safe side, you should take a 2nd backup with the nanddump method. Assuming you have a USB Stick or other USB drive mapped via sda - you can try this:

cd /tmp
mkdir backup
mount /dev/sda1 /tmp/backup
wget http://plugapps.com/os/pogoplug/uboot/nanddump
chmod +x nanddump
./nanddump -nf backup/mtd0 /dev/mtd0
./nanddump -nf backup/mtd1 /dev/mtd1
./nanddump -nf backup/mtd2 /dev/mtd2
umount /dev/sda1

So, I take that as a "yes." Quoting these guides you followed aren't too helpful; but you may want to make notes, so you can update or correct them later.

  • Since you followed those instructions, please tell us you have a a copy of those images?
  • If so, is there a reason why you have not attempted to restore them?
  • Does it start the bootloader, and if so, are there flash commands?

I have made two copies of mtd0 mtd1 and mtd2 as per guide.

I have not restored them because I can't see how to access those backups.

As mentioned, .Linux does not boot up to a command prompt, and I don't know how to access files on a USB stick when booting via kwboot.

I've read that three times. Please allow me to help you.

Can YOU boot Linux? (MEANING, DO YOU KNOW HOW?)

From u-boot isn’t just

boot

to start Linux booting ?

1 Like

Not entirely sure what you are asking...

Do you mean a particular flavour of Linux or a particular platform.

What I can't do is create a Linux rootfs on a USB stick which will boot up to a command prompt on my GoFlex Home unit, as I have mentioned before.

So to answer your question I don't know how to do that (successfully).

:open_mouth:

I hope you realize, at some point, you're gonna have to know something about re-flashing and hexadecimal. You're also gonna have to read what others like @Pippo posted. You can't keep saying you don't know everything, it's just code for you "don't wanna learn."

HUH!?

  • To be clear, we are talking about OpenWrt on a GoFlex Home, correct???
  • If so, why would you suggest another platform?!?!

Please focus on OpenWrt and the topic of the thread.

You were just told above.


You need to better explain what you need from the community.

  • You have a backup of your device; and
  • You can see the bootloader

So you need to tell us what difficulty you're having now.

It does if you have a bootable version of Linux around.

You will need to learn some basic Linux-based OS skills to be able to prepare a USB stick that is bootable with the image that you want to boot from.

You will need to determine the format of the USB stick that the bootloader on your device is expecting.

Another option often available is to prepare an initramfs image, use the bootloader to load it to memory, and boot from memory.

The commands to do so are sometimes common, but generally require becoming familiar with the specifics of the bootloader and tools for the board you're working with.

As there is no "cookbook solution" for these advanced operations, this will require you learning the basic skills and doing the basic research around how your board works. Many of the utilities have man pages or help.

That you have apparently overwritten your boot loader by blindly following "printed" instructions without understanding them completely makes many unwilling to provide explicit instructions, especially for a device that they do not have personal experience with.

2 Likes

So

First thing first

printenv bootcmd

??

1 Like

Here is a log from booting up using kwboot

Sending boot message. Please reboot the target...^@-^H\^H|^H/^H-^H\^H|^H/^H-^H\^M
Sending boot image...^M
  0 % [......................................................................]^M
  1 % [......................................................................]^M
  3 % [......................................................................]^M
  5 % [......................................................................]^M
  6 % [......................................................................]^M
  8 % [......................................................................]^M
 10 % [......................................................................]^M
 11 % [......................................................................]^M
 13 % [......................................................................]^M
 15 % [......................................................................]^M
 17 % [......................................................................]^M
 18 % [......................................................................]^M
 20 % [......................................................................]^M
 22 % [......................................................................]^M
 23 % [......................................................................]^M
 25 % [......................................................................]^M
 27 % [......................................................................]^M
 29 % [......................................................................]^M
 30 % [......................................................................]^M
 32 % [......................................................................]^M
 34 % [......................................................................]^M
 35 % [......................................................................]^M
 37 % [......................................................................]^M
 39 % [......................................................................]^M
 41 % [......................................................................]^M
 42 % [......................................................................]^M
 44 % [......................................................................]^M
 46 % [......................................................................]^M
 47 % [......................................................................]^M
 49 % [......................................................................]^M
 51 % [......................................................................]^M
 53 % [......................................................................]^M
 54 % [......................................................................]^M
 56 % [......................................................................]^M
 58 % [......................................................................]^M
 59 % [......................................................................]^M
 61 % [......................................................................]^M
 63 % [......................................................................]^M
 64 % [......................................................................]^M
 66 % [......................................................................]^M
 68 % [......................................................................]^M
 70 % [......................................................................]^M
 71 % [......................................................................]^M
 73 % [......................................................................]^M
 75 % [......................................................................]^M
 76 % [......................................................................]^M
 78 % [......................................................................]^M
 80 % [......................................................................]^M
 82 % [......................................................................]^M
 83 % [......................................................................]^M
 85 % [......................................................................]^M
 87 % [......................................................................]^M
 88 % [......................................................................]^M
 90 % [......................................................................]^M
 92 % [......................................................................]^M
 94 % [......................................................................]^M
 95 % [......................................................................]^M
 97 % [......................................................................]^M
 99 % [....................................]^M
[Type Ctrl-\ + c to quit]^M
F^M
^M
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)^M
Seagate GoFlex Home^M
^M
SoC:   Kirkwood 88F6281_A1^M
DRAM:  128 MiB^M
WARNING: Caches not enabled^M
NAND:  256 MiB^M
In:    serial^M
Out:   serial^M
Err:   serial^M
Net:   egiga0^M
88E1116 Initialized on egiga0^M
Using egiga0 device^M
^M
ARP Retry count exceeded; starting again^M
ping failed; host 10.10.10.5 is not alive^M
Hit any key to stop autoboot:  3 ^H^H^H 2 ^H^H^H 1 ^H^H^H 0 ^M
starting USB...^M
USB0:   USB EHCI 1.00^M
scanning bus 0 for devices... 2 USB Device(s) found^M
       scanning usb for storage devices... 1 Storage Device(s) found^M
^M
Reset IDE: ide_preinit failed^M
^M
USB device 0: ^M
    Device 0: Vendor: Kingston Rev: 0000 Prod: DataTraveler 2.0^M
            Type: Removable Hard Disk^M
            Capacity: 7461.0 MB = 7.2 GB (15280192 x 512)^M
... is now current device^M
usb found on device 0^M
Checking for: /boot/uEnv.txt ...^M
747 bytes read in 892 ms (0 Bytes/s)^M
oaded environment from /boot/uEnv.txt^M
Checking if uenvcmd is set ...^M
** File not found /boot/zImage **^M
3821592 bytes read in 1102 ms (3.3 MiB/s)^M
Unknown command 'part' - try 'help'^M
** Bad device :1 0x1c00000 **^M
** File not found /boot/initramfs-linux.img **^M
## Booting kernel from Legacy Image at 00810000 ...^M
   Image Name:   Linux-4.12.1-kirkwood-tld-1^M
   Created:      2017-07-20   8:11:24 UTC^M
   Image Type:   ARM Linux Kernel Image (uncompressed)^M
   Data Size:    3821528 Bytes = 3.6 MiB^M
   Load Address: 00008000^M
   Entry Point:  00008000^M
   Verifying Checksum ... OK^M
   Loading Kernel Image ... OK^M
^M
Starting kernel ...^M
^M
Uncompressing Linux... done, booting the kernel.^M

^MError: unrecognized/unsupported machine ID (r1 = 0x00000d0a).
^M
^MAvailable machine support:
^M
^MID (hex)<---->NAME
^Mffffffff<---->Generic DT based system
^Mffffffff<---->Marvell Kirkwood (Flattened Device Tree)
^M
^MPlease check your kernel config and/or bootloader.
^M^[]0;root@archlinux:~/projects/u-boot^G[root@archlinux u-boot]# exit^M
logout^M

I am unable to tell what to correct.

What is the error that tells me immediately that the image you uploaded isn’t suitable for your device?

What do the error messages tell you to do?

1 Like

U-boot is newer than the recovery image is trying to load ??

How does kwboot works ? It first look on serial for uboot ? Then load the one in eeprom ? Why need for two bootloaders?

Be patient not an expert on this !! Keep wondering why eeprom aren’t set on removable sockets so that I can use a new one for experiments like I do with my recycled hdd to experiment different Linux distros !

There are obviously quite a few errors, but this looks as though it needs correcting first.

I'm not sure whether I need to
setenv arcNumber 3338 setenv machid saveenv

to clear these errors.

You need to fix the cause of the errors, not clear them.

I would take the time to understand what "initramfs" is and how it works.

Edit: I would also take the time to understand how bootloader variables work before you completely wreck the device by overwriting them.

2 Likes

Exactly. This looks to be easily recoverable at this point, but if you don't know what you're doing it's bound to get worse.

kwboot sends a copy of u-boot over serial to the device's RAM, so it can boot up (once) even if there is nothing in the internal flash.
This process completes successfully.
U-boot starts up with the typical u-boot message of processor type, RAM and flash sizes.
It starts up the network and tries to ping a server at 10.10.10.5 but there is no response.
It finds your Kingston USB flash drive and apparently loads /boot/uEnv.txt from it, then checks for two files to potentially load and boot.

  • /boot/zImage
  • /boot/initramfs-linux.img

Those files are not found.
So, as the last resort, it boots from internal flash.
There is a kernel in internal flash but it doesn't match the machine ID. System halts.

Those all FF numbers suggest they were read from corrupted / erased flash.

2 Likes