#!/bin/bash set -e # Find the --sysroot argument sysroot= next_arg=false for arg; do if ${next_arg}; then next_arg=false sysroot="${arg}" continue # not break, in case there are more than one fi case "${arg}" in (--sysroot|-r) next_arg=true continue ;; (--sysroot=*) sysroot="${arg#*=}" continue # not break, in case there are more than one ;; (-r?*) sysroot="${arg#-r}" continue # not break, in case there are more than one ;; esac done if [ -z "${sysroot}" ]; then echo "${0}: --sysroot argument must be given." 1>&2 exit 1 fi topdir="$(dirname "$(realpath "$(dirname "${0}")")")" DRACUT_LDD="$(mktemp /tmp/dracut-ldd.XXXXXX)" cat >"${DRACUT_LDD}" <