Skip to content

Commit 208187f

Browse files
committed
Race conditions: installing packages before adding a repo
1 parent 396ccb4 commit 208187f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

extensions/ti-debpkgs.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
function extension_prepare_config__add_packages() {
2-
if [[ ${#TI_PACKAGES[@]} -gt 0 ]] ; then
3-
add_packages_to_image "${TI_PACKAGES[@]}"
4-
fi
5-
}
6-
71
function post_repo_customize_image__install_ti_packages() {
8-
2+
93
# Read JSON array into Bash array safely
104
mapfile -t valid_suites < <(
115
curl -s https://api.github.com/repos/TexasInstruments/ti-debpkgs/contents/dists |
@@ -30,6 +24,12 @@ function post_repo_customize_image__install_ti_packages() {
3024
chroot_sdcard "mkdir -p /etc/apt/preferences.d/"
3125
run_host_command_logged "cp \"$SRC/packages/bsp/ti/ti-debpkgs/ti-debpkgs\" \"$SDCARD/etc/apt/preferences.d/\""
3226

27+
# Install packages
28+
if [[ ${#TI_PACKAGES[@]} -gt 0 ]] ; then
29+
do_with_retries 3 chroot_sdcard_apt_get_update
30+
do_with_retries 3 chroot_sdcard_apt_get_install "${TI_PACKAGES[@]}"
31+
fi
32+
3333
else
3434
# Error if suite is not valid but continue building image anyway
3535
display_alert "Error: Detected OS suite '$RELEASE' is not valid based on TI package repository. Skipping!"

0 commit comments

Comments
 (0)