Skip to content

Commit

Permalink
perf(dracut.sh): do not mkdir $initdir/lib/dracut within a loop
Browse files Browse the repository at this point in the history
This directory is always needed to store files like modules.txt and
build-parameter.txt, so always create it, but only in one place.
  • Loading branch information
aafeijoo-suse authored and johannbg committed Dec 21, 2022
1 parent e3ec51e commit 8d46cc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2010,10 +2010,11 @@ else
done
fi
mkdir -p "${initdir}"/lib/dracut
if [[ $kernel_only != yes ]]; then
mkdir -p "${initdir}/etc/cmdline.d"
# shellcheck disable=SC2174
mkdir -m 0755 -p "${initdir}"/lib "${initdir}"/lib/dracut "${initdir}"/lib/dracut/hooks
mkdir -m 0755 "${initdir}"/lib/dracut/hooks
# shellcheck disable=SC2154
for _d in $hookdirs; do
# shellcheck disable=SC2174
Expand Down Expand Up @@ -2071,7 +2072,6 @@ done
unset moddir
for i in $modules_loaded; do
mkdir -p "$initdir"/lib/dracut
printf "%s\n" "$i" >> "$initdir"/lib/dracut/modules.txt
done
Expand Down

0 comments on commit 8d46cc0

Please sign in to comment.