diff --git a/config/boards/sk-am62b.conf b/config/boards/sk-am62b.conf index b6e16a56d..fbd923331 100644 --- a/config/boards/sk-am62b.conf +++ b/config/boards/sk-am62b.conf @@ -15,3 +15,4 @@ SERIALCON="ttyS2" ATF_BOARD="lite" OPTEE_ARGS="CFG_TEE_CORE_LOG_LEVEL=1" OPTEE_PLATFORM="k3-am62x" +CC33XX_SUPPORT="yes" diff --git a/config/sources/families/k3.conf b/config/sources/families/k3.conf index 304d77833..c201feb89 100644 --- a/config/sources/families/k3.conf +++ b/config/sources/families/k3.conf @@ -20,6 +20,15 @@ declare -g SPD_OPTEED="SPD=opteed" declare -g INSTALL_HEADERS="yes" +declare -g TI_PACKAGES=() +if [[ "${CC33XX_SUPPORT}" == "yes" ]] ; then + if [[ "${RELEASE}" == "trixie" || "${RELEASE}" == "noble" ]] ; then + TI_PACKAGES+=("cc33xx-fw" "cc33xx-target-scripts" "cc33conf" "cc33calibrator") + fi +fi + +enable_extension "ti-debpkgs" + case "${BRANCH}" in current | current-rt) @@ -32,6 +41,7 @@ case "${BRANCH}" in declare -g OPTEE_BRANCH="tag:4.6.0" declare -g TI_LINUX_FIRMWARE_BRANCH="${CORESDK_TAG}" declare -g BOOTBRANCH="${CORESDK_TAG}" + EXTRAWIFI="no" ;; edge) diff --git a/extensions/ti-debpkgs.sh b/extensions/ti-debpkgs.sh new file mode 100644 index 000000000..116cd3d62 --- /dev/null +++ b/extensions/ti-debpkgs.sh @@ -0,0 +1,37 @@ +function extension_prepare_config__add_packages() { + if [[ ${#TI_PACKAGES[@]} -gt 0 ]] ; then + add_packages_to_rootfs "${TI_PACKAGES[@]}" + fi +} + +function custom_apt_repo__install_ti_packages() { + # Read JSON array into Bash array safely + mapfile -t valid_suites < <( + curl -s https://api.github.com/repos/TexasInstruments/ti-debpkgs/contents/dists | + jq -r '.[].name' + ) + display_alert "TI Repo has the following valid suites - ${valid_suites[@]}..." + + if printf '%s\n' "${valid_suites[@]}" | grep -qx "${RELEASE}"; then + # Get the sources file + run_host_command_logged "mkdir -p \"$SDCARD/tmp\"" + run_host_command_logged "wget -qO $SDCARD/tmp/ti-debpkgs.sources https://raw.githubusercontent.com/TexasInstruments/ti-debpkgs/main/ti-debpkgs.sources" + + # Update suite in source file + chroot_sdcard "sed -i 's/bookworm/${RELEASE}/g' /tmp/ti-debpkgs.sources" + + # Copy updated sources file into chroot + chroot_sdcard "cp /tmp/ti-debpkgs.sources /etc/apt/sources.list.d/ti-debpkgs.sources" + + # Clean up inside the chroot + chroot_sdcard "rm -f /tmp/ti-debpkgs.sources" + + chroot_sdcard "mkdir -p /etc/apt/preferences.d/" + run_host_command_logged "cp \"$SRC/packages/bsp/ti/ti-debpkgs/ti-debpkgs\" \"$SDCARD/etc/apt/preferences.d/\"" + + else + # Error if suite is not valid but continue building image anyway + display_alert "Error: Detected OS suite '$RELEASE' is not valid based on TI package repository. Skipping!" + display_alert "Valid Options Would Have Been: ${valid_suites[@]}" + fi +} diff --git a/packages/bsp/ti/ti-debpkgs/ti-debpkgs b/packages/bsp/ti/ti-debpkgs/ti-debpkgs new file mode 100644 index 000000000..436d12889 --- /dev/null +++ b/packages/bsp/ti/ti-debpkgs/ti-debpkgs @@ -0,0 +1,3 @@ +Package: * +Pin: origin texasinstruments.github.io +Pin-Priority: 1001