diff options
36 files changed, 77 insertions, 41 deletions
diff --git a/3 b/3 index cda01c3..13c96b1 100755 --- a/3 +++ b/3 @@ -49,6 +49,8 @@ fi sync if [ -z "$VIRTUALIZATION" ]; then + deactivate_vgs + deactivate_crypt if [ -e /run/runit/reboot ] && command -v kexec >/dev/null; then msg "Triggering kexec..." kexec -e 2>/dev/null diff --git a/functions b/functions index 35449c1..971d288 100644 --- a/functions +++ b/functions @@ -34,3 +34,22 @@ detect_virt() { export VIRTUALIZATION=1 fi } + +deactivate_vgs() { + _group=${1:-All} + if [ -x /sbin/vgchange ]; then + vgs=$(vgs|wc -l) + if [ $vgs -gt 0 ]; then + msg "Deactivating $_group LVM Volume Groups..." + vgchange -an + fi + fi +} + +deactivate_crypt() { + if [ -x /sbin/dmsetup ]; then + msg "Deactivating Crypt Volumes" + dmsetup ls --target crypt --exec 'cryptsetup close' + deactivate_vgs "Crypt" + fi +} diff --git a/services/agetty-console/conf b/services/agetty-console/conf new file mode 100644 index 0000000..c725133 --- /dev/null +++ b/services/agetty-console/conf @@ -0,0 +1,2 @@ +BAUD_RATE=38400 +TERM_NAME=linux diff --git a/services/agetty-console/finish b/services/agetty-console/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-console/finish +++ b/services/agetty-console/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-console/run b/services/agetty-console/run index 9fc6409..26e72f0 100755..120000 --- a/services/agetty-console/run +++ b/services/agetty-console/run @@ -1,7 +1 @@ -#!/bin/sh -if [ -x /sbin/getty ]; then - GETTY=getty -elif [ -x /sbin/agetty ]; then - GETTY=agetty -fi -exec $GETTY console 38400 linux +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-generic/run b/services/agetty-generic/run index 9a34297..1e6c2bd 100755 --- a/services/agetty-generic/run +++ b/services/agetty-generic/run @@ -1,5 +1,9 @@ #!/bin/sh + tty=${PWD##*-} + +[ -r conf ] && . ./conf + if [ -x /sbin/getty ]; then # busybox GETTY=getty @@ -7,4 +11,6 @@ elif [ -x /sbin/agetty ]; then # util-linux GETTY=agetty fi -exec setsid $GETTY $tty 38400 linux + +exec setsid ${GETTY}${GETTY_ARGS:+ $GETTY_ARGS} \ + "${tty}" "${BAUD_RATE}" "${TERM_NAME}" diff --git a/services/agetty-serial/conf b/services/agetty-serial/conf new file mode 100644 index 0000000..b40bb22 --- /dev/null +++ b/services/agetty-serial/conf @@ -0,0 +1,8 @@ +GETTY_ARGS="-L" +if [ -x /sbin/agetty ]; then + # util-linux specific settings + GETTY_ARGS="${GETTY_ARGS} -8" +fi + +BAUD_RATE=115200 +TERM_NAME=vt100 diff --git a/services/agetty-serial/finish b/services/agetty-serial/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-serial/finish +++ b/services/agetty-serial/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-serial/run b/services/agetty-serial/run index 58d795e..26e72f0 100755..120000 --- a/services/agetty-serial/run +++ b/services/agetty-serial/run @@ -1,3 +1 @@ -#!/bin/sh -tty=${PWD##*-} -exec setsid agetty -8 -L 115200 --noclear $tty vt100 +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-tty1/conf b/services/agetty-tty1/conf new file mode 100644 index 0000000..7c684e9 --- /dev/null +++ b/services/agetty-tty1/conf @@ -0,0 +1,9 @@ +if [ -x /sbin/agetty ]; then + # util-linux specific settings + if [ "${tty}" = "tty1" ]; then + GETTY_ARGS="--noclear" + fi +fi + +BAUD_RATE=38400 +TERM_NAME=linux diff --git a/services/agetty-tty1/finish b/services/agetty-tty1/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-tty1/finish +++ b/services/agetty-tty1/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-tty1/run b/services/agetty-tty1/run index dc01b10..26e72f0 100755..120000 --- a/services/agetty-tty1/run +++ b/services/agetty-tty1/run @@ -1,11 +1 @@ -#!/bin/sh -tty=${PWD##*-} -if [ -x /sbin/getty ]; then - # busybox - GETTY=getty -elif [ -x /sbin/agetty ]; then - # util-linux - GETTY=agetty - GETTY_ARGS="--noclear" -fi -exec setsid $GETTY $GETTY_ARGS $tty 38400 linux +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-tty2/conf b/services/agetty-tty2/conf new file mode 120000 index 0000000..7c3c642 --- /dev/null +++ b/services/agetty-tty2/conf @@ -0,0 +1 @@ +../agetty-tty1/conf \ No newline at end of file diff --git a/services/agetty-tty2/finish b/services/agetty-tty2/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-tty2/finish +++ b/services/agetty-tty2/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-tty2/run b/services/agetty-tty2/run index 2ebc95f..26e72f0 120000 --- a/services/agetty-tty2/run +++ b/services/agetty-tty2/run @@ -1 +1 @@ -/etc/sv/agetty-generic/run \ No newline at end of file +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-tty3/conf b/services/agetty-tty3/conf new file mode 120000 index 0000000..7c3c642 --- /dev/null +++ b/services/agetty-tty3/conf @@ -0,0 +1 @@ +../agetty-tty1/conf \ No newline at end of file diff --git a/services/agetty-tty3/finish b/services/agetty-tty3/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-tty3/finish +++ b/services/agetty-tty3/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-tty3/run b/services/agetty-tty3/run index 2ebc95f..26e72f0 120000 --- a/services/agetty-tty3/run +++ b/services/agetty-tty3/run @@ -1 +1 @@ -/etc/sv/agetty-generic/run \ No newline at end of file +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-tty4/conf b/services/agetty-tty4/conf new file mode 120000 index 0000000..7c3c642 --- /dev/null +++ b/services/agetty-tty4/conf @@ -0,0 +1 @@ +../agetty-tty1/conf \ No newline at end of file diff --git a/services/agetty-tty4/finish b/services/agetty-tty4/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-tty4/finish +++ b/services/agetty-tty4/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-tty4/run b/services/agetty-tty4/run index 2ebc95f..26e72f0 120000 --- a/services/agetty-tty4/run +++ b/services/agetty-tty4/run @@ -1 +1 @@ -/etc/sv/agetty-generic/run \ No newline at end of file +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-tty5/conf b/services/agetty-tty5/conf new file mode 120000 index 0000000..7c3c642 --- /dev/null +++ b/services/agetty-tty5/conf @@ -0,0 +1 @@ +../agetty-tty1/conf \ No newline at end of file diff --git a/services/agetty-tty5/finish b/services/agetty-tty5/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-tty5/finish +++ b/services/agetty-tty5/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-tty5/run b/services/agetty-tty5/run index 2ebc95f..26e72f0 120000 --- a/services/agetty-tty5/run +++ b/services/agetty-tty5/run @@ -1 +1 @@ -/etc/sv/agetty-generic/run \ No newline at end of file +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-tty6/conf b/services/agetty-tty6/conf new file mode 120000 index 0000000..7c3c642 --- /dev/null +++ b/services/agetty-tty6/conf @@ -0,0 +1 @@ +../agetty-tty1/conf \ No newline at end of file diff --git a/services/agetty-tty6/finish b/services/agetty-tty6/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-tty6/finish +++ b/services/agetty-tty6/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-tty6/run b/services/agetty-tty6/run index 2ebc95f..26e72f0 120000 --- a/services/agetty-tty6/run +++ b/services/agetty-tty6/run @@ -1 +1 @@ -/etc/sv/agetty-generic/run \ No newline at end of file +../agetty-generic/run \ No newline at end of file diff --git a/services/agetty-ttyAMA0/conf b/services/agetty-ttyAMA0/conf new file mode 120000 index 0000000..ba71d1c --- /dev/null +++ b/services/agetty-ttyAMA0/conf @@ -0,0 +1 @@ +../agetty-serial/conf \ No newline at end of file diff --git a/services/agetty-ttyAMA0/finish b/services/agetty-ttyAMA0/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-ttyAMA0/finish +++ b/services/agetty-ttyAMA0/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-ttyAMA0/run b/services/agetty-ttyAMA0/run index bfaca3e..ffa62a5 120000 --- a/services/agetty-ttyAMA0/run +++ b/services/agetty-ttyAMA0/run @@ -1 +1 @@ -/etc/sv/agetty-serial/run \ No newline at end of file +../agetty-serial/run \ No newline at end of file diff --git a/services/agetty-ttyS0/conf b/services/agetty-ttyS0/conf new file mode 120000 index 0000000..ba71d1c --- /dev/null +++ b/services/agetty-ttyS0/conf @@ -0,0 +1 @@ +../agetty-serial/conf \ No newline at end of file diff --git a/services/agetty-ttyS0/finish b/services/agetty-ttyS0/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-ttyS0/finish +++ b/services/agetty-ttyS0/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-ttyS0/run b/services/agetty-ttyS0/run index bfaca3e..ffa62a5 120000 --- a/services/agetty-ttyS0/run +++ b/services/agetty-ttyS0/run @@ -1 +1 @@ -/etc/sv/agetty-serial/run \ No newline at end of file +../agetty-serial/run \ No newline at end of file diff --git a/services/agetty-ttyUSB0/conf b/services/agetty-ttyUSB0/conf new file mode 120000 index 0000000..ba71d1c --- /dev/null +++ b/services/agetty-ttyUSB0/conf @@ -0,0 +1 @@ +../agetty-serial/conf \ No newline at end of file diff --git a/services/agetty-ttyUSB0/finish b/services/agetty-ttyUSB0/finish index fa7eecd..ad464cb 120000 --- a/services/agetty-ttyUSB0/finish +++ b/services/agetty-ttyUSB0/finish @@ -1 +1 @@ -/etc/sv/agetty-generic/finish \ No newline at end of file +../agetty-generic/finish \ No newline at end of file diff --git a/services/agetty-ttyUSB0/run b/services/agetty-ttyUSB0/run index bfaca3e..ffa62a5 120000 --- a/services/agetty-ttyUSB0/run +++ b/services/agetty-ttyUSB0/run @@ -1 +1 @@ -/etc/sv/agetty-serial/run \ No newline at end of file +../agetty-serial/run \ No newline at end of file |