diff options
Diffstat (limited to 'recipes/images/files/library')
-rw-r--r-- | recipes/images/files/library/fwd_blk.scr | 8 | ||||
-rw-r--r-- | recipes/images/files/library/fwd_eth.scr | 3 | ||||
-rw-r--r-- | recipes/images/files/library/fwd_mmc.scr | 9 | ||||
-rwxr-xr-x | recipes/images/files/library/imx6/update.sh | 35 | ||||
-rwxr-xr-x | recipes/images/files/library/tegra/update.sh | 53 |
5 files changed, 72 insertions, 36 deletions
diff --git a/recipes/images/files/library/fwd_blk.scr b/recipes/images/files/library/fwd_blk.scr new file mode 100644 index 0000000..9db3744 --- /dev/null +++ b/recipes/images/files/library/fwd_blk.scr @@ -0,0 +1,8 @@ +#the update.sh script renames this. fwd_blk.scr -> ../flash_blk.img +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 +test "${board_name}" = "colibri_t20" && setenv drive 0 +test "${board_name}" = "colibri_vf" && setenv drive 0 + +fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img +source ${loadaddr} diff --git a/recipes/images/files/library/fwd_eth.scr b/recipes/images/files/library/fwd_eth.scr new file mode 100644 index 0000000..18ae3ad --- /dev/null +++ b/recipes/images/files/library/fwd_eth.scr @@ -0,0 +1,3 @@ +#the update.sh script renames this. fwd_eth.scr -> ../flash_eth.img +tftpboot ${loadaddr} "${board_name}/flash_eth.img" +source ${loadaddr} diff --git a/recipes/images/files/library/fwd_mmc.scr b/recipes/images/files/library/fwd_mmc.scr new file mode 100644 index 0000000..561a861 --- /dev/null +++ b/recipes/images/files/library/fwd_mmc.scr @@ -0,0 +1,9 @@ +#the update.sh script renames this. fwd_mmc.scr -> ../flash_mmc.img +#flash_mmc has been renamed to flash_blk, ensure compatibilty when updating from older versions +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 +test "${board_name}" = "colibri_t20" && setenv drive 0 +test "${board_name}" = "colibri_vf" && setenv drive 0 + +fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img +source ${loadaddr} 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 diff --git a/recipes/images/files/library/tegra/update.sh b/recipes/images/files/library/tegra/update.sh index dfe531f..92ddb27 100755 --- a/recipes/images/files/library/tegra/update.sh +++ b/recipes/images/files/library/tegra/update.sh @@ -128,6 +128,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 CNT=`grep -ic "apalis" rootfs/etc/issue || true` if [ "$CNT" -ge 1 ] ; then @@ -135,16 +141,17 @@ if [ "$CNT" -ge 1 ] ; then if [ "$CNT" -ge 1 ] ; then echo "Apalis T30 rootfs detected" MODTYPE=apalis-t30 - IMAGEFILE=root.ext3 - U_BOOT_BINARY=u-boot-dtb-tegra.bin - KERNEL_DEVICETREE="tegra30-apalis-eval.dtb" - LOCPATH="tegra-uboot-flasher" - # assumed minimal eMMC size [in sectors of 512] - EMMC_SIZE=$(expr 1024 \* 7450 \* 2) # BCT=apalis_t30_12MHz_MT41K512M8RH-125_533MHz.bct BCT=Apalis_T30_2GB_800Mhz.bct CBOOT_IMAGE=apalis_t30.img CBOOT_IMAGE_TARGET=tegra30 + # assumed minimal eMMC size [in sectors of 512] + EMMC_SIZE=$(expr 1024 \* 7450 \* 2) + IMAGEFILE=root.ext3 + KERNEL_DEVICETREE="tegra30-apalis-eval.dtb" + LOCPATH="tegra-uboot-flasher" + OUT_DIR="$OUT_DIR/apalis_t30" + U_BOOT_BINARY=u-boot-dtb-tegra.bin else echo "can not detect module type from ./rootfs/etc/issue" echo "exiting" @@ -157,31 +164,33 @@ else if [ "$CNT" -ge 1 ] ; then echo "Colibri T20 rootfs detected" MODTYPE=colibri-t20 - IMAGEFILE=ubifs - U_BOOT_BINARY=u-boot-dtb-tegra.bin - KERNEL_DEVICETREE="tegra20-colibri-eval-v3.dtb" - LOCPATH="tegra-uboot-flasher" BCT=colibri_t20-${RAM_SIZE}-${MODVERSION}-${BOOT_DEVICE}.bct CBOOT_IMAGE="colibri_t20-256-v11-nand.img colibri_t20-256-v12-nand.img colibri_t20-512-v11-nand.img colibri_t20-512-v12-nand.img" CBOOT_IMAGE_TARGET=tegra20 + EMMC_PARTS="" + IMAGEFILE=ubifs + KERNEL_DEVICETREE="tegra20-colibri-eval-v3.dtb" # zImage but from rootfs/boot KERNEL_IMAGETYPE="" - EMMC_PARTS="" + LOCPATH="tegra-uboot-flasher" + OUT_DIR="$OUT_DIR/colibri_t20" + U_BOOT_BINARY=u-boot-dtb-tegra.bin else CNT=`grep -ic "t30" rootfs/etc/issue || true` if [ "$CNT" -ge 1 ] ; then echo "Colibri T30 rootfs detected" MODTYPE=colibri-t30 - IMAGEFILE=root.ext3 - U_BOOT_BINARY=u-boot-dtb-tegra.bin - KERNEL_DEVICETREE="tegra30-colibri-eval-v3.dtb" - LOCPATH="tegra-uboot-flasher" - EMMC_SIZE=$(expr 1024 \* 2000 \* 2) # with new kernel, boot with 400MHz, then switch between 400 & 800 BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct # BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_533MHz.bct CBOOT_IMAGE=colibri_t30.img CBOOT_IMAGE_TARGET=tegra30 + EMMC_SIZE=$(expr 1024 \* 2000 \* 2) + IMAGEFILE=root.ext3 + KERNEL_DEVICETREE="tegra30-colibri-eval-v3.dtb" + LOCPATH="tegra-uboot-flasher" + OUT_DIR="$OUT_DIR/colibri_t30" + U_BOOT_BINARY=u-boot-dtb-tegra.bin else echo "can not detect module type from ./rootfs/etc/issue" echo "exiting" @@ -225,12 +234,6 @@ if [ "$UBOOT_RECOVERY" -eq 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; } @@ -289,6 +292,9 @@ fi $ECHO -n "Rootfs " >> ${BINARIES}/versions.txt grep -i t[2-3]0 rootfs/etc/issue >> ${BINARIES}/versions.txt +#create subdirectory for this module type +sudo mkdir -p "$OUT_DIR" + # The emmc layout used is: # # boot area partition 1 aka primary eMMC boot sector: @@ -400,6 +406,9 @@ fi OUT_DIR=`readlink -f $OUT_DIR` cd ${BINARIES} sudo cp ${CBOOT_IMAGE} ${KERNEL_IMAGETYPE} ${EMMC_PARTS} ${IMAGEFILE}* flash*.img versions.txt "$OUT_DIR" +sudo cp fwd_blk.img "$OUT_DIR/../flash_blk.img" +sudo cp fwd_eth.img "$OUT_DIR/../flash_eth.img" +sudo cp fwd_mmc.img "$OUT_DIR/../flash_mmc.img" #cleanup intermediate files sudo rm ${CBOOT_IMAGE} ${EMMC_PARTS} ${IMAGEFILE}* versions.txt cd .. |