summaryrefslogtreecommitdiff
path: root/recipes/images/files/library/imx6
diff options
context:
space:
mode:
authorMax Krummenacher <max.oss.09@gmail.com>2015-10-20 14:56:24 +0200
committerMax Krummenacher <max.oss.09@gmail.com>2015-10-28 09:36:02 +0100
commit8a6d1bb3afe9e76156d7999e720527a4f1b3a871 (patch)
treeaea0eed2b77945587752fb2c220961dec1b9570d /recipes/images/files/library/imx6
parent59f0507817c86e84239265a1c0b95d519e467b17 (diff)
update.sh: use moduletype specific folder for output files
With update.sh one creates files on e.g. a SD-card or a tftp server which enables updating the SW on a module from U-Boot running on said module. This commit adds a module type specific directory on that output media so that update data for multiple module types can be stored on one media. Generic U-Boot scripts in the media's root directory do select the matching update data depending on module type.
Diffstat (limited to 'recipes/images/files/library/imx6')
-rwxr-xr-xrecipes/images/files/library/imx6/update.sh35
1 files changed, 21 insertions, 14 deletions
diff --git a/recipes/images/files/library/imx6/update.sh b/recipes/images/files/library/imx6/update.sh
index 5c3ecae..509dbbe 100755
--- a/recipes/images/files/library/imx6/update.sh
+++ b/recipes/images/files/library/imx6/update.sh
@@ -95,31 +95,39 @@ if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then
exit 0
fi
+# is OUT_DIR an existing directory?
+if [ ! -d "$OUT_DIR" ] ; then
+ echo "$OUT_DIR" "does not exist, exiting"
+ exit 1
+fi
+
# auto detect MODTYPE from rootfs directory
CNT=`grep -ic "Colibri.iMX6" rootfs/etc/issue || true`
if [ "$CNT" -ge 1 ] ; then
echo "Colibri iMX6 rootfs detected"
MODTYPE=colibri-imx6
+ # assumed minimal eMMC size [in sectors of 512]
+ EMMC_SIZE=$(expr 1024 \* 3500 \* 2)
IMAGEFILE=root.ext3
- U_BOOT_BINARY=u-boot.imx
- U_BOOT_BINARY_IT=u-boot.imx
KERNEL_DEVICETREE="imx6dl-colibri-eval-v3.dtb imx6dl-colibri-cam-eval-v3.dtb"
LOCPATH="imx_flash"
- # assumed minimal eMMC size [in sectors of 512]
- EMMC_SIZE=$(expr 1024 \* 3500 \* 2)
+ OUT_DIR="$OUT_DIR/colibri_imx6"
+ U_BOOT_BINARY=u-boot.imx
+ U_BOOT_BINARY_IT=u-boot.imx
else
CNT=`grep -ic "imx6" rootfs/etc/issue || true`
if [ "$CNT" -ge 1 ] ; then
echo "Apalis iMX6 rootfs detected"
MODTYPE=apalis-imx6
+ # assumed minimal eMMC size [in sectors of 512]
+ EMMC_SIZE=$(expr 1024 \* 3500 \* 2)
IMAGEFILE=root.ext3
- U_BOOT_BINARY=u-boot.imx
- U_BOOT_BINARY_IT=u-boot-it.imx
KERNEL_DEVICETREE="imx6q-apalis-eval.dtb imx6q-apalis_v1_0-eval.dtb \
imx6q-apalis-ixora.dtb imx6q-apalis_v1_0-ixora.dtb "
LOCPATH="imx_flash"
- # assumed minimal eMMC size [in sectors of 512]
- EMMC_SIZE=$(expr 1024 \* 3500 \* 2)
+ OUT_DIR="$OUT_DIR/apalis_imx6"
+ U_BOOT_BINARY=u-boot.imx
+ U_BOOT_BINARY_IT=u-boot-it.imx
else
echo "can not detect module type from ./rootfs/etc/issue"
echo "exiting"
@@ -136,12 +144,6 @@ if [ "$UBOOT_RECOVERY" -ge 1 ] ; then
exit 1
fi
-# is OUT_DIR an existing directory?
-if [ ! -d "$OUT_DIR" ] ; then
- echo "$OUT_DIR" "does not exist, exiting"
- exit 1
-fi
-
#sanity check for awk programs
AWKTEST=`echo 100000000 | awk -v min=100 -v f=10000 '{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'` || true
[ "${AWKTEST}x" = "204x" ] || { echo >&2 "Program awk not available. Aborting."; exit 1; }
@@ -183,6 +185,8 @@ basename "`readlink -e ${BINARIES}/uImage`" >> ${BINARIES}/versions.txt
$ECHO -n "Rootfs " >> ${BINARIES}/versions.txt
grep -i imx6 rootfs/etc/issue >> ${BINARIES}/versions.txt
+#create subdirectory for this module type
+sudo mkdir -p "$OUT_DIR"
# The emmc layout used is:
#
@@ -271,6 +275,9 @@ sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} ||
#copy to $OUT_DIR
sudo cp ${BINARIES}/${U_BOOT_BINARY} ${BINARIES}/${U_BOOT_BINARY_IT} ${BINARIES}/uImage ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat \
${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR"
+sudo cp ${BINARIES}/fwd_blk.img "$OUT_DIR/../flash_blk.img"
+sudo cp ${BINARIES}/fwd_eth.img "$OUT_DIR/../flash_eth.img"
+sudo cp ${BINARIES}/fwd_mmc.img "$OUT_DIR/../flash_mmc.img"
#cleanup intermediate files
sudo rm ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat ${BINARIES}/${IMAGEFILE} ${BINARIES}/versions.txt