Skip to content

Commit

Permalink
nonsdk_container_setup: also make sure we don't race with cloud-init
Browse files Browse the repository at this point in the history
Seems like cloud-init can update sources.list after us. Make sure it
will include our changes by injecting our changes into cloud-init too.
  • Loading branch information
peat-psuwit committed Apr 30, 2024
1 parent c23bb02 commit a7e876e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crossbuilder
Expand Up @@ -436,6 +436,12 @@ nonsdk_container_setup () {
-e 's:(archive|security)\.ubuntu\.com/ubuntu/? :ports.ubuntu.com/ubuntu-ports/ :' \
-e 's:^deb :deb [arch=${TARGET_ARCH}] :' \
/etc/apt/sources.list >/etc/apt/sources.list.d/ports.list"
# Make sure we don't race with cloud-init. On some image it might
# not exists, so don't fail if this fails.
exec_container_root "sed -i -E \
-e 's:^deb :deb [arch=${HOST_ARCH}] :' \
/etc/cloud/templates/sources.list.ubuntu.tmpl \
/etc/cloud/templates/sources.list.tmpl" || true
exec_container_root "sed -i -E \
-e 's:^deb :deb [arch=${HOST_ARCH}] :' \
/etc/apt/sources.list"
Expand All @@ -447,6 +453,12 @@ nonsdk_container_setup () {
-e 's:ports\.ubuntu\.com/ubuntu-ports/? ([a-z-]+):archive.ubuntu.com/ubuntu \1 :' \
-e 's:^deb :deb [arch=${TARGET_ARCH}] :' \
/etc/apt/sources.list >/etc/apt/sources.list.d/non-ports.list"
# Make sure we don't race with cloud-init. On some image it might
# not exists, so don't fail if this fails.
exec_container_root "sed -i -E \
-e 's:^deb :deb [arch=${HOST_ARCH}] :' \
/etc/cloud/templates/sources.list.ubuntu.tmpl \
/etc/cloud/templates/sources.list.tmpl" || true
exec_container_root "sed -i -E \
-e 's:^deb :deb [arch=${HOST_ARCH}] :' \
/etc/apt/sources.list"
Expand Down

0 comments on commit a7e876e

Please sign in to comment.