#!/bin/sh export PATH="/bin:/sbin:/usr/bin:/usr/sbin" export HOME='/root' export PS1='\w \h\$ ' HOSTNAME='minlin' UDHCPC_ARGS= mkdir -p /dev /proc /sys mount -t devtmpfs devtmpfs /dev -o size=4k mount -t proc proc /proc mount -t sysfs sysfs /sys mount -t debugfs debugfs /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 < < $(uname -r) \/ \/_|_| |_|_| \____/_|_| |_|\__,_/_/\_\ musl $(/lib/ld-musl-x86_64.so.1 2>&1 | sed -n 's/^Version \(.*\)$/\1/gp') $(busybox | head -1) EOF for arg in $(cat /proc/cmdline | tr '[:upper:]' '[:lower:]'); do case $arg in net|net=*) if [ x"$(command -v udhcpc)" != x ]; then if [ x"${arg#net}" = x ]; then for netif in $(ls /sys/class/net); do ifconfig ${netif} up done else NETIF="${arg#net=}" echo "dhcp interface: ${NETIF}" ifconfig ${NETIF} up fi $(command -v udhcpc) -R -x hostname:${HOSTNAME} -t 4 -n ${UDHCPC_ARGS} else echo 'net: Missing udhcpc' fi ;; keymap=*) KEYMAP="/usr/share/keymaps/${arg#keymap=}.bmap" if [ -r "${KEYMAP}" ]; then echo "KEYMAP=${KEYMAP}" loadkmap <"${KEYMAP}" else echo "keymap: Invalid path '${KEYMAP}'" fi ;; esac done resize hostname ${HOSTNAME} cd ${HOME} setsid cttyhack sh poweroff -f