Skip to content

Commit

Permalink
fix(dracut-systemd): check and create generator dir outside of inner …
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
aafeijoo-suse authored and LaszloGombos committed May 10, 2023
1 parent a7c0471 commit acfa793
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules.d/98dracut-systemd/rootfs-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ generator_mount_rootfs() {
[ -z "$1" ] && return 0

_name=$(dev_unit_name "$1")
[ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR"
if ! [ -f "$GENERATOR_DIR"/sysroot.mount ]; then
{
echo "[Unit]"
Expand Down Expand Up @@ -101,9 +100,11 @@ case "${root#block:}" in
;;
esac

GENERATOR_DIR="$1"

if [ "$rootok" = "1" ]; then
GENERATOR_DIR="$1"
[ -z "$GENERATOR_DIR" ] && exit 1
[ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR"

generator_wait_for_dev "${root#block:}"
generator_fsck_after_pre_mount "${root#block:}"
strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)"
Expand Down

0 comments on commit acfa793

Please sign in to comment.