uclient: update to Git HEAD (2024-04-19)
[openwrt/openwrt.git] / package / base-files / files / lib / preinit / 80_mount_root
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
4
5 do_mount_root() {
6 mount_root
7 boot_run_hook preinit_mount_root
8 [ -f /sysupgrade.tgz ] && {
9 echo "- config restore -"
10 cd /
11 tar xzf /sysupgrade.tgz
12 # Prevent configuration corruption on a power loss
13 sync
14 }
15 }
16
17 [ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root