diff options
| author | Serge Schneider <serge@raspberrypi.com> | 2025-04-15 11:48:57 +0100 |
|---|---|---|
| committer | Serge Schneider <serge@raspberrypi.com> | 2025-04-15 14:57:18 +0100 |
| commit | ca3d54e7e77372e9018893ab482a9fb1ad0049eb (patch) | |
| tree | 22495147e7aa5b9395dc1c9cb1936537f4ed3988 | |
| parent | 260c17db0e1904bec665e65a507a296279f22703 (diff) | |
Add TEMP_REPO variable
| -rw-r--r-- | README.md | 7 | ||||
| -rwxr-xr-x | build.sh | 1 | ||||
| -rwxr-xr-x | export-image/02-set-sources/01-run.sh | 1 | ||||
| -rwxr-xr-x | stage0/00-configure-apt/00-run.sh | 7 |
4 files changed, 16 insertions, 0 deletions
@@ -80,6 +80,13 @@ The following environment variables are supported: will not be included in the image, making it safe to use an `apt-cacher` or similar package for development. + * `TEMP_REPO` (Default: unset) + + An additional temporary apt repo to be used during the build process. This + could be useful if you require pre-release software to be included in the + image. The variable should contain sources in [one-line-style format](https://manpages.debian.org/stable/apt/sources.list.5.en.html#ONE-LINE-STYLE_FORMAT). + "RELEASE" will be replaced with the RELEASE variable. + * `BASE_DIR` (Default: location of `build.sh`) **CAUTION**: Currently, changing this value will probably break build.sh @@ -222,6 +222,7 @@ export PUBKEY_SSH_FIRST_USER export CLEAN export APT_PROXY +export TEMP_REPO export STAGE export STAGE_DIR diff --git a/export-image/02-set-sources/01-run.sh b/export-image/02-set-sources/01-run.sh index 6d50496..d93efdf 100755 --- a/export-image/02-set-sources/01-run.sh +++ b/export-image/02-set-sources/01-run.sh @@ -1,6 +1,7 @@ #!/bin/bash -e rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" +rm -f "${ROOTFS_DIR}/etc/apt/sources.list.d/00-temp.list" find "${ROOTFS_DIR}/var/lib/apt/lists/" -type f -delete on_chroot << EOF apt-get update diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index 926c4c6..1b7e03f 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -12,6 +12,13 @@ else rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" fi +if [ -n "$TEMP_REPO" ]; then + install -m 644 /dev/null "${ROOTFS_DIR}/etc/apt/sources.list.d/00-temp.list" + echo "$TEMP_REPO" | sed "s/RELEASE/$RELEASE/g" > "${ROOTFS_DIR}/etc/apt/sources.list.d/00-temp.list" +else + rm -f "${ROOTFS_DIR}/etc/apt/sources.list.d/00-temp.list" +fi + cat files/raspberrypi.gpg.key | gpg --dearmor > "${STAGE_WORK_DIR}/raspberrypi-archive-stable.gpg" install -m 644 "${STAGE_WORK_DIR}/raspberrypi-archive-stable.gpg" "${ROOTFS_DIR}/etc/apt/trusted.gpg.d/" on_chroot <<- \EOF |
