[PATCH 1/1] update factory reset for generic handling of all type of devices(jffs2, ubi, etc)

mail at adrianschmutzler.de mail at adrianschmutzler.de
Wed Jul 22 10:05:17 EDT 2020


Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Todor Colov
> Sent: Montag, 20. Juli 2020 21:19
> To: openwrt-devel at lists.openwrt.org
> Cc: Todor Colov <todorcolov at abv.bg>
> Subject: [PATCH 1/1] update factory reset for generic handling of all type of
> devices(jffs2, ubi, etc)

Despite the formal requirements not met (commit title/message), one comment below.

> 
> Signed-off-by: Todor Colov <todorcolov at abv.bg>
> ---
>  package/base-files/files/etc/rc.button/reset | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-
> files/files/etc/rc.button/reset
> index 2403122ad2..0c11bfe462 100755
> --- a/package/base-files/files/etc/rc.button/reset
> +++ b/package/base-files/files/etc/rc.button/reset
> @@ -23,7 +23,7 @@ released)
>  	elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
>  	then
>  		echo "FACTORY RESET" > /dev/console
> -		jffs2reset -y && reboot &
> +		rm -f /etc/config/* && cp -a /rom/etc/* /etc/. ; sync ; reboot

As far as I understand it, jffs2reset will really reset the file system, just throwing away all diffs to the "rom". What you do here looks to me like it will essentially remove the files, and then recreate them, both increasing the diff between the overlay fs and the rom part, eating up precious space.
Or is this healed somewhere magically I'm not aware of?

Best

Adrian

>  	fi
>  ;;
>  esac
> --
> 2.27.0
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20200722/57b1f44f/attachment.sig>


More information about the openwrt-devel mailing list