grep -q pstore /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t pstore pstore /sys/fs/pstore
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
- touch /tmp/.config_pending
- /sbin/kmodloader
+ # update wifi config before additional ieee80211 hotplug events
+ # get executed because of '/sbin/kmodloader' kmod loading.
+ [ -f /etc/board.json ] && /sbin/wifi config
- [ ! -f /etc/config/wireless ] && {
- # compat for bcm47xx and mvebu
- sleep 1
- }
+ /sbin/kmodloader
- mkdir -p /tmp/.uci
- [ -f /etc/uci-defaults/30_uboot-envtools ] && (. /etc/uci-defaults/30_uboot-envtools)
- /bin/config_generate
- rm -f /tmp/.config_pending
- /sbin/wifi config
uci_apply_defaults
sync
-
+
# temporary hack until configd exists
/sbin/reload_config
}
--- /dev/null
+do_config_generate() {
+ [ -f /etc/board.json ] || {
+ # This allows /etc/board.d/* scripts to use values from the uboot environment
+ mkdir -p /tmp/.uci
+ [ -f /etc/uci-defaults/30_uboot-envtools ] && (. /etc/uci-defaults/30_uboot-envtools)
+
+ echo "- generating board file -"
+ /bin/board_detect /tmp/board.json
+ mv /tmp/board.json /etc/board.json
+
+ /bin/config_generate > /dev/null
+ }
+}
+
+boot_hook_add preinit_main do_config_generate
+boot_hook_add initramfs do_config_generate