Welcome! Log In Create A New Profile

Advanced

Booting with kwboot

Posted by balanga 
Booting with kwboot
February 25, 2019 03:21PM
How can I tell if I have a uBoot?

I may have zapped it in a previous attempt to install OpenWrt.

I am currently trying to boot using kwboot with uboot-2017.07-tld-1.goflexhome.

The system starts to boot but I don't get as far as a login prompt. The last msg being

random: crng init done.

Although I have updated uBoot in the past I'm still confused as to how it works.

According to the instructions here https://forum.doozan.com/read.php?3,12381 under

A. Flashing Instruction:

It does not say where to start, as far as I can tell. Does this assume your system has booted up to a login prompt?

The first instructions are:

cat /etc/fw_env.config
cat /proc/mtd

I have no way of running these commands.

What to do?

And.... how to break out of kwboot, apart from pulling out the USB-serial connector?
Re: Booting with kwboot
February 25, 2019 04:12PM
> How can I tell if I have a uBoot?

Power up the box, with serial console running. If it shows the U-Boot banner and starts running then u-boot is on NAND.

> And.... how to break out of kwboot, apart from
> pulling out the USB-serial connector?

It shows at the bottom after loading:
[Type Ctrl-\ + c to quit]


> According to the instructions here https://forum.doozan.com/read.php?3,12381 under

> A. Flashing Instruction:

> It does not say where to start, as far as I can tell. Does this assume your system has booted up to a login prompt?

Yes, either inside stock OS , or inside Debian, at the Linux shell prompt.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
February 25, 2019 04:33PM
bodhi Wrote:
-------------------------------------------------------
> > How can I tell if I have a uBoot?
>
> Power up the box, with serial console running. If
> it shows the U-Boot banner and starts running then
> u-boot is on NAND.

Nothing is shown.

Looks like I'm in limbo

> > And.... how to break out of kwboot, apart from
> > pulling out the USB-serial connector?
>
> It shows at the bottom after loading:
>
> [Type Ctrl-\ + c to quit]
>

I tried that - doesn't seem to work...

Although maybe kwboot has finished at this point... If I have A GoFlexHome> prompt, am I still under kwboot control or has it passed on to something else?

I can't break out of the prompt.

> > According to the instructions here
> https://forum.doozan.com/read.php?3,12381 under
>
> > A. Flashing Instruction:
>
> > It does not say where to start, as far as I can
> tell. Does this assume your system has booted up
> to a login prompt?
>
> Yes, either inside stock OS , or inside Debian, at
> the Linux shell prompt.

Since it doesn't boot to a prompt, what do I need to do create one? Using a debian rootfs + a /boot/uEnv.txt?
Re: Booting with kwboot
February 25, 2019 04:50PM
> If
> > it shows the U-Boot banner and starts running
> then
> > u-boot is on NAND.
>
> Nothing is shown.
>
> Looks like I'm in limbo

It just mean there is no u-boot on NAND mtd0, or it was corrupted. As long as you can kwboot wiht the new u-boot, you are OK and ready to recover.

> > [Type Ctrl-\ + c to quit]

> I tried that - doesn't seem to work...

Holding Control key with your left hand, and with your righ hand, type \, release (don't hold \), and then type c.

> Although maybe kwboot has finished at this
> point... If I have A GoFlexHome> prompt, am I
> still under kwboot control or has it passed on to
> something else?

When you see GoFlexHome> prompt, after kwboot has finished, it means kwboot is now just a regular serial console. That's what the option -t in the kwboot command means. And you have interrupted that serial console, so you are at the prompt.

> I can't break out of the prompt.

Either Control \ c to exit kwboot, or continue booting into a USB rootfs.

>
> Since it doesn't boot to a prompt, what do I need
> to do create one? Using a debian rootfs + a
> /boot/uEnv.txt?

Boot with the Debian rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 on USB. And then flash new u-boot. If you have trouble doing this after some tries, then I'll show you another approach.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
February 26, 2019 06:20AM
bodhi Wrote:
-------------------------------------------------------
> Holding Control key with your left hand, and with
> your righ hand, type \, release (don't hold \),
> and then type c.

The problem was with keyboard mapping... Eventually I found the key marked '#' actually produced a '\'

> > Since it doesn't boot to a prompt, what do I
> need
> > to do create one? Using a debian rootfs + a
> > /boot/uEnv.txt?
>
> Boot with the Debian rootfs
> Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2
> on USB. And then flash new u-boot. If you have
> trouble doing this after some tries, then I'll
> show you another approach.

I created an new Debian rootfs as you advised but some changes are needed and the instructions I have seem outdated regarding creating zImage and uImage.

In my /boot I have

System.map-4.12.1-kirkwood-tld-1
initrd.img-4.12.1-kirkwood-tld-1
uInitrd
config-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
uImage
Re: Booting with kwboot
February 26, 2019 11:03AM
After some hunting around, I think I found the instructions I needed here in the first section:-

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

but I've just noticed there must be several hundred posts in this thread so my problem may have been answered...

The instructions under 4a are:

cd /boot
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.20.6-kirkwood-tld-1 -d vmlinuz-4.20.6-kirkwood-tld-1 uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.20.6-kirkwood-tld-1 -d initrd.img-4.20.6-kirkwood-tld-1 uInitrd

This doesn't work because some of the files are missing and need to be generated using dpkg, but since I'm using Arch Linux I can't make them. Can they be downloaded anywhere?
Re: Booting with kwboot
February 26, 2019 02:00PM
balanga,

> After some hunting around, I think I found the
> instructions I needed here in the first section:-
>
> https://forum.doozan.com/read.php?2,12096
>
> but I've just noticed there must be several
> hundred posts in this thread so my problem may
> have been answered...
>
> The instructions under 4a are:
>
>
> cd /boot
> mkimage -A arm -O linux -T kernel -C none -a
> 0x00008000 -e 0x00008000 -n
> Linux-4.20.6-kirkwood-tld-1 -d
> vmlinuz-4.20.6-kirkwood-tld-1 uImage
> mkimage -A arm -O linux -T ramdisk -C gzip -a
> 0x00000000 -e 0x00000000 -n
> initramfs-4.20.6-kirkwood-tld-1 -d
> initrd.img-4.20.6-kirkwood-tld-1 uInitrd
>
>
> This doesn't work because some of the files are
> missing and need to be generated using dpkg, but
> since I'm using Arch Linux I can't make them. Can
> they be downloaded anywhere?


You don't need to do anything as above. The only rootfs you need is Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2.

Quote
bodhi
Boot with the Debian rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 on USB. And then flash new u-boot.

The rootfs has kernel 4.12.1-kirkwood-tld-1 already installed in it.

Quote
https://forum.doozan.com/read.php?2,12096
Note: If this is your first time installation, then you need rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (this has kernel 4.12.1-kirkwood-tld-1 already installed).


So just extract the tarball to USB drive, like the instruction stated, and you'll have a full Debian rootfs. Using Arch or Debian, or OpenWrt, Ubuntu, will work.... you only need to run the tar command to extract the archive.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
February 26, 2019 03:43PM
Script started on Tue Feb 26 22:25:43 2019
You have mail.
root@S07:~/projects/uboot # ssh 192.168.1.98

Last login: Tue Feb 26 22:18:25 2019 from 192.168.1.69

.]0;root@archlinux:~.[root@archlinux ~]# cd projects/u-boot/
.]0;root@archlinux:~/projects/u-boot.[root@archlinux u-boot]# sh bodhi
Sending boot message. Please reboot the target....-.\.|./.-.\.|./.-.\.|./
Sending boot image...
  0 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]
.

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 10.10.10.5 is not alive
Hit any key to stop autoboot:  3 ... 2 ... 1 ... 0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Reset IDE: ide_preinit failed

USB device 0:
    Device 0: Vendor: Lexar    Rev: 8.07 Prod: USB Flash Drive
            Type: Removable Hard Disk
            Capacity: 15276.0 MB = 14.9 GB (31285248 x 512)
... is now current device
usb found on device 0
Checking for: /boot/uEnv.txt ...
747 bytes read in 799 ms (0 Bytes/s)
Loaded environment from /boot/uEnv.txt
Checking if uenvcmd is set ...
** File not found /boot/zImage **
 ** ext4fs_devread read error - block
** SI ext2fs read block (indir 1)failed. **
No kernel found

USB device 1: unknown device

Device 0: device type unknown
... is now current device
ide found on device 0
Checking for: /boot/uEnv.txt ...
** Bad device ide 0 **
** Bad device ide 0 **
** Bad device ide 0 **
No kernel found

Device 1: device type unknown
... is now current device
ide found on device 1
Checking for: /boot/uEnv.txt ...
** Bad device ide 1 **
** Bad device ide 1 **
** Bad device ide 1 **
No kernel found

Device 2: unknown device
Trying to boot from NAND ...
ubi0: attaching mtd1
ubi0: scanning is finished
UBI init error 22
Error reading superblock on volume 'ubi0:rootfs' errno=-19!
ubifsmount - mount UBIFS volume

Usage:
ubifsmount <volume-name>
    - mount 'volume-name' volume
GoFlexHome> printenv
baudrate=115200
bootcmd=run startboot; run bootubi
bootdelay=3
bootdir=/boot
bootfilem=uImage
bootfilez=zImage
bootm=run load_debian; echo Booting from ${type} ${disk}:1 ...; bootm ${uimage_addr} ${initrd_addr} ${fdt_addr}
bootpart=1:1
bootubi=echo Trying to boot from NAND ...; if run mountubi; then ubifsload ${loadaddr} /boot/zImage;ubifsload ${fdtaddr} /boot/dtbs/${fdtfile}; ubifsumount; setenv boota
rgs console=${console} ubi.mtd=1 root=ubi0:rootfs ro rootfstype=ubifs  rootwait ${mtdparts}; bootz ${loadaddr} - ${fdtaddr}; fi
console=ttyS0,115200
devnum=2
ethact=egiga0
ethaddr=00:10:75:28:cc:00
fdt_addr=0x1c00000
fdt_file=/boot/dts/kirkwood-goflexhome.dtb
fdtaddr=0x800000
fdtdir=/boot/dts
fdtfile=kirkwood-goflexhome.dtb
fileaddr=810000
filesize=2eb
initrd=/boot/uInitrd
initrd_addr=0x1100000
ipaddr=192.168.1.23
load_debian=setenv type usb; setenv disk 0; run set_bootargs; echo Running loadfdt ...;run loadfdt; echo Running loaduinitrd ...;run loaduinitrd; echo Running loaduimage
 ...; run loaduimage
loadaddr=0x810000
loadfdt=ext2load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilez} || load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilem}
loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}
loaduimage=ext2load ${type} ${disk}:1 ${uimage_addr} ${uimage}
loaduinitrd=ext2load ${type} ${disk}:1 ${initrd_addr} ${initrd}
mainargs=setenv bootargs console=${console} ${mtdparts} root=${root} rw rootwait ${optargs} ${ncargs}
mountubi=ubi part rootfs; ubifsmount ubi0:rootfs
mtddevname=u-boot
mtddevnum=0
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
ncip=10.10.10.5
ncipk=10.10.10.4
netconsole=on
partition=nand0,0
preboot=if env exists netconsole && test ${netconsole} = on; then if ping ${ncip}; then setenv stdin nc; setenv stdout nc; setenv stderr nc; version; if env exists ncarg
susr; then echo ncargs has been defined by user; setenv ncargs ${ncargsusr}; else setenv ncargs ignore_loglevel netconsole=6665@${ipaddr}/eth0,6666@${ncipk}/; fi; fi; el
se echo Netconsole has been turned off.; echo To turn it on, set netconsole variable to on.; setenv stdin; setenv stdout; setenv stderr; setenv ncargs; fi
rdaddr=0x1100000
rdfile=initramfs-linux.img
serverip=192.168.1.2
set_bootargs=setenv bootargs console=$console root=LABEL=rootfs rootdelay=10 $mtdparts
startboot=usb start; ide reset; for devtype in usb ide; do setenv devnum 0; while ${devtype} dev ${devnum}; do echo ${devtype} found on device ${devnum}; setenv bootpart
 ${devnum}:1; echo Checking for: ${bootdir}/uEnv.txt ...; if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/
uEnv.txt; env import -t ${loadaddr} ${filesize}; echo Loaded environment from ${bootdir}/uEnv.txt; echo Checking if uenvcmd is set ...; if test -n ${uenvcmd}; then echo
Running uenvcmd ...; run uenvcmd; fi; fi; if run loadimage; then if env exists root; then echo root has been defined by user; else part uuid ${devtype} ${bootpart} uuid;
 setenv root PARTUUID=${uuid}; fi; run mainargs; if run loadfdt; then if run loadrd; then bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr}; else bootz ${loadaddr} - ${
fdtaddr}; fi; else if run loadrd; then bootm ${loadaddr} ${rdaddr}:${filesize}; else bootm ${loadaddr}; fi; fi; else echo No kernel found; fi; setexpr devnum ${devnum} +
 1; done; done;
uimage=/boot/uImage
uimage_addr=0x800000

Environment size: 3560/131068 bytes
GoFlexHome> .]0;root@archlinux:~/projects/u-boot.[root@archlinux u-boot]# exit
logout

Looks like I'm picking up envs from somewhere... How do I clear them or load ones appropriate to Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 ?
Re: Booting with kwboot
February 27, 2019 01:28AM
That's Arch Linux u-boot envs.

How did you get that? I think that was when you have installed Arch Linux, running their oficial installation script. And then later, you've updated u-boot to my 2017 version, but did not flash the envs image in step 8:

Quote
https://forum.doozan.com/read.php?3,12381
8. Flashing default u-boot envs image (if you are upgrading from 2016.05-tld-1 u-boot, you can skip this step 8).


See here for how to load the default envs in u-boot:

https://forum.doozan.com/read.php?3,29362,29390#msg-29390

The instruction was for GoFlex Net, but it is the same for GoFlex Home, except:

setenv dtb_file '/boot/dts/kirkwood-goflexnet.dtb'
should be
setenv dtb_file '/boot/dts/kirkwood-goflexhome.dtb'

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
February 27, 2019 02:04AM
Apologies for that.... I assumed that zapping uBoot would get rid of enviroment variables, and am still not sure where they live.

I'm kwbooting with 2017.07-tld-1, is there an accompanying 2017.07-tld-1.environment that I should use?

Just noticed that in the instructions you mention a

uboot.2016.05-tld-1.environment.scr

which does not exist in the archive. Did you mean uboot.2016.05-tld-1.environment (without '.scr')?



Edited 1 time(s). Last edit at 02/27/2019 03:04AM by balanga.
Re: Booting with kwboot
February 27, 2019 03:06AM
balanga,

> Apologies for that.... I assumed that zapping
> uBoot would get rid of enviroment variables, and
> am still not sure where they live.

It is described in the installation instruction.

Quote

d. Flash u-boot envs to NAND location 0xC0000.

The 1st 1MB, which is mtd0:

0-512K is where new u-boot image is
at 768K is where new u-boot envs are, and it is 128K.


> I'm kwbooting with 2017.07-tld-1, is there an
> accompanying 2017.07-tld-1.environment that I
> should use?

The uboot.2016.05-tld-1 enviroment is the latest. It did not change in 2017.07-tld-1.

Step 8:
Quote

8. Flashing default u-boot envs image (if you are upgrading from 2016.05-tld-1 u-boot, you can skip this step 8).

As described in step 1, u-boot envs must be defined in /etc/fw_env.config as

# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

This default envs image supports booting with multiple disk drives (and hubs) attached. The disk drives could be any type (usb, sata, sd card). The scanning logic and default envs were set to automatically boot the box with the following required configuration:

For whatever reason, if you can't set up your configuration to satisfy the following 4 requirements, then don't flash this defaut envs image. It might not boot properly. In this case, section C below can be used to tailor the envs to your specific configuration.

r1. There must be only one partition among all partitions from all drives that contains the kernel files. The 2 kernel files are /boot/uImage and /boot/uInitrd.
r2. The partition that contains the 2 kernel files must be partition 1 in a disk drive
r3. The partition that contains the rootfs must be labeled rootfs
r4. The rootfs partition is recommended to be type Ext3 (this is not a hard requirement, ext4 should boot OK, but Ext3 will ensure no problem).

So the bottom line is if you have only one rootfs in a single Ext3 partition, which is labeled as rootfs, then you're all set.

a. Download the default u-boot envs at Dropbox:

uboot.2016.05-tld-1.environment.bodhi.tar
md5:
3823eef10011b864859d31a76470e0e3
sha256:
c8db95a4225e8d78bdaaaa372bd5a87e4b98f3448dd9c62fc96c72b2df1a997c

This tarball includes 3 files:

uboot.2016.05-tld-1.environment.img (the default envs image to be flashed)
uboot.2016.05-tld-1.environment (the content of the default envs in text format)
uboot.2016.05-tld-1.environment.64K.img (small envs image to be flashed on HP T5325 only).

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 02/27/2019 03:10AM by bodhi.
Re: Booting with kwboot
February 27, 2019 12:57PM
Many thanks.

I'm trying to create a script which will automate the instructions in Step 8 above.

Here is my attempt.

#
#  ***********************       adjust /dev/sdc to suit  otherwise you will format the wrong disk!!!!!!!!!     ***********************
#
#
#create usb stick with single ext3 partition
sfdisk /dev/sdc << EOF
;
EOF

#label as rootfs
mkfs.ext3 -L rootfs /dev/sdc1

#mount usb stick
mkdir /mnt/uboot
mount /dev/sdc1 /mnt/uboot

cd /tmp

#get Debian rootfs
wget http://bitly.com/2gW5oGg -O Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2

#extract Debian rootfs
tar jxf Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 -C /mnt/uboot

#get environment
wget https://bitly.com/1sMwD7b -O uboot.2016.05-tld-1.environment.bodhi.tar.

#extract environment to /boot.
tar xf uboot.2016.05-tld-1.environment.bodhi.tar  -C /mnt/uboot/boot uboot.2016.05-tld-1.environment

Tell me if I'm close.

One thing though, following the instructions in https://forum.doozan.com/read.php?3,29362,29390#msg-29390

where it says:-

On another Linux box, mount the Debian rootfs that you meant to run on this box and put the attached u-boot script in the /boot folder (if it was mounted at /media/sdb1): 

cp -a uboot.2016.05-tld-1.environment.scr /media/sdb1/boot/

kwboot this box and interrupt serial console, run the script loading commands: 

usb start
ext2load usb 0:1 0x800000 /boot/uboot.2016.05-tld-1.environment.scr
source 0x800000
printenv

it's apparent that the archive does not contain the file uboot.2016.05-tld-1.environment.scr . Should this be uboot.2016.05-tld-1.environment - without .scr ?



Edited 1 time(s). Last edit at 02/27/2019 01:47PM by balanga.
Re: Booting with kwboot
February 28, 2019 12:06AM
balanga,

> it's apparent that the archive does not contain
> the file uboot.2016.05-tld-1.environment.scr .
> Should this be uboot.2016.05-tld-1.environment -
> without .scr ?

No, the script is not in the tarball. It's only available in that post.

I've created the u-boot envs script solely for recovery purpose: when users did not install the new default envs image (your case), or when someone needs to recover from a corrupted NAND.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
February 28, 2019 03:01AM
bodhi,

Many thanks, I hadn't noticed that it was attached to that post.

Just confirming that I can use a normal text editor, since the first line has some odd characters which might get altered by some editors...to amend the following variables:-

ethaddr
ipaddr
serverip
dtb_file

Any others?
Re: Booting with kwboot
February 28, 2019 03:20AM
balanga Wrote:
-------------------------------------------------------
> bodhi,
>
> Many thanks, I hadn't noticed that it was attached
> to that post.
>
> Just confirming that I can use a normal text
> editor, since the first line has some odd
> characters which might get altered by some
> editors...to amend the following variables:-
>
> ethaddr
> ipaddr
> serverip
> dtb_file
>
> Any others?

Yes, a regular text editor.

Those 4 envs are all you need to boot Debian. And you set them in serial console prompt, after you have executed the script.

In fact, the only env you absolutely need is dtb_file. The other 3 envs can be adjusted later (but you have to use the default values during boot). So it's good to have all 4 set to your own configuration.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 02/28/2019 03:21AM by bodhi.
Re: Booting with kwboot
March 02, 2019 12:02PM
After numerous experiments including getting OpenWrt installed, I'm now trying to get uboot.2017.05-tld-2 installed but have got into some difficulties....

Following instructions in https://forum.doozan.com/read.php?3,12381 where it says

1. uBoot envs config should be defined as followed in your /etc/fw_env.config 

cat /etc/fw_env.config 
 # MTD device name	Device offset	Env. size	Flash sector size	Number of sectors 
/dev/mtd0 0xc0000 0x20000 0x20000

- And your mtd partitions should be: 

cat /proc/mtd 
dev: size erasesize name 
mtd0: 00100000 00020000 "u-boot" 
mtd1: 00400000 00020000 "uImage" 
mtd2: 02000000 00020000 "rootfs" 
mtd3: 0db00000 00020000 "data"

I get this

root@debian:~# cat /etc/fw_env.config
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 0ff00000 00020000 "ubi"

Carrying on regardless

6. Erase mtd0 
flash_erase /dev/mtd0 0 4
Expected output: 
Erase Total 4 Units 
Performing Flash Erase of length 131072 at offset 0x60000 done

I get:-

root@debian:~# flash_erase /dev/mtd0 0 4
Erasing 128 Kibyte @ 7f5d2f5c00000064 --  4 % complete

That definitely looks wrong, so I'm not sure what to do.
Re: Booting with kwboot
March 02, 2019 06:41PM
balanga,

> root@debian:~# cat /proc/mtd
> dev: size erasesize name
> mtd0: 00100000 00020000 "u-boot"
> mtd1: 0ff00000 00020000 "ubi"
> [/code]
>
> Carrying on regardless

That is OK. Only mtd0 is matter.


> I get:-
>
>
> root@debian:~# flash_erase /dev/mtd0 0 4
> Erasing 128 Kibyte @ 7f5d2f5c00000064 --  4 %
> complete 
>
>
> That definitely looks wrong, so I'm not sure what
> to do.

The message is misleading. It actuall was OK. This flash_erase version gives out wrong messages (we've seen this).

However, you can't flash this u-boot to NAND yet. This u-boot is quite big comparing my official released u-boots for GF Home. I will have to write a few new instruction before you can flash it permanently to NAND.

In the mean time, you can use kwboot to run it succssfully already, so not an important issue?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
March 03, 2019 12:02PM
bodhi Wrote:
-------------------------------------------------------
> However, you can't flash this u-boot to NAND yet.
> This u-boot is quite big comparing my official
> released u-boots for GF Home. I will have to write
> a few new instruction before you can flash it
> permanently to NAND.
>
> In the mean time, you can use kwboot to run it
> succssfully already, so not an important issue?

I do hope to flash it eventually... but it's not a big problem at the moment. One thing I've noticed is that I don't seem to be able to boot without kwboot. The system appears dead - the LED does not start flashing when I switch the unit on. Is there some variable I have set that only makes it respond to kwboot?

Also does this u-boot (2017.5-tld-2) use the same variables?

ie uboot.2016.05-tld-1.environment.bodhi.tar
Re: Booting with kwboot
March 03, 2019 02:58PM
balanga,

> I do hope to flash it eventually... but it's not a
> big problem at the moment. One thing I've noticed
> is that I don't seem to be able to boot without
> kwboot. The system appears dead - the LED does not
> start flashing when I switch the unit on. Is there
> some variable I have set that only makes it
> respond to kwboot?

It just mean that there is no valid u-boot image stored in mtd0, so nothing is running. It is practically bricked.

Now the only way that you can run this box is using kwboot to load u-boot, until you can flash it to NAND.

> Also does this u-boot (2017.5-tld-2) use the same
> variables?
>
> ie uboot.2016.05-tld-1.environment.bodhi.tar

Same envs.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
March 03, 2019 03:17PM
To confirm, please list this -tl-2 u-boot image so I can see the timestanmp and size:

ls -lh <image>
ls -l <image>

And also post the link to the post where I attached this u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
March 09, 2019 12:30PM
bodhi Wrote:
-------------------------------------------------------
> To confirm, please list this -tl-2 u-boot image so
> I can see the timestanmp and size:
>
>
> ls -lh <image>
> ls -l <image>
>

bodhi,

I'll post the above later...


> And also post the link to the post where I
> attached this u-boot.

Took some time to find :)

https://forum.doozan.com/read.php?3,34799,35728#msg-35728
Re: Booting with kwboot
March 11, 2019 01:51AM
bodhi Wrote:
-------------------------------------------------------
> To confirm, please list this -tl-2 u-boot image so
> I can see the timestanmp and size:
>
>
> ls -lh <image>
> ls -l <image>
>

[root@archlinux ~]# ls -lh uboot.2017.05-tld-2.goflexhome.mtd0.kwb
-rwxr-xr-x 1 root root 512K Jul 26 2017 uboot.2017.05-tld-2.goflexhome.mtd0.kwb

[root@archlinux ~]# ls -l uboot.2017.05-tld-2.goflexhome.mtd0.kwb
-rwxr-xr-x 1 root root 524288 Jul 26 2017 uboot.2017.05-tld-2.goflexhome.mtd0.kwb
Re: Booting with kwboot
March 11, 2019 03:22AM
balanga,

-rwxr-xr-x 1 root root 512K Jul 26 2017 uboot.2017.05-tld-2.goflexhome.mtd0.kwb

That has refreshed my memory and confirmed why it worked when you flashed this u-boot!

This version image is the same size as other u-boots (512K) because I've removed some functionalities to add API (needed for FreeBSD).

The removed capabilties were not siginificant. But be aware that something is not in this version. iirc, JFFS2 flash and other things that are not used very often.

So, no worry! you can use the same instruction in the u-boot release thread to flash this version.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
March 11, 2019 05:12AM
bodhi,

bodhi Wrote:
-------------------------------------------------------
> balanga,
>
>
> -rwxr-xr-x 1 root root 512K Jul 26 2017
> uboot.2017.05-tld-2.goflexhome.mtd0.kwb
>
>
> That has refreshed my memory and confirmed why it
> worked when you flashed this u-boot!
>
> This version image is the same size as other
> u-boots (512K) because I've removed some
> functionalities to add API (needed for FreeBSD).

I'm confused now, because I was under the impression this u-boot was specifically to add API for Freebsd...

> The removed capabilties were not siginificant. But
> be aware that something is not in this version.
> iirc, JFFS2 flash and other things that are not
> used very often.
>
> So, no worry! you can use the same instruction in
> the
> u-boot
> release thread
to flash this version.

I have installed this u-boot (uboot.2017.05-tld-2.goflexhome.mtd0.kwb) now so do I just need to install the envs (uboot.2016.05-tld-1.environment).

Will this environment enable reading /boot/uEnv.txt from USB?

Is there any way to temporarly disable nc? I'm finding it a pain to watch the boot process start under minicom but don't get a prompt to stop autoboot. I have to watch the nc session elsewhere. Is it possible to change the process so that if there is no ping response from serverip after one attempt to carry on in the minicom session?
Re: Booting with kwboot
March 11, 2019 05:30AM
balanga,

> I'm confused now, because I was under the
> impression this u-boot was specifically to add API
> for Freebsd...

Forget what I said :)

The bottom line is this -tld-2 u-boot is capable to boot FreeBSD with API. And also boot Debian or any other distro.

> Is there any way to temporarly disable nc? I'm
> finding it a pain to watch the boot process start
> under minicom but don't get a prompt to stop
> autoboot. I have to watch the nc session
> elsewhere. Is it possible to change the process so
> that if there is no ping response from serverip
> after one attempt to carry on in the minicom
> session?

The easiest way to temporarily remove nc is to change the IP of the serial console server (the box where you run minicom session) to something not the same IP as the u-boot env serverip. nc will fail after 5 tries and go back to minicom.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Booting with kwboot
March 11, 2019 06:52PM
bodhi Wrote:
-------------------------------------------------------
> > Is there any way to temporarly disable nc? I'm
> > finding it a pain to watch the boot process
> start
> > under minicom but don't get a prompt to stop
> > autoboot. I have to watch the nc session
> > elsewhere. Is it possible to change the process
> so
> > that if there is no ping response from serverip
> > after one attempt to carry on in the minicom
> > session?
>
> The easiest way to temporarily remove nc is to
> change the IP of the serial console server (the
> box where you run minicom session) to something
> not the same IP as the u-boot env serverip. nc
> will fail after 5 tries and go back to minicom.

How do I disable nc altogether since it is causing a problem. I just want to stop autoboot in my minicom session.

As it is I need two scripts to monitor what is going on. Also with nc I can't scroll back through history which is a pain as I make a lot of spelling mistakes.
Re: Booting with kwboot
March 11, 2019 08:32PM
> How do I disable nc altogether since it is causing
> a problem. I just want to stop autoboot in my
> minicom session.

Set the preboot variable to empty. Currently to activate netconsole it is set to 'run preboot_nc'.

fw_setenv preboot

-bodhi
===========================
Forum Wiki
bodhi's corner
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: