1
0

boot 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. START=10
  4. STOP=98
  5. uci_apply_defaults() {
  6. . /lib/functions/system.sh
  7. cd /etc/uci-defaults || return 0
  8. files="$(ls)"
  9. [ -z "$files" ] && return 0
  10. mkdir -p /tmp/.uci
  11. for file in $files; do
  12. ( . "./$(basename $file)" ) && rm -f "$file"
  13. done
  14. uci commit
  15. }
  16. boot() {
  17. [ -f /proc/mounts ] || /sbin/mount_root
  18. [ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
  19. [ -f /proc/net/vlan/config ] && vconfig set_name_type DEV_PLUS_VID_NO_PAD
  20. mkdir -p /var/run
  21. mkdir -p /var/log
  22. mkdir -p /var/lock
  23. mkdir -p /var/state
  24. mkdir -p /var/tmp
  25. mkdir -p /tmp/.uci
  26. chmod 0700 /tmp/.uci
  27. touch /var/log/wtmp
  28. touch /var/log/lastlog
  29. touch /tmp/resolv.conf.auto
  30. ln -sf /tmp/resolv.conf.auto /tmp/resolv.conf
  31. grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
  32. [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
  33. /sbin/kmodloader
  34. [ ! -f /etc/config/wireless ] && {
  35. # compat for brcm47xx and mvebu
  36. sleep 1
  37. }
  38. /bin/config_generate
  39. uci_apply_defaults
  40. # temporary hack until configd exists
  41. /sbin/reload_config
  42. }