summaryrefslogtreecommitdiff
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
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>
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_blk.scr2
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_eth.scr2
-rwxr-xr-xrecipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh (renamed from recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext3fs.sh)14
-rw-r--r--recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr2
-rw-r--r--recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr2
l---------recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext4fs.sh1
-rwxr-xr-xrecipes-images/images/files/library/tegra/update.sh19
7 files changed, 28 insertions, 14 deletions
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_blk.scr b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_blk.scr
index 42e93b7..2aef05f 100644
--- a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_blk.scr
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_blk.scr
@@ -11,7 +11,7 @@ setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_of
setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232'
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext4-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}'
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_eth.scr b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_eth.scr
index 3442e3c..27bab62 100644
--- a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_eth.scr
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_eth.scr
@@ -8,7 +8,7 @@ setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_of
setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232'
-setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext4-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}'
diff --git a/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext3fs.sh b/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh
index 93c2b60..56e79f5 100755
--- a/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext3fs.sh
+++ b/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-#creates a file containing a ext3 binary blob of the content of the ../rootfs folder
+#creates a file containing a ext4 binary blob of the content of the ../rootfs folder
# sometimes we need the binary echo, not the shell builtin
ECHO=`which echo`
@@ -8,8 +8,8 @@ MOUNTPOINT="mnt/tdx-rootfs"
Usage()
{
- echo "creates a file containing a ext3 binary blob. Output file name taken from command line"
- echo "Usage: genext3fs.sh [OPTION]... dest_file_name"
+ echo "creates a file containing a ext4 binary blob. Output file name taken from command line"
+ echo "Usage: genext4fs.sh [OPTION]... dest_file_name"
echo "-h : Prints this message"
echo "-b : Sets the partition size in MBytes, default 256"
echo "-d : Selects the directory which contains the partition content, default ../rootfs"
@@ -37,10 +37,10 @@ done
#adjust the commandline arg for the now used options
shift $(($OPTIND - 1))
-#create the file used for the loopbackdevice and format it for ext3
+#create the file used for the loopbackdevice and format it for ext4
#answer y to "is not a block special device"
dd if=/dev/zero of=$@ bs=1024k count=$PARTITIONSIZE
-mkfs.ext3 -F -L rootfs $@
+mkfs.ext4 -F -L rootfs $@
#disable fsck checks based on mount count or time interval
tune2fs -c 0 -i 0 $@
@@ -49,12 +49,12 @@ sudo mkdir -p $MOUNTPOINT
sudo umount $MOUNTPOINT &> /dev/null
sudo rm -rf $MOUNTPOINT/*
#mount the file as a loopdevice
-#there seems to be a race between mkfs.ext3 not yet finished and mount already trying to mount, so try until it works
+#there seems to be a race between mkfs.ext4 not yet finished and mount already trying to mount, so try until it works
MOUNTED=0
while [ "$MOUNTED" -eq "0" ] ; do
sync
sleep 1
- sudo mount $@ $MOUNTPOINT/ -o loop -t ext3
+ sudo mount $@ $MOUNTPOINT/ -o loop -t ext4
MOUNTED=`mount | grep -c "$MOUNTPOINT"`
done
#extract rootfs into the file
diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr
index 42e93b7..2aef05f 100644
--- a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr
+++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr
@@ -11,7 +11,7 @@ setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_of
setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232'
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext4-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}'
diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr
index 3442e3c..27bab62 100644
--- a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr
+++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr
@@ -8,7 +8,7 @@ setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_of
setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232'
-setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext4-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}'
diff --git a/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext4fs.sh b/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext4fs.sh
new file mode 120000
index 0000000..f7eeef9
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext4fs.sh
@@ -0,0 +1 @@
+../../library/genext4fs.sh \ No newline at end of file
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