Skip to content

Commit 48e0eeb

Browse files
Grippy98jsuhaas22
authored andcommitted
extensions: Add TI's repo and install specified packages in k3-*
Texas Instruments maintains a custom apt repository [0] that contains: * tools like k3conf, which run on K3 devices * TI's versions of upstream packages (such as mesa) * out-of-tree drivers and firmware for graphics, wifi etc Therefore, add TI's custom repository as the highest priority repository in the filesystem. Doing this ensures that if apt finds a version of a package that exists in both upstream Debian and the TI repository, it picks the latter. Additionally, introduce K3_PACKAGES variable to store a list of packages that should be installed by-default in a K3 image. Initialize it to hold TI's CC33xx packages. Also set EXTRAWIFI to "no" in `current` image. [0] https://github.com/TexasInstruments/ti-debpkgs Co-authored-by: Suhaas Joshi <[email protected]> Signed-off-by: Suhaas Joshi <[email protected]>
1 parent dbe1b2b commit 48e0eeb

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

config/boards/sk-am62b.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ SERIALCON="ttyS2"
1515
ATF_BOARD="lite"
1616
OPTEE_ARGS="CFG_TEE_CORE_LOG_LEVEL=1"
1717
OPTEE_PLATFORM="k3-am62x"
18+
CC33XX_SUPPORT="yes"

config/sources/families/k3.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ declare -g SPD_OPTEED="SPD=opteed"
2020

2121
declare -g INSTALL_HEADERS="yes"
2222

23+
declare -g TI_PACKAGES=()
24+
if [[ "${CC33XX_SUPPORT}" == "yes" ]] ; then
25+
if [[ "${RELEASE}" == "trixie" || "${RELEASE}" == "noble" ]] ; then
26+
TI_PACKAGES+=("cc33xx-fw" "cc33xx-target-scripts" "cc33conf" "cc33calibrator")
27+
fi
28+
fi
29+
30+
enable_extension "ti-debpkgs"
31+
2332
case "${BRANCH}" in
2433

2534
current | current-rt)
@@ -32,6 +41,7 @@ case "${BRANCH}" in
3241
declare -g OPTEE_BRANCH="tag:4.6.0"
3342
declare -g TI_LINUX_FIRMWARE_BRANCH="${CORESDK_TAG}"
3443
declare -g BOOTBRANCH="${CORESDK_TAG}"
44+
EXTRAWIFI="no"
3545
;;
3646

3747
edge)

extensions/ti-debpkgs.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
function extension_prepare_config__add_packages() {
2+
if [[ ${#TI_PACKAGES[@]} -gt 0 ]] ; then
3+
add_packages_to_rootfs "${TI_PACKAGES[@]}"
4+
fi
5+
}
6+
7+
function custom_apt_repo__install_ti_packages() {
8+
# Read JSON array into Bash array safely
9+
mapfile -t valid_suites < <(
10+
curl -s https://api.github.com/repos/TexasInstruments/ti-debpkgs/contents/dists |
11+
jq -r '.[].name'
12+
)
13+
display_alert "TI Repo has the following valid suites - ${valid_suites[@]}..."
14+
15+
if printf '%s\n' "${valid_suites[@]}" | grep -qx "${RELEASE}"; then
16+
# Get the sources file
17+
run_host_command_logged "mkdir -p \"$SDCARD/tmp\""
18+
run_host_command_logged "wget -qO $SDCARD/tmp/ti-debpkgs.sources https://raw.githubusercontent.com/TexasInstruments/ti-debpkgs/main/ti-debpkgs.sources"
19+
20+
# Update suite in source file
21+
chroot_sdcard "sed -i 's/bookworm/${RELEASE}/g' /tmp/ti-debpkgs.sources"
22+
23+
# Copy updated sources file into chroot
24+
chroot_sdcard "cp /tmp/ti-debpkgs.sources /etc/apt/sources.list.d/ti-debpkgs.sources"
25+
26+
# Clean up inside the chroot
27+
chroot_sdcard "rm -f /tmp/ti-debpkgs.sources"
28+
29+
chroot_sdcard "mkdir -p /etc/apt/preferences.d/"
30+
run_host_command_logged "cp \"$SRC/packages/bsp/ti/ti-debpkgs/ti-debpkgs\" \"$SDCARD/etc/apt/preferences.d/\""
31+
32+
else
33+
# Error if suite is not valid but continue building image anyway
34+
display_alert "Error: Detected OS suite '$RELEASE' is not valid based on TI package repository. Skipping!"
35+
display_alert "Valid Options Would Have Been: ${valid_suites[@]}"
36+
fi
37+
}

packages/bsp/ti/ti-debpkgs/ti-debpkgs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Package: *
2+
Pin: origin texasinstruments.github.io
3+
Pin-Priority: 1001

0 commit comments

Comments
 (0)