These will run on first boot or manually as you have run by doing "sh /etc/uci-defaults/70-rootpt-resize".
/etc/uci-defaults/70-rootpt-resize will resize the root partition. During the resize the PARTUUID changes. If you edit 70-rootpt-resize and add the following after touch /etc/rootpt-resize (line 12)
NEW_UUID=`blkid ${ROOT_DISK}p${ROOT_PART} | sed -n 's/.*PARTUUID="\([^"]*\)".*/\1/p'`
sed -i "s/PARTUUID=[^ ]*/PARTUUID=${NEW_UUID}/" /boot/cmdline.txt
It should update the partuuid in cmdline.txt after the partition resize but before the reboot, so the system should come up again successfully without intervention. This should help with subsequent upgrades too.
My logic is that replacing the PARTUUID is a more generic way of fixing this issue rather than replacing the partuuid with /dev/mmcblk0p2 as there may be people who have their root on a different partition/device.
So I changed root=PARTUUID=a00596c2-02 to root=/dev/mmcblk0p2 and that solved booting issue.
Is this something everything I have to perform after an upgrade?
Also files on my home directory (/root) was gone and /etc/init.d custom scripts also gone?
wont owut upgrade take care of that?
owut doesn't do any backup/restore, it lets standard sysupgrade handle all of that. If you have configured /etc/sysupgrade.conf to contain the files and directories such that sysupgrade --list shows the correct items, that part should "just work."
root@OpenWrt:~# cat /etc/sysupgrade.conf
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/
/etc/uci-defaults/70-rootpt-resize
/etc/uci-defaults/80-rootfs-resize
/etc/uci-defaults/70-rootpt-resize
/etc/uci-defaults/80-rootfs-resize
The files in /etc/uci-defaults/ are deleted as part of firstboot, so if you get the router to boot successfully, then they're gone and will not be backed up.
Yup, those should all work as you expect. Just run sysupgrade -l and maybe pipe through grep to see what is going to be saved.
Well, to be pedantic, nothing preserves the partition setup. What we're doing is replicating the current partitions in the new image, so when they are overwritten by sysupgrade, it appears that they have been preserved.
You do this with owut upgrade --rootfs-size 512 (512MB for example purposes, could be anything less than or equal to 1024). Since you don't want to type (or be forced to remember) --rootfs-size 512 every time you do an upgrade, you add that number to the config file and then it becomes the automatic default:
No, you can't use anything bigger that 1024 MB for various reasons. Since you're only using 94.3 MB at present, and even if you try hard you'll have difficulty getting up above 500 MB or so, just set it to 1024 and carry on.
There's no easy way to get all of that space in a partition. Consider it like buying a big plot of land, 10 km2, then building a big house on it. You'd like to build a gigantic 10 km2 house (most of which you'd never use), but there's no easy way, the rest of the land will just have to be "wasted".