Compare commits
6 Commits
8e30e79434
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
2e5d13e1b9 | ||
|
f621f9e279 | ||
|
e071d0de36 | ||
|
fb5180d3de | ||
|
fc280356b1 | ||
|
ca08900c66 |
@@ -1,7 +1,7 @@
|
|||||||
ARG BASE_IMAGE=debian:bullseye
|
ARG BASE_IMAGE=debian:bullseye
|
||||||
FROM ${BASE_IMAGE}
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt-get -y update && \
|
RUN apt-get -y update && \
|
||||||
apt-get -y install --no-install-recommends \
|
apt-get -y install --no-install-recommends \
|
||||||
|
@@ -22,7 +22,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 arch-test
|
gpg pigz xxd arch-test bmap-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
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
|
||||||
@@ -423,7 +423,7 @@ work from a Raspberry Pi with a 64-bit capable processor (i.e. Raspberry Pi Zero
|
|||||||
|
|
||||||
## `binfmt_misc`
|
## `binfmt_misc`
|
||||||
|
|
||||||
Linux is able execute binaries from other architectures, meaning that it should be
|
Linux is able to execute binaries from other architectures, meaning that it should be
|
||||||
possible to make use of `pi-gen` on an x86_64 system, even though it will be running
|
possible to make use of `pi-gen` on an x86_64 system, even though it will be running
|
||||||
ARM binaries. This requires support from the [`binfmt_misc`](https://en.wikipedia.org/wiki/Binfmt_misc)
|
ARM binaries. This requires support from the [`binfmt_misc`](https://en.wikipedia.org/wiki/Binfmt_misc)
|
||||||
kernel module.
|
kernel module.
|
||||||
|
@@ -85,10 +85,10 @@ BUILD_OPTS="$(echo "${BUILD_OPTS:-}" | sed -E 's@\-c\s?([^ ]+)@-c /config@')"
|
|||||||
# Check the arch of the machine we're running on. If it's 64-bit, use a 32-bit base image instead
|
# Check the arch of the machine we're running on. If it's 64-bit, use a 32-bit base image instead
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
x86_64|aarch64)
|
x86_64|aarch64)
|
||||||
BASE_IMAGE=i386/debian:bullseye
|
BASE_IMAGE=i386/debian:bookworm
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
BASE_IMAGE=debian:bullseye
|
BASE_IMAGE=debian:bookworm
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}"
|
${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}"
|
||||||
@@ -151,7 +151,7 @@ time ${DOCKER} run \
|
|||||||
pi-gen \
|
pi-gen \
|
||||||
bash -e -o pipefail -c "
|
bash -e -o pipefail -c "
|
||||||
dpkg-reconfigure qemu-user-static &&
|
dpkg-reconfigure qemu-user-static &&
|
||||||
# binfmt_misc is sometimes not mounted with debian bullseye image
|
# binfmt_misc is sometimes not mounted with debian bookworm image
|
||||||
(mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc || true) &&
|
(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/
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||||
INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info"
|
INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info"
|
||||||
SBOM_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.sbom"
|
SBOM_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.sbom"
|
||||||
|
BMAP_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.bmap"
|
||||||
|
|
||||||
on_chroot << EOF
|
on_chroot << EOF
|
||||||
update-initramfs -k all -c
|
update-initramfs -k all -c
|
||||||
@@ -100,6 +101,12 @@ zerofree "${ROOT_DEV}"
|
|||||||
|
|
||||||
unmount_image "${IMG_FILE}"
|
unmount_image "${IMG_FILE}"
|
||||||
|
|
||||||
|
if hash bmaptool 2>/dev/null; then
|
||||||
|
bmaptool create \
|
||||||
|
-o "${BMAP_FILE}" \
|
||||||
|
"${IMG_FILE}"
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "${DEPLOY_DIR}"
|
mkdir -p "${DEPLOY_DIR}"
|
||||||
|
|
||||||
rm -f "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.*"
|
rm -f "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.*"
|
||||||
@@ -128,4 +135,7 @@ esac
|
|||||||
if [ -f "${SBOM_FILE}" ]; then
|
if [ -f "${SBOM_FILE}" ]; then
|
||||||
xz -c "${SBOM_FILE}" > "$DEPLOY_DIR/image_$(basename "${SBOM_FILE}").xz"
|
xz -c "${SBOM_FILE}" > "$DEPLOY_DIR/image_$(basename "${SBOM_FILE}").xz"
|
||||||
fi
|
fi
|
||||||
|
if [ -f "${BMAP_FILE}" ]; then
|
||||||
|
xz -c "${BMAP_FILE}" > "$DEPLOY_DIR/image_$(basename "${BMAP_FILE}").xz"
|
||||||
|
fi
|
||||||
cp "$INFO_FILE" "$DEPLOY_DIR/"
|
cp "$INFO_FILE" "$DEPLOY_DIR/"
|
||||||
|
@@ -13,7 +13,7 @@ BOOT_SIZE="$((512 * 1024 * 1024))"
|
|||||||
ROOT_SIZE=$(du -x --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --exclude boot/firmware --block-size=1 | cut -f 1)
|
ROOT_SIZE=$(du -x --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --exclude boot/firmware --block-size=1 | cut -f 1)
|
||||||
|
|
||||||
# All partition sizes and starts will be aligned to this size
|
# All partition sizes and starts will be aligned to this size
|
||||||
ALIGN="$((4 * 1024 * 1024))"
|
ALIGN="$((8 * 1024 * 1024))"
|
||||||
# Add this much space to the calculated file size. This allows for
|
# Add this much space to the calculated file size. This allows for
|
||||||
# some overhead (since actual space usage is usually rounded up to the
|
# some overhead (since actual space usage is usually rounded up to the
|
||||||
# filesystem block size) and gives some free space on the resulting
|
# filesystem block size) and gives some free space on the resulting
|
||||||
|
@@ -71,8 +71,8 @@ on_chroot << EOF
|
|||||||
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure keyboard-configuration
|
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure keyboard-configuration
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sed -i 's/^#?Storage=.*/Storage=volatile/' "${ROOTFS_DIR}/etc/systemd/journald.conf"
|
sed -i 's/^#\?Storage=.*/Storage=volatile/' "${ROOTFS_DIR}/etc/systemd/journald.conf"
|
||||||
|
|
||||||
if [ -e "${ROOTFS_DIR}/etc/avahi/avahi-daemon.conf" ]; then
|
if [ -e "${ROOTFS_DIR}/etc/avahi/avahi-daemon.conf" ]; then
|
||||||
sed -i 's/^#?publish-workstation=.*/publish-workstation=yes/' "${ROOTFS_DIR}/etc/avahi/avahi-daemon.conf"
|
sed -i 's/^#\?publish-workstation=.*/publish-workstation=yes/' "${ROOTFS_DIR}/etc/avahi/avahi-daemon.conf"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user