system

the Chamesle handbook, init, live ISO and install helpers
git clone https://github.com/tortr-rs/system
Log | Files | Refs | README | LICENSE

post-upgrade (1737B)


      1 #!/bin/sh
      2 # NetworkManager starts its own wpa_supplicant; the service next to it takes the card away from it
      3 if [ -e /etc/runlevels/default/networkmanager ] && [ -e /etc/runlevels/default/wpa_supplicant ]; then
      4 	rm -f /etc/runlevels/default/wpa_supplicant
      5 	echo "chamesle-base: wpa_supplicant is off at boot, NetworkManager starts its own (reboot, or rc-service wpa_supplicant stop)"
      6 fi
      7 # from dinit (or Winchester) to OpenRC, once: what was enabled there is enabled in the default runlevel
      8 [ -e /etc/runlevels/boot/hostname ] && exit 0
      9 levels() {
     10 	add() { l=$1; shift; mkdir -p /etc/runlevels/$l; for s; do [ -e /etc/runlevels/$l/$s ] || [ -L /etc/runlevels/$l/$s ] || ln -s /etc/init.d/$s /etc/runlevels/$l/$s; done; }
     11 	add sysinit devfs dmesg udev udev-trigger udev-settle
     12 	add boot modules hwclock sysctl hostname bootmisc syslog seedrng swap
     13 	add shutdown killprocs mount-ro savecache
     14 	add default udev-postmount
     15 }
     16 levels
     17 on=$(ls /etc/dinit.d/boot.d 2>/dev/null)
     18 [ -f /etc/init.conf.old ] && on="$on $(sed -n 's/^\(boot-services\|ttys\) *= *//p' /etc/init.conf.old | tr -d '{}' | tr ',' ' ')"
     19 for s in $on; do
     20 	case $s in
     21 	tty*|udev|modules|setup|rootfs) continue;;
     22 	network) s=dhcpcd;;
     23 	NetworkManager) s=networkmanager;;
     24 	bluetoothd) s=bluetooth;;
     25 	connmand) s=connman;;
     26 	syslogd) s=syslog;;
     27 	esac
     28 	add default $s
     29 done
     30 [ -e /etc/runlevels/default/networkmanager ] && rm -f /etc/runlevels/default/wpa_supplicant
     31 command -v zpool >/dev/null && add sysinit zfs-import zfs-mount
     32 rm -rf /etc/dinit.d
     33 echo "chamesle-base: the init is OpenRC now. enabled: $(ls /etc/runlevels/default | tr '\n' ' ')"
     34 [ -d /run/dinit ] || [ -S /run/dinitctl ] && echo "chamesle-base: dinit is still running, so reboot this once with: dinit-reboot"
     35 exit 0