new file mode 100644
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(board_name)
+
+ubootenv_mtdinfo () {
+ UBOOTENV_PART=$(cat /proc/mtd | grep u-boot-env)
+ mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
+ mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
+ mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
+ sectors=$(( $mtd_size / $mtd_erase ))
+ echo /dev/$mtd_dev 0x0 $mtd_size $mtd_erase $sectors
+}
+
+case "$board" in
+pine64,pine64-lts)
+ ubootenv_add_uci_config $(ubootenv_mtdinfo)
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
Add support for reading and writing environment stored in SPI flash device. Signed-off-by: Oskari Lemmela <oskari@lemmela.net> --- package/boot/uboot-envtools/files/sunxi | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 package/boot/uboot-envtools/files/sunxi