mvebu: Add basic support for WRT1900AC (v1) and Turris Omnia (pre 2019)
[librecmc/librecmc.git] / target / linux / mvebu / base-files / lib / preinit / 79_move_config
1 #!/bin/sh
2 # Copyright (C) 2015 OpenWrt.org
3
4 . /lib/functions.sh
5 . /lib/upgrade/common.sh
6
7 move_config() {
8         local partdev
9
10         if export_bootdevice && export_partdevice partdev 1; then
11                 case $(board_name) in
12                         cznic,turris-omnia)
13                         insmod nls_cp437
14                         insmod nls_iso8859-1
15                         insmod fat
16                         insmod vfat
17                         ;;
18                 esac
19                 mkdir -p /boot
20                 mount -o rw,noatime "/dev/$partdev" /boot
21                 [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
22                 umount /boot
23         fi
24 }
25
26 boot_hook_add preinit_mount_root move_config