Merge branch 'master' into arm64

This commit is contained in:
Serge Schneider 2022-02-02 14:26:31 +00:00
commit 2b3ba5b2a6
5 changed files with 42 additions and 11 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 qemu-utils kpartx \ binfmt-support ca-certificates qemu-utils kpartx fdisk gpg \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY . /pi-gen/ COPY . /pi-gen/

View file

@ -15,12 +15,30 @@ 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 \
qemu-utils kpartx qemu-utils kpartx gpg
``` ```
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
package is `<tool>[:<debian-package>]`. package is `<tool>[:<debian-package>]`.
## Getting started with building your images
Getting started is as simple as cloning this repository on your build machine. You
can do so with:
```bash
git clone -depth 1 https://github.com/RPI-Distro/pi-gen.git
```
Using `--depth 1` with `git clone` will create a shallow clone, only containing
the latest revision of the repository. Do not do this on your development machine.
Also, be careful to clone the repository to a base path **NOT** containing spaces.
This configuration is not supported by debootstrap and will lead to `pi-gen` not
running.
After cloning the repository, you can move to the next step and start configuring
your build.
## Config ## Config

View file

@ -98,6 +98,8 @@ if [ "${CONTAINER_EXISTS}" != "" ]; then
--volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \ --volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \
pi-gen \ pi-gen \
bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static &&
# binfmt_misc is sometimes not mounted with debian bullseye image
(mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc || true) &&
cd /pi-gen; ./build.sh ${BUILD_OPTS} && cd /pi-gen; ./build.sh ${BUILD_OPTS} &&
rsync -av work/*/build.log deploy/" & rsync -av work/*/build.log deploy/" &
wait "$!" wait "$!"
@ -112,6 +114,8 @@ else
-e "GIT_HASH=${GIT_HASH}" \ -e "GIT_HASH=${GIT_HASH}" \
pi-gen \ pi-gen \
bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static &&
# binfmt_misc is sometimes not mounted with debian bullseye image
(mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc || true) &&
cd /pi-gen; ./build.sh ${BUILD_OPTS} && cd /pi-gen; ./build.sh ${BUILD_OPTS} &&
rsync -av work/*/build.log deploy/" & rsync -av work/*/build.log deploy/" &
wait "$!" wait "$!"

View file

@ -155,6 +155,14 @@ if [ "$(id -u)" != "0" ]; then
fi fi
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ $BASE_DIR = *" "* ]]; then
echo "There is a space in the base path of pi-gen"
echo "This is not a valid setup supported by debootstrap."
echo "Please remove the spaces, or move pi-gen directory to a base path without spaces" 1>&2
exit 1
fi
export BASE_DIR export BASE_DIR
if [ -f config ]; then if [ -f config ]; then

View file

@ -19,3 +19,4 @@ lsmod:kmod
bc bc
qemu-nbd:qemu-utils qemu-nbd:qemu-utils
kpartx kpartx
gpg