]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut): remove trailing null characters from SBATs when building UKIs
authorLi Tian <litian@redhat.com>
Wed, 14 Jan 2026 05:24:36 +0000 (13:24 +0800)
committerLaszlo <laszlo.gombos@gmail.com>
Thu, 15 Jan 2026 02:11:44 +0000 (21:11 -0500)
SBAT of kernel has null character paddings at the end. Using tools
like ukify will display massive amount of '\0' in SBAT. Ukify is
doing ".rstrip('b\x00')" when merging SBATs.

dracut.sh

index 2f83ad5812be65495dca15bb99f2b36e334d3d5a..7039e15710aadeed4f41f0972fcc950acc4ce876 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -3438,6 +3438,7 @@ get_sbat_string() {
     local inp=$1
     local out=$uefi_outdir/$2
     "${OBJCOPY:-objcopy}" -O binary --only-section=.sbat "$inp" "$out"
+    sed -i 's/\x00*$//' "$out"
     clean_sbat_string "$out"
 }