From a1aad239faa431b532dcdb0662f051b9db72567d Mon Sep 17 00:00:00 2001 From: Bartlomiej Grzeskowiak <bartlomiej.grzeskowiak@iopsys.eu> Date: Fri, 28 Jan 2022 13:00:27 +0100 Subject: [PATCH] iopsys-econet: Remove overlay autoformat Bringup and format of overlay partition should be done manually. Not in upgrade bundle script. Description added to Readme.md file. Mtd squashfs variant does use overlay in mtd8 (container) partition. This solution is temporary. Signed-off-by: Bartlomiej Grzeskowiak <bartlomiej.grzeskowiak@iopsys.eu> --- iopsys-econet/README.md | 76 +++++++++++++++------- iopsys-econet/image/upgrade-bundle/upgrade | 9 --- 2 files changed, 52 insertions(+), 33 deletions(-) diff --git a/iopsys-econet/README.md b/iopsys-econet/README.md index 7bd08527f..3a1e42a7b 100644 --- a/iopsys-econet/README.md +++ b/iopsys-econet/README.md @@ -23,32 +23,60 @@ Preparing the board for first time Raw boards must be prepared before booting iopsys image for first time: -Dump wifi calibration data (cat /etc/Wireless/RT2860AP_AC/RT30xxEEPROM.bin | hexdump https://project.iopsys.eu/issues/4822) -Precompiled bootloader is located in [repository](https://dev.iopsys.eu/feed/econet/-/blob/devel/dl/iopboot.bin) - -It is also copied to bin dir during the build process Connect UART console -cp ./bin/targets/iopsys-econet/en7562/iopboot.bin ~/tftp; -cp ./bin/targets/iopsys-econet/en7562/ubilinux ~/tftp; -cp ./bin/targets/iopsys-econet/en7562/ubi_root.bin ~/tftp; + cp ./bin/targets/iopsys-econet/en7562/iopboot.bin ~/tftp; + cp ./bin/targets/iopsys-econet/en7562/ubilinux ~/tftp; + cp ./bin/targets/iopsys-econet/en7562/ubi_root.bin ~/tftp; + cp ./bin/targets/iopsys-econet/en7562/last.itb ~/tftp; -[...] -Log into uboot console -ECNT> tftpboot iopboot.bin -ECNT> flash erase 0x0 ${filesize} -ECNT> flash write 0x0 ${filesize} ${loadaddr} -ECNT> reset -ECNT> tftpboot ubilinux -ECNT> flash erase 0x100000 0xA00000 -ECNT> flash write 0x100000 ${filesize} ${loadaddr} -ECNT> flash write 0x600000 ${filesize} ${loadaddr} -ECNT> tftpboot ubi_root.bin -ECNT> flash erase 0xb00000 0xA100000 -ECNT> flash write 0xb00000 ${filesize} ${loadaddr} -ECNT> setenv rootfstype ubifs; saveenv -ECNT> reset +Setup your local network + + ECNT> setenv serverip 192.168.1.100; setenv ipaddr 192.168.1.1; ping 192.168.1.100; saveenv ; + +Download bootloader and flash + + ECNT> tftpboot iopboot.bin + ECNT> flash erase 0x0 ${filesize} ; flash write 0x0 ${filesize} ${loadaddr} + +Download kernel and flash both banks + + ECNT> tftpboot ubilinux ; flash erase 0x100000 0xA00000 ; flash write 0x100000 ${filesize} ${loadaddr} ; flash write 0x600000 ${filesize} ${loadaddr} ; + +Download rootFS and flash both banks + + ECNT> tftpboot root.squashfs ; flash erase 0xb00000 0x8C00000 ; flash write 0xb00000 ${filesize} ${loadaddr} ;flash write 0x5100000 ${filesize} ${loadaddr} + +Reboot and store uboot envs + + ECNT> reset + ECNT> setenv serverip 192.168.1.100 ; setenv ipaddr 192.168.1.1 ; setenv ethaddr 00:21:94:71:5B:90 ; saveenv ; reset + +Boot board and install overlay + + root@iopsys:~# flash_erase /dev/mtd8 0 0 + root@iopsys:~# ubidetach -m 8 + root@iopsys:~# ubiformat /dev/mtd8 + root@iopsys:~# ubiattach -p /dev/mtd8 + root@iopsys:~# ubimkvol /dev/ubi0 -n 6 -N overlay1 -s 10MiB + root@iopsys:~# ubimkvol /dev/ubi0 -n 7 -N overlay2 -s 10MiB + root@iopsys:~# reboot + +Dump art partition and test sysupgrade + + root@iopsys:~# cd /tmp ; ifconfig br-lan 192.168.1.1 up ; + root@iopsys:~# nanddump /dev/mtd9 -f ./[!BASE_MAC!].art + root@iopsys:~# tftp -p -l ./*.art 192.168.1.100 ; scp bg@192.168.1.100:/home/bg/tftp/last.itb ./ + root@iopsys:~# sysupgrade -n ./last.itb + +Check BASE MAC + + root@iopsys:~# ifconfig br-lan + +Chect BOOT BANKS contants. Bank B should be active + + root@iopsys:~# ubus call fwbank dump Network configuration -- @@ -85,12 +113,12 @@ Flashing an IOPSYSWRT OS image To flash an image from **linux console**, type in this command: ``` -scp ./bin/targets/iopsys-econet/en7562/last-ubifs.itb root@<board>:/tmp +scp ./bin/targets/iopsys-econet/en7562/last.itb root@<board>:/tmp ``` and on the \<board\> (ssh \<board\>) ``` [...] -root@iopsys:~# sysupgrade /tmp/last-ubifs.itb +root@iopsys:~# sysupgrade /tmp/last.itb ``` Board recovery diff --git a/iopsys-econet/image/upgrade-bundle/upgrade b/iopsys-econet/image/upgrade-bundle/upgrade index 2d46ea6ed..48f7a3763 100755 --- a/iopsys-econet/image/upgrade-bundle/upgrade +++ b/iopsys-econet/image/upgrade-bundle/upgrade @@ -85,15 +85,6 @@ do_squashfs_update() { nandwrite -p /dev/$next_bank_rootfs_mtd /tmp/squashfs.bin rm /tmp/squashfs.bin - log "- Install overlay partition if not present -" - if [[ "1" != "$(fw_printenv -n overlay_installed)" ]]; then - flash_erase /dev/$ubicontainer_mtd 0 0 - ubiformat /dev/$ubicontainer_mtd - ubiattach -p /dev/$ubicontainer_mtd - ubimkvol /dev/ubi0 -n 6 -N overlay1 -s 10MiB - ubimkvol /dev/ubi0 -n 7 -N overlay2 -s 10MiB - fw_setenv overlay_installed "1" - fi } case $invocation in -- GitLab