#!/bin/sh # As part of sysupgrade we migrate the users custom changes to the # new fs. (Those which differ from the first boot defaults.) # Abort on any error. set -e # Do nothing if user want to discard old settings. if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then exit 0 fi # Source functions. for f in /lib/upgrade/iopsys*.sh; do [ -r "$f" -a -s "$f" ] || continue source $f done [ -d "/lib/config/snapshots/first_boot/uci" ] || exit 0 # Does this system has WiFi? hasWifi=$(chroot "${2}" db -q get hw.board.hasWifi) [ "$hasWifi" = "1" ] || exit 0 uci_possibly_migrate_package "wireless" "$2" || exit # Report success. logger -s -p daemon.info -t post-hooks -- "UCI wireless migrated." exit 0