Merge branch 'master' into arm64

This commit is contained in:
Serge Schneider 2024-05-13 16:28:00 +01:00
commit 2327c5e28d
4 changed files with 17 additions and 10 deletions

View File

@ -8,7 +8,7 @@ RUN apt-get -y update && \
git vim parted \ git vim parted \
quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \ quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \
libarchive-tools libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc \ libarchive-tools libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc \
binfmt-support ca-certificates fdisk gpg pigz\ binfmt-support ca-certificates fdisk gpg pigz arch-test \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY . /pi-gen/ COPY . /pi-gen/

View File

@ -19,7 +19,7 @@ To install the required dependencies for `pi-gen` you should run:
```bash ```bash
apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \ apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \
dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \ dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \
gpg pigz xxd gpg pigz xxd arch-test
``` ```
The file `depends` contains a list of tools needed. The format of this The file `depends` contains a list of tools needed. The format of this
@ -52,7 +52,7 @@ environment variables.
The following environment variables are supported: The following environment variables are supported:
* `IMG_NAME` **required** (Default: unset) * `IMG_NAME` (Default: raspios-$RELEASE-$ARCH, for example: "raspios-bookworm-armhf")
The name of the image to build with the current stage directories. Use this The name of the image to build with the current stage directories. Use this
variable to set the root name of your OS, eg `IMG_NAME=Frobulator`. variable to set the root name of your OS, eg `IMG_NAME=Frobulator`.

View File

@ -167,10 +167,9 @@ export PI_GEN=${PI_GEN:-pi-gen}
export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen} export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen}
export PI_GEN_RELEASE=${PI_GEN_RELEASE:-Raspberry Pi reference} export PI_GEN_RELEASE=${PI_GEN_RELEASE:-Raspberry Pi reference}
if [ -z "${IMG_NAME}" ]; then export ARCH=armhf
echo "IMG_NAME not set" 1>&2 export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh
exit 1 export IMG_NAME="${IMG_NAME:-raspios-$RELEASE-$ARCH}"
fi
export USE_QEMU="${USE_QEMU:-0}" export USE_QEMU="${USE_QEMU:-0}"
export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}" export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}"
@ -198,7 +197,6 @@ export TARGET_HOSTNAME=${TARGET_HOSTNAME:-raspberrypi}
export FIRST_USER_NAME=${FIRST_USER_NAME:-pi} export FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
export FIRST_USER_PASS export FIRST_USER_PASS
export DISABLE_FIRST_BOOT_USER_RENAME=${DISABLE_FIRST_BOOT_USER_RENAME:-0} export DISABLE_FIRST_BOOT_USER_RENAME=${DISABLE_FIRST_BOOT_USER_RENAME:-0}
export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh
export WPA_COUNTRY export WPA_COUNTRY
export ENABLE_SSH="${ENABLE_SSH:-0}" export ENABLE_SSH="${ENABLE_SSH:-0}"
export PUBKEY_ONLY_SSH="${PUBKEY_ONLY_SSH:-0}" export PUBKEY_ONLY_SSH="${PUBKEY_ONLY_SSH:-0}"
@ -215,7 +213,6 @@ export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
export PUBKEY_SSH_FIRST_USER export PUBKEY_SSH_FIRST_USER
export CLEAN export CLEAN
export IMG_NAME
export APT_PROXY export APT_PROXY
export STAGE export STAGE
@ -247,6 +244,15 @@ fi
dependencies_check "${BASE_DIR}/depends" dependencies_check "${BASE_DIR}/depends"
echo "Checking native $ARCH executable support..."
if ! arch-test -n "$ARCH"; then
echo "WARNING: Only a native build environment is supported. Checking emulated support..."
if ! arch-test "$ARCH"; then
echo "No fallback mechanism found. Ensure your OS has binfmt_misc support enabled and configured."
exit 1
fi
fi
#check username is valid #check username is valid
if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then
echo "Invalid FIRST_USER_NAME: $FIRST_USER_NAME" echo "Invalid FIRST_USER_NAME: $FIRST_USER_NAME"

View File

@ -19,3 +19,4 @@ lsmod:kmod
bc bc
gpg gpg
pigz pigz
arch-test