summaryrefslogtreecommitdiff
path: root/recipes-images/images/files/library/tegra/update.sh
diff options
context:
space:
mode:
authorSanchayan Maity <maitysanchayan@gmail.com>2017-08-07 17:27:44 +0530
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-10-03 18:23:35 +0200
commit28aba6b79a16d995659a2e46fe1a4be615de5c9b (patch)
tree41520d7f9aa390116290b9f6d91756006d24a240 /recipes-images/images/files/library/tegra/update.sh
parent11828d16453dee272b05b9aa8d9bdeca0523b6af (diff)
recipes-images: images: Use ext4 by default for TK1 modules
Use ext4 by default for TK1 modules. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-images/images/files/library/tegra/update.sh')
-rwxr-xr-xrecipes-images/images/files/library/tegra/update.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/recipes-images/images/files/library/tegra/update.sh b/recipes-images/images/files/library/tegra/update.sh
index e740bb6..27e4fe6 100755
--- a/recipes-images/images/files/library/tegra/update.sh
+++ b/recipes-images/images/files/library/tegra/update.sh
@@ -211,7 +211,7 @@ case "$MODTYPE" in
CBOOT_IMAGE_TARGET=tegra124
# assumed minimal eMMC size [in sectors of 512]
EMMC_SIZE=$(expr 1024 \* 15020 \* 2)
- IMAGEFILE=root.ext3
+ IMAGEFILE=root.ext4
KERNEL_DEVICETREE="tegra124-apalis-eval.dtb"
LOCPATH="tegra-uboot-flasher"
OUT_DIR="$OUT_DIR/apalis-tk1"
@@ -300,6 +300,7 @@ MCOPY=`command -v mcopy` || { echo >&2 "Program mcopy not available. Aborting."
PARTED=`command -v parted` || PARTED=`sudo -s command -v parted` || { echo >&2 "Program parted not available. Aborting."; exit 1; }
MKFSVFAT=`command -v mkfs.fat` || MKFSVFAT=`sudo -s command -v mkfs.fat` || { echo >&2 "Program mkfs.fat not available. Aborting."; exit 1; }
MKFSEXT3=`command -v mkfs.ext3` || MKFSEXT3=`sudo -s command -v mkfs.ext3` || { echo >&2 "Program mkfs.ext3 not available. Aborting."; exit 1; }
+MKFSEXT4=`command -v mkfs.ext4` || MKFSEXT4=`sudo -s command -v mkfs.ext4` || { echo >&2 "Program mkfs.ext4 not available. Aborting."; exit 1; }
dd --help >/dev/null 2>&1 || { echo >&2 "Program dd not available. Aborting."; exit 1; }
CBOOT_CNT=`tegra-uboot-flasher/cbootimage -h | grep -c outputimage || true`
@@ -394,7 +395,11 @@ else
${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary fat32 ${BOOT_START} $(expr ${ROOTFS_START} - 1 )
# the partition spans to the end of the disk, even though the fs size will be smaller
# on the target the fs is then grown to the full size
- ${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary ext2 ${ROOTFS_START} $(expr ${EMMC_SIZE} \- ${ROOTFS_START} \- 1)
+ if [ "${MODTYPE}" = "apalis-tk1" ] || [ "${MODTYPE}" = "apalis-tk1-mainline" ] ; then
+ ${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary ext4 ${ROOTFS_START} $(expr ${EMMC_SIZE} \- ${ROOTFS_START} \- 1)
+ else
+ ${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary ext2 ${ROOTFS_START} $(expr ${EMMC_SIZE} \- ${ROOTFS_START} \- 1)
+ fi
${PARTED} -s ${BINARIES}/mbr.bin unit s print
# get the size of the VFAT partition
BOOT_BLOCKS=$(LC_ALL=C ${PARTED} -s ${BINARIES}/mbr.bin unit b print \
@@ -441,7 +446,11 @@ else
'{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'`
rm -f ${BINARIES}/${IMAGEFILE}
- sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || exit 1
+ if [ "${MODTYPE}" = "apalis-tk1" ] || [ "${MODTYPE}" = "apalis-tk1-mainline" ] ; then
+ sudo $LOCPATH/genext4fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || exit 1
+ else
+ sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || exit 1
+ fi
fi
fi
@@ -457,6 +466,10 @@ if [ "${IMAGEFILE}" = "root.ext3" ] ; then
if [ "$SPLIT" -ge 1 ] ; then
sudo split -a 3 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=100 ${IMAGEFILE} "$OUT_DIR/root.ext3-"
fi
+elif [ "${IMAGEFILE}" = "root.ext4" ] ; then
+ if [ "$SPLIT" -ge 1 ] ; then
+ sudo split -a 3 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=100 ${IMAGEFILE} "$OUT_DIR/root.ext4-"
+ fi
else
sudo cp ${IMAGEFILE}* "$OUT_DIR"
fi