[PATCH] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets
Tomasz Maciej Nowak
tmn505 at terefe.re
Thu Mar 28 10:00:11 PDT 2024
From: Tomasz Maciej Nowak <tmn505 at gmail.com>
Some old or proprietary bootloader recognize only FAT file system
variants on storage devices with MBR, 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 at gmail.com>
---
scripts/gen_image_generic.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
index 11e40f38868f..44837fde1e12 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" -o "$KERNELPARTTYPE" = "6" -o "$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" /
--
2.44.0
More information about the openwrt-devel
mailing list