diff options
author | Sven Gothel <[email protected]> | 2021-08-06 03:28:21 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-08-06 03:28:21 +0200 |
commit | 213aa304cd1b8350f1dd2036cb5dfc1e5ed1e9d6 (patch) | |
tree | a1e020f2bbea8f35f902c612eaceb5fd9ba60e19 | |
parent | e1dca8cd8ef265dcaaceaa579737828e92ea9065 (diff) |
Only use raspberry.org package source for Raspi-armhf is explicitly chosen via `PREFER_RASPI_SOURCE=1`
This change reworked commit 53b2203c5d25f86faf6ac4711b0a7e370bf8689e,
i.e. reverts if PREFER_RASPI_SOURCE is not set to `1`
-rw-r--r-- | README.md | 22 | ||||
-rwxr-xr-x | build.sh | 7 | ||||
-rw-r--r-- | scripts/common | 2 | ||||
-rwxr-xr-x | stage0/00-configure-apt/00-run.sh | 2 | ||||
-rwxr-xr-x | stage0/prerun.sh | 2 |
5 files changed, 22 insertions, 13 deletions
@@ -31,16 +31,11 @@ The file `depends` contains a list of tools needed. The format of this package is `<tool>[:<debian-package>]`. ### Package Source -For target Raspi-armhf (arm32) the scripts utilize `raspberrypi.org` -as the main source for `debootstrap` and `apt` package management. - -It has been observed using `debian.org` as the source for target Raspi-armhf -may lead to an instable installation, despite successful completion. -Network disconnect was one observation. - -For all other targets, e.g. Raspi-arm64 and PC-amd64, the scripts utilize `debian.org` -as the main source for `debootstrap` and `apt` package management. +For all targets, default source for `debootstrap` and `apt` package management +is `debian.org`. +See `PREFER_RASPI_SOURCE` below, describing how to use `raspberrypi.org` +as the package source. ## Notes @@ -106,10 +101,17 @@ The following environment variables are supported: - i386 - amd64 -* `RELEASE` (Default: `buster`) + * `RELEASE` (Default: `buster`) The release version to build images against. Valid values are `buster` and `bullseye`. + * `PREFER_RASPI_SOURCE` (Default: unset) + + If set to '1' and `TARGET_RASPI=1` and `TARGET_ARCH=armhf`, + `raspberrypi.org` will be used as the main source `debootstrap` and `apt` package management. + + Default is to use `debian.org` as the main package source for all targets. + * `INSTALL_RECOMMENDS` (Default: unset) If set to one, i.e. `INSTALL_RECOMMENDS=1`, @@ -328,6 +328,13 @@ if [ -z "${IS_TESTING}" ]; then fi export IS_TESTING +if [ "${PREFER_RASPI_SOURCE}" = "1" -a "${TARGET_RASPI}" = "1" -a "${TARGET_ARCH}" = "armhf" ]; then + USE_RASPI_SOURCE=1 +else + USE_RASPI_SOURCE=0 +fi +export USE_RASPI_SOURCE + # shellcheck source=scripts/common source "${SCRIPT_DIR}/common" # shellcheck source=scripts/dependencies_check diff --git a/scripts/common b/scripts/common index e41cd95..4ff9a96 100644 --- a/scripts/common +++ b/scripts/common @@ -18,7 +18,7 @@ bootstrap(){ BOOTSTRAP_ARGS+=(--arch ${TARGET_ARCH}) BOOTSTRAP_ARGS+=(--include gnupg) BOOTSTRAP_ARGS+=(--components "main,contrib,non-free") - if [ "${TARGET_RASPI}" = "1" -a "${TARGET_ARCH}" = "armhf" ]; then + if [ "${USE_RASPI_SOURCE}" = "1" ]; then BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg") fi BOOTSTRAP_ARGS+=("$@") diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index c106d1c..a083e88 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -if [ "${TARGET_RASPI}" = "1" -a "${TARGET_ARCH}" = "armhf" ]; then +if [ "${USE_RASPI_SOURCE}" = "1" ]; then install -m 644 files/sources-raspi_armhf.list "${ROOTFS_DIR}/etc/apt/sources.list" elif [ "${IS_TESTING}" = "1" ]; then install -m 644 files/sources-testing.list "${ROOTFS_DIR}/etc/apt/sources.list" diff --git a/stage0/prerun.sh b/stage0/prerun.sh index 6b1b831..16a4257 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -if [ "${TARGET_RASPI}" = "1" -a "${TARGET_ARCH}" = "armhf" ]; then +if [ "${USE_RASPI_SOURCE}" = "1" ]; then bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ else bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/ |