[OpenWrt-Devel] [PATCH v2] octeon: Allow sysupgrade restore on ER
Hauke Mehrtens
hauke at hauke-m.de
Sat Nov 24 12:52:00 EST 2018
On 11/13/18 3:48 PM, 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.
>
> This version checks board names in alphabetical order.
Please follow the contribution guidelines and add a Signed-off-by line:
https://openwrt.org/wiki/wikirules
>
>
> 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
> + ;;
This looks whitespace damaged, I would suggest to use git send-email for
sending patches.
It looks the same in patchworks: https://patchwork.ozlabs.org/patch/997249/
> 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`
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20181124/62f5ceae/attachment.sig>
-------------- next part --------------
_______________________________________________
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