From 223dfcdde964469ac0edbb20a86e52d62420cc9b Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Mon, 24 Oct 2016 14:13:09 -0500 Subject: [PATCH] Added usher file which will create /etc/inittab if it doesn't exist --- Makefile | 2 +- SNAP/usher | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 SNAP/usher diff --git a/Makefile b/Makefile index 63cb483..32a55e0 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ARCH = x86_64 URL = https://savannah.nongnu.org/projects/sysvinit DESC = System V style init programs original written by Miquel van Smoorenburg \ that control the booting and shutdown of your system -SNAPVER = sr1 +SNAPVER = sr2 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') diff --git a/SNAP/usher b/SNAP/usher new file mode 100755 index 0000000..5715374 --- /dev/null +++ b/SNAP/usher @@ -0,0 +1,38 @@ +#!/bin/bash + +set -e + +INITTAB="id:3:initdefault: +si::sysinit:/etc/init.d/rc S +l0:0:wait:/etc/init.d/rc 0 +l1:S1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now +su:S016:once:/sbin/sulogin +1:2345:respawn:/sbin/agetty --noclear tty1 38400 +2:2345:respawn:/sbin/agetty tty2 38400 +3:2345:respawn:/sbin/agetty tty3 38400 +4:2345:respawn:/sbin/agetty tty4 38400 +5:2345:respawn:/sbin/agetty tty5 38400 +6:2345:respawn:/sbin/agetty tty6 38400" + +case $1 in + preinst) + exit 0 + ;; + postinst) + if [ ! -f ${TARGET}/etc/inittab ]; then + echo "${INITTAB}" > ${TARGET}/etc/inittab + fi + ;; + prerm) + exit 0 + ;; + postrm) + exit 0 + ;; +esac