Skip to content

Commit

Permalink
Add BSP version to the names of output tars and wics
Browse files Browse the repository at this point in the history
There is a requirement to include the BSP versions in the names of the
images we distribute. So include the version in the name.

Signed-off-by: Suhaas Joshi <[email protected]>
  • Loading branch information
jsuhaas22 committed Nov 18, 2024
1 parent 04a8cb7 commit 1505503
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

23 changes: 14 additions & 9 deletions create-wic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand All @@ -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/
Expand Down
10 changes: 5 additions & 5 deletions scripts/build_bsp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
}
Expand Down
12 changes: 7 additions & 5 deletions scripts/build_distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ function generate_rootfs() {
distro=$1
distro_codename=$2
machine=$3
distro_bsp_version=$4

cd ${topdir}

log "> Building rootfs .."
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}"
Expand All @@ -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}"
}

0 comments on commit 1505503

Please sign in to comment.