diff options
author | Cem Keylan <cem@ckyln.com> | 2020-02-07 17:34:55 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-02-07 17:34:55 +0300 |
commit | 23055b3d7da4bfef00d302e91b87fa36f6f9be96 (patch) | |
tree | 27ccbaa55473bacd1d48c17de841584fb2c12fca | |
parent | c416432b8cc934b768a19242b976c159f07a22a5 (diff) | |
download | repository-23055b3d7da4bfef00d302e91b87fa36f6f9be96.tar.gz |
sinit: add changes
* Use official sources
* Switch to 1.0
* Remove the ubase dependency
* Use kpow by Dylan Araps for shutdown
-rwxr-xr-x | core/sinit/build | 23 | ||||
-rw-r--r-- | core/sinit/checksums | 10 | ||||
-rw-r--r-- | core/sinit/files/poweroff | 1 | ||||
-rw-r--r-- | core/sinit/files/sinit-launch-services.boot | 20 | ||||
-rw-r--r-- | core/sinit/files/sinit.post.shutdown | 17 | ||||
-rwxr-xr-x | core/sinit/post-install | 28 | ||||
-rw-r--r-- | core/sinit/sources | 4 | ||||
-rw-r--r-- | core/sinit/version | 2 |
8 files changed, 43 insertions, 62 deletions
diff --git a/core/sinit/build b/core/sinit/build index 4a3a1bf2..1466e64d 100755 --- a/core/sinit/build +++ b/core/sinit/build @@ -1,24 +1,15 @@ #!/bin/sh -e -ls -cp config.h sinit/config.h -cd sinit -make CFLAGS="$CFLAGS -static" PREFIX=/usr DESTDIR="$1" install -mv "$1/usr/bin/sinit" "$1/usr/bin/init" +( + cd sinit + make CFLAGS="$CFLAGS -static" PREFIX=/usr DESTDIR="$1" install +) +ln -s sinit "$1/usr/bin/init" -cd .. install -Dm755 poweroff "$1/usr/bin/poweroff" install -Dm755 reboot "$1/usr/bin/reboot" install -Dm644 sinit-launch-services.boot "$1/etc/init/sinit-launch-services.boot" -install -Dm644 sinit.post.shutdown "$1/etc/init/sinit.post.shutdown" -# We are building ubase here so we don't need -# the full package - -cd ubase -make halt -make respawn - -install -Dm755 halt "$1/usr/bin/halt" -install -Dm755 respawn "$1/usr/bin/respawn" +# shellcheck disable=2086 +"${CC:-gcc}" -o "$1/usr/bin/kpow" init/bin/kpow.c $CFLAGS -static diff --git a/core/sinit/checksums b/core/sinit/checksums index 5ce16c76..d3d7b051 100644 --- a/core/sinit/checksums +++ b/core/sinit/checksums @@ -1,7 +1,7 @@ -aaccd0515070545174bf962c462686e7719c02c68004bd0b350b98b4c78a90ba sinit-1.1.tar.gz -2fd1cd03b9ea9b0d08a523634be942177f1a370daa9a120e0279316003fb0ec1 b33bdaa.tar.gz +78c2120a97a5e93b80606c5403bd731152f8a344e47aa4ab74970c1c11dc6fc0 sinit-1.0.tar.gz +c334ec2395fab8e45800c97b2f032395262ea7e61adc2be2f3b59fd565c292d8 0.4.tar.gz 6f0f1a5f2f43b5bcfd4beaa93e1a49438d398cf758d7813bc6ba86b5156357a8 config.h f638aaa23383da584d3a56347a8e279abdc7c9c521661ef54a5bc8b955c5632b reboot -d21a020d7cdb6a328962adac7cc1a8701a413c1dfabd40ac00bf7dc212fa29d1 poweroff -b8638d409b57b21d0deb11b6c0a5a870c0a6088d7733b205b0265bcc03d13486 sinit-launch-services.boot -913696a0bad385add0ea6207d5c6a8708fb4c74af7340715b12e98a094307e5c sinit.post.shutdown +4da8b0c2771a9046a7ce2ded49beb5297045e9979796e5e4b390168286f05379 poweroff +3aa8642d8a1058876f3a47639640a81887298eac992bf15e41fbe420738b09ef sinit-launch-services.boot +5e2541aa672d80a8d0fcef694e4a4e74b8a0b12d415e7189228b793a4411ccd1 sinit.post.shutdown diff --git a/core/sinit/files/poweroff b/core/sinit/files/poweroff index 69e8f9a4..69d8731e 100644 --- a/core/sinit/files/poweroff +++ b/core/sinit/files/poweroff @@ -1,3 +1,2 @@ #!/bin/sh - /bin/kill -s USR1 1 diff --git a/core/sinit/files/sinit-launch-services.boot b/core/sinit/files/sinit-launch-services.boot index 4cbb0570..6ba14057 100644 --- a/core/sinit/files/sinit-launch-services.boot +++ b/core/sinit/files/sinit-launch-services.boot @@ -1,14 +1,10 @@ -# we are going to start runit and getty here +# We are going to start runit and getty here -sinit_run_getty() { - for getty in 1 2 3 4 5 6; do - respawn /sbin/getty 38400 tty${getty} 2>&1 & - done -} +# Uncomment to enable gettys +# for getty in 1 2 3 4 5 6 ; do +# while :; do /sbin/getty tty${getty} 0 linux ; done & # busybox getty +# # while :; do /sbin/getty tty${getty} linux ; done & # ubase getty +# done -sinit_runit() { - respawn /usr/bin/runsvdir -P /var/service & -} - -[ "$SINIT_ENABLE_GETTY" = 1 ] && sinit_run_getty -[ "$SINIT_ENABLE_RUNIT" = 1 ] && sinit_runit +# Uncomment enable runit services +# while :; do /usr/bin/runsvdir -P /var/service ; done & diff --git a/core/sinit/files/sinit.post.shutdown b/core/sinit/files/sinit.post.shutdown index 4f3c793b..5ce4d8ec 100644 --- a/core/sinit/files/sinit.post.shutdown +++ b/core/sinit/files/sinit.post.shutdown @@ -1,16 +1 @@ -# vim:filetype=sh - -# We handle the shutdown from here - -if [ "$SINIT_SHUTDOWN_HOOKS" = 1 ]; then - case "$1" in - reboot) - out "Requesting system reboot..." - halt -r - ;; - *) - out "Requesting system poweroff..." - halt -p - ;; - esac -fi +case "$1" in reboot) kpow r ;; poweroff) kpow p ;; esac diff --git a/core/sinit/post-install b/core/sinit/post-install index 1f3fdf30..50170454 100755 --- a/core/sinit/post-install +++ b/core/sinit/post-install @@ -1,16 +1,26 @@ #!/bin/sh -e -grep -q SINIT_ /etc/init/rc.conf || cat <<EOF >> /etc/init/rc.conf +cat <<EOF -# Comment these to run the scripts for sinit -SINIT_SHUTDOWN_HOOKS=1 -SINIT_ENABLE_GETTY=1 -SINIT_ENABLE_RUNIT=1 -EOF +!! IMPORTANT !! -cat <<EOF +To start using sinit, edit +/etc/init/sinit-launch-services.boot +And uncomment the getty function, and +Optionally uncomment the runit function +If you deem necessary. + +sinit is installed as /usr/bin/sinit. It +can fully replace busybox init by running +the following command. + + kiss a | grep ^sinit | kiss a - -Important: If you want to replace sinit, you need to -edit your /etc/init/rc.conf to disable SINIT variables." +NOTE: If swapping from busybox init on a + running system, shutdown/reboot by + invoking 'busybox-init poweroff'. + sinit's poweroff/reboot utilities + can't be of use until it is actually + running. EOF diff --git a/core/sinit/sources b/core/sinit/sources index 3630ef6e..f4e6330e 100644 --- a/core/sinit/sources +++ b/core/sinit/sources @@ -1,5 +1,5 @@ -https://dl.carbslinux.org/distfiles/sinit-1.1.tar.gz sinit -https://github.com/michaelforney/ubase/archive/b33bdaa.tar.gz ubase +https://dl.suckless.org/sinit/sinit-1.0.tar.gz sinit +https://github.com/kisslinux/init/archive/0.4.tar.gz init files/config.h files/reboot files/poweroff diff --git a/core/sinit/version b/core/sinit/version index ccfcfa47..f35ed484 100644 --- a/core/sinit/version +++ b/core/sinit/version @@ -1 +1 @@ -1.1 3 +1.0 1 |