2019-11-25 22:44:56 +00:00
|
|
|
#!/bin/sh
|
2018-07-18 06:14:40 +00:00
|
|
|
#
|
|
|
|
# Copyright 2018 NXP
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
set -x
|
2020-08-24 12:29:32 +00:00
|
|
|
[ $# -eq 5 ] || {
|
|
|
|
echo "SYNTAX: $0 <file> <kernel part offset> <kernel size> <rootfs part offset> <rootfs size>"
|
2018-07-18 06:14:40 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
OUTPUT="$1"
|
2020-08-24 12:29:32 +00:00
|
|
|
KERNELOFFSET="$(($2 * 1024))"
|
|
|
|
KERNELSIZE="$3"
|
|
|
|
ROOTFSOFFSET="$(($4 * 1024))"
|
|
|
|
ROOTFSSIZE="$5"
|
2018-07-18 06:14:40 +00:00
|
|
|
|
|
|
|
head=4
|
2020-08-24 12:29:32 +00:00
|
|
|
sect=63
|
2018-07-18 06:14:40 +00:00
|
|
|
|
2020-08-24 12:29:32 +00:00
|
|
|
set $(ptgen -o $OUTPUT -h $head -s $sect -t 83 -p ${KERNELSIZE}M@${KERNELOFFSET} -p ${ROOTFSSIZE}M@${ROOTFSOFFSET})
|