x86: generalize partition discovery for sysupgrade
[openwrt/openwrt.git] / target / linux / x86 / base-files / lib / preinit / 79_move_config
1 #!/bin/sh
2 # Copyright (C) 2012-2015 OpenWrt.org
3
4 move_config() {
5 local partdev
6
7 . /lib/upgrade/platform.sh
8
9 if platform_export_bootdevice && platform_export_partdevice partdev 1; then
10 mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt
11 mv -f /mnt/sysupgrade.tgz /
12 umount /mnt
13 fi
14 }
15
16 boot_hook_add preinit_mount_root move_config
17