[OpenWrt-Devel] [PATCHv5] ramips: add support for SamKnows SK-WB8

John Crispin john at phrozen.org
Mon Apr 25 12:32:38 EDT 2016



On 25/04/2016 18:01, Andrew Yong wrote:
> diff --git a/target/linux/ramips/base-files/lib/preinit/04_handle_bootcount b/target/linux/ramips/base-files/lib/preinit/04_handle_bootcount
> new file mode 100644
> index 0000000..570fe16
> --- /dev/null
> +++ b/target/linux/ramips/base-files/lib/preinit/04_handle_bootcount
> @@ -0,0 +1,22 @@
> +#!/bin/sh
> +
> +# SamKnows Whitebox 8 increments a bootcount variable every  boot and attempts
> +# to boot a recovery partition when bootcount > 3. We need to ensure this is
> +# reset to 0 every boot
> +
> +do_bootcount_reset() {
> +	. /lib/ramips.sh
> +
> +	local board=$(ramips_board_name)
> +
> +	case "$board" in
> +	sk-wb8)
> +		echo "Board is SamKnows Whitebox 8, resetting bootcount environment variable..."
> +		fw_setenv bootcount 0
> +	;;
> +	esac
> +
> +	return 0
> +}
> +
> +boot_hook_add preinit_main do_bootcount_reset


does this actually work ? thinking about it, you might need to have
uci-default run for it to work properly or alternatively call uboot-env
directly without the fw_* abstraction layer

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


More information about the openwrt-devel mailing list