summaryrefslogtreecommitdiff
path: root/recipes/images/files/colibri-vf/update.sh
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
commitf463f754048ebc3325025f0e1506b03cf14203a5 (patch)
tree42c42951d6534a6b38d2c5613e82e86acb7840fa /recipes/images/files/colibri-vf/update.sh
parent646a2579d33a24bae18dec79687ef2b66b39987c (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/colibri-vf/update.sh')
-rwxr-xr-xrecipes/images/files/colibri-vf/update.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/recipes/images/files/colibri-vf/update.sh b/recipes/images/files/colibri-vf/update.sh
index 7212fe0..1205017 100755
--- a/recipes/images/files/colibri-vf/update.sh
+++ b/recipes/images/files/colibri-vf/update.sh
@@ -104,6 +104,12 @@ 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
if [ -f rootfs/etc/issue ] ; then
CNT=`grep -c "VF" rootfs/etc/issue || true`
@@ -111,8 +117,8 @@ if [ -f rootfs/etc/issue ] ; then
echo "Colibri VF rootfs detected"
MODTYPE=colibri-vf
IMAGEFILE=ubifs.img
-
LOCPATH="vf_flash"
+ OUT_DIR="$OUT_DIR/colibri_vf"
fi
fi
@@ -136,12 +142,6 @@ if [ "$UBOOT_RECOVERY" -eq 1 ] ; 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
-
#sanity check for correct untared rootfs
DEV_OWNER=`ls -ld rootfs/dev | awk '{print $3}'`
if [ "${DEV_OWNER}x" != "rootx" ]
@@ -178,8 +178,14 @@ basename "`readlink -e ${BINARIES}/u-boot.imx`" >> ${BINARIES}/versions.txt
$ECHO -n "Rootfs " >> ${BINARIES}/versions.txt
grep VF rootfs/etc/issue >> ${BINARIES}/versions.txt
+#create subdirectory for this module type
+sudo mkdir -p "$OUT_DIR"
+
#copy to $OUT_DIR
sudo cp ${BINARIES}/u-boot-nand.imx ${BINARIES}/ubifs.img ${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}/ubifs.img ${BINARIES}/versions.txt
sync