Compare commits

..

No commits in common. "f5e9a950bec8a8f72a8d01483c388976d3197222" and "8e30e7943412e949ca349b76192490c918c64e5f" have entirely different histories.

23 changed files with 57 additions and 77 deletions

3
.gitignore vendored
View File

@ -1,5 +1,8 @@
deploy/*
work/*
config
postrun.sh
SKIP
SKIP_IMAGES
.pc
*-pc

View File

@ -1,7 +1,7 @@
ARG BASE_IMAGE=debian:bullseye
FROM ${BASE_IMAGE}
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update && \
apt-get -y install --no-install-recommends \

View File

@ -423,7 +423,7 @@ work from a Raspberry Pi with a 64-bit capable processor (i.e. Raspberry Pi Zero
## `binfmt_misc`
Linux is able to execute binaries from other architectures, meaning that it should be
Linux is able 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
ARM binaries. This requires support from the [`binfmt_misc`](https://en.wikipedia.org/wiki/Binfmt_misc)
kernel module.
@ -443,7 +443,7 @@ To resolve this, ensure that the following files are available (install them if
```
/lib/modules/$(uname -r)/kernel/fs/binfmt_misc.ko
/usr/bin/qemu-aarch64-static
/usr/bin/qemu-arm-static
```
You may also need to load the module by hand - run `modprobe binfmt_misc`.

View File

@ -82,7 +82,16 @@ fi
# Modify original build-options to allow config file to be mounted in the docker container
BUILD_OPTS="$(echo "${BUILD_OPTS:-}" | sed -E 's@\-c\s?([^ ]+)@-c /config@')"
${DOCKER} build --build-arg BASE_IMAGE=debian:bookworm -t pi-gen "${DIR}"
# 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
x86_64|aarch64)
BASE_IMAGE=i386/debian:bullseye
;;
*)
BASE_IMAGE=debian:bullseye
;;
esac
${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}"
if [ "${CONTAINER_EXISTS}" != "" ]; then
DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont"
@ -105,10 +114,10 @@ case $(uname -m) in
;;
esac
# Check if qemu-aarch64-static and /proc/sys/fs/binfmt_misc are present
# Check if qemu-arm-static and /proc/sys/fs/binfmt_misc are present
if [[ "${binfmt_misc_required}" == "1" ]]; then
if ! qemu_arm=$(which qemu-aarch64-static) ; then
echo "qemu-aarch64-static not found (please install qemu-user-static)"
if ! qemu_arm=$(which qemu-arm-static) ; then
echo "qemu-arm-static not found (please install qemu-user-static)"
exit 1
fi
if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
@ -119,13 +128,13 @@ if [[ "${binfmt_misc_required}" == "1" ]]; then
fi
echo "binfmt_misc mounted"
fi
if ! grep -q "^interpreter ${qemu_arm}" /proc/sys/fs/binfmt_misc/qemu-aarch64* ; then
# Register qemu-aarch64 for binfmt_misc
reg="echo ':qemu-aarch64-rpi:M::"\
"\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:"\
if ! grep -q "^interpreter ${qemu_arm}" /proc/sys/fs/binfmt_misc/qemu-arm* ; then
# Register qemu-arm for binfmt_misc
reg="echo ':qemu-arm-rpi:M::"\
"\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:"\
"\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:"\
"${qemu_arm}:F' > /proc/sys/fs/binfmt_misc/register"
echo "Registering qemu-aarch64 for binfmt_misc..."
echo "Registering qemu-arm for binfmt_misc..."
sudo bash -c "${reg}" 2>/dev/null || true
fi
fi
@ -142,7 +151,7 @@ time ${DOCKER} run \
pi-gen \
bash -e -o pipefail -c "
dpkg-reconfigure qemu-user-static &&
# binfmt_misc is sometimes not mounted with debian bookworm image
# 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} &&
rsync -av work/*/build.log deploy/

View File

@ -175,7 +175,7 @@ export PI_GEN=${PI_GEN:-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 ARCH=arm64
export ARCH=armhf
export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh
export IMG_NAME="${IMG_NAME:-raspios-$RELEASE-$ARCH}"

15
config
View File

@ -1,15 +0,0 @@
IMG_NAME="showpieceos-bookworm-arm64"
PI_GEN_RELEASE="Showpiece OS Bookworm"
RELEASE="bookworm"
DEPLOY_COMPRESSION="none"
COMPRESSION_LEVEL=0
LOCALE_DEFAULT="en_US.UTF-8"
TARGET_HOSTNAME="showpiece"
KEYBOARD_KEYMAP="us"
KEYBOARD_LAYOUT="English (US)"
TIMEZONE_DEFAULT="America/Chicago"
FIRST_USER_NAME="pi"
FIRST_USER_PASS="letmein"
DISABLE_FIRST_BOOT_USER_RENAME=1
WPA_COUNTRY=US
ENABLE_SSH=0

View File

@ -1,15 +1,18 @@
{
"description": "NOOBS_DESCRIPTION",
"feature_level": 35120124,
"kernel": "KERNEL",
"name": "NOOBS_NAME",
"password": "raspberry",
"release_date": "UNRELEASED",
"supported_hex_revisions": "2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,19,1040,1041,0092,0093,2082",
"supported_models": [
"Pi Zero 2",
"Pi Model",
"Pi 2",
"Pi Zero",
"Pi 3",
"Pi 4",
"Pi Compute Module 3",
"Pi Compute Module 4"
"Pi 4"
],
"url": "http://www.raspbian.org/",
"username": "pi",

View File

@ -9,16 +9,15 @@ bootstrap(){
export http_proxy=${APT_PROXY}
BOOTSTRAP_ARGS+=(--arch arm64)
BOOTSTRAP_ARGS+=(--include gnupg)
BOOTSTRAP_ARGS+=(--arch armhf)
BOOTSTRAP_ARGS+=(--components "main,contrib,non-free")
#BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg")
BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg")
BOOTSTRAP_ARGS+=(--exclude=info,ifupdown)
BOOTSTRAP_ARGS+=(--include=ca-certificates)
BOOTSTRAP_ARGS+=("$@")
printf -v BOOTSTRAP_STR '%q ' "${BOOTSTRAP_ARGS[@]}"
capsh $CAPSH_ARG -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
setarch linux32 capsh $CAPSH_ARG -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then
cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}"
@ -101,7 +100,7 @@ on_chroot() {
mount -t tmpfs tmpfs "${ROOTFS_DIR}/tmp"
fi
capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@"
setarch linux32 capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@"
}
export -f on_chroot

View File

@ -1,7 +1,3 @@
deb http://deb.debian.org/debian RELEASE main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security/ RELEASE-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian RELEASE-updates main contrib non-free non-free-firmware
# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
#deb-src http://deb.debian.org/debian RELEASE main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian-security/ RELEASE-security main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian RELEASE-updates main contrib non-free non-free-firmware
deb [ arch=armhf ] http://raspbian.raspberrypi.com/raspbian/ RELEASE main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.com/raspbian/ RELEASE main contrib non-free rpi

View File

@ -1,6 +1,9 @@
initramfs-tools
raspi-firmware
linux-image-rpi-v6
linux-image-rpi-v7
linux-image-rpi-v7l
linux-image-rpi-v8
linux-image-rpi-2712
linux-headers-rpi-v8
linux-headers-rpi-2712
linux-headers-rpi-v6
linux-headers-rpi-v7
linux-headers-rpi-v7l

View File

@ -6,5 +6,5 @@ if [ "$RELEASE" != "bookworm" ]; then
fi
if [ ! -d "${ROOTFS_DIR}" ]; then
bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/
bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.com/raspbian/
fi

View File

@ -30,9 +30,6 @@ max_framebuffers=2
# Use the kernel's default instead.
disable_fw_kms_setup=1
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1

View File

@ -0,0 +1 @@
raspi-copies-and-fills

View File

@ -0,0 +1,6 @@
#!/bin/bash -e
if [ -f "${ROOTFS_DIR}/etc/ld.so.preload" ]; then
mv "${ROOTFS_DIR}/etc/ld.so.preload" "${ROOTFS_DIR}/etc/ld.so.preload.disabled"
fi

View File

@ -71,8 +71,8 @@ on_chroot << EOF
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure keyboard-configuration
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
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

View File

@ -1,4 +1,4 @@
gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
evince gtk2-engines alsa-utils
desktop-base
git
@ -10,8 +10,6 @@ firefox rpi-firefox-mods
gldriver-test
fonts-droid-fallback
fonts-liberation2
fonts-noto
fonts-noto-color-emoji
obconf
raindrop
libcamera-tools

View File

@ -1,8 +1,6 @@
xserver-xorg xinit
x11-xserver-utils
xserver-xorg-video-fbdev xserver-xorg xinit
mousepad
eom
vim
lxde lxtask menu-xdg
zenity xdg-utils
gvfs-backends gvfs-fuse

View File

@ -1,3 +0,0 @@
apt-transport-https
gnupg2
software-properties-common

View File

@ -1,7 +0,0 @@
#!/bin/bash
#change to "debian" if necessary:
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
$(lsb_release -cs) stable" | \
tee /etc/apt/sources.list.d/docker.list
apt update

View File

@ -1,3 +0,0 @@
docker-ce
docker-compose-plugin
cgroupfs-mount

View File

@ -1,5 +0,0 @@
#!/bin/bash
systemctl enable docker
systemctl start docker
gpasswd -a pi docker
newgrp docker

View File

View File