- mkdir -p $initdir/etc/systemd/system/testsuite.target.wants
- ln -fs ../testsuite.service $initdir/etc/systemd/system/testsuite.target.wants/testsuite.service
- ln -fs ../end.service $initdir/etc/systemd/system/testsuite.target.wants/end.service
-
- # make the testsuite the default target
- ln -fs testsuite.target $initdir/etc/systemd/system/default.target
- mkdir -p $initdir/etc/rc.d
- cat >$initdir/etc/rc.d/rc.local <<EOF
-#!/bin/bash
-exit 0
-EOF
- chmod 0755 $initdir/etc/rc.d/rc.local
- # install basic tools needed
- dracut_install sh bash setsid loadkeys setfont \
- login sushell sulogin gzip sleep echo mount umount cryptsetup date
- dracut_install dmsetup modprobe
-
- # install libnss_files for login
- inst_libdir_file "libnss_files*"
-
- # install dbus and pam
- find \
- /etc/dbus-1 \
- /etc/pam.d \
- /etc/security \
- /lib64/security \
- /lib/security -xtype f \
- | while read file; do
- inst $file
- done
-
- # install dbus socket and service file
- inst /usr/lib/systemd/system/dbus.socket
- inst /usr/lib/systemd/system/dbus.service
-
- # install basic keyboard maps and fonts
- for i in \
- /usr/lib/kbd/consolefonts/latarcyrheb-sun16* \
- /usr/lib/kbd/keymaps/include/* \
- /usr/lib/kbd/keymaps/i386/include/* \
- /usr/lib/kbd/keymaps/i386/qwerty/us.*; do
- [[ -f $i ]] || continue
- inst $i
- done
-
- # some basic terminfo files
- for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
- [ -f ${_terminfodir}/l/linux ] && break
- done
- dracut_install -o ${_terminfodir}/l/linux
-
- # softlink mtab
- ln -fs /proc/self/mounts $initdir/etc/mtab
-
- # install any Exec's from the service files
- egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
- | while read i; do
- i=${i##Exec*=}; i=${i##-}
- inst $i
- done
-
- # install plymouth, if found... else remove plymouth service files
- # if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
- # PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$TEST_BASE_DIR/test-functions" \
- # /usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
- # dracut_install plymouth plymouthd
- # else
- rm -f $initdir/{usr/lib,etc}/systemd/system/plymouth* $initdir/{usr/lib,etc}/systemd/system/*/plymouth*
- # fi
-
- # some helper tools for debugging
- [[ $DEBUGTOOLS ]] && dracut_install $DEBUGTOOLS
-
- # install ld.so.conf* and run ldconfig
- cp -a /etc/ld.so.conf* $initdir/etc
- ldconfig -r "$initdir"
- ddebug "Strip binaeries"
- find "$initdir" -perm +111 -type f | xargs strip --strip-unneeded | ddebug
-
- # copy depmod files
- inst /lib/modules/$KERNEL_VER/modules.order
- inst /lib/modules/$KERNEL_VER/modules.builtin
- # generate module dependencies
- if [[ -d $initdir/lib/modules/$KERNEL_VER ]] && \
- ! depmod -a -b "$initdir" $KERNEL_VER; then
- dfatal "\"depmod -a $KERNEL_VER\" failed."
- exit 1
- fi