Skip to content

Commit

Permalink
fix(dracut.sh): exit if resolving executable dependencies fails
Browse files Browse the repository at this point in the history
We came across an issue where, when resolving executable dependencies, a call to
a buggy glib function in `dracut-install` was causing a termination with
SIGSEGV, but dracut didn't stop the build process, which resulted in an
unbootable initrd, due to missing required libraries.

```
dracut: *** Resolving executable dependencies ***
xargs: /usr/lib/dracut/dracut-install: terminated by signal 11
dracut: *** Resolving executable dependencies done ***
```

Therefore, stop the initrd creation in this case.
  • Loading branch information
aafeijoo-suse committed Aug 10, 2023
1 parent fffeade commit b2c6b58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2045,7 +2045,13 @@ if [[ $kernel_only != yes ]]; then
# shellcheck disable=SC2086
find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \
| xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${dracutsysrootdir:+-r "$dracutsysrootdir"} -R ${DRACUT_FIPS_MODE:+-f} --
dinfo "*** Resolving executable dependencies done ***"
# shellcheck disable=SC2181
if (($? == 0)); then
dinfo "*** Resolving executable dependencies done ***"
else
dfatal "Resolving executable dependencies failed"
exit 1
fi
fi
# Now we are done with lazy resolving, always install dependencies
Expand Down

0 comments on commit b2c6b58

Please sign in to comment.