aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/image/gen_sdcard_head_img.sh
blob: 08ab4497d5f13cff2673a10e1da5fbe47e89d0d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# Copyright 2018 NXP
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

set -x
[ $# -eq 3 ] || {
    echo "SYNTAX: $0 <file> <rootfs part offset> <rootfs size>"
    exit 1
}

OUTPUT="$1"
ROOTFSOFFSET="$(($2 * 1024))"
ROOTFSSIZE="$3"

head=4
sect=16

set $(ptgen -o $OUTPUT -h $head -s $sect -l $ROOTFSOFFSET -t 83 -p ${ROOTFSSIZE}M)