diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-06-04 23:08:41 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-06-04 23:08:41 (EDT) |
commit | 9de16d22b0ac3cbb74793faa913db889d8151ee5 (patch) | |
tree | 0f6ed6fe2701368c036c0da9e72be362963d68b6 /busybox.pkg | |
parent | 79d474a5fdc0ea8b9e05f5b68567dbbe9086e4ca (diff) | |
parent | b98d2d2ad1e341a6493fcd5531d605e8427665ca (diff) |
Merge branch 'feature/init-system-improvements'.
Diffstat (limited to 'busybox.pkg')
-rwxr-xr-x | busybox.pkg/postinst | 17 | ||||
-rwxr-xr-x | busybox.pkg/prerm | 7 |
2 files changed, 22 insertions, 2 deletions
diff --git a/busybox.pkg/postinst b/busybox.pkg/postinst index d74c331..fa5e152 100755 --- a/busybox.pkg/postinst +++ b/busybox.pkg/postinst @@ -9,10 +9,25 @@ if [ "x${1}" = 'xconfigure' ]; then exec 3>/etc/network/interfaces printf 'auto lo\niface lo inet loopback\n\n' >&3 for iface in /sys/class/net/eth*; do - iface="${iface#*/}" + iface="${iface##*/}" printf 'auto %s\niface %s inet dhcp\n\n' \ "${iface}" "${iface}" >&3 done exec 3>&- fi + if ! [ -f /etc/rc.policy ]; then + if [ "x$(cat /etc/proteanos_plat)" = 'xdev' ]; then + printf 'disabled\n' >/etc/rc.policy + else + printf 'enabled\n' >/etc/rc.policy + fi + fi + if [ -f /usr/share/busybox/init-scripts ]; then + for script in $(cat /usr/share/busybox/init-scripts); do + if [ "x${2:+set}" != 'xset' ]; then + "/etc/init.d/${script}" enable + fi + "/etc/init.d/${script}" start + done + fi fi diff --git a/busybox.pkg/prerm b/busybox.pkg/prerm index 54b5053..160a2d7 100755 --- a/busybox.pkg/prerm +++ b/busybox.pkg/prerm @@ -1,6 +1,11 @@ #!/bin/sh -if [ "x${1}" = 'xremove' ]; then +if [ "x${1}" = 'xupgrade' ]; then + if [ -f /usr/share/busybox/init-scripts ]; then + for script in $(cat /usr/share/busybox/init-scripts); do + "/etc/init.d/${script}" stop + done + fi while read link name prio; do update-alternatives --remove "${name}" "${link}.busybox" done </usr/share/busybox/alternatives |