1
0
Fork 0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-04-19 00:04:05 +02:00

scripts/gen_image_generic.sh: allow passing in partition offset

Allow passing in an optional offset (PARTOFFSET) for the first partition.
If not specified this will default to 256K (512 blocks) as it has before.

For example if you want to start partition data at a 16M offset instead
of 256K, specify 'PARTOFFSET=16M'.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
This commit is contained in:
Tim Harvey 2023-03-22 09:02:52 -07:00 committed by Christian Lamparter
parent 39e6039410
commit 7519b35881

View File

@ -19,7 +19,7 @@ head=16
sect=63
# create partition table
set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -p "${KERNELSIZE}m" -p "${ROOTFSSIZE}m" ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID})
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})
KERNELOFFSET="$(($1 / 512))"
KERNELSIZE="$2"