2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
16 dracut_install mount mknod mkdir modprobe pidof sleep chroot \
17 sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink
18 dracut_install -o less
19 [[ $cttyhack = yes ]] && dracut_install -o setsid
20 if [ ! -e "${initdir}/bin/sh" ]; then
22 (ln -s bash "${initdir}/bin/sh" || :)
25 #add common users in /etc/passwd, it will be used by nfs/ssh currently
26 egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
27 egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
28 # install our scripts and hooks
29 inst "$moddir/init" "/init"
30 inst "$moddir/initqueue" "/sbin/initqueue"
31 inst "$moddir/loginit" "/sbin/loginit"
33 [ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
34 mkdir -m 0755 -p ${initdir}/lib/dracut
35 mkdir -m 0755 -p ${initdir}/lib/dracut/hooks
36 for _d in $hookdirs emergency \
37 initqueue initqueue/timeout initqueue/finished initqueue/settled; do
38 mkdir -m 0755 -p ${initdir}/lib/dracut/hooks/$_d
41 mkdir -p ${initdir}/tmp
43 dracut_install switch_root || dfatal "Failed to install switch_root"
45 inst "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh"
46 inst "$moddir/mount-hook.sh" "/usr/bin/mount-hook"
47 inst_hook cmdline 10 "$moddir/parse-root-opts.sh"
48 mkdir -p "${initdir}/var"
49 [ -x /lib/systemd/systemd-timestamp ] && inst /lib/systemd/systemd-timestamp
50 if [[ $realinitpath ]]; then
51 for i in $realinitpath; do
52 echo "rd.distroinit=$i"
53 done > "${initdir}/etc/cmdline.d/distroinit.conf"