test-functions revision 53d90f9582f96208b3674da823ad1a3d2c3b1aa4
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# ex: ts=8 sw=4 sts=4 et filetype=sh
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyerif ! ROOTLIBDIR=$(pkg-config --variable=systemdutildir systemd); then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer echo "WARNING! Cannot determine rootlibdir from pkg-config, assuming /usr/lib/systemd" >&2
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald HoyerBASICTOOLS="sh bash setsid loadkeys setfont login sulogin gzip sleep echo mount umount cryptsetup date dmsetup modprobe"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald HoyerDEBUGTOOLS="df free ls stty cat ps ln ip route dmesg dhclient mkdir cp ping dhclient strace less grep id tty touch du sort"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ "$QEMU_BIN" ] || QEMU_BIN=$(which -a kvm qemu-kvm 2>/dev/null | grep '^/' -m1)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer # QEMU's own build system calls it qemu-system-x86_64
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ "$QEMU_BIN" ] || QEMU_BIN=$(which -a qemu-system-x86_64 2>/dev/null | grep '^/' -m1)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ "$QEMU_BIN" ] || QEMU_BIN=$(which -a qemu-system-i386 2>/dev/null | grep '^/' -m1)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ "$QEMU_BIN" ] || QEMU_BIN=$(which -a qemu 2>/dev/null | grep '^/' -m1)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer echo "Could not find a suitable QEMU binary" >&2
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ "$KERNEL_BIN" ] || KERNEL_BIN=/boot/vmlinuz-$KERNEL_VER
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ "$INITRD" ] || INITRD=/boot/initramfs-${KERNEL_VER}.img
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyerraid=noautodetect \
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyerconsole=ttyS0 \
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer $QEMU_BIN $QEMU_OPTIONS -append "$KERNEL_APPEND" $TESTDIR/rootdisk.img ) || return 1
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer ../../systemd-nspawn --boot --directory=$TESTDIR/nspawn-root $ROOTLIBDIR/systemd $KERNEL_APPEND
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer type -P dmeventd >/dev/null && dracut_install dmeventd
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer (cd $TEST_BASE_DIR/..; set -x; make DESTDIR=$initdir install)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer # we strip binaries since debug symbols increase binaries size a lot
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer for i in $initdir/{sbin,bin}/* $initdir/lib/systemd/*; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer # Create the blank file to use as a root filesystem
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer dd if=/dev/null of="$TESTDIR/rootdisk.img" bs=1M seek=300
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer LOOPDEV=$(losetup --show -P -f $TESTDIR/rootdisk.img)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -f $TESTDIR/nspawn-root/failed ]] && cp -a $TESTDIR/nspawn-root/failed $TESTDIR
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer cp -a $TESTDIR/nspawn-root/var/log/journal $TESTDIR
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer find "$initdir" -executable -not -path '*/lib/modules/*.ko' -type f | xargs strip --strip-unneeded | ddebug
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer | while read i; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ -d $initdir/lib/modules/$KERNEL_VER ]] && \
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer # install plymouth, if found... else remove plymouth service files
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer # if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer # PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$TEST_BASE_DIR/test-functions" \
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer # /usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer rm -f $initdir/{usr/lib,etc}/systemd/system/plymouth* $initdir/{usr/lib,etc}/systemd/system/*/plymouth*
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald HoyerLABEL=systemd / ext3 rw 0 1
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ $BASICTOOLS ]] && dracut_install $BASICTOOLS
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ $DEBUGTOOLS ]] && dracut_install $DEBUGTOOLS
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer | while read file; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer | while read file; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -f $i ]] || continue
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer /usr/lib/kbd/consolefonts/latarcyrheb-sun16*; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -f $i ]] || continue
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ -f ${_terminfodir}/l/linux ] && break
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer cp $TEST_BASE_DIR/testsuite.target $initdir/etc/systemd/system/
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer sed "s#@SYSTEMCTL@#$(type -P systemctl)#g" $TEST_BASE_DIR/end.service.in > $initdir/etc/systemd/system/end.service
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer mkdir -p $initdir/etc/systemd/system/testsuite.target.wants
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer ln -fs $TEST_BASE_DIR/testsuite.service $initdir/etc/systemd/system/testsuite.target.wants/testsuite.service
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer ln -fs $TEST_BASE_DIR/end.service $initdir/etc/systemd/system/testsuite.target.wants/end.service
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer ln -fs testsuite.target $initdir/etc/systemd/system/default.target
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run run/lock run/initramfs; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer local _so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer LC_ALL=C ldd "$_bin" 2>/dev/null | while read _line; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ $_line = 'not a dynamic executable' ]] && break
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ $_line =~ $_so_regex ]]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -e ${initdir}/$_file ]] && continue
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ $_line =~ not\ found ]]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer dfatal "Missing a shared library required by $_bin."
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer dfatal "Run \"ldd $_bin\" to find out what it is."
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ -z "$TESTDIR" ]] || [[ ! -d "$TESTDIR" ]]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer TESTDIR=$(mktemp --tmpdir=/var/tmp -d -t systemd-test.XXXXXX)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Converts numeric logging level to the first letter of level name.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param lvl Numeric logging level in range from 1 to 6.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 1 if @a lvl is out of range.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 if @a lvl is correct.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @result Echoes first letter of level name.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer *) return 1;;
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Internal helper function for _do_dlog()
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param lvl Numeric logging level.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param msg Message.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 It's always returned, even if logging failed.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @note This function is not supposed to be called manually. Please use
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# dtrace(), ddebug(), or others instead which wrap this one.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# This function calls _do_dlog() either with parameter msg, or if
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# none is given, it will read standard input and will use every line as
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# This enables:
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# dwarn "This is a warning"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# echo "This is a warning" | dwarn
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [ $1 -le $LOG_LEVEL ] || return 0
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [ $# -ge 1 ]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer while read line; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Logs message at TRACE level (6)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param msg Message.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 It's always returned, even if logging failed.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Logs message at DEBUG level (5)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param msg Message.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 It's always returned, even if logging failed.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# [ -n "$debug" ] && set -x || :
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Logs message at INFO level (4)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param msg Message.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 It's always returned, even if logging failed.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Logs message at WARN level (3)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param msg Message.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 It's always returned, even if logging failed.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Logs message at ERROR level (2)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param msg Message.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 It's always returned, even if logging failed.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# [ -n "$debug" ] && set -x || :
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer## @brief Logs message at FATAL level (1)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @param msg Message.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# @retval 0 It's always returned, even if logging failed.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Generic substring function. If $2 is in $1, return 0.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# normalize_path <path>
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Prints the normalized path, where it removes any duplicated
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# and trailing slashes.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# $ normalize_path ///test/test//
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# convert_abs_rel <from> <to>
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Prints the relative path, when creating a symlink to <to> from <from>.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# $ convert_abs_rel /usr/bin/test /bin/test-2
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer local __current __absolute __abssize __cursize __newpath
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ "$1" == "$2" ]] && { echo "${1##*/}"; return; }
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ "${1%/*}" == "$2" ]] && { echo "."; return; }
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer while [[ ${__absolute[__level]} == ${__current[__level]} ]]
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if (( __level > __abssize || __level > __cursize ))
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer for ((__i = __level; __i < __cursize-1; __i++))
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Install a directory, keeping symlinks as on the original system.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Example: if /lib points to /lib64 on the host, "inst_dir /lib/file"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# will create ${initdir}/lib64, ${initdir}/lib64/file,
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# and a symlink ${initdir}/lib -> lib64.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -e ${initdir}/"$1" ]] && return 0 # already there
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}/${_part}" ]]; do
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ -L $_file ]]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer mkdir -m 0755 -p "${initdir}/$_file" || return 1
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -e "$_file" ]] && chmod --reference="$_file" "${initdir}/$_file"
33a5e20ffaa2cbb2853f14265566bac66a7f9026Harald Hoyer# $1 = file to copy to ramdisk
33a5e20ffaa2cbb2853f14265566bac66a7f9026Harald Hoyer# $2 (optional) Name for the file on the ramdisk
33a5e20ffaa2cbb2853f14265566bac66a7f9026Harald Hoyer# Location of the image dir is assumed to be $initdir
33a5e20ffaa2cbb2853f14265566bac66a7f9026Harald Hoyer# We never overwrite the target if it exists.
33a5e20ffaa2cbb2853f14265566bac66a7f9026Harald Hoyer if ! [[ -d ${initdir}/$target ]]; then
33a5e20ffaa2cbb2853f14265566bac66a7f9026Harald Hoyer [[ -e ${initdir}/$target ]] && return 0
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -L ${initdir}/$target ]] && return 0
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -d "${initdir}/${target%/*}" ]] || inst_dir "${target%/*}"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer cp --sparse=always -pfL "$_src" "${initdir}/$target"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# find symlinks linked to given library file
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# $1 = library file
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Function searches for symlinks by stripping version numbers appended to
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# library filename, checks if it points to the same target and finally
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# prints the list of symlinks to stdout.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# rev_lib_symlinks libfoo.so.8.1
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# (Only if libfoo.so.8 and libfoo.so exists on host system.)
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ ! $1 ]] && return 0
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer local fn="$1" orig="$(readlink -f "$1")" links=''
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ ${fn} =~ .*\.so\..* ]] || return 1
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Same as above, but specialized to handle dynamic libraries.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# It handles making symlinks according to how the original library
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# is referenced.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer local _src="$1" _dest=${2:-$1} _lib _reallib _symlink
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -e $initdir/$_dest ]] && return 0
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ -L $_src ]]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer inst "${_src%/*}/.${_src##*/}.hmac" "${_dest%/*}/.${_dest##*/}.hmac"
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer ln -sfn $(convert_abs_rel "${_dest}" "${_reallib}") "${initdir}/${_dest}"
[[ -L $_bin ]] && inst_symlink $_bin $_target && return 0
if [[ $_line =~ $_so_regex ]]; then
_file=${BASH_REMATCH[1]}
local _bin
local _line _shebang_regex
[[ $_line =~ $_shebang_regex ]] || return 1
if [[ -d $_realsrc ]]; then
if [[ -f $r/$_rule ]]; then
if [[ -f ${r}$_rule ]]; then
local _x
case $# in
[[ $initdir = $2 ]] && set $1;;
for _x in inst_symlink inst_script inst_binary inst_simple; do
local to f
if [[ $_optional = yes ]]; then
if [[ $omit_drivers ]]; then
_found=1
local _modname _filtercmd
if ! [[ $hostonly ]]; then
if ! [[ $hostonly ]]; then
[[ $no_kernel = yes ]] && return
local _fderr=9
| instmods
| instmods
local _moddirname=${KERNEL_MODS%%/lib/modules/*}
--set-version $KERNEL_VER ${_moddirname} $_mpargs
return $_ret
while read _mod; do
set -o pipefail
| while read line; do [[ "$line" =~ $_filter_not_found ]] && echo $line || echo $line >&2 ;done | derror
_ret=$?
set +o pipefail
return $_ret
local _pattern=$1
case $1 in
--run)
ret=$?
exit $ret;;
--setup)
--clean)
--all)
ret=$?
exit $ret
ret=$?
exit $ret;;