aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMathew McBride <matt@traverse.com.au>2023-04-20 06:36:50 +0000
committerPetr Štetiar <ynezz@true.cz>2023-06-13 14:12:27 +0200
commitddb8845bd6be37e6126a4a56c071dd9fc3b3695a (patch)
treeec485d1ebbd79382f5160b12273f6bf25d37a0b4 /scripts
parentf48985861a26f175682e49ce87e6d5b674a22d1a (diff)
downloadupstream-ddb8845bd6be37e6126a4a56c071dd9fc3b3695a.tar.gz
upstream-ddb8845bd6be37e6126a4a56c071dd9fc3b3695a.tar.bz2
upstream-ddb8845bd6be37e6126a4a56c071dd9fc3b3695a.zip
scripts: gen_image_generic: allow the partition types to be set
The use case for this is to set the kernel partition as the EFI system partition. Versions of U-Boot with the EFI boot manager (eficonfig and efidebug commands) will store their boot order data on the ESP. Signed-off-by: Mathew McBride <matt@traverse.com.au> (cherry picked from commit 701d774f54aef2f9fe3c584700773dcb260dd03c)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_image_generic.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
index 5c88dcea80..11e40f3886 100755
--- a/scripts/gen_image_generic.sh
+++ b/scripts/gen_image_generic.sh
@@ -9,8 +9,10 @@ fi
OUTPUT="$1"
KERNELSIZE="$2"
KERNELDIR="$3"
+KERNELPARTTYPE=${KERNELPARTTYPE:-83}
ROOTFSSIZE="$4"
ROOTFSIMAGE="$5"
+ROOTFSPARTTYPE=${ROOTFSPARTTYPE:-83}
ALIGN="$6"
rm -f "$OUTPUT"
@@ -19,7 +21,7 @@ head=16
sect=63
# create partition table
-set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -p "${KERNELSIZE}m${PARTOFFSET:+@$PARTOFFSET}" -p "${ROOTFSSIZE}m" ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID})
+set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -t "${KERNELPARTTYPE}" -p "${KERNELSIZE}m${PARTOFFSET:+@$PARTOFFSET}" -t "${ROOTFSPARTTYPE}" -p "${ROOTFSSIZE}m" ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID})
KERNELOFFSET="$(($1 / 512))"
KERNELSIZE="$2"