diff --git a/build.sh b/build.sh index 387c5bb..61c8d04 100755 --- a/build.sh +++ b/build.sh @@ -48,6 +48,7 @@ do fi bsp_version=($(read_bsp_config ${distro_codename} bsp_version)) + distro_bsp_version="${distro}-${bsp_version}" export host_arch=`uname -m` export native_build=false @@ -60,6 +61,7 @@ do echo "machine: ${machine}" echo "bsp_version: ${bsp_version}" echo "distro: ${distro}" + echo "distro_bsp_version: ${distro_bsp_version}" echo "host_arch: ${host_arch}" setup_build_tools @@ -68,9 +70,9 @@ do validate_build ${machine} ${bsp_version} ${distro_codename}/${distro}.yaml - generate_rootfs ${distro} ${distro_codename} ${machine} + generate_rootfs ${distro} ${distro_codename} ${machine} ${distro_bsp_version} build_bsp ${distro} ${machine} ${bsp_version} - package_and_clean ${distro} + package_and_clean ${distro} ${distro_bsp_version} done diff --git a/create-wic.sh b/create-wic.sh index 76539e3..2c3af66 100755 --- a/create-wic.sh +++ b/create-wic.sh @@ -83,17 +83,22 @@ source ${topdir}/scripts/common.sh validate_section "Build" ${BUILD} "${topdir}/builds.toml" -if [ ! -f ${topdir}/build/${BUILD}/tisdk-debian-${BUILD}-boot.tar.xz ]; then + +distro_codename=($(read_build_config ${BUILD} distro_codename)) +bsp_version=($(read_bsp_config ${distro_codename} bsp_version)) +BUILD_FULL="${BUILD}-${bsp_version}" + +if [ ! -f ${topdir}/build/${BUILD}/tisdk-debian-${BUILD_FULL}-boot.tar.xz ]; then echo "Error: Boot partition tarball not found for ${BUILD}." exit -1 fi -if [ ! -f ${topdir}/build/${BUILD}/tisdk-debian-${BUILD}-rootfs.tar.xz ]; then +if [ ! -f ${topdir}/build/${BUILD}/tisdk-debian-${BUILD_FULL}-rootfs.tar.xz ]; then echo "Error: RootFS partition tarball not found for ${BUILD}." exit -1 fi -IMAGE=tisdk-debian-${BUILD}.wic +IMAGE=tisdk-debian-${BUILD_FULL}.wic echo "Creating an empty image" dd if=/dev/zero of=${BUILDPATH}/${BUILD}/${IMAGE} count=10485760 status=progress @@ -133,9 +138,9 @@ mount ${LOOPDEV}p1 ./img_boot echo "Copy Boot Partition files" cd ./img_boot -tar -xf ${BUILDPATH}/${BUILD}/tisdk-debian-${BUILD}-boot.tar.xz -mv tisdk-debian-${BUILD}-boot/* ./ -rmdir tisdk-debian-${BUILD}-boot +tar -xf ${BUILDPATH}/${BUILD}/tisdk-debian-${BUILD_FULL}-boot.tar.xz +mv tisdk-debian-${BUILD_FULL}-boot/* ./ +rmdir tisdk-debian-${BUILD_FULL}-boot echo "Sync and Unmount Boot Partition" cd ${BUILDPATH}/${BUILD}/temp/ @@ -149,9 +154,9 @@ mount ${LOOPDEV}p2 ./img_rootfs echo "Copy RootFS Partition files" cd ./img_rootfs -tar -xf ${BUILDPATH}/${BUILD}/tisdk-debian-${BUILD}-rootfs.tar.xz -mv tisdk-debian-${BUILD}-rootfs/* ./ -rmdir tisdk-debian-${BUILD}-rootfs +tar -xf ${BUILDPATH}/${BUILD}/tisdk-debian-${BUILD_FULL}-rootfs.tar.xz +mv tisdk-debian-${BUILD_FULL}-rootfs/* ./ +rmdir tisdk-debian-${BUILD_FULL}-rootfs echo "Sync and Unmount RootFS Partition" cd ${BUILDPATH}/${BUILD}/temp/ diff --git a/scripts/build_bsp.sh b/scripts/build_bsp.sh index 1d420a3..cc680a0 100755 --- a/scripts/build_bsp.sh +++ b/scripts/build_bsp.sh @@ -94,7 +94,7 @@ bsp_version=$3 tar --use-compress-program="pigz --best --recursive | pv" -cf bsp_sources.tar.xz bsp_sources &>>"${LOG_FILE}" log "> BSP sources: backup created .." - mkdir -p tisdk-debian-${distro}-boot + mkdir -p tisdk-debian-${distro}-${bsp_version}-boot } function build_atf() { @@ -137,18 +137,18 @@ bsp_version=$2 log "> uboot-r5: building .." make -j`nproc` ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- ${uboot_r5_defconfig} O=${UBOOT_DIR}/out/r5 &>>"${LOG_FILE}" make -j`nproc` ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- O=${UBOOT_DIR}/out/r5 BINMAN_INDIRS=${FW_DIR} &>>"${LOG_FILE}" - cp ${UBOOT_DIR}/out/r5/tiboot3*.bin ${topdir}/build/${build}/tisdk-debian-${distro}-boot/ &>> ${LOG_FILE} + cp ${UBOOT_DIR}/out/r5/tiboot3*.bin ${topdir}/build/${build}/tisdk-debian-${distro}-${bsp_version}-boot/ &>> ${LOG_FILE} cd ${UBOOT_DIR} log "> uboot-a53: building .." make -j`nproc` ARCH=arm CROSS_COMPILE=${cross_compile} ${uboot_a53_defconfig} O=${UBOOT_DIR}/out/a53 &>>"${LOG_FILE}" make -j`nproc` ARCH=arm CROSS_COMPILE=${cross_compile} BL31=${TFA_DIR}/build/k3/lite/release/bl31.bin TEE=${OPTEE_DIR}/out/arm-plat-k3/core/tee-pager_v2.bin O=${UBOOT_DIR}/out/a53 BINMAN_INDIRS=${topdir}/build/${build}/bsp_sources/ti-linux-firmware &>>"${LOG_FILE}" - cp ${UBOOT_DIR}/out/a53/tispl.bin ${topdir}/build/${build}/tisdk-debian-${distro}-boot/ &>> ${LOG_FILE} - cp ${UBOOT_DIR}/out/a53/u-boot.img ${topdir}/build/${build}/tisdk-debian-${distro}-boot/ &>> ${LOG_FILE} + cp ${UBOOT_DIR}/out/a53/tispl.bin ${topdir}/build/${build}/tisdk-debian-${distro}-${bsp_version}-boot/ &>> ${LOG_FILE} + cp ${UBOOT_DIR}/out/a53/u-boot.img ${topdir}/build/${build}/tisdk-debian-${distro}-${bsp_version}-boot/ &>> ${LOG_FILE} case ${machine} in am62pxx-evm | am62xx-evm | am62xx-lp-evm | am62xxsip-evm) - cp ${UBOOT_DIR}/tools/logos/ti_logo_414x97_32bpp.bmp.gz ${topdir}/build/${build}/tisdk-debian-${distro}-boot/ &>> ${LOG_FILE} + cp ${UBOOT_DIR}/tools/logos/ti_logo_414x97_32bpp.bmp.gz ${topdir}/build/${build}/tisdk-debian-${distro}-${bsp_version}-boot/ &>> ${LOG_FILE} ;; esac } diff --git a/scripts/build_distro.sh b/scripts/build_distro.sh index 6e2a4ae..ebf2c2c 100755 --- a/scripts/build_distro.sh +++ b/scripts/build_distro.sh @@ -6,6 +6,7 @@ function generate_rootfs() { distro=$1 distro_codename=$2 machine=$3 +distro_bsp_version=$4 cd ${topdir} @@ -13,7 +14,7 @@ machine=$3 bdebstrap \ -c ${topdir}/configs/bdebstrap_configs/${distro_codename}/${distro}.yaml \ --name ${topdir}/build/${distro} \ - --target tisdk-debian-${distro}-rootfs \ + --target tisdk-debian-${distro_bsp_version}-rootfs \ --hostname ${machine} \ -f \ &>>"${LOG_FILE}" @@ -25,21 +26,22 @@ machine=$3 function package_and_clean() { build=$1 +distro_bsp_version=$2 cd ${topdir}/build/${build} log "> Cleaning up ${build}" - tar --use-compress-program="pigz --best --recursive | pv" -cf tisdk-debian-${distro}-rootfs.tar.xz tisdk-debian-${distro}-rootfs &>>"${LOG_FILE}" + tar --use-compress-program="pigz --best --recursive | pv" -cf tisdk-debian-${distro_bsp_version}-rootfs.tar.xz tisdk-debian-${distro_bsp_version}-rootfs &>>"${LOG_FILE}" rm -rf tisdk-debian-${distro}-rootfs - tar --use-compress-program="pigz --best --recursive | pv" -cf tisdk-debian-${distro}-boot.tar.xz tisdk-debian-${distro}-boot &>>"${LOG_FILE}" - rm -rf tisdk-debian-${distro}-boot + tar --use-compress-program="pigz --best --recursive | pv" -cf tisdk-debian-${distro_bsp_version}-boot.tar.xz tisdk-debian-${distro_bsp_version}-boot &>>"${LOG_FILE}" + rm -rf tisdk-debian-${distro_bsp_version}-boot rm -rf bsp_sources cd ${topdir}/build/ log "> Packaging ${build}" - tar --use-compress-program="pigz --best --recursive | pv" -cf ${build}.tar.xz ${build} &>>"${LOG_FILE}" + tar --use-compress-program="pigz --best --recursive | pv" -cf ${distro_bsp_version}.tar.xz ${build} &>>"${LOG_FILE}" }