fi
if ! [[ $kernel ]]; then
- if type -P systemd-detect-virt &> /dev/null && container=$(systemd-detect-virt -c) &> /dev/null; then
- dinfo "*** Detected container: $container ***"
+ if type -P systemd-detect-virt &> /dev/null && systemd-detect-virt -c &> /dev/null; then
# shellcheck disable=SC2012
kernel="$(cd /lib/modules && ls -1v | tail -1)"
# shellcheck disable=SC2012
. "$dracutbasedir"/dracut-version.sh
fi
-if systemd-detect-virt -c &> /dev/null; then
- export DRACUT_NO_MKNOD=1
- if [[ ${hostonly-} ]]; then
- printf "%s\n" "dracut[W]: Running in hostonly mode in a container!" >&2
- fi
-fi
-
if [[ -f $dracutbasedir/dracut-init.sh ]]; then
# shellcheck source=./dracut-init.sh
. "$dracutbasedir"/dracut-init.sh
exit 1
fi
+if container=$(systemd-detect-virt -c) &> /dev/null; then
+ export DRACUT_NO_MKNOD=1
+ dinfo "Detected $container container."
+fi
+
if [[ $persistent_policy == "mapper" ]]; then
unset persistent_policy
elif [[ -n $persistent_policy && ! -d "/dev/disk/${persistent_policy}" ]]; then