Re: HowTo: openWrt on OXNAS boxes August 02, 2022 07:20PM |
Registered: 11 years ago Posts: 144 |
/dev/mtd1 0xc0000 0x20000 0x20000
/dev/mtd2 0x0 0x20000 0x20000
Re: HowTo: openWrt on OXNAS boxes August 03, 2022 01:56PM |
Registered: 11 years ago Posts: 144 |
Re: HowTo: openWrt on OXNAS boxes August 03, 2022 02:29PM |
Registered: 11 years ago Posts: 144 |
root@debian ~ $ uname -a Linux debian 5.4.179-oxnas-tld-1 #1.0 SMP PREEMPT Mon Feb 14 21:50:21 PST 2022 armv6l GNU/Linux root@debian ~ $ cat /proc/cmdline console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=41000000.nand:0x100000@0x0(u-boot),0x20000@0x100000(u-boot-env-main),0x80000@0x3c0000(u-boot-env),0x440000@0x9C0000(kernel),-(ubi) root@debian ~ $ cat /proc/mtd dev: size erasesize name mtd0: 00e00000 00020000 "boot" mtd1: 07200000 00020000 "data" root@debian ~ $ dmesg | grep -i 0x0 [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=41000000.nand:0x100000@0x0(u-boot),0x20000@0x100000(u-boot-env-main),0x80000@0x3c0000(u-boot-env),0x440000@0x9C0000(kernel),-(ubi) [ 8.477432] 0x000000000000-0x000000e00000 :"boot" [ 8.485373] 0x000000e00000-0x000008000000 :"data" root@debian ~ $ fw_printenv | tail -n 5 partition=nand0,0 set_bootargs_owrt=setenv bootargs console=ttyS0,115200 $mtdparts bootcmd_owrt=run set_bootargs_owrt; nboot 60500000 0 440000; bootm bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_owrt mtdparts=mtdparts=41000000.nand:0x100000@0x0(u-boot),0x20000@0x100000(u-boot-env-main),0x80000@0x3c0000(u-boot-env),0x440000@0x9C0000(kernel),-(ubi) root@debian ~ $>
Re: HowTo: openWrt on OXNAS boxes August 03, 2022 04:27PM |
Admin Registered: 11 years ago Posts: 16,644 |
Re: HowTo: openWrt on OXNAS boxes August 03, 2022 05:28PM |
Admin Registered: 11 years ago Posts: 16,644 |
Quote
A. How to use the uEnv.txt script (Optional)
This uEnv.txt script can be used to further customizing u-boot envs without saving to NAND or to boot with a completely different set of u-boot envs.
Create a text file in /boot directory with the content in the format that u-boot envs are listed.
mkdir -p /boot cd /boot
nano uEnv.txt
loaded_envs=See_uEnv.txt_from_rootfsExit and save the file.
printenv loaded_envs
Re: HowTo: openWrt on OXNAS boxes August 03, 2022 05:33PM |
Registered: 11 years ago Posts: 144 |
>Quote
A. How to use the uEnv.txt script
> (Optional)
>
> This uEnv.txt script can be used to further
> customizing u-boot envs without saving to NAND or
> to boot with a completely different set of u-boot
> envs.
>
> Create a text file in /boot directory with the
> content in the format that u-boot envs are
> listed.
> mkdir -p /boot > cd /boot >>
> nano uEnv.txt >>
> loaded_envs=See_uEnv.txt_from_rootfs >> Exit and save the file.
> printenv loaded_envs >
Re: HowTo: openWrt on OXNAS boxes August 03, 2022 06:49PM |
Admin Registered: 11 years ago Posts: 16,644 |
setenv mtdparts 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)' setenv partition 'nand0,0' ubi part ubi ubi infovolume name should be in the output.
ubifsmount <volume name>
ubifsls boot
Re: HowTo: openWrt on OXNAS boxes August 03, 2022 06:54PM |
Admin Registered: 11 years ago Posts: 16,644 |
Re: HowTo: openWrt on OXNAS boxes August 04, 2022 01:50PM |
Registered: 11 years ago Posts: 144 |
mkdir -p /boot cd /boot nano uEnv.txt # wrote loaded_envs=See_uEnv.txt_from_rootfs
# this should survive cp uEnv.txt /etc/config/
cd /tmp wget https://downloads.openwrt.org/releases/21.02.3/targets/oxnas/ox820/openwrt-21.02.3-oxnas-ox820-cloudengines_pogoplug-series-3-squashfs-sysupgrade.tar sysupgrade -v openwrt-21.02.3-oxnas-ox820-cloudengines_pogoplug-series-3-squashfs-sysupgrade.tar root@OpenWrt:/tmp# sysupgrade -v openwrt-21.02.3-oxnas-ox820-cloudengines_pogoplug-series-3-squashfs-sysupgrade.tar Thu Aug 4 17:52:47 UTC 2022 upgrade: Saving config files... etc/config/dropbear etc/config/firewall etc/config/fstab etc/config/luci etc/config/mdadm etc/config/network etc/config/rpcd etc/config/system etc/config/uEnv.txt etc/config/ubootenv etc/config/ubootenv_bodhi etc/config/ubootenv_owrt etc/config/ubootenv_test1 etc/config/ubootenv_test2 etc/config/ucitrack etc/config/uhttpd etc/dropbear/dropbear_ed25519_host_key etc/dropbear/dropbear_rsa_host_key etc/fw_env.config etc/group etc/hosts etc/inittab etc/luci-uploads/.placeholder etc/opkg/keys/2f8b0b98e08306bf etc/opkg/keys/4d017e6f1ed5d616 etc/passwd etc/profile etc/rc.local etc/shadow etc/shells etc/shinit etc/sysctl.conf etc/uhttpd.crt etc/uhttpd.key etc/uhttpd.key etc/uhttpd.crt Thu Aug 4 17:52:47 UTC 2022 upgrade: Commencing upgrade. Closing all shell sessions. Command failed: Connection failed root@OpenWrt:/tmp# Connection to 192.168.XXX.YYY closed by remote host.
BusyBox v1.33.2 (2022-04-16 12:59:34 UTC) built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt 21.02.3, r16554-1d4dea6d4f ----------------------------------------------------- === WARNING! ===================================== There is no root password defined on this device! Use the "passwd" command to set up a new password in order to prevent unauthorized SSH logins. -------------------------------------------------- root@OpenWrt:~# cd /boot -ash: cd: can't cd to /boot: No such file or directory root@OpenWrt:~# cat /etc/config/uEnv.txt loaded_envs=See_uEnv.txt_from_rootfs root@OpenWrt:~#
> setenv mtdparts > 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)' > setenv partition 'nand0,0' > ubi part ubi > ubi info >> volume name should be in the output.
setenv mtdparts 'mtdparts=41000000.nand:0x100000@0x0(u-boot),-@0x100000(ubi)'
U-Boot 2015.10-tld-2 (Oct 21 2017 - 22:00:02 -0700) OXNAS OX820 gcc (Debian 6.3.0-18) 6.3.0 20170516 GNU ld (GNU Binutils for Debian) 2.28 Hit any key to stop autoboot: 8 0 OX820> setenv mtdparts 'mtdparts=41000000.nand:0x100000@0x0(u-boot),-@0x100000(ubi)' setenv mtdparts 'mtdparts=41000000.nand:0x100000@0x0(u-boot),-@0x100000(ubi)' OX820> setenv partition 'nand0,0' setenv partition 'nand0,0' OX820> ubi part ubi ubi part ubi UBI: attaching mtd1 to ubi0 UBI: scanning is finished UBI: attached mtd1 (name "mtd=1", size 127 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: 1016, bad PEBs: 0, corrupted PEBs: 0 UBI: user volume: 2, internal volumes: 1, max. volumes count: 128 UBI: max/mean erase counter: 6/3, WL threshold: 4096, image sequence number: 834073264 UBI: available PEBs: 104, 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: 127 MiB UBI: physical eraseblock size: 131072 bytes (128 KiB) UBI: logical eraseblock size: 129024 bytes UBI: number of good PEBs: 1016 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: 2 UBI: available PEBs: 104 UBI: total number of reserved PEBs: 912 UBI: number of PEBs reserved for bad PEB handling: 20 UBI: max/mean erase counter: 6/3 OX820> ubifsmount /dev/mtd1 ubifsmount /dev/mtd1 Error reading superblock on volume '/dev/mtd1' errno=-22! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> ubifsmount mtd=1 ubifsmount mtd=1 Error reading superblock on volume 'mtd=1' errno=-22! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> ubifsmount mtd1 ubifsmount mtd1 Error reading superblock on volume 'mtd1' errno=-22! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> ubifsmount ubi0 ubifsmount ubi0 Error reading superblock on volume 'ubi0' errno=-22! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> ubifsmount ubi0_0 ubifsmount ubi0_0 Error reading superblock on volume 'ubi0_0' errno=-22! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> ubifsmount ubi:mtd1 ubifsmount ubi:mtd1 Error reading superblock on volume 'ubi:mtd1' errno=-19! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> ubifsmount ubi:mtd=1 ubifsmount ubi:mtd=1 Error reading superblock on volume 'ubi:mtd=1' errno=-19! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> OX820>
Re: HowTo: openWrt on OXNAS boxes August 04, 2022 03:57PM |
Admin Registered: 11 years ago Posts: 16,644 |
Quote
Conclusion: The /boot-directory did not survive. Thus, if the file absolutely has to be in /boot, it should be symlinked. However, since the uBoot-env will have to be customized anyway, why not just read it from /etc/config right away for the OpenWrt boot?
ubifsmount ubi0:mdt1
Re: HowTo: openWrt on OXNAS boxes August 04, 2022 04:09PM |
Registered: 11 years ago Posts: 144 |
>Quote
Conclusion: The /boot-directory did not
> survive. Thus, if the file absolutely has to be in
> /boot, it should be symlinked. However, since the
> uBoot-env will have to be customized anyway, why
> not just read it from /etc/config right away for
> the OpenWrt boot?
> ubifsmount ubi0:mdt1 >
Re: HowTo: openWrt on OXNAS boxes August 07, 2022 05:13PM |
Registered: 11 years ago Posts: 144 |
> ubifsmount ubi0:mdt1 >
OX820> ubifsmount ubi0:mdt1 ubifsmount ubi0:mdt1 Error reading superblock on volume 'ubi0:mdt1' errno=-19! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820>
root@OpenWrt:~# blkid /dev/ubi0_1: UUID="eaa436ab-920d-454c-b47b-de15f9a5db60" TYPE="ubifs" /dev/ubi0_0: TYPE="squashfs" /dev/mtdblock4: UUID="834073264" TYPE="ubi" /dev/ubiblock0_0: TYPE="squashfs" root@OpenWrt:~#
OX820> ubifsmount ubi0_0:mdt1 ubifsmount ubi0_2:mdt1 Error reading superblock on volume 'ubi0_0:mdt1' errno=-22! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820> ubifsmount ubi0_1:mtd1 ubifsmount ubi0_1:mtd1 Error reading superblock on volume 'ubi0_1:mtd1' errno=-22! ubifsmount - mount UBIFS volume Usage: ubifsmount <volume-name> - mount 'volume-name' volume OX820>
Re: HowTo: openWrt on OXNAS boxes August 07, 2022 07:00PM |
Admin Registered: 11 years ago Posts: 16,644 |
Re: HowTo: openWrt on OXNAS boxes August 07, 2022 08:53PM |
Registered: 7 years ago Posts: 339 |
+ partition@3c0000 { + label = "u-boot-env"; + reg = <0x003c0000 0x00080000>; + };
Re: HowTo: openWrt on OXNAS boxes August 07, 2022 10:28PM |
Admin Registered: 11 years ago Posts: 16,644 |
Re: HowTo: openWrt on OXNAS boxes August 12, 2022 07:37PM |
Admin Registered: 11 years ago Posts: 16,644 |
ubi part ubi ubi info ubi info layout
ubifsmount ubi0:rootfs_data
mountIt should show the rootfs mounted with squashfs. And the /overlay is ubifs. The upper layer of the root file system is etc. (it's overlaid on top) So that's why /etc/config is sticky and not got overwritten by sysupgrade.