Build CBOOT_IMAGE only

When debugging a customized u-boot it is very interruptive that all images are build when executing ~/Apalis_TK1_LinuxImageV2.7$ ./update.sh -m 2 -o /srv/tftp/ to build and copy all images to the tftp output directory. Could you suggest some simple patch for update.sh offering an option to build just the CBOOT_IMAGE (containing u-boot) for the TK1 and copying it to the tftp directory related to the following section?

CBOOT_IMAGE=apalis-tk1.img
...
# generate cbootimage(s) containing BCT(s) and U-Boot boot loader
cd ${BINARIES}
for cbootimage in ${CBOOT_IMAGE}; do
	sudo ../${LOCPATH}/cbootimage -s ${CBOOT_IMAGE_TARGET} ${cbootimage}.cfg ${cbootimage}
done
cd ..
...
#copy to $OUT_DIR
OUT_DIR=`readlink -f $OUT_DIR`
cd ${BINARIES}
sudo cp ${CBOOT_IMAGE} ${KERNEL_IMAGETYPE} ${EMMC_PARTS} flash*.img versions.txt "$OUT_DIR"

This script is an excerpt from update.sh (located in the same directory as e.g. update_uboot.sh). It updates the u-boot image in the default tftp output directory /srv/tftp/apalis-tk1/apalis-tk1,img only and works fine for me while debugging:

#!/bin/sh

MODTYPE=apalis-tk1
BINARIES=${MODTYPE}_bin
CBOOT_IMAGE=apalis-tk1.img
CBOOT_IMAGE_TARGET=tegra124
LOCPATH="tegra-uboot-flasher"
OUT_DIR=/srv/tftp
OUT_DIR="$OUT_DIR/apalis-tk1"

#make the directory with the outputfiles writable
sudo chown $USER: ${BINARIES}

#create subdirectory for this module type
sudo mkdir -p "$OUT_DIR"

# generate cbootimage(s) containing BCT(s) and U-Boot boot loader
cd ${BINARIES}
for cbootimage in ${CBOOT_IMAGE}; do
	sudo ../${LOCPATH}/cbootimage -s ${CBOOT_IMAGE_TARGET} ${cbootimage}.cfg ${cbootimage}
done
cd ..

#copy to $OUT_DIR
OUT_DIR=`readlink -f $OUT_DIR`
cd ${BINARIES}
sudo cp ${CBOOT_IMAGE} "$OUT_DIR"

I update u-boot with Apalis TK1 # run setupdate and Apalis TK1 # run update_uboot. The u-boot environment is overriden with the compiled environment only if Apalis TK1 # env default -a is used.

The environment problematic is kind of documented here. We basically want to preserve the customer’s own environment as he may have some valuable changes which we do not just want to overwrite on update by default.