summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2016-12-19 14:32:15 +0100
committerStefan Agner <stefan.agner@toradex.com>2017-01-10 16:54:45 -0800
commiteb4e2c5fc55a6167c5f6feea4af2e8e89e8ad633 (patch)
tree8c367a2f6f60814a5fb77f0ba5692f935375c86d
parent5b26740b4f0d8eb32d25e716faaf127dd90a3c53 (diff)
images: update.sh: Add Apalis TK1 Mainline machine
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--recipes-images/images/angstrom-lxde-image.bb9
-rw-r--r--recipes-images/images/angstrom-qt-x11-image.bb7
-rw-r--r--recipes-images/images/angstrom-qt5-x11-image.bb7
-rw-r--r--recipes-images/images/console-trdx-image.bb3
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bctbin0 -> 8192 bytes
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/apalis-tk1.img.cfg22
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_blk.scr31
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_eth.scr28
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_blk.scr11
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_eth.scr6
-rw-r--r--recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_mmc.scr3
-rwxr-xr-xrecipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/mk-u-boot-scripts.sh5
-rwxr-xr-xrecipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext3fs.sh80
l---------recipes-images/images/files/apalis-tk1-mainline/update.sh1
-rwxr-xr-xrecipes-images/images/files/library/tegra/update.sh13
-rw-r--r--recipes-images/images/trdx-extra.inc17
-rw-r--r--recipes-images/images/trdx-image-fstype.inc15
17 files changed, 254 insertions, 4 deletions
diff --git a/recipes-images/images/angstrom-lxde-image.bb b/recipes-images/images/angstrom-lxde-image.bb
index a98c664..50f22b2 100644
--- a/recipes-images/images/angstrom-lxde-image.bb
+++ b/recipes-images/images/angstrom-lxde-image.bb
@@ -8,6 +8,7 @@ PV = "V2.6.2"
IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxImage"
IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxImage"
IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxImage"
+IMAGE_NAME_apalis-tk1-mainline = "Apalis_TK1_Mainline_LinuxImage"
IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxImage"
IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxImage"
IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxImage"
@@ -165,6 +166,14 @@ IMAGE_INSTALL_append_tegra124 = " \
tiff \
xvinfo \
"
+IMAGE_INSTALL_append_tegra124m = " \
+ gnome-disk-utility \
+ libglu \
+ freeglut \
+ mime-support \
+ tiff \
+ xvinfo \
+"
IMAGE_INSTALL_append_mx6 = " \
gpio-tool \
packagegroup-fsl-gpu-libs \
diff --git a/recipes-images/images/angstrom-qt-x11-image.bb b/recipes-images/images/angstrom-qt-x11-image.bb
index 18285d4..f361e70 100644
--- a/recipes-images/images/angstrom-qt-x11-image.bb
+++ b/recipes-images/images/angstrom-qt-x11-image.bb
@@ -8,6 +8,7 @@ PV = "V2.6.2"
IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxImage-qt"
IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxImage-qt"
IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxImage-qt"
+IMAGE_NAME_apalis-tk1-mainline = "Apalis_TK1_Mainline_LinuxImage-qt"
IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxImage-qt"
IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxImage-qt"
IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxImage-qt"
@@ -187,6 +188,12 @@ IMAGE_INSTALL_append_tegra124 = " \
tiff \
xvinfo \
"
+IMAGE_INSTALL_append_tegra124m = " \
+ libglu \
+ freeglut \
+ tiff \
+ xvinfo \
+"
IMAGE_INSTALL_append_mx6 = " \
packagegroup-fsl-gpu-libs \
libopencl-mx6 \
diff --git a/recipes-images/images/angstrom-qt5-x11-image.bb b/recipes-images/images/angstrom-qt5-x11-image.bb
index cb348fe..d630aac 100644
--- a/recipes-images/images/angstrom-qt5-x11-image.bb
+++ b/recipes-images/images/angstrom-qt5-x11-image.bb
@@ -12,6 +12,7 @@ PV = "V2.6.2"
IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxImage-qt5"
IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxImage-qt5"
IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxImage-qt5"
+IMAGE_NAME_apalis-tk1-mainline = "Apalis_TK1_Mainline_LinuxImage-qt5"
IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxImage-qt5"
IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxImage-qt5"
IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxImage-qt5"
@@ -162,6 +163,12 @@ IMAGE_INSTALL_append_tegra124 = " \
tiff \
xvinfo \
"
+IMAGE_INSTALL_append_tegra124m = " \
+ libglu \
+ freeglut \
+ tiff \
+ xvinfo \
+"
IMAGE_INSTALL_append_mx6 = " \
packagegroup-fsl-gpu-libs \
libopencl-mx6 \
diff --git a/recipes-images/images/console-trdx-image.bb b/recipes-images/images/console-trdx-image.bb
index ed240b7..fc1c3a0 100644
--- a/recipes-images/images/console-trdx-image.bb
+++ b/recipes-images/images/console-trdx-image.bb
@@ -8,6 +8,7 @@ PV = "V2.6.2"
IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxConsoleImage"
IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxConsoleImage"
IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxConsoleImage"
+IMAGE_NAME_apalis-tk1-mainline = "Apalis_TK1_Mainline_LinuxConsoleImage"
IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxConsoleImage"
IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxConsoleImage"
IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxConsoleImage"
@@ -34,7 +35,7 @@ CONMANPKGS_libc-uclibc = ""
#deploy the X server for the tegras
#this adds a few MB to the image, but all graphical HW acceleration is
-#available only on top of X
+#available only on top of X, this is not required for nouveau based build.
IMAGE_INSTALL_append_tegra = " ${XSERVER} xterm xclock"
IMAGE_INSTALL_append_tegra124 = " ${XSERVER} xterm xclock"
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct
new file mode 100644
index 0000000..556a40e
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct
Binary files differ
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/apalis-tk1.img.cfg b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/apalis-tk1.img.cfg
new file mode 100644
index 0000000..b9d203c
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/apalis-tk1.img.cfg
@@ -0,0 +1,22 @@
+# Copyright (C) 2016 Toradex, Inc.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+
+Version = 0x00400001;
+Bctcopy = 1;
+Bctfile = PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct;
+BootLoader = u-boot-dtb-tegra.bin,0x80108000,0x80108000,Complete;
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
new file mode 100644
index 0000000..95b6ae5
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_blk.scr
@@ -0,0 +1,31 @@
+test -n ${interface} || setenv interface mmc
+test -n ${drive} || setenv drive 1
+
+setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
+#workaround U-Boot counting in hex and split did in decimal
+setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow1 ${filenum} % 0x100; setexpr filenrlow2 ${filenrlow1} % 0x10; test ${filenrlow1} -eq "9a" && test ${filenrlow2} -ne "9" && setexpr filenum ${filenum} + 0x66; test ${filenrlow1} -ne "9a" && test ${filenrlow2} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
+setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}'
+
+setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1'
+setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1'
+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} ${filesize} ${filepos}; 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}'
+
+setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
+
+setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${soc}-apalis-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-apalis-${fdt_board}.dtb ${filesize}'
+
+setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
+
+setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
+setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}'
+#do it in chunks of 64M to fit into DDR RAM of the smallest module
+setenv update_rootfs 'setenv filesize 4000000; setenv filenum 100; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done'
+
+setenv update 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_rootfs; reset'
+
+echo 'enter "run update" to update the entire module'
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
new file mode 100644
index 0000000..01da4bb
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/flash_eth.scr
@@ -0,0 +1,28 @@
+setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
+#workaround U-Boot counting in hex and split did in decimal
+setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow1 ${filenum} % 0x100; setexpr filenrlow2 ${filenrlow1} % 0x10; test ${filenrlow1} -eq "9a" && test ${filenrlow2} -ne "9" && setexpr filenum ${filenum} + 0x66; test ${filenrlow1} -ne "9a" && test ${filenrlow2} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
+setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}'
+
+setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1'
+setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1'
+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}; 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}'
+
+setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
+
+setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${soc}-apalis-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-apalis-${fdt_board}.dtb ${filesize}'
+
+setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
+
+setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
+setenv update_2 'tftpboot ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}'
+#do it in chunks of 64M to fit into DDR RAM of the smallest module
+setenv update_rootfs 'setenv filesize 4000000; setenv filenum 100; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done'
+
+setenv update 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_rootfs; reset'
+
+echo 'enter "run update" to update the entire module'
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_blk.scr b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_blk.scr
new file mode 100644
index 0000000..7af72e6
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_blk.scr
@@ -0,0 +1,11 @@
+#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 -z "${board_name}" && test "${soc}" = "vf500" && setenv board_name colibri_vf
+test -z "${board_name}" && test "${soc}" = "vf610" && setenv board_name colibri_vf
+test "${board_name}" = "colibri_imx7" && setenv drive 0
+test "${board_name}" = "colibri_t20" && setenv drive 0
+test "${board_name}" = "colibri_vf" && setenv drive 0
+
+test -n ${board_name} || echo "board_name env not set!" && exit
+fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img && source ${loadaddr}
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_eth.scr b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_eth.scr
new file mode 100644
index 0000000..d7ea35c
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_eth.scr
@@ -0,0 +1,6 @@
+#the update.sh script renames this. fwd_eth.scr -> ../flash_eth.img
+test -z "${board_name}" && test "${soc}" = "vf500" && setenv board_name colibri_vf
+test -z "${board_name}" && test "${soc}" = "vf610" && setenv board_name colibri_vf
+
+test -n ${board_name} || echo "board_name env not set!" && exit
+tftpboot ${loadaddr} "${board_name}/flash_eth.img" && source ${loadaddr}
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_mmc.scr b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_mmc.scr
new file mode 100644
index 0000000..4c8f666
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/fwd_mmc.scr
@@ -0,0 +1,3 @@
+#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
+fatload mmc ${drive}:1 ${loadaddr} flash_blk.img && source ${loadaddr}
diff --git a/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/mk-u-boot-scripts.sh
new file mode 100755
index 0000000..dda47d5
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/apalis-tk1-mainline_bin/mk-u-boot-scripts.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+for f in *.scr
+do
+ mkimage -T script -C none -n 'Flash Apalis/Colibri module' -d $f `basename $f .scr`.img
+done
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/genext3fs.sh
new file mode 100755
index 0000000..ffcf060
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext3fs.sh
@@ -0,0 +1,80 @@
+#!/bin/sh
+#creates a file containing a ext3 binary blob of the content of the ../rootfs folder
+
+# sometimes we need the binary echo, not the shell builtin
+ECHO=`which echo`
+
+MOUNTPOINT="mnt/trdx-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 "-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"
+ echo ""
+}
+
+PARTITIONSIZE=256
+SRCPATH=../rootfs
+
+while getopts "b:d:h" Option ; do
+ case $Option in
+ h) Usage
+ # Exit if only usage (-h) was specfied.
+ if [[ "$#" -eq "1" ]] ; then
+ exit 10
+ fi
+ exit 0
+ ;;
+ b) PARTITIONSIZE=$OPTARG
+ ;;
+ d) SRCPATH=$OPTARG
+ ;;
+ esac
+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
+#answer y to "is not a block special device"
+dd if=/dev/zero of=$@ bs=1024k count=$PARTITIONSIZE
+mkfs.ext3 -F -L rootfs $@
+#disable fsck checks based on mount count or time interval
+tune2fs -c 0 -i 0 $@
+
+#prepare mountpoint for the loopdevice
+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
+MOUNTED=0
+while [ "$MOUNTED" -eq "0" ] ; do
+ sync
+ sleep 1
+ sudo mount $@ $MOUNTPOINT/ -o loop -t ext3
+ MOUNTED=`mount | grep -c "$MOUNTPOINT"`
+done
+#extract rootfs into the file
+sudo cp -rpP $SRCPATH/* $MOUNTPOINT
+if [ "$?" -ne "0" ] ; then
+ $ECHO -e "\033[1mCopying the rootfs failed.\033[0m"
+ echo "Check for error messages from cp"
+ sudo rm $@
+ exit 1
+fi
+
+#unmount again
+sudo umount $MOUNTPOINT
+
+#if the mounting was unsuccesful all rootfs data now still is in MOUNTPOINT, and $@ contains an empty fs
+#delete $@ in that case to fail early
+sync
+FAILED=`ls $MOUNTPOINT | wc -l`
+if [ "$FAILED" -ne "0" ] ; then
+ $ECHO -e "\033[1mMounting the loopdevice $@ failed.\033[0m"
+ sudo rm $@
+ exit 1
+fi
diff --git a/recipes-images/images/files/apalis-tk1-mainline/update.sh b/recipes-images/images/files/apalis-tk1-mainline/update.sh
new file mode 120000
index 0000000..6ebea84
--- /dev/null
+++ b/recipes-images/images/files/apalis-tk1-mainline/update.sh
@@ -0,0 +1 @@
+../library/tegra/update.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 3644511..a07b005 100755
--- a/recipes-images/images/files/library/tegra/update.sh
+++ b/recipes-images/images/files/library/tegra/update.sh
@@ -139,7 +139,14 @@ case $MODTYPE_DETECT in
if [ "$CNT" -ge 1 ] ; then
echo "Apalis TK1 rootfs detected"
MODTYPE=apalis-tk1
+
+ CNT=`grep -ic "mainline" rootfs/etc/issue || true`
+ if [ "$CNT" -ge 1 ] ; then
+ echo "Mainline variant"
+ MODTYPE=apalis-tk1-mainline
+ fi
fi
+
fi
else
CNT=`grep -ic "colibri" rootfs/etc/issue || true`
@@ -197,7 +204,7 @@ case "$MODTYPE" in
OUT_DIR="$OUT_DIR/apalis_t30"
U_BOOT_BINARY=u-boot-dtb-tegra.bin
;;
- "apalis-tk1")
+ "apalis-tk1" | "apalis-tk1-mainline")
BCT=PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct
CBOOT_IMAGE=apalis-tk1.img
CBOOT_IMAGE_TARGET=tegra124
@@ -369,7 +376,7 @@ if [ "${MODTYPE}" = "colibri-t20" ] ; then
echo ""
echo "UBI image of root file system generated, copying data to target folder..."
else
- if [ "${MODTYPE}" = "apalis-t30" ] || [ "${MODTYPE}" = "apalis-tk1" ] || [ "${MODTYPE}" = "colibri-t30" ] ; then
+ if [ "${MODTYPE}" = "apalis-t30" ] || [ "${MODTYPE}" = "apalis-tk1" ] || [ "${MODTYPE}" = "apalis-tk1-mainline" ] || [ "${MODTYPE}" = "colibri-t30" ] ; then
# Boot partition [in sectors of 512]
BOOT_START=$(expr 4096 \* 2)
# Rootfs partition [in sectors of 512]
@@ -418,7 +425,7 @@ else
fi
fi
done
- [ "${MODTYPE}" = "apalis-tk1" ] && ([ $COPIED = true ] || { echo "Did not find the devicetrees from KERNEL_DEVICETREE, ${KERNEL_DEVICETREE}. Aborting."; exit 1; })
+ ([ "${MODTYPE}" = "apalis-tk1" ] || [ "${MODTYPE}" = "apalis-tk1-mainline" ]) && ([ $COPIED = true ] || { echo "Did not find the devicetrees from KERNEL_DEVICETREE, ${KERNEL_DEVICETREE}. Aborting."; exit 1; })
fi
echo ""
diff --git a/recipes-images/images/trdx-extra.inc b/recipes-images/images/trdx-extra.inc
index 59cd5ac..f61d3af 100644
--- a/recipes-images/images/trdx-extra.inc
+++ b/recipes-images/images/trdx-extra.inc
@@ -58,6 +58,23 @@ IMAGE_INSTALL_append_tegra124 = " \
u-boot-toradex-fw-utils \
usb-rndis-systemd \
"
+IMAGE_INSTALL_append_tegra124m = " \
+ aspell \
+ canutils \
+ curl \
+ e2fsprogs \
+ e2fsprogs-mke2fs \
+ e2fsprogs-tune2fs \
+ file \
+ fs-init \
+ hdmi-hotplug \
+ kernel-modules \
+ linuxptp \
+ lvds-tegra124 \
+ pciutils \
+ ptpd \
+ u-boot-toradex-fw-utils \
+"
IMAGE_INSTALL_append_apalis-t30 = " \
linuxptp \
diff --git a/recipes-images/images/trdx-image-fstype.inc b/recipes-images/images/trdx-image-fstype.inc
index 808fd03..b082197 100644
--- a/recipes-images/images/trdx-image-fstype.inc
+++ b/recipes-images/images/trdx-image-fstype.inc
@@ -10,9 +10,11 @@ U_BOOT_EXT_vf = "imx"
U_BOOT_SYMLINK = "u-boot-${MACHINE}.${U_BOOT_EXT}"
U_BOOT_SYMLINK_tegra = "u-boot-dtb-tegra-${MACHINE}.${U_BOOT_EXT}"
U_BOOT_SYMLINK_tegra124 = "u-boot-dtb-tegra-${MACHINE}.${U_BOOT_EXT}"
+U_BOOT_SYMLINK_tegra124m = "u-boot-dtb-tegra-${MACHINE}.${U_BOOT_EXT}"
U_BOOT_BINARY = "u-boot.${U_BOOT_EXT}"
U_BOOT_BINARY_tegra = "u-boot-dtb-tegra.${U_BOOT_EXT}"
U_BOOT_BINARY_tegra124 = "u-boot-dtb-tegra.${U_BOOT_EXT}"
+U_BOOT_BINARY_tegra124m = "u-boot-dtb-tegra.${U_BOOT_EXT}"
#we need some native tools for deployment
DEPENDS_append_mx6 = " imx-loader-native"
@@ -20,6 +22,7 @@ DEPENDS_append_mx7 = " mtd-utils-native imx-loader-native"
#FIXME: 32-bit tegrarcm built on F20 does not run on 64-bit F20 even with properly installed 32-bit libs!
DEPENDS_append_tegra = " cbootimage-native tegrarcm-native"
DEPENDS_append_tegra124 = " cbootimage-native tegrarcm-native"
+DEPENDS_append_tegra124m = " cbootimage-native tegrarcm-native"
DEPENDS_append_tegra2 = " mtd-utils-native"
DEPENDS_append_vf = " mtd-utils-native imx-loader-native"
#we need mkimage to produce the U-Boot scripts even if not building a uImage kernel
@@ -87,6 +90,18 @@ imagedeploytools_append_tegra124() {
${BUILD_STRIP} ${IMAGE_ROOT}/tegrarcm
}
+imagedeploytools_append_tegra124m() {
+ IMAGE_ROOT="${IMAGE_ROOTFS}/../tegra-uboot-flasher/"
+ mkdir -p ${IMAGE_ROOT}
+
+ # add cbootimage and tegrarcm
+ cp ${STAGING_BINDIR_NATIVE}/cbootimage ${IMAGE_ROOT}/
+ cp ${STAGING_BINDIR_NATIVE}/tegrarcm ${IMAGE_ROOT}/
+ ${BUILD_STRIP} ${IMAGE_ROOT}/cbootimage
+ ${BUILD_STRIP} ${IMAGE_ROOT}/tegrarcm
+}
+
+
imagedeploytools_append_vf() {
IMAGE_ROOT="${IMAGE_ROOTFS}/../vf_flash/"
rm -f ${IMAGE_ROOT}/mkfs.ubifs ${IMAGE_ROOT}/imx_uart