2006-12-07 00:26:26 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
OUTPUT="$1"
|
|
|
|
KERNELSIZE="$2"
|
|
|
|
KERNELIMAGE="$3"
|
|
|
|
ROOTFSSIZE="$4"
|
|
|
|
ROOTFSIMAGE="$5"
|
2015-03-27 21:22:17 +00:00
|
|
|
ALIGN="$6"
|
2006-12-07 00:26:26 +00:00
|
|
|
|
|
|
|
rm -f "$OUTPUT"
|
|
|
|
|
|
|
|
# create partition table
|
2019-07-24 22:51:27 +00:00
|
|
|
set $(ptgen -o "$OUTPUT" -h 16 -s 32 -l ${ALIGN} -t 0x27 -p ${KERNELSIZE}m -t 0x83 -p ${ROOTFSSIZE}m)
|
2006-12-07 00:26:26 +00:00
|
|
|
|
|
|
|
KERNELOFFSET="$(($1 / 512))"
|
2007-05-23 18:15:11 +00:00
|
|
|
ROOTFSOFFSET="$(($3 / 512))"
|
2006-12-07 00:26:26 +00:00
|
|
|
|
|
|
|
dd if="$KERNELIMAGE" of="$OUTPUT" bs=512 conv=notrunc seek="$KERNELOFFSET"
|
|
|
|
dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 conv=notrunc seek="$ROOTFSOFFSET"
|