build.sh: Warn user of unsupported build environment architecture and fail early if binfmt_misc isn't working as expected
This commit is contained in:
parent
e95e00f879
commit
d87f764fcb
@ -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/
|
||||||
|
@ -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
|
||||||
|
9
build.sh
9
build.sh
@ -244,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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user