summaryrefslogtreecommitdiff
path: root/src/initrd/init
blob: 3b62c0a2223326972ca69c64d532c43063f5c0dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
PATH=$PATH:/usr/lib/klibc/bin
#if [ $$ = 1 ]; then
#  "$0" "$@"
#  exec sh -i
#fi
. init.functions
warnings=y

debug_log init
mountvirt
klogd -c1 # no kernel messages

mkdir -p "$LOGBASE"
sh -c "syslogd -O '$LOGBASE'/"'syslogd.$$.log';
if [ "$DEBUG" != y ]; then
  echo 0 > /proc/sys/kernel/printk
fi

makedev
loadenv

if [ -x /bin/kmod ]; then
  ln -sf /bin/kmod /bin/depmod
  /bin/depmod -a
else
  depmod -a
fi

PS1='[$$ \w]# ' my_openvt 8 -- sh -i

mkfifo "$MENUFIFO" || panic "mkfifo '$MENUFIFO' failed"
bootmenu
mkdir -p /etc/udev/rules.d
cat <<END >/etc/udev/rules.d/z00_blockdev_mountroot.rules
ACTION=="add", SUBSYSTEM=="block", RUN+="/bin/grok-block \$env{DEVNAME}"
END

start_udev
mountunionroot

bootwait rw-overlay
# killeverything
# nuke /dev/.udev/queue/
stop_udev
insertoverlay

movemounts
gpg_agent_chroot
patchroot
clear >/dev/tty1
chvt 1
[ -e /do-delay-boot ] && bootwait 'launch-init-ready'
launch_init "$@"

# unreachable since launch_init will panic on failure
panic 'inconceivable!'
exec >/dev/tty1 2>&1 <&1
reset
exec sh -i