Merge pull request #4 from nathanael-h/yunohost-bullseye

Yunohost bullseye
This commit is contained in:
ljf (zamentur) 2022-07-18 16:29:47 +02:00 committed by GitHub
commit 5304de9929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 28 additions and 37 deletions

View file

@ -9,6 +9,7 @@ RUN apt-get -y update && \
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 fdisk gpg pigz\ binfmt-support ca-certificates qemu-utils kpartx fdisk gpg pigz\
procps lsof\
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY . /pi-gen/ COPY . /pi-gen/

View file

@ -75,16 +75,7 @@ fi
# Modify original build-options to allow config file to be mounted in the docker container # 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@')" 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 ${DOCKER} build --build-arg BASE_IMAGE=debian:bullseye -t pi-gen "${DIR}"
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 if [ "${CONTAINER_EXISTS}" != "" ]; then
trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}_cont' SIGINT SIGTERM trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}_cont' SIGINT SIGTERM

4
config
View file

@ -1,6 +1,6 @@
IMG_NAME="yunohost" IMG_NAME="yunohost"
RELEASE="buster" RELEASE="bullseye"
USE_QEMU="1" USE_QEMU="0"
LOCALE_DEFAULT="en_US.UTF-8" LOCALE_DEFAULT="en_US.UTF-8"
TARGET_HOSTNAME="yunohost" TARGET_HOSTNAME="yunohost"
KEYBOARD_KEYMAP="us" KEYBOARD_KEYMAP="us"

View file

@ -1,18 +1,15 @@
{ {
"description": "NOOBS_DESCRIPTION", "description": "NOOBS_DESCRIPTION",
"feature_level": 35120124,
"kernel": "KERNEL", "kernel": "KERNEL",
"name": "NOOBS_NAME", "name": "NOOBS_NAME",
"password": "raspberry", "password": "raspberry",
"release_date": "UNRELEASED", "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": [ "supported_models": [
"Pi Model", "Pi Zero 2",
"Pi 2",
"Pi Zero",
"Pi 3", "Pi 3",
"Pi 4",
"Pi Compute Module 3", "Pi Compute Module 3",
"Pi 4" "Pi Compute Module 4"
], ],
"url": "http://www.raspbian.org/", "url": "http://www.raspbian.org/",
"username": "pi", "username": "pi",

View file

@ -9,15 +9,16 @@ bootstrap(){
export http_proxy=${APT_PROXY} export http_proxy=${APT_PROXY}
BOOTSTRAP_ARGS+=(--arch armhf) BOOTSTRAP_ARGS+=(--arch arm64)
BOOTSTRAP_ARGS+=(--include gnupg)
BOOTSTRAP_ARGS+=(--components "main,contrib,non-free") 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) BOOTSTRAP_ARGS+=(--exclude=info)
BOOTSTRAP_ARGS+=(--include=ca-certificates) BOOTSTRAP_ARGS+=(--include=ca-certificates)
BOOTSTRAP_ARGS+=("$@") BOOTSTRAP_ARGS+=("$@")
printf -v BOOTSTRAP_STR '%q ' "${BOOTSTRAP_ARGS[@]}" printf -v BOOTSTRAP_STR '%q ' "${BOOTSTRAP_ARGS[@]}"
setarch linux32 capsh --drop=cap_setfcap -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true capsh --drop=cap_setfcap -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then
cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}" cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}"
@ -90,7 +91,7 @@ on_chroot() {
mount --bind /sys "${ROOTFS_DIR}/sys" mount --bind /sys "${ROOTFS_DIR}/sys"
fi fi
setarch linux32 capsh --drop=cap_setfcap "--chroot=${ROOTFS_DIR}/" -- -e "$@" capsh --drop=cap_setfcap "--chroot=${ROOTFS_DIR}/" -- -e "$@"
} }
export -f on_chroot export -f on_chroot

View file

@ -14,6 +14,7 @@ fi
cat files/raspberrypi.gpg.key | gpg --dearmor > "${ROOTFS_DIR}/etc/apt/trusted.gpg.d/raspberrypi-archive-stable.gpg" cat files/raspberrypi.gpg.key | gpg --dearmor > "${ROOTFS_DIR}/etc/apt/trusted.gpg.d/raspberrypi-archive-stable.gpg"
on_chroot << EOF on_chroot << EOF
dpkg --add-architecture armhf
apt-get update apt-get update
apt-get dist-upgrade -y apt-get dist-upgrade -y
EOF EOF

View file

@ -1,3 +1,7 @@
deb http://raspbian.raspberrypi.org/raspbian/ RELEASE main contrib non-free rpi deb http://deb.debian.org/debian RELEASE main contrib non-free
# Uncomment line below then 'apt-get update' to enable 'apt-get source' deb http://security.debian.org/debian-security RELEASE-security main contrib non-free
#deb-src http://raspbian.raspberrypi.org/raspbian/ RELEASE main contrib non-free rpi deb http://deb.debian.org/debian RELEASE-updates main contrib non-free
# 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
#deb-src http://security.debian.org/debian-security RELEASE-security main contrib non-free
#deb-src http://deb.debian.org/debian RELEASE-updates main contrib non-free

View file

@ -1,5 +1,5 @@
#!/bin/bash -e #!/bin/bash -e
if [ ! -d "${ROOTFS_DIR}" ] || [ "${USE_QCOW2}" = "1" ]; then if [ ! -d "${ROOTFS_DIR}" ] || [ "${USE_QCOW2}" = "1" ]; then
bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/
fi fi

View file

@ -62,6 +62,9 @@ display_auto_detect=1
dtoverlay=vc4-kms-v3d dtoverlay=vc4-kms-v3d
max_framebuffers=2 max_framebuffers=2
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan # Disable compensation for displays with overscan
disable_overscan=1 disable_overscan=1

View file

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

View file

@ -1,6 +0,0 @@
#!/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

@ -60,7 +60,7 @@ EOF
# the rootfs/image after that ? # the rootfs/image after that ?
while lsof 2>/dev/null | grep -q /root/rpi-image/work/*/export-image/rootfs/dev; while lsof 2>/dev/null | grep -q /root/rpi-image/work/*/export-image/rootfs/dev;
do do
for PID in `ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'` for PID in `ps -ef --forest | grep "qemu-binfmt" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'`
do do
echo "Killing $PID" echo "Killing $PID"
kill -9 $PID || true kill -9 $PID || true
@ -68,13 +68,13 @@ do
done done
sleep 5 sleep 5
done done
while ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" while ps -ef --forest | grep "qemu-binfmt" | grep -v "grep"
do do
for PID in `ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'` for PID in `ps -ef --forest | grep "qemu-binfmt" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'`
do do
echo "Killing $PID" echo "Killing $PID"
kill -9 $PID || true kill -9 $PID || true
sleep 1 sleep 1
done done
sleep 5 sleep 5
done done