[OpenWrt-Devel] [PATCH v3] octeon: Allow sysupgrade restore on ER

John Crispin john at phrozen.org
Mon Dec 3 01:35:15 EST 2018


On 28/11/2018 20:07, Jonathan Thibault wrote:
> This is a very simple patch that completes sysupgrade functionality on UBNT
> ER8.
>
> Default layout leaves about 128MB free on the kernel partition so there is
> plenty of space for temporary config backups.
Hi Jonathan,
ordering looks correct, however you are now mixing 2 things into 1 patch.
there is the part adding the er) blocks and a second change which fixes 
previously
broken ordering. these need to go into 2 separate patches.
     John


>
> ---
> v2: checks board name in alphabetical order
> v3: used git send-email to avoid patch mangling
> ---
>   target/linux/octeon/base-files/lib/preinit/79_move_config |  5 +++++
>   target/linux/octeon/base-files/lib/upgrade/platform.sh    | 15 ++++++++++-----
>   2 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/target/linux/octeon/base-files/lib/preinit/79_move_config b/target/linux/octeon/base-files/lib/preinit/79_move_config
> index ec63d9f5ff..470cbfe005 100644
> --- a/target/linux/octeon/base-files/lib/preinit/79_move_config
> +++ b/target/linux/octeon/base-files/lib/preinit/79_move_config
> @@ -5,6 +5,11 @@ move_config() {
>   	. /lib/functions.sh
>   
>   	case "$(board_name)" in
> +		er)
> +			mount -t vfat /dev/mmcblk0p1 /mnt
> +			[ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz /
> +			umount /mnt
> +			;;
>   		erlite)
>   			mount -t vfat /dev/sda1 /mnt
>   			[ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz /
> diff --git a/target/linux/octeon/base-files/lib/upgrade/platform.sh b/target/linux/octeon/base-files/lib/upgrade/platform.sh
> index cd49c0da36..009eae7a2c 100755
> --- a/target/linux/octeon/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/octeon/base-files/lib/upgrade/platform.sh
> @@ -23,6 +23,11 @@ platform_get_rootfs() {
>   
>   platform_copy_config() {
>   	case "$(board_name)" in
> +	er)
> +		mount -t vfat /dev/mmcblk0p1 /mnt
> +		cp -af "$CONF_TAR" /mnt/
> +		umount /mnt
> +		;;
>   	erlite)
>   		mount -t vfat /dev/sda1 /mnt
>   		cp -af "$CONF_TAR" /mnt/
> @@ -62,12 +67,12 @@ platform_do_upgrade() {
>   
>   	[ -b "${rootfs}" ] || return 1
>   	case "$board" in
> -	erlite)
> -		kernel=sda1
> -		;;
>   	er)
>   		kernel=mmcblk0p1
>   		;;
> +	erlite)
> +		kernel=sda1
> +		;;
>   	*)
>   		return 1
>   	esac
> @@ -82,8 +87,8 @@ platform_check_image() {
>   	local board=$(board_name)
>   
>   	case "$board" in
> -	erlite | \
> -	er)
> +	er | \
> +	erlite)
>   		local tar_file="$1"
>   		local kernel_length=`(tar xf $tar_file sysupgrade-$board/kernel -O | wc -c) 2> /dev/null`
>   		local rootfs_length=`(tar xf $tar_file sysupgrade-$board/root -O | wc -c) 2> /dev/null`

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list