aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/socfpga/base-files/lib/preinit/79_move_config
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/socfpga/base-files/lib/preinit/79_move_config')
-rw-r--r--target/linux/socfpga/base-files/lib/preinit/79_move_config18
1 files changed, 18 insertions, 0 deletions
diff --git a/target/linux/socfpga/base-files/lib/preinit/79_move_config b/target/linux/socfpga/base-files/lib/preinit/79_move_config
new file mode 100644
index 0000000000..89f62d52f1
--- /dev/null
+++ b/target/linux/socfpga/base-files/lib/preinit/79_move_config
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+move_config() {
+ . /lib/socfpga.sh
+ . /lib/upgrade/sockit.sh
+
+ local board=$(socfpga_board_name)
+
+ # Restore configuration
+ if [ "${board}" = "socfpga-sockit" ] ; then
+ mount -o rw,noatime "$CFGPART" /mnt
+ [ -e "/mnt/sysupgrade.tgz" ] && mv -f /mnt/sysupgrade.tgz /
+ umount /mnt
+ fi
+}
+
+boot_hook_add preinit_mount_root move_config