diff --git a/README.md b/README.md index 4afcbbb..6361199 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,10 @@ The following environment variables are supported: If set, use this directory path as the location of scripts to run when generating images. An absolute or relative path can be given for a location outside the pi-gen directory. + * `ENABLE_CLOUD_INIT` (Default: `1`) + + If set to `1`, cloud-init and netplan will be installed and configured. This will allow you to configure your Raspberry Pi using cloud-init configuration files. The cloud-init configuration files should be placed in the bootfs or by editing the files in `stage2/04-cloud-init/files`. Cloud-init will be configured to read them on first boot. + A simple example for building Raspberry Pi OS: ```bash diff --git a/build.sh b/build.sh index 6be9466..efd5c4d 100755 --- a/build.sh +++ b/build.sh @@ -244,6 +244,8 @@ export QUILT_NO_DIFF_INDEX=1 export QUILT_NO_DIFF_TIMESTAMPS=1 export QUILT_REFRESH_ARGS="-p ab" +export ENABLE_CLOUD_INIT=${ENABLE_CLOUD_INIT:-1} + # shellcheck source=scripts/common source "${SCRIPT_DIR}/common" # shellcheck source=scripts/dependencies_check diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index be0e8cd..6da2876 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -26,14 +26,16 @@ if [ "${USE_QEMU}" = "1" ]; then echo "leaving QEMU mode" fi -on_chroot <