This is a documentation for emergency cases, when something goes wrong with the firmware replaced NAS Seagate GoflexHome.
Update guide from Bodhi. The latest U-boot on device is needed because newer Linux-Kernel have the flattened device tree included in their image. U-boot image as of June 2016. All must be done on the Goflex Home with a running Debian.
First be sure that needed utilities are installed.
apt-get install mtd-utils u-boot-tools
Check correct addresses of mtd0 with /etc/fw_env.config
:
# MTDdevicename Deviceoffset Env.size Flashsectorsize Numberofsectors
/dev/mtd0 0xc0000 0x20000 0x20000
Check mtd table with cat /proc/mtd
should show
dev: size erasesize name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "rootfs"
mtd3: 0db00000 00020000 "data"
Check ethernet parameter.fw_printenv ethaddr
should print the MAC address:
ethaddr=xx:xx:xx:xx:xx:xx
Backup the old bootloader image and its environment:
nanddump --noecc --omitoob -l 0x80000 -f uboot_mtd0 /dev/mtd0
fw_printenv > current_envs1.txt
Check that there is no bad block in mtd0:
dmesg | grep -i 'bad'
[ 1.729806] Scanning device for bad blocks
Download the U-boot tar file in a temporary directory.
mkdir tmp
cd tmp
wget https://www.dropbox.com/s/6hzqz0wfrorb6zz/uboot.2016.05-tld-1.goflexhome.bodhi.tar
Untar the bootloader. This results in a .kwb
file appropriate for the mtd-utils.
tar -xf uboot.2016.05-tld-1.goflexhome.bodhi.tar
Erase mtd0.
Be aware to not switch off the Goflex Home until new bootloader is flashed
flash_erase /dev/mtd0 0 4
Erasing 128 Kibyte @ 60000 -- 100 % complete
Flash new U-boot.
nandwrite /dev/mtd0 uboot.2016.05-tld-1.goflexhome.mtd0.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Check if environment is still in U-boot flash
fw_printenv > current_envs2.txt
diff current_envs1.txt current_envs2.txt
If diff shows a difference, you need to flash the formerly backuped environment. Reboot the device.
reboot
After that, Debian should reboot. If not, repeat the steps before.
This instruction is apart from Bodhis way of installing his customised kernel. This is the approach to install the debian standard kernel for marvell kirkwood SoC's.
Because of a missing dtb file for the GoFlexHome in the standard debian 4.6 kernel, it must be taken from Bodhi's 4.6 kernel and moved into the etc dir of the package flash-kernel.
/etc/flash-kernel/dtbs/kirkwood-goflexhome.dtb
Also a configuration entry of the “Seagate GoFlex Home” is missing in the database of the debian flash-kernel package. For this a manipulation of the packaged file /usr/share/flash-kernel/db/all.db
is necessary. Please note that after a reinstall or update of the package flash-kernel this is overwritten. Add a machine entry to this file.
Machine: Seagate GoFlex Home
Kernel-Flavors: kirkwood marvell
DTB-Id: kirkwood-goflexhome.dtb
DTB-Append: yes
U-Boot-Kernel-Address: 0x00008000
U-Boot-Initrd-Address: 0x0
Boot-Kernel-Path: /boot/uImage
Boot-Initrd-Path: /boot/uInitrd
Boot-DTB-Path: /boot/dtb
Required-Packages: u-boot-tools
The name followed by Machine:
must be written into flash-kernel configuration /etc/flash-kernel/machine
Seagate GoFlex Home
When flash-kernel is called while installing kernel the machine name is compared with entries in /usr/share/flash-kernel/db/all.db
and when found, the corresponding dtb file is copied from /etc/flash-kernel/dtbs
into the file behind the label Boot-DTB-Path.