Adding OpenWrt support for Xiaomi AX3600 (Part 1)

But now I am unable to install any package

root@OpenWrt:~# opkg install wireguard-tools
Installing wireguard-tools (1.0.20210914-1) to root...
Collected errors:
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg wireguard-tools needs 27
 * opkg_install_cmd: Cannot install package wireguard-tools.
root@OpenWrt:~# df -H
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.8M      6.8M         0 100% /rom
tmpfs                   203.4M      3.4M    200.1M   2% /tmp
/dev/ubi0_2              14.8M     14.3M         0 100% /overlay
overlayfs:/overlay       14.8M     14.3M         0 100% /
tmpfs                   512.0K         0    512.0K   0% /dev

Run
opkg update
first, this will get a new package list.

I did already

Oh, that's unusual, with release

OpenWrt SNAPSHOT r0-928dceb / LuCI Master git-22.361.69865-deed682

I have several MB free.

df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.8M      6.8M         0 100% /rom
tmpfs                   203.4M     92.0K    203.4M   0% /tmp
/dev/ubi0_2              14.8M     88.0K     13.9M   1% /overlay
overlayfs:/overlay       14.8M     88.0K     13.9M   1% /
tmpfs                   512.0K         0    512.0K   0% /dev

Do you have a lot of other packages installed?

In the default state (without additional installs) it should only be

opkg list-installed | wc -l
151

@dawkli

Hi. Sorry, i do not have time at the moment. There is a problem in my github action build process. I will check it, next week or so.
If you a time, you can take a look: https://github.com/snoova/ipq807x-openwrt-builder/actions/runs/3844606529/jobs/6547860727#step:3:11

Finally got the single/enlarged rootfs done for all Xiaomi devices, tested flashing from stock FW on AX3600 and pushed it.

Compat version is set to 2.0 to prevent anybody from using sysupgrade at all as it would brick your device.
If you are running one of the recent builds, you can flash the *-initramfs-factory.ubi image in the non used rootfs and set env variables to boot from it and sysupgrade from that initramfs image or return to stock FW and reinstall.

Install instructions for all Xiaomi devices in the commit messages have been rewritten to be up to date, please use those.

Can somebody update the wiki with those as well?

If we dont get any regressions I will be making a PR for the target in couple of days.
Regards,
Robert

15 Likes

when we flash *-initramfs-factory.ubi on the non used rootfs and perform a sysupgrade from that image, do we lose our config files?

Yes, you will lose your configs - but in this case (for the devices where the device order hasn't been changde) you can restore them later (although that will require careful meddling with compat_version in /etc/config/system); it would be better not to restore your configs blindly.

1 Like

I was thinking that the compat version is increased because of the necessity of booting initramfs-factory image first. If booting from that image will not cause factory default config to be present, compat version can be manually set to 2.0 and then the sysupgrade would keep the config files. I already did compat version 1.1 migration with a one-lier script provided in this forum.

Let's be clear, you need to flash the initramfs image first - which has no way to retain configurations - meaning at the sysupgrade step, there is nothing left to retain.

1 Like

the compat is done to prevent any kind of brick under any circumstance... User will need to migrate and just restore a backup to have a clean and intended state.

1 Like

Fixed thank you, AGH was consuming the whole disk space.

1 Like

This worked great, thanks.

Starting from yesterday's -pr release:

  1. Backup settings to PC using GUI
  2. scp *-initramfs-factory.ubi to /tmp, ubiformat write it to the inactive partition, fw_setenv the vars and reboot
  3. Using GUI, connect to the fresh/unconfigured 192.168.1.1, and sysupgrade to *-sysupgrade.bin
  4. Not sure if compat matters for config restore, so I manually scp'd the backup to /tmp, then cd /; tar xzf /tmp/backup*.tar.gz, then manually edited /etc/config/system and altered compat from 1.1 back to 2.0 before finally rebooting
3 Likes

I followed robimarko's instructions and it worked flawlessly.

On 928dceb:

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.8M      6.8M         0 100% /rom
tmpfs                   203.4M    104.0K    203.3M   0% /tmp
/dev/ubi0_2              14.8M     68.0K     13.9M   0% /overlay
overlayfs:/overlay       14.8M     68.0K     13.9M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev

On 8faba05:

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.8M      6.8M         0 100% /rom
tmpfs                   203.4M    100.0K    203.3M   0% /tmp
/dev/ubi0_1             175.2M     60.0K    170.4M   0% /overlay
overlayfs:/overlay      175.2M     60.0K    170.4M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
3 Likes

happy to hear the feature works correctly... we are very near the final stage for openwrt inclusion of this!

7 Likes

Thank you.

It's working

1 Like

Does that mean there won't be no more builds without the partition scheme override from now on?

1 Like

Yes, that is correct

2 Likes

Will the TFTP soft debrick still work with the new partition scheme?

Just asking for a friend :wink:

Yeah, as that rewrites both rootfs-s and you are fully back to the default FW layout

1 Like