aboutsummaryrefslogtreecommitdiff
path: root/skeleton/init
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-09-05 20:16:44 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-09-05 20:16:44 +0200
commit16fd78edbc1c04eab8cf9ebf49594c3b28fd1b6c (patch)
treef8b34eb721d29cd6b0356d1502d7d74a53b173d3 /skeleton/init
parent67173d02a884a7769c47e45f8fea5a97827c15c4 (diff)
moved initscript from scripts/init.rootfs to skeleton/init
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'skeleton/init')
-rwxr-xr-xskeleton/init59
1 files changed, 59 insertions, 0 deletions
diff --git a/skeleton/init b/skeleton/init
new file mode 100755
index 0000000..19757b8
--- /dev/null
+++ b/skeleton/init
@@ -0,0 +1,59 @@
+#!/bin/sh
+export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+export HOME='/root'
+export PS1='\w \h\$ '
+UDHCPC_ARGS=
+
+mkdir -p /dev /proc /sys
+mount -t devtmpfs none /dev -o size=4k
+mount -t proc none /proc
+mount -t sysfs none /sys
+mount -t debugfs nodev /sys/kernel/debug
+
+if [ x"$(command -v klogd)" != x ]; then
+ $(command -v klogd)
+fi
+if [ x"$(command -v syslogd)" != x ]; then
+ $(command -v syslogd) -C
+ UDHCPC_ARGS='-S'
+fi
+
+echo '4 4 1 7' >/proc/sys/kernel/printk
+cat <<EOF
+
+
+Boot took $(cut -d' ' -f1 /proc/uptime) seconds
+
+ _ _ __ _
+ /\/\ (_)_ __ (_) / /(_)_ __ _ ___ __
+ / \| | '_ \| | / / | | '_ \| | | \ \/ /
+/ /\/\ \ | | | | | / /__| | | | | |_| |> <
+\/ \/_|_| |_|_| \____/_|_| |_|\__,_/_/\_\
+
+
+Welcome to mini_linux
+
+
+EOF
+
+for arg in $(cat /proc/cmdline | tr '[:upper:]' '[:lower:]'); do
+ if [ x"${arg}" = xip4 ]; then
+ sysctl -w net.ipv6.conf.all.disable_ipv6=1
+ fi
+done
+
+for arg in $(cat /proc/cmdline | tr '[:upper:]' '[:lower:]'); do
+ if [ x"$(command -v udhcpc)" != x -a x"${arg}" = xnet ]; then
+ echo '*** INIT NETWORK ***'
+ for netif in $(ls /sys/class/net); do
+ ifconfig ${netif} 0.0.0.0 up
+ done
+ $(command -v udhcpc) -R ${UDHCPC_ARGS}
+ fi
+done
+
+hostname minlin
+loadkmap </usr/share/keymaps/i386/qwertz/de-latin1.bmap
+cd ${HOME}
+setsid cttyhack sh
+poweroff -f