loongarch64: new target
[openwrt/staging/pepe2k.git] / target / linux / loongarch64 / base-files / lib / preinit / 79_move_config
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 move_config() {
4 local partdev parttype=ext4
5
6 . /lib/upgrade/common.sh
7
8 if export_bootdevice && export_partdevice partdev 1; then
9 part_magic_fat "/dev/$partdev" && parttype=vfat
10 if mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt; then
11 if [ -f "/mnt/$BACKUP_FILE" ]; then
12 mv -f "/mnt/$BACKUP_FILE" /
13 fi
14 umount /mnt
15 fi
16 fi
17 }
18
19 boot_hook_add preinit_mount_root move_config