2023.04 U-Boot Kirkwood - ZyXEL NSA325 May 26, 2023 09:22PM |
Admin Registered: 12 years ago Posts: 18,150 |
md5sum 15ef315acc142d4704fd4b8eec18b6be sha256sum f0eebe427f509179a6fd7c0a5a017180b0c2cdec13f5d71fb27fcf95246cca2b
uboot.2023.04-tld-1.nsa325.kwb uboot.2023.04-tld-1.nsa325.environment.img uboot.2023.04-tld-1.nsa325.environment uboot.2023.04-tld-1.nsa325.boot.scr
# MTD device name Device offset Env. size Flash sector size Number of sectors /dev/mtd0 0xc0000 0x20000 0x20000
echo "/dev/mtd0 0xc0000 0x20000 0x20000" > /etc/fw_env.config
dev: size erasesize name mtd0: 00100000 00020000 "uboot" mtd1: 00080000 00020000 "stock_uboot_env" mtd2: 00080000 00020000 "key_store" mtd3: 00080000 00020000 "info" mtd4: 00a00000 00020000 "etc" mtd5: 00a00000 00020000 "kernel_1" mtd6: 02fc0000 00020000 "rootfs1" mtd7: 00a00000 00020000 "kernel_2" mtd8: 02fc0000 00020000 "rootfs2"
nanddump --noecc --omitoob -l 0x80000 -f mtd0.nsa325 /dev/mtd0 nanddump --noecc --omitoob -f mtd0.nsa325.envs -s 786432 -l 131072 /dev/mtd0If installing from stock u-boot, also save stock envs
nanddump --noecc --omitoob -f mtd0.nsa325.envs.stock /dev/mtd1
fw_printenv > current_envs.txtFor most stock OS, there is no fw_printenv. So it's OK if this step fails.
dmesg | grep -i 'bad' [ 2.413231] Scanning device for bad blocks [ 2.417731] Bad eraseblock 3 at 0x000000060000
cd /tmp tar xf uboot.2023.04-tld-1.nsa325.bodhi.tar
flash_erase /dev/mtd0 0 4Expected output:
Erase Total 4 Units Performing Flash Erase of length 131072 at offset 0x60000 done
nandwrite /dev/mtd0 /tmp/uboot.2023.04-tld-1.nsa325.kwbExpected output:
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
flash_erase /dev/mtd0 0xc0000 1Expected output:
Erase Total 1 Units Performing Flash Erase of length 131072 at offset 0xc0000 done
nandwrite -s 786432 /dev/mtd0 /tmp/uboot.2023.04-tld-1.nsa325.environment.imgExpected output:
Writing data to block 6 at offset 0xc0000
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'For sanity check, list you envs again
fw_printenv
fw_setenv preboot 'run preboot_nc' fw_setenv ipaddr '192.168.0.xxx' fw_setenv serverip '192.168.0.yyy'
U-Boot 2023.04-tld-1 (Jun 24 .......) ZyXEL NSA325 2-Bay Power Media Server
fw_setenv devices 'sata usb' fw_setenv init_sata 'sata init' fw_setenv scan_disk 'echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_sata "sata init"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done' fw_setenv uenv_init_devices 'echo Initializing devices...; setenv init_usb "usb start"; setenv init_sata "sata init"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done'
fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 10; setenv stdin serial,nc; setenv stdout serial,nc; setenv stderr serial,nc; version'
cd /media/sdb1/boot cp -a uboot.2023.04-tld-1.nsa325.boot.scr boot.scr sync
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 June 09, 2023 11:30PM |
Admin Registered: 12 years ago Posts: 18,150 |
Quote
8. (Optional) Activate netconsole
Please do not activate netconsole! I'm troubleshooting a problem, stay tune... .
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 July 01, 2023 03:34PM |
Admin Registered: 12 years ago Posts: 18,150 |
Quote
Update 01 July 2023: Fixed netconsole
Quote
5. Flash u-boot image to NAND
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 September 03, 2023 04:09AM |
Registered: 5 years ago Posts: 109 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 September 03, 2023 02:34PM |
Admin Registered: 12 years ago Posts: 18,150 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 September 03, 2023 03:40PM |
Registered: 5 years ago Posts: 109 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 September 04, 2023 01:19PM |
Admin Registered: 12 years ago Posts: 18,150 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 September 04, 2023 01:46PM |
Registered: 5 years ago Posts: 109 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 29, 2023 01:58PM |
Registered: 1 year ago Posts: 28 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 29, 2023 02:28PM |
Admin Registered: 12 years ago Posts: 18,150 |
Quote
1. got only 4 partitions:
# MTD device name Device offset Env. size Flash sector size Number of sectors /dev/mtd0 0xc0000 0x20000 0x20000 root@debian:/boot# cat /proc/mtd dev: size erasesize name mtd0: 00100000 00020000 "u-boot" mtd1: 00400000 00020000 "uImage" mtd2: 02000000 00020000 "rootfs" mtd3: 05b00000 00020000 "data"
Quote
https://forum.doozan.com/read.php?3,12381
e.2 Box specific envs:
Then for all boxes, restore these 2 envs using the saved envs text in step c (replace xxx with the real saved values)
fw_setenv mtdparts 'xxxxxxxxx'
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
Quote
2. Bad blocks are:
root@debian:/boot/nand_backup# dmesg | grep -i 'bad' [ 8.632478] Scanning device for bad blocks [ 8.642563] Bad eraseblock 100 at 0x000000c80000 [ 8.653102] Bad eraseblock 200 at 0x000001900000 [ 281.253499] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK [ 281.278377] sd 0:0:0:0: [sda] Start/Stop Unit failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Quote
Instruction
3. Check for bad blocks
Be sure there is no bad block in the first 1M of your NAND. This is very important, if there is bad block in the first 1M (blocks 0 to 7), don't flash u-boot, because you will almost certainly soft-brick your box.
Quote
root@debian:/boot# cat /proc/mtd
dev: size erasesize name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "rootfs"
mtd3: 05b00000 00020000 "data"
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 29, 2023 02:54PM |
Registered: 1 year ago Posts: 28 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 29, 2023 04:06PM |
Admin Registered: 12 years ago Posts: 18,150 |
cd /media/sdb1/boot mv uEnv.txt uEnv.txt.rescue
cp -a uboot.2023.04-tld-1.nsa325.environment uEnv.txt
device=0:1 device_type=usb devices=usb disk_number=0 disks=0 1 2 3
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 29, 2023 04:58PM |
Registered: 1 year ago Posts: 28 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 29, 2023 05:06PM |
Registered: 8 years ago Posts: 424 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 29, 2023 05:11PM |
Admin Registered: 12 years ago Posts: 18,150 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 October 30, 2023 08:38AM |
Registered: 1 year ago Posts: 28 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 November 06, 2023 12:05PM |
Registered: 1 year ago Posts: 28 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 November 06, 2023 01:34PM |
Admin Registered: 12 years ago Posts: 18,150 |
cat /proc/mtd cat /etc/fw_env.config fw_printenv mount
e2fsck /dev/sda1 e2fsck /dev/sdb1
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 November 07, 2023 06:03AM |
Registered: 1 year ago Posts: 28 |
Re: 2023.04 U-Boot Kirkwood - ZyXEL NSA325 November 07, 2023 01:46PM |
Admin Registered: 12 years ago Posts: 18,150 |
> cat /proc/mtd > cat /etc/fw_env.config > fw_printenv > mount >>