617336583ee37a4ae4d89b308f77564e35613dd0
[openwrt/openwrt.git] / target / linux / mediatek / mt7623 / base-files / lib / preinit / 79_move_config
1 #!/bin/sh
2 # Copyright (C) 2015 OpenWrt.org
3
4 . /lib/upgrade/common.sh
5
6 RECOVERY_PART=/dev/mmcblk0p1
7
8 move_config() {
9 if [ -b $RECOVERY_PART ]; then
10 insmod nls_cp437
11 insmod nls_iso8859-1
12 insmod fat
13 insmod vfat
14 mkdir -p /recovery
15 mount -o rw,noatime $RECOVERY_PART /recovery
16 [ -f "/recovery/$BACKUP_FILE" ] && mv -f "/recovery/$BACKUP_FILE" /
17 umount /recovery
18 fi
19 }
20
21 boot_hook_add preinit_mount_root move_config