diff --git a/README.md b/README.md index db46f87..c27bfe3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/build.sh b/build.sh index f35da03..4d3902c 100755 --- a/build.sh +++ b/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