Skip to content

Commit d523f9a

Browse files
hooks/50-dracut.install: fix read of tmp file, add missing die
This fixes installing UKIs when the install.conf is overridden and initrd_generator/uki_generator are not set. Closes: https://bugs.gentoo.org/930520 Signed-off-by: Andrew Ammerlaan <[email protected]>
1 parent b26e006 commit d523f9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hooks/50-dracut.install

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ main() {
7070
# be a combined kernel+initramfs UEFI executable. We can easily
7171
# recognize it by PE magic (vs cpio for a regular initramfs)
7272
if [[ -s ${tmp} ]]; then
73-
read -nr 2 magic <"${tmp}"
73+
read -rn 2 magic <"${tmp}" || die "Cannot read ${tmp}"
7474
if [[ ${magic} == MZ ]]; then
7575
einfo "Combined UEFI kernel+initramfs executable found"
76-
mv "${tmp}" "${uki}" || die "Failed to rename initramfs"
76+
mv "${tmp}" "${uki}" || die "Failed to rename UKI"
7777
else
7878
einfo "Plain initramfs image found"
7979
mv "${tmp}" "${initrd}" || die "Failed to rename initramfs"

0 commit comments

Comments
 (0)