Re: HowTo: openWrt on OXNAS boxes August 14, 2022 04:34PM |
Admin Registered: 13 years ago Posts: 18,898 |
Quote
6. Install to NAND
Finally, we can perform a sysupgrade of OpenWrt/LEDE either using the LUCI WIF (Web Interface) or the command line.
< text about removing all USB drives here>
Since we are already logged in via ssh, I only describe the latter option, while the former may be found, e.g., in step 4.b of Jörg's original post for the Kirkwoods. We must do:
opkg update
opkg install ca-certificates
cd /tmp
wget <URL of our desired sysupgrade file>
sysupgrade <name of our desired sysupgrade file>
The desired upgrade file may be found the same way as we found the image in step 2 above starting from the release page (but, ideally, you kept the browser tab open in step 2). There you can just copy the link address to the sysupgrade file (tar or bin depending on the release) and paste it into the ssh window.
Remark: Coresponding to the above uImages, the concrete files for the sysupgrade were
this upgrade file for the classic Pogoplug v3
this upgrade file for the Pogoplug Pro
remove: The upgrade process will result in an automatic reboot (during which I removed the USB stick, but that may not be necessary).
Re: HowTo: openWrt on OXNAS boxes August 14, 2022 04:44PM |
Admin Registered: 13 years ago Posts: 18,898 |
Quote
7. Boot from NAND and log in to OpenWrt
.......
generate or modify /etc/fw_env.config
Check whether the file /etc/fw_env.config has the following contents (which is easily calculated from the above MTD layout in comparison to bodhi's):
/dev/mtd1 0xc0000 0x20000 0x20000
If not or if the file does not exist at all, the easiest way to modify/generate it is
echo '/dev/mtd1 0xc0000 0x20000 0x20000' > /etc/fw_env.config
Afterwards, check that the uBoot environment is found by printing the variables to screen using
fw_printenv
...
Re: HowTo: openWrt on OXNAS boxes August 14, 2022 04:45PM |
Admin Registered: 13 years ago Posts: 18,898 |
Re: HowTo: openWrt on OXNAS boxes August 15, 2022 07:15AM |
Registered: 13 years ago Posts: 157 |
Re: HowTo: openWrt on OXNAS boxes August 15, 2022 07:31AM |
Registered: 13 years ago Posts: 157 |
OX820> printenv mtdparts printenv mtdparts mtdparts=mtdparts=41000000.nand:14m(boot),-(data) OX820> setenv partition 'nand0,0' setenv partition 'nand0,0' OX820> ubi part data ubi part data UBI: attaching mtd1 to ubi0 UBI: scanning is finished UBI: attached mtd1 (name "mtd=1", size 114 MiB) to ubi0 UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512 UBI: VID header offset: 512 (aligned 512), data offset: 2048 UBI: good PEBs: 912, bad PEBs: 0, corrupted PEBs: 0 UBI: user volume: 1, internal volumes: 1, max. volumes count: 128 UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 3797175681 UBI: available PEBs: 0, total reserved PEBs: 912, PEBs reserved for bad PEB handling: 20 OX820> ubi info ubi info UBI: MTD device name: "mtd=1" UBI: MTD device size: 114 MiB UBI: physical eraseblock size: 131072 bytes (128 KiB) UBI: logical eraseblock size: 129024 bytes UBI: number of good PEBs: 912 UBI: number of bad PEBs: 0 UBI: smallest flash I/O unit: 2048 UBI: VID header offset: 512 (aligned 512) UBI: data offset: 2048 UBI: max. allowed volumes: 128 UBI: wear-leveling threshold: 4096 UBI: number of internal volumes: 1 UBI: number of user volumes: 1 UBI: available PEBs: 0 UBI: total number of reserved PEBs: 912 UBI: number of PEBs reserved for bad PEB handling: 20 UBI: max/mean erase counter: 2/1 OX820> ubi info layout ubi info layout Volume information dump: vol_id 0 reserved_pebs 888 alignment 1 data_pad 0 vol_type 3 name_len 6 usable_leb_size 129024 used_ebs 888 used_bytes 114573312 last_eb_bytes 129024 corrupted 0 upd_marker 0 name rootfs Volume information dump: vol_id 2147479551 reserved_pebs 2 alignment 1 data_pad 0 vol_type 3 name_len 13 usable_leb_size 129024 used_ebs 2 used_bytes 258048 last_eb_bytes 2 corrupted 0 upd_marker 0 name layout volume OX820> ubifsmount ubi0:rootfs ubifsmount ubi0:rootfs OX820> ubifsls / ubifsls / <DIR> 3984 Sat Apr 16 12:59:34 2022 bin <DIR> 160 Sat Apr 16 12:59:34 2022 dev <DIR> 4032 Fri Jan 29 20:20:40 2021 etc <DIR> 1904 Sat Apr 16 12:59:34 2022 lib <DIR> 160 Sat Apr 16 12:59:34 2022 mnt <DIR> 224 Sat Apr 16 12:59:34 2022 rom <DIR> 160 Sat Apr 16 12:59:34 2022 tmp <DIR> 160 Sat Apr 16 12:59:34 2022 sys <LNK> 3 Sat Apr 16 12:59:34 2022 var <DIR> 480 Tue Aug 02 18:04:25 2022 usr <DIR> 368 Sat Apr 16 12:59:34 2022 www <DIR> 160 Sat Apr 16 12:59:34 2022 proc <DIR> 3736 Sat Apr 16 12:59:34 2022 sbin <DIR> 160 Sat Apr 16 12:59:34 2022 root <DIR> 160 Sat Apr 16 12:59:34 2022 overlay OX820> ubifsls /etc ubifsls /etc <LNK> 7 Sat Apr 16 12:59:34 2022 TZ 70 Sat Apr 16 12:59:34 2022 udhcpc.user <DIR> 296 Fri Jan 29 20:20:40 2021 ssl 34 Mon Aug 15 12:12:37 2022 fw_env.config <LNK> 12 Sat Apr 16 12:59:34 2022 mtab <DIR> 376 Sat Apr 16 12:59:34 2022 opkg <DIR> 2320 Mon Aug 15 12:09:27 2022 rc.d 305 Sat Apr 16 12:59:34 2022 hotplug-preinit.json <LNK> 21 Sat Apr 16 12:59:34 2022 os-release <DIR> 376 Sat Apr 16 12:59:34 2022 iproute2 170 Sat Apr 16 12:59:36 2022 board.json <DIR> 1696 Sat Apr 16 12:59:34 2022 init.d <DIR> 328 Sat Apr 16 12:59:50 2022 dropbear 1522 Sat Apr 16 12:59:34 2022 hotplug.json 18 Sat Apr 16 12:59:34 2022 openwrt_version <DIR> 552 Sat Apr 16 12:59:34 2022 rc.button <DIR> 160 Sat Apr 16 12:59:34 2022 udhcpc.user.d 664 Sat Apr 16 12:59:36 2022 uhttpd.crt 121 Sat Apr 16 12:59:36 2022 uhttpd.key 3233 Sat Apr 16 12:59:34 2022 rc.common <DIR> 424 Sat Apr 16 12:59:34 2022 hotplug.d <DIR> 232 Sat Apr 16 12:59:34 2022 luci-uploads 948 Sat Apr 16 12:59:34 2022 diag.sh 352 Sat Apr 16 12:59:34 2022 firewall.user 320 Sat Apr 16 12:59:34 2022 passwd 80 Sat Apr 16 12:59:34 2022 sysctl.conf <DIR> 312 Sat Apr 16 12:59:34 2022 board.d 61 Sat Apr 16 12:59:34 2022 fstab 189 Sat Apr 16 12:59:34 2022 group 110 Sat Apr 16 12:59:34 2022 hosts 106 Sat Apr 16 12:59:34 2022 inittab <DIR> 824 Sat Apr 16 12:59:34 2022 modules-boot.d <DIR> 1960 Sat Apr 16 12:59:34 2022 modules.d <DIR> 312 Sat Apr 16 12:59:34 2022 sysctl.d 180 Sat Apr 16 12:59:34 2022 shadow 9 Sat Apr 16 12:59:34 2022 shells 1120 Sat Apr 16 12:59:34 2022 shinit 461 Sat Apr 16 12:59:34 2022 banner.failsafe 123 Sat Apr 16 12:59:34 2022 device_info 512 Sat Apr 16 12:59:54 2022 urandom.seed <LNK> 14 Sat Apr 16 12:59:34 2022 localtime 397 Sat Apr 16 12:59:34 2022 banner 2541 Sat Apr 16 12:59:34 2022 protocols <DIR> 160 Sat Apr 16 12:59:37 2022 uci-defaults <DIR> 160 Sat Apr 16 12:59:34 2022 crontabs 132 Sat Apr 16 12:59:34 2022 rc.local <DIR> 304 Sat Apr 16 12:59:34 2022 capabilities <LNK> 16 Sat Apr 16 12:59:34 2022 resolv.conf <DIR> 968 Mon Aug 15 12:11:00 2022 config 213 Sat Apr 16 12:59:34 2022 openwrt_release 128 Sat Apr 16 12:59:34 2022 sysupgrade.conf 609 Sat Apr 16 12:59:34 2022 preinit 1046 Sat Apr 16 12:59:34 2022 profile 108 Sat Apr 16 12:59:34 2022 opkg.conf 130 Sat Apr 16 12:59:34 2022 ethers 3073 Sat Apr 16 12:59:34 2022 services OX820> ubifsls /etc/config ubifsls /etc/config 973 Mon Aug 15 12:09:27 2022 luci 167 Sat Apr 16 12:59:34 2022 rpcd 521 Mon Aug 15 12:11:00 2022 network 788 Sat Apr 16 12:59:34 2022 ucitrack 134 Sat Apr 16 12:59:34 2022 dropbear 151 Sat Apr 16 12:59:36 2022 fstab 445 Sat Apr 16 12:59:34 2022 mdadm 449 Mon Aug 15 12:09:10 2022 system 783 Sat Apr 16 12:59:36 2022 uhttpd 352 Sat Apr 16 12:59:35 2022 wireless 4632 Sat Apr 16 12:59:34 2022 firewall 132 Sat Apr 16 12:59:37 2022 ubootenv
Re: HowTo: openWrt on OXNAS boxes August 15, 2022 04:03PM |
Admin Registered: 13 years ago Posts: 18,898 |
Re: HowTo: openWrt on OXNAS boxes August 15, 2022 04:09PM |
Registered: 13 years ago Posts: 157 |
Re: HowTo: openWrt on OXNAS boxes August 15, 2022 04:32PM |
Admin Registered: 13 years ago Posts: 18,898 |
Quote
5. Log in to OpenWrt
Find the IP address of your box and ssh into it (user root without password). The following step is absolutely crucial but does not yet quite work the way we would expect.
Verify your mtd layout.
Ideally, (see bodhi's u-Boot post) it should be:
root@OpenWrt:# cat /proc/mtd
dev: size erasesize name
mtd0: 00e00000 00020000 "boot"
mtd1: 07200000 00020000 "data"
Instead, what it will probably be (at least it was for me) is:
root@OpenWrt:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "stage1"
mtd1: 00380000 00020000 "u-boot"
mtd2: 00080000 00020000 "u-boot-env"
mtd3: 009c0000 00020000 "kernel"
mtd4: 07200000 00020000 "ubi"
This means that for OpenWrt, the boot-section is further subdivided, while the ubi-/data-section is the same - so that is promising. However, since apparently our mtdparts-definition from step 1 was not picked up, we will have to calculate a bit in order to specify where fw_printenv should find the uBoot environment.
Temporarily generate or modify /etc/fw_env.config
Check whether the file /etc/fw_env.config has the following contents (which is easily calculated from the above MTD layout in comparison to bodhi's):
/dev/mtd1 0xc0000 0x20000 0x20000
If not or if the file does not exist at all, the easiest way to modify/generate it is
echo '/dev/mtd1 0xc0000 0x20000 0x20000' > /etc/fw_env.config
Afterwards, check that the uBoot environment is found by printing the variables to screen using
fw_printenv
Remarks:
Since OpenWrt only runs in RAM at the moment, this is a temporary change. If you want to be able to access the uBoot environment from the OpenWrt rescue system later on, this step will most likely have to be repeated (see step 7 below).
If you would rather modify an existing file, you can do so using vim (which is pre-installed in OpenWrt). If, like me, you do not want to learn vim and prefer nano, you can instead do
opkg update && opkg install nano
Re: HowTo: openWrt on OXNAS boxes August 15, 2022 06:22PM |
Registered: 13 years ago Posts: 157 |
Re: HowTo: openWrt on OXNAS boxes August 15, 2022 09:25PM |
Admin Registered: 13 years ago Posts: 18,898 |
Re: HowTo: openWrt on OXNAS boxes August 17, 2022 02:51PM |
Admin Registered: 13 years ago Posts: 18,898 |
Re: HowTo: openWrt on OXNAS boxes August 19, 2022 04:30PM |
Admin Registered: 13 years ago Posts: 18,898 |
Quote
https://forum.doozan.com/read.php?2,23630
Rescue Systems
Rescue System V2 (Original)
MacPlug & SMBPLug
Rescue System Pogo V3
Rescue System V4, using a custom LEDE firmware (BETA)
Rescue System for Pogo E02 using LEDE/OpenWrt (Install with Serial Console)
Rescue System for Pogo V4/Mobile using OpenWrt (Install with NetConsole)
Rescue System using OpenWrt on Kirkwood boxes
Rescue System using OpenWrt on OXNAS (Pogoplug V3 Classic and Pro)
Re: HowTo: openWrt on OXNAS boxes August 19, 2022 04:32PM |
Admin Registered: 13 years ago Posts: 18,898 |
Re: HowTo: openWrt on OXNAS boxes August 20, 2022 05:11AM |
Registered: 13 years ago Posts: 157 |