diff mbox series

[v2] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets

Message ID 20240403162340.29711-1-tmn505@terefe.re
State New
Headers show
Series [v2] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets | expand

Commit Message

Tomasz Maciej Nowak April 3, 2024, 4:20 p.m. UTC
From: Tomasz Maciej Nowak <tmn505@gmail.com>

Some old or proprietary bootloader recognise only FAT file system
variants on storage devices with MBR but unfortunately script ties
format of kernel partition to GPT partition table. So, allow kernel
partition file system to be FAT16 or FAT32 if appropriate type is set
in partition table.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
---
v1 -> v2
- use well defined conditional syntax

 scripts/gen_image_generic.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
index 11e40f38868f..190cb6ae4a48 100755
--- a/scripts/gen_image_generic.sh
+++ b/scripts/gen_image_generic.sh
@@ -49,7 +49,7 @@  dos_dircopy() {
 [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc count="$ROOTFSSIZE"
 dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc
 
-if [ -n "$GUID" ]; then
+if [ -n "$GUID" ] || [ "$KERNELPARTTYPE" = "6" ] || [ "$KERNELPARTTYPE" = "c" ]; then
     [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$((ROOTFSOFFSET + ROOTFSSIZE))" conv=notrunc count="$sect"
     mkfs.fat --invariant -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 1024))"
     LC_ALL=C dos_dircopy "$KERNELDIR" /