From 05081aa0c4d3faf482cc22a88c5dd11364907aa5 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 8 Feb 2023 18:46:32 +0000 Subject: [PATCH 01/57] Fix apt gpg key install --- stage0/00-configure-apt/00-run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index 4d0ac92121..6494a03d05 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -12,7 +12,8 @@ else rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" 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 > "${STAGE_WORK_DIR}/raspberrypi-archive-stable.gpg" +install -m 644 "${STAGE_WORK_DIR}/raspberrypi-archive-stable.gpg" "${ROOTFS_DIR}/etc/apt/trusted.gpg.d/" on_chroot << EOF apt-get update apt-get dist-upgrade -y From 5d2c6f31cefc7710e3bbc44012b9ffb843294e34 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 14 Feb 2023 15:09:53 +0000 Subject: [PATCH 02/57] export-image: change boot partition lable to 'bootfs' Fixes #669 --- export-image/prerun.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index c3412c255f..2d8e1bbe27 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -55,7 +55,7 @@ if [ "${NO_PRERUN_QCOW2}" = "0" ]; then ROOT_FEATURES="^$FEATURE,$ROOT_FEATURES" fi done - mkdosfs -n boot -F 32 -s 4 -v "$BOOT_DEV" > /dev/null + mkdosfs -n bootfs -F 32 -s 4 -v "$BOOT_DEV" > /dev/null mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4 From f2d385517c9631f2ded876deb1115725d0c75995 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 14 Feb 2023 15:26:12 +0000 Subject: [PATCH 03/57] Update release notes --- export-noobs/00-release/files/release_notes.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 3e6650dbeb..c6948280c0 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,5 +1,16 @@ UNRELEASED: + * glamor now disabled on all platforms other than Raspberry Pi 4 with legacy video driver + * msdri3 video driver support added + * KiCad added to Recommended Software + * Support for new touchscreen driver added to Screen Resolution tool; minor UI tweaks + * GTK message dialogs shown with right-justified buttons + * Bug fix - updater plugin now does not clear icon when an update has failed + * Bug fix - keyboard highlight now shown on GTK switch control + * Some Korean and Brazilian translations added + * Fix rpi-imager hidden ssid configuration * Install kms++-utils + * Raspberry Pi firmware 78852e166b4cf3ebb31d051e996d54792f0994b0 + * Linux kernel 5.15.84 2022-09-22: * NodeRED removed from Recommended Software and full image - should only be installed via apt * Improved speed of startup of lxpanel network controller plugins From 60c9ba3199038acfc476a54f7a9d69e268bb9873 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 9 Mar 2023 15:12:33 +0000 Subject: [PATCH 04/57] Re-enable wolfram-engine on arm64 --- stage5/00-install-extras/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage5/00-install-extras/00-packages b/stage5/00-install-extras/00-packages index 76bf5a19f0..6350ab31f2 100644 --- a/stage5/00-install-extras/00-packages +++ b/stage5/00-install-extras/00-packages @@ -5,7 +5,7 @@ smartsim python3-sense-emu sense-emu-tools python-sense-emu-doc -#wolfram-engine +wolfram-engine claws-mail greenfoot-unbundled bluej-unbundled realvnc-vnc-viewer From cf40e4b299ca4023f842eed1ecc5b254eb3eb688 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 27 Mar 2023 16:30:34 +0300 Subject: [PATCH 05/57] Check that docker is not set up in rootless mode (#679) Mounting binfmt_misc inside the container requires root rights. If "docker info" indicates rootless mode then fall back to "sudo docker". Allow the user to override the docker command with the DOCKER by setting the environment variable. --- build-docker.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index a7f18f136f..b3995d53b0 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -4,10 +4,15 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" BUILD_OPTS="$*" -DOCKER="docker" - -if ! ${DOCKER} ps >/dev/null 2>&1; then - DOCKER="sudo docker" +# Allow user to override docker command +DOCKER=${DOCKER:-docker} + +# Ensure that default docker command is not set up in rootless mode +if \ + ! ${DOCKER} ps >/dev/null 2>&1 || \ + ${DOCKER} info 2>/dev/null | grep -q rootless \ +; then + DOCKER="sudo ${DOCKER}" fi if ! ${DOCKER} ps >/dev/null; then echo "error connecting to docker:" From 0db41e35efc3ebee7c334e11ae8d91607ef5931a Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 27 Mar 2023 16:31:02 +0300 Subject: [PATCH 06/57] Ensure that deploy is always owned by user (#680) Switch "docker cp" to tar streaming mode. As the receiving "tar" command is executed outside Docker the resulting directories & files are owned by the calling user. --- build-docker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-docker.sh b/build-docker.sh index b3995d53b0..413c12a69f 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -126,8 +126,9 @@ else wait "$!" fi +# Ensure that deploy/ is always owned by calling user echo "copying results from deploy/" -${DOCKER} cp "${CONTAINER_NAME}":/pi-gen/deploy . +${DOCKER} cp "${CONTAINER_NAME}":/pi-gen/deploy - | tar -xf - ls -lah deploy # cleanup From 3e8046da4cd3f1b7ff51ab003e4fce8001b70d85 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 27 Mar 2023 18:02:46 +0300 Subject: [PATCH 07/57] Update qemu ARM binary name in README.md (#684) When running a 64 bit build you need the QEMU aarch64 binary installed on the host system. Fixes #678 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7beb1f473..19c2615391 100644 --- a/README.md +++ b/README.md @@ -531,7 +531,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-arm-static +/usr/bin/qemu-aarch64-static ``` You may also need to load the module by hand - run `modprobe binfmt_misc`. From b8437a77ba9e52ae23ee80414198d5d92f2babf5 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 28 Mar 2023 13:53:54 +0300 Subject: [PATCH 08/57] DRY removal for docker run command line (#686) Factor out the differences into variables so that there is only one implementation of the "docker run" command line to maintain. --- build-docker.sh | 65 ++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index 413c12a69f..01b9f8e98c 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -92,40 +92,43 @@ esac ${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}" if [ "${CONTAINER_EXISTS}" != "" ]; then - trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}_cont' SIGINT SIGTERM - time ${DOCKER} run --rm --privileged \ - --cap-add=ALL \ - -v /dev:/dev \ - -v /lib/modules:/lib/modules \ - ${PIGEN_DOCKER_OPTS} \ - --volume "${CONFIG_FILE}":/config:ro \ - -e "GIT_HASH=${GIT_HASH}" \ - --volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \ - pi-gen \ - 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} && - rsync -av work/*/build.log deploy/" & - wait "$!" + DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont" + DOCKER_CMDLINE_PRE=( \ + --rm \ + ) + DOCKER_CMDLINE_POST=( \ + --volumes-from="${CONTAINER_NAME}" \ + ) else - trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}' SIGINT SIGTERM - time ${DOCKER} run --name "${CONTAINER_NAME}" --privileged \ - --cap-add=ALL \ - -v /dev:/dev \ - -v /lib/modules:/lib/modules \ - ${PIGEN_DOCKER_OPTS} \ - --volume "${CONFIG_FILE}":/config:ro \ - -e "GIT_HASH=${GIT_HASH}" \ - pi-gen \ - 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} && - rsync -av work/*/build.log deploy/" & - wait "$!" + DOCKER_CMDLINE_NAME="${CONTAINER_NAME}" + DOCKER_CMDLINE_PRE=( \ + ) + DOCKER_CMDLINE_POST=( \ + ) fi +trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${DOCKER_CMDLINE_NAME}' SIGINT SIGTERM +time ${DOCKER} run \ + "${DOCKER_CMDLINE_PRE[@]}" \ + --name "${DOCKER_CMDLINE_NAME}" \ + --privileged \ + --cap-add=ALL \ + -v /dev:/dev \ + -v /lib/modules:/lib/modules \ + ${PIGEN_DOCKER_OPTS} \ + --volume "${CONFIG_FILE}":/config:ro \ + -e "GIT_HASH=${GIT_HASH}" \ + "${DOCKER_CMDLINE_POST[@]}" \ + pi-gen \ + 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} && + rsync -av work/*/build.log deploy/ + " & + wait "$!" + # Ensure that deploy/ is always owned by calling user echo "copying results from deploy/" ${DOCKER} cp "${CONTAINER_NAME}":/pi-gen/deploy - | tar -xf - From 4e9275398278c4cab8ba68f3d9ca54ab97b73922 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 29 Mar 2023 07:55:37 +0100 Subject: [PATCH 09/57] Use tmpfs for chroot /run and /tmp --- scripts/common | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/common b/scripts/common index 82bd726d6a..5731b72fa6 100644 --- a/scripts/common +++ b/scripts/common @@ -86,6 +86,14 @@ on_chroot() { mount --bind /sys "${ROOTFS_DIR}/sys" fi + if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/run)"; then + mount -t tmpfs tmpfs "${ROOTFS_DIR}/run" + fi + + if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/tmp)"; then + mount -t tmpfs tmpfs "${ROOTFS_DIR}/tmp" + fi + setarch linux32 capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@" } export -f on_chroot From 6dc45a80e764eacd6e311c32164b623bbe7f8e08 Mon Sep 17 00:00:00 2001 From: Mohsen Tahmasebi Date: Mon, 3 Apr 2023 11:57:59 +0330 Subject: [PATCH 10/57] Register binfmt_misc entry for docker build (#685) --- build-docker.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/build-docker.sh b/build-docker.sh index 01b9f8e98c..5495dfaaea 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -107,6 +107,40 @@ else ) fi +# Check if binfmt_misc is required +binfmt_misc_required=1 +case $(uname -m) in + aarch64) + binfmt_misc_required=0 + ;; + arm*) + binfmt_misc_required=0 + ;; +esac + +# Check if qemu-arm-static and /proc/sys/fs/binfmt_misc are present +if [[ "${binfmt_misc_required}" == "1" ]]; then + 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 + echo "binfmt_misc required but not mounted, trying to mount it..." + if ! mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc ; then + echo "mounting binfmt_misc failed" + exit 1 + fi + echo "binfmt_misc mounted" + fi + # Register qemu-arm for binfmt_misc (binfmt_misc won't care duplicate entries unless they have common names) + 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-arm for binfmt_misc..." + sudo bash -c "$reg" 2>/dev/null || true +fi + trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${DOCKER_CMDLINE_NAME}' SIGINT SIGTERM time ${DOCKER} run \ "${DOCKER_CMDLINE_PRE[@]}" \ From 9249e146d2e3987adf2ea0e5e19e295d37f3f886 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 3 Apr 2023 12:08:50 +0300 Subject: [PATCH 11/57] Copy container log to deploy (#688) The container log is much more detailed than the default build.log, which makes life much easier for a build maintainer. Before deleting the container copy the log out to the deploy/ directory. --- build-docker.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-docker.sh b/build-docker.sh index 5495dfaaea..7d0b5ad9c7 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -166,6 +166,10 @@ time ${DOCKER} run \ # Ensure that deploy/ is always owned by calling user echo "copying results from deploy/" ${DOCKER} cp "${CONTAINER_NAME}":/pi-gen/deploy - | tar -xf - + +echo "copying log from container ${CONTAINER_NAME} to depoy/" +${DOCKER} logs --timestamps "${CONTAINER_NAME}" &>deploy/build-docker.log + ls -lah deploy # cleanup From 47eee1f0ddcf8811559d51eea1c1bb48335e3e88 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 25 Apr 2023 15:44:14 +0100 Subject: [PATCH 12/57] Update release notes --- .../00-release/files/release_notes.txt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index c6948280c0..7ec34fde2c 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,4 +1,37 @@ UNRELEASED: + * 64-bit Mathematica added to rp-prefapps + * Bug fix - occasional segfault in CPU temperature plugin + * Bug fix - X server crash when changing screen orientation + * Bug fix - X server DPMS not working + * Mathematica updated to 13.2.1 + * Matlab updated to 23.1.0 + * Chromium updated to 113.0.5672.59 + * Raspberry Pi Imager updated to 1.7.4 + * RealVNC server updated to 7.0.1.49073 + * RealVNC viewer updated to 7.0.1.48981 + * Updated VLC HW acceleration patch + * libcamera + - Add generalised statistics handling. + - Fix overflow that would cause incorrect calculations in the AGC algorithm. + - Improve IMX296 sensor tuning. + * libcamera-apps + - Improve handling of audio resampling and encoding using libav + - Improve performance of QT preview window rendering + - Add support for 16-bit Bayer in the DNG writer + - Fix for encoder lockup when framerate is set to 0 + - Improved thumbnail rendering + * picamera2 + - MJPEG server example that uses the hardware MJPEG encoder. + - Example showing preview from two cameras in a single Qt app. + - H264 encoder accepts frame time interval for SPS headers. + - H264 encoder should advertise correct profile/level. + - H264 encoder supports constant quality parameter. + - Exif DateTime and DateTimeOriginal tags are now added. + - Various bug fixes (check Picamera2 release notes for more details). + * Some translations added + * Raspberry Pi firmware 055e044d5359ded1aacc5a17a8e35365373d0b8b + * Linux kernel 6.1.21 +2023-02-21: * glamor now disabled on all platforms other than Raspberry Pi 4 with legacy video driver * msdri3 video driver support added * KiCad added to Recommended Software From 7c750947a959fb626a70c09fd17c65815df192ac Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 2 Dec 2021 12:37:19 +0000 Subject: [PATCH 13/57] Update chromium install --- stage3/00-install-packages/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 6a1208666a..9ee260aead 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -5,7 +5,7 @@ git policykit-1 gvfs rfkill -chromium-browser rpi-chromium-mods +chromium-browser rpi-chromium-mods libwidevinecdm0 gldriver-test fonts-droid-fallback fonts-liberation2 From 01d24ef22778337ed04cf9d6444b1be57b6a1e1a Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 9 May 2023 16:24:49 +0300 Subject: [PATCH 14/57] Skip binfmt_misc register when unnecessary (#693) This improves commit 6dc45a80e764eacd6e311c32164b623bbe7f8e08 Check if interpreter is already registered before running the register step. This avoids unnecessary "sudo" execution which may require user interaction for the password. Improves on #685 --- build-docker.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index 7d0b5ad9c7..4fdd89c090 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -132,13 +132,15 @@ if [[ "${binfmt_misc_required}" == "1" ]]; then fi echo "binfmt_misc mounted" fi - # Register qemu-arm for binfmt_misc (binfmt_misc won't care duplicate entries unless they have common names) - reg="echo ':qemu-arm-rpi:M::"\ + 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-arm for binfmt_misc..." - sudo bash -c "$reg" 2>/dev/null || true +"${qemu_arm}:F' > /proc/sys/fs/binfmt_misc/register" + echo "Registering qemu-arm for binfmt_misc..." + sudo bash -c "${reg}" 2>/dev/null || true + fi fi trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${DOCKER_CMDLINE_NAME}' SIGINT SIGTERM From a86d732f58c901c80a5422d43e24ce37037e2665 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 9 May 2023 16:27:36 +0300 Subject: [PATCH 15/57] Register aarch64 in binfmt misc (#694) This modifies commit 6dc45a80e764eacd6e311c32164b623bbe7f8e08 for the arm64 branch. For 64-bit builds we need to register qemu-aarch64-static instead. Improves on #685 --- build-docker.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index d28b6876e6..38ae9ca501 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -109,10 +109,10 @@ case $(uname -m) in ;; esac -# Check if qemu-arm-static and /proc/sys/fs/binfmt_misc are present +# Check if qemu-aarch64-static and /proc/sys/fs/binfmt_misc are present if [[ "${binfmt_misc_required}" == "1" ]]; then - if ! qemu_arm=$(which qemu-arm-static) ; then - echo "qemu-arm-static not found (please install qemu-user-static)" + if ! qemu_arm=$(which qemu-aarch64-static) ; then + echo "qemu-aarch64-static not found (please install qemu-user-static)" exit 1 fi if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then @@ -123,13 +123,15 @@ if [[ "${binfmt_misc_required}" == "1" ]]; then fi echo "binfmt_misc mounted" fi - # Register qemu-arm for binfmt_misc (binfmt_misc won't care duplicate entries unless they have common names) - reg="echo ':qemu-arm-rpi:M::"\ -"\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:"\ + 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:"\ "\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-arm for binfmt_misc..." - sudo bash -c "$reg" 2>/dev/null || true +"${qemu_arm}:F' > /proc/sys/fs/binfmt_misc/register" + echo "Registering qemu-aarch64 for binfmt_misc..." + sudo bash -c "${reg}" 2>/dev/null || true + fi fi trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${DOCKER_CMDLINE_NAME}' SIGINT SIGTERM From 446f3e34c8ceb33dfe7bd38578f1cd6b6afe19da Mon Sep 17 00:00:00 2001 From: bamartin125 Date: Thu, 17 Aug 2023 10:24:47 -0500 Subject: [PATCH 16/57] Adds call to mknod if loop dev does not exist after call to `losetup -f` (#483) --- export-image/prerun.sh | 2 +- export-noobs/prerun.sh | 2 +- scripts/common | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 2d8e1bbe27..267bbe0322 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -35,7 +35,7 @@ if [ "${NO_PRERUN_QCOW2}" = "0" ]; then echo "Creating loop device..." cnt=0 - until LOOP_DEV="$(losetup --show --find --partscan "$IMG_FILE")"; do + until ensure_next_loopdev && LOOP_DEV="$(losetup --show --find --partscan "$IMG_FILE")"; do if [ $cnt -lt 5 ]; then cnt=$((cnt + 1)) echo "Error in losetup. Retrying..." diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index 3858c66193..62828368cb 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -11,7 +11,7 @@ rm -rf "${NOOBS_DIR}" echo "Creating loop device..." cnt=0 -until LOOP_DEV="$(losetup --show --find --partscan "$IMG_FILE")"; do +until ensure_next_loopdev && LOOP_DEV="$(losetup --show --find --partscan "$IMG_FILE")"; do if [ $cnt -lt 5 ]; then cnt=$((cnt + 1)) echo "Error in losetup. Retrying..." diff --git a/scripts/common b/scripts/common index 5731b72fa6..c94b0f0abb 100644 --- a/scripts/common +++ b/scripts/common @@ -102,3 +102,11 @@ update_issue() { echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue" } export -f update_issue + +ensure_next_loopdev() { + local loopdev + loopdev="$(losetup -f)" + loopmaj="$(echo "$loopdev" | sed -E 's/.*[^0-9]*?([0-9]+)$/\1/')" + [[ -b "$loopdev" ]] || mknod "$loopdev" b 7 "$loopmaj" +} +export -f ensure_next_loopdev From 77706bd2f6b77fbdbc329267f8386a38e4704c34 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Mon, 25 Sep 2023 15:59:25 +0200 Subject: [PATCH 17/57] fix: support bash v3 by removing array usage (#705) --- build-docker.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index 38ae9ca501..8d71b0f06c 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,6 +1,8 @@ -#!/bin/bash -eu +#!/usr/bin/env bash +# Note: Avoid usage of arrays as MacOS users have an older version of bash (v3.x) which does not supports arrays +set -eu -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)" BUILD_OPTS="$*" @@ -84,18 +86,12 @@ ${DOCKER} build --build-arg BASE_IMAGE=debian:bullseye -t pi-gen "${DIR}" if [ "${CONTAINER_EXISTS}" != "" ]; then DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont" - DOCKER_CMDLINE_PRE=( \ - --rm \ - ) - DOCKER_CMDLINE_POST=( \ - --volumes-from="${CONTAINER_NAME}" \ - ) + DOCKER_CMDLINE_PRE="--rm" + DOCKER_CMDLINE_POST="--volumes-from=\"${CONTAINER_NAME}\"" else DOCKER_CMDLINE_NAME="${CONTAINER_NAME}" - DOCKER_CMDLINE_PRE=( \ - ) - DOCKER_CMDLINE_POST=( \ - ) + DOCKER_CMDLINE_PRE="" + DOCKER_CMDLINE_POST="" fi # Check if binfmt_misc is required @@ -136,7 +132,7 @@ fi trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${DOCKER_CMDLINE_NAME}' SIGINT SIGTERM time ${DOCKER} run \ - "${DOCKER_CMDLINE_PRE[@]}" \ + $DOCKER_CMDLINE_PRE \ --name "${DOCKER_CMDLINE_NAME}" \ --privileged \ --cap-add=ALL \ @@ -145,7 +141,7 @@ time ${DOCKER} run \ ${PIGEN_DOCKER_OPTS} \ --volume "${CONFIG_FILE}":/config:ro \ -e "GIT_HASH=${GIT_HASH}" \ - "${DOCKER_CMDLINE_POST[@]}" \ + $DOCKER_CMDLINE_POST \ pi-gen \ bash -e -o pipefail -c " dpkg-reconfigure qemu-user-static && From ed68013abbe46c0f665a157a9bdfd06603811101 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Mon, 25 Sep 2023 15:59:25 +0200 Subject: [PATCH 18/57] fix: support bash v3 by removing array usage (#705) --- build-docker.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index 4fdd89c090..3445a4069a 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,6 +1,8 @@ -#!/bin/bash -eu +#!/usr/bin/env bash +# Note: Avoid usage of arrays as MacOS users have an older version of bash (v3.x) which does not supports arrays +set -eu -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)" BUILD_OPTS="$*" @@ -93,18 +95,12 @@ ${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}" if [ "${CONTAINER_EXISTS}" != "" ]; then DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont" - DOCKER_CMDLINE_PRE=( \ - --rm \ - ) - DOCKER_CMDLINE_POST=( \ - --volumes-from="${CONTAINER_NAME}" \ - ) + DOCKER_CMDLINE_PRE="--rm" + DOCKER_CMDLINE_POST="--volumes-from=\"${CONTAINER_NAME}\"" else DOCKER_CMDLINE_NAME="${CONTAINER_NAME}" - DOCKER_CMDLINE_PRE=( \ - ) - DOCKER_CMDLINE_POST=( \ - ) + DOCKER_CMDLINE_PRE="" + DOCKER_CMDLINE_POST="" fi # Check if binfmt_misc is required @@ -145,7 +141,7 @@ fi trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${DOCKER_CMDLINE_NAME}' SIGINT SIGTERM time ${DOCKER} run \ - "${DOCKER_CMDLINE_PRE[@]}" \ + $DOCKER_CMDLINE_PRE \ --name "${DOCKER_CMDLINE_NAME}" \ --privileged \ --cap-add=ALL \ @@ -154,7 +150,7 @@ time ${DOCKER} run \ ${PIGEN_DOCKER_OPTS} \ --volume "${CONFIG_FILE}":/config:ro \ -e "GIT_HASH=${GIT_HASH}" \ - "${DOCKER_CMDLINE_POST[@]}" \ + $DOCKER_CMDLINE_POST \ pi-gen \ bash -e -o pipefail -c " dpkg-reconfigure qemu-user-static && From 6aca615037355f3f0e51f984d196989167424e50 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 12:50:34 +0100 Subject: [PATCH 19/57] Switch to Bookworm --- build.sh | 2 +- stage0/prerun.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 986f81cc3b..ca0fb576fc 100755 --- a/build.sh +++ b/build.sh @@ -226,7 +226,7 @@ export TARGET_HOSTNAME=${TARGET_HOSTNAME:-raspberrypi} export FIRST_USER_NAME=${FIRST_USER_NAME:-pi} export FIRST_USER_PASS export DISABLE_FIRST_BOOT_USER_RENAME=${DISABLE_FIRST_BOOT_USER_RENAME:-0} -export RELEASE=${RELEASE:-bullseye} # Don't forget to update stage0/prerun.sh +export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh export WPA_ESSID export WPA_PASSWORD export WPA_COUNTRY diff --git a/stage0/prerun.sh b/stage0/prerun.sh index 024d369f36..c8e51a426e 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -if [ "$RELEASE" != "bullseye" ]; then +if [ "$RELEASE" != "bookworm" ]; then echo "WARNING: RELEASE does not match the intended option for this branch." echo " Please check the relevant README.md section." fi From 9d9d0637909a506c82cb76cea90a94a958b1732c Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 12:59:39 +0100 Subject: [PATCH 20/57] Remove/replace obsolete packages --- stage2/01-sys-tweaks/00-packages | 6 +++--- stage3/00-install-packages/00-packages-nr | 2 +- stage4/00-install-packages/00-packages | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 6138c6d5a4..86bdd9d351 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -1,4 +1,4 @@ -ssh less fbset sudo psmisc strace ed ncdu crda +ssh less fbset sudo psmisc strace ed ncdu console-setup keyboard-configuration debconf-utils parted build-essential manpages-dev bash-completion gdb pkg-config python-is-python3 @@ -7,7 +7,7 @@ python3-gpiozero avahi-daemon lua5.1 luajit -hardlink ca-certificates curl +ca-certificates curl fake-hwclock nfs-common usbutils libraspberrypi-dev libraspberrypi-doc libfreetype6-dev dosfstools @@ -29,7 +29,7 @@ ethtool ntfs-3g pciutils rpi-eeprom -raspinfo +raspi-utils udisks2 unzip zip p7zip-full file diff --git a/stage3/00-install-packages/00-packages-nr b/stage3/00-install-packages/00-packages-nr index 75fa2a1c5f..91131983de 100644 --- a/stage3/00-install-packages/00-packages-nr +++ b/stage3/00-install-packages/00-packages-nr @@ -3,5 +3,5 @@ mousepad lxde lxtask menu-xdg zenity xdg-utils gvfs-backends gvfs-fuse -lightdm gnome-themes-standard-data gnome-icon-theme +lightdm gnome-themes-extra-data gnome-icon-theme gnome-keyring diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index 7854596a1f..bfb3f0d587 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -2,12 +2,10 @@ python3-pygame python3-tk thonny python3-pgzero python3-serial -python3-picamera debian-reference-en dillo raspberrypi-net-mods raspberrypi-ui-mods python3-pip python3-numpy -pypy alacarte rc-gui sense-hat tree libgl1-mesa-dri libgles1 libgles2-mesa xcompmgr @@ -24,4 +22,3 @@ rp-prefapps ffmpeg vlc rpi-imager -rpi-wayland From a524fe44ce88b54869cb6f83dffb403f45543a9e Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 13:01:04 +0100 Subject: [PATCH 21/57] stage3: replace qpdfview with evince --- stage3/00-install-packages/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index d8a272f69b..a9e44e8252 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -1,5 +1,5 @@ gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav -qpdfview gtk2-engines alsa-utils +evince gtk2-engines alsa-utils desktop-base git policykit-1 From 43c49d84d28bfafb05386ff53557d61dbbb48743 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 13:01:54 +0100 Subject: [PATCH 22/57] stage3: install eom --- stage3/00-install-packages/00-packages-nr | 1 + 1 file changed, 1 insertion(+) diff --git a/stage3/00-install-packages/00-packages-nr b/stage3/00-install-packages/00-packages-nr index 91131983de..66f3004819 100644 --- a/stage3/00-install-packages/00-packages-nr +++ b/stage3/00-install-packages/00-packages-nr @@ -1,5 +1,6 @@ xserver-xorg-video-fbdev xserver-xorg xinit xserver-xorg-video-fbturbo mousepad +eom lxde lxtask menu-xdg zenity xdg-utils gvfs-backends gvfs-fuse From 9fc1385eb7c666b0105e7eb9e6acc86a853a88df Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 13:02:50 +0100 Subject: [PATCH 23/57] stage3: install Firefox --- stage3/00-install-packages/00-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index a9e44e8252..2d206cd17e 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -6,6 +6,7 @@ policykit-1 gvfs rfkill chromium-browser rpi-chromium-mods libwidevinecdm0 +firefox rpi-firefox-mods gldriver-test fonts-droid-fallback fonts-liberation2 From 8dd23cbc1d01b2a89f560c98f5e5b8ef2e71fbf3 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 13:34:21 +0100 Subject: [PATCH 24/57] Remove dhcpcd and associated options --- README.md | 4 ++-- build.sh | 2 -- stage2/02-net-tweaks/00-packages | 1 - stage2/02-net-tweaks/01-run.sh | 20 -------------------- stage3/01-tweaks/00-run.sh | 5 ----- 5 files changed, 2 insertions(+), 30 deletions(-) delete mode 100755 stage3/01-tweaks/00-run.sh diff --git a/README.md b/README.md index d7beb1f473..ea276abc22 100644 --- a/README.md +++ b/README.md @@ -195,9 +195,9 @@ The following environment variables are supported: stays activated. `FIRST_USER_PASS` must be set for this to work. Please be aware of the implied security risk of defining a default username and password for your devices. - * `WPA_ESSID`, `WPA_PASSWORD` and `WPA_COUNTRY` (Default: unset) + * `WPA_COUNTRY` (Default: unset) - If these are set, they are use to configure `wpa_supplicant.conf`, so that the Raspberry Pi can automatically connect to a wireless network on first boot. If `WPA_ESSID` is set and `WPA_PASSWORD` is unset an unprotected wireless network will be configured. If set, `WPA_PASSWORD` must be between 8 and 63 characters. `WPA_COUNTRY` is a 2-letter ISO/IEC 3166 country Code, i.e. `GB` + Sets the default WLAN regulatory domain and unblocks WLAN interfaces. This should be a 2-letter ISO/IEC 3166 country Code, i.e. `GB` * `ENABLE_SSH` (Default: `0`) diff --git a/build.sh b/build.sh index ca0fb576fc..22b605d822 100755 --- a/build.sh +++ b/build.sh @@ -227,8 +227,6 @@ export FIRST_USER_NAME=${FIRST_USER_NAME:-pi} export FIRST_USER_PASS export DISABLE_FIRST_BOOT_USER_RENAME=${DISABLE_FIRST_BOOT_USER_RENAME:-0} export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh -export WPA_ESSID -export WPA_PASSWORD export WPA_COUNTRY export ENABLE_SSH="${ENABLE_SSH:-0}" export PUBKEY_ONLY_SSH="${PUBKEY_ONLY_SSH:-0}" diff --git a/stage2/02-net-tweaks/00-packages b/stage2/02-net-tweaks/00-packages index f0125f6a6d..d446837df7 100644 --- a/stage2/02-net-tweaks/00-packages +++ b/stage2/02-net-tweaks/00-packages @@ -1,5 +1,4 @@ wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods -dhcpcd5 network-manager net-tools diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index 3b06c0577e..d49bdebfcd 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -3,32 +3,12 @@ install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant" install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/" -on_chroot << EOF - SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_wait 0 - SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_netconf 1 -EOF - if [ -v WPA_COUNTRY ]; then on_chroot <<- EOF SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_wifi_country "${WPA_COUNTRY}" EOF fi -if [ -v WPA_ESSID ] && [ -v WPA_PASSWORD ]; then -on_chroot <> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" << EOL - -network={ - ssid="${WPA_ESSID}" - key_mgmt=NONE -} -EOL -fi - # Disable wifi on 5GHz models if WPA_COUNTRY is not set mkdir -p "${ROOTFS_DIR}/var/lib/systemd/rfkill/" if [ -n "$WPA_COUNTRY" ]; then diff --git a/stage3/01-tweaks/00-run.sh b/stage3/01-tweaks/00-run.sh deleted file mode 100755 index 79b749e397..0000000000 --- a/stage3/01-tweaks/00-run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -on_chroot << EOF - SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_wait 1 -EOF From 4a4a66ed3661a241558beda050b1bf4d6ce49128 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 13:40:09 +0100 Subject: [PATCH 25/57] export-image: auto-remove and purge packages on dist-upgrade --- export-image/02-set-sources/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-image/02-set-sources/01-run.sh b/export-image/02-set-sources/01-run.sh index 5f512099b3..6d5049613c 100755 --- a/export-image/02-set-sources/01-run.sh +++ b/export-image/02-set-sources/01-run.sh @@ -4,6 +4,6 @@ rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" find "${ROOTFS_DIR}/var/lib/apt/lists/" -type f -delete on_chroot << EOF apt-get update -apt-get -y dist-upgrade +apt-get -y dist-upgrade --auto-remove --purge apt-get clean EOF From 88ac5235d62135806157183c466fdea202ce38f8 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 13:42:31 +0100 Subject: [PATCH 26/57] Enable Wayland by default --- stage4/06-enable-wayland/00-run.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 stage4/06-enable-wayland/00-run.sh diff --git a/stage4/06-enable-wayland/00-run.sh b/stage4/06-enable-wayland/00-run.sh new file mode 100755 index 0000000000..bd8bbc3bcc --- /dev/null +++ b/stage4/06-enable-wayland/00-run.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +on_chroot << EOF + SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_wayland W2 +EOF From c856800c72c8a58e17d7ee20295605d479b00dff Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 14:08:13 +0100 Subject: [PATCH 27/57] Switch to new kernel and firmware packages --- export-image/04-set-partuuid/00-run.sh | 3 +- export-image/05-finalise/01-run.sh | 5 +- export-image/prerun.sh | 12 ++-- stage0/00-configure-apt/00-run.sh | 1 + stage0/02-firmware/01-packages | 8 ++- stage0/02-firmware/02-run.sh | 3 + stage1/00-boot-files/00-run.sh | 17 ++++- stage1/00-boot-files/files/config.txt | 62 +++++-------------- stage1/01-sys-tweaks/files/fstab | 2 +- .../00-patches/07-resize-init.diff | 4 +- 10 files changed, 53 insertions(+), 64 deletions(-) create mode 100755 stage0/02-firmware/02-run.sh diff --git a/export-image/04-set-partuuid/00-run.sh b/export-image/04-set-partuuid/00-run.sh index 16e1b158ef..2694295c3c 100755 --- a/export-image/04-set-partuuid/00-run.sh +++ b/export-image/04-set-partuuid/00-run.sh @@ -12,7 +12,6 @@ if [ "${NO_PRERUN_QCOW2}" = "0" ]; then sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab" sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab" - sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/boot/cmdline.txt" - + sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/boot/firmware/cmdline.txt" fi diff --git a/export-image/05-finalise/01-run.sh b/export-image/05-finalise/01-run.sh index c104366f6e..eae7d6e901 100755 --- a/export-image/05-finalise/01-run.sh +++ b/export-image/05-finalise/01-run.sh @@ -3,7 +3,10 @@ IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info" +sed -i 's/^update_initramfs=.*/update_initramfs=all/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" + on_chroot << EOF +update-initramfs -u if [ -x /etc/init.d/fake-hwclock ]; then /etc/init.d/fake-hwclock stop fi @@ -53,7 +56,7 @@ rm -f "${ROOTFS_DIR}/root/.vnc/private.key" rm -f "${ROOTFS_DIR}/etc/vnc/updateid" update_issue "$(basename "${EXPORT_DIR}")" -install -m 644 "${ROOTFS_DIR}/etc/rpi-issue" "${ROOTFS_DIR}/boot/issue.txt" +install -m 644 "${ROOTFS_DIR}/etc/rpi-issue" "${ROOTFS_DIR}/boot/firmware/issue.txt" cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE" diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 267bbe0322..a5f94e93ac 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -10,8 +10,8 @@ if [ "${NO_PRERUN_QCOW2}" = "0" ]; then rm -rf "${ROOTFS_DIR}" mkdir -p "${ROOTFS_DIR}" - BOOT_SIZE="$((256 * 1024 * 1024))" - ROOT_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --exclude boot --block-size=1 | cut -f 1) + BOOT_SIZE="$((512 * 1024 * 1024))" + ROOT_SIZE=$(du --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 ALIGN="$((4 * 1024 * 1024))" @@ -59,9 +59,9 @@ if [ "${NO_PRERUN_QCOW2}" = "0" ]; then mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4 - mkdir -p "${ROOTFS_DIR}/boot" - mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot" -t vfat + mkdir -p "${ROOTFS_DIR}/boot/firmware" + mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot/firmware" -t vfat - rsync -aHAXx --exclude /var/cache/apt/archives --exclude /boot "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/" - rsync -rtx "${EXPORT_ROOTFS_DIR}/boot/" "${ROOTFS_DIR}/boot/" + rsync -aHAXx --exclude /var/cache/apt/archives --exclude /boot/firmware "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/" + rsync -rtx "${EXPORT_ROOTFS_DIR}/boot/firmware/" "${ROOTFS_DIR}/boot/firmware/" fi diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index 6494a03d05..fa4f59f435 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -15,6 +15,7 @@ fi cat files/raspberrypi.gpg.key | gpg --dearmor > "${STAGE_WORK_DIR}/raspberrypi-archive-stable.gpg" install -m 644 "${STAGE_WORK_DIR}/raspberrypi-archive-stable.gpg" "${ROOTFS_DIR}/etc/apt/trusted.gpg.d/" on_chroot << EOF +dpkg --add-architecture arm64 apt-get update apt-get dist-upgrade -y EOF diff --git a/stage0/02-firmware/01-packages b/stage0/02-firmware/01-packages index b166aa8dff..150958a287 100644 --- a/stage0/02-firmware/01-packages +++ b/stage0/02-firmware/01-packages @@ -1,2 +1,6 @@ -raspberrypi-bootloader -raspberrypi-kernel +initramfs-tools +raspi-firmware +linux-image-rpi-v6 +linux-image-rpi-v7 +linux-image-rpi-v7l +linux-image-rpi-v8 diff --git a/stage0/02-firmware/02-run.sh b/stage0/02-firmware/02-run.sh new file mode 100755 index 0000000000..0b2bca9625 --- /dev/null +++ b/stage0/02-firmware/02-run.sh @@ -0,0 +1,3 @@ +#!/bin/bash -e + +sed -i 's/^update_initramfs=.*/update_initramfs=no/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" diff --git a/stage1/00-boot-files/00-run.sh b/stage1/00-boot-files/00-run.sh index bc61397d9d..ddb0f5b22b 100755 --- a/stage1/00-boot-files/00-run.sh +++ b/stage1/00-boot-files/00-run.sh @@ -1,4 +1,17 @@ #!/bin/bash -e -install -m 644 files/cmdline.txt "${ROOTFS_DIR}/boot/" -install -m 644 files/config.txt "${ROOTFS_DIR}/boot/" +mkdir -p "${ROOTFS_DIR}/boot/firmware" + +if ! [ -L "${ROOTFS_DIR}/boot/overlays" ]; then + ln -s firmware/overlays "${ROOTFS_DIR}/boot/overlays" +fi + +install -m 644 files/cmdline.txt "${ROOTFS_DIR}/boot/firmware/" +if ! [ -L "${ROOTFS_DIR}/boot/cmdline.txt" ]; then + ln -s firmware/cmdline.txt "${ROOTFS_DIR}/boot/cmdline.txt" +fi + +install -m 644 files/config.txt "${ROOTFS_DIR}/boot/firmware/" +if ! [ -L "${ROOTFS_DIR}/boot/config.txt" ]; then + ln -s firmware/config.txt "${ROOTFS_DIR}/boot/config.txt" +fi diff --git a/stage1/00-boot-files/files/config.txt b/stage1/00-boot-files/files/config.txt index 6e072cb999..621637afda 100644 --- a/stage1/00-boot-files/files/config.txt +++ b/stage1/00-boot-files/files/config.txt @@ -1,70 +1,41 @@ # For more options and information see -# http://rpf.io/configtxt +# http://rptl.io/configtxt # Some settings may impact device functionality. See link above for details -# uncomment if you get no picture on HDMI for a default "safe" mode -#hdmi_safe=1 - -# uncomment the following to adjust overscan. Use positive numbers if console -# goes off screen, and negative if there is too much border -#overscan_left=16 -#overscan_right=16 -#overscan_top=16 -#overscan_bottom=16 - -# uncomment to force a console size. By default it will be display's size minus -# overscan. -#framebuffer_width=1280 -#framebuffer_height=720 - -# uncomment if hdmi display is not detected and composite is being output -#hdmi_force_hotplug=1 - -# uncomment to force a specific HDMI mode (this will force VGA) -#hdmi_group=1 -#hdmi_mode=1 - -# uncomment to force a HDMI mode rather than DVI. This can make audio work in -# DMT (computer monitor) modes -#hdmi_drive=2 - -# uncomment to increase signal to HDMI, if you have interference, blanking, or -# no display -#config_hdmi_boost=4 - -# uncomment for composite PAL -#sdtv_mode=2 - -#uncomment to overclock the arm. 700 MHz is the default. -#arm_freq=800 - # Uncomment some or all of these to enable the optional hardware interfaces #dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on -# Uncomment this to enable infrared communication. -#dtoverlay=gpio-ir,gpio_pin=17 -#dtoverlay=gpio-ir-tx,gpio_pin=18 - -# Additional overlays and parameters are documented /boot/overlays/README - # Enable audio (loads snd_bcm2835) dtparam=audio=on +# Additional overlays and parameters are documented +# /boot/firmware/overlays/README + # Automatically load overlays for detected cameras camera_auto_detect=1 # Automatically load overlays for detected DSI displays display_auto_detect=1 +# Automatically load initramfs files, if found +auto_initramfs=1 + # Enable DRM VC4 V3D driver dtoverlay=vc4-kms-v3d max_framebuffers=2 +# Don't have the firmware create an initial video= setting in cmdline.txt. +# Use the kernel's default instead. +disable_fw_kms_setup=1 + # Disable compensation for displays with overscan disable_overscan=1 +# Run as fast as firmware / board allows +arm_boost=1 + [cm4] # Enable host mode on the 2711 built-in XHCI USB controller. # This line should be removed if the legacy DWC2 controller is required @@ -73,8 +44,3 @@ otg_mode=1 [all] -[pi4] -# Run as fast as firmware / board allows -arm_boost=1 - -[all] diff --git a/stage1/01-sys-tweaks/files/fstab b/stage1/01-sys-tweaks/files/fstab index f16e3fb8aa..525c3bc84c 100644 --- a/stage1/01-sys-tweaks/files/fstab +++ b/stage1/01-sys-tweaks/files/fstab @@ -1,3 +1,3 @@ proc /proc proc defaults 0 0 -BOOTDEV /boot vfat defaults 0 2 +BOOTDEV /boot/firmware vfat defaults 0 2 ROOTDEV / ext4 defaults,noatime 0 1 diff --git a/stage2/01-sys-tweaks/00-patches/07-resize-init.diff b/stage2/01-sys-tweaks/00-patches/07-resize-init.diff index dfc01d4950..e508a9f525 100644 --- a/stage2/01-sys-tweaks/00-patches/07-resize-init.diff +++ b/stage2/01-sys-tweaks/00-patches/07-resize-init.diff @@ -1,5 +1,5 @@ ---- stage2.orig/rootfs/boot/cmdline.txt -+++ stage2/rootfs/boot/cmdline.txt +--- stage2.orig/rootfs/boot/firmware/cmdline.txt ++++ stage2/rootfs/boot/firmware/cmdline.txt @@ -1 +1 @@ -console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 fsck.repair=yes rootwait +console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 fsck.repair=yes rootwait quiet init=/usr/lib/raspberrypi-sys-mods/firstboot From 64b498b2dd458937cfc930d557513ff36db4dd23 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 7 Sep 2023 14:59:28 +0100 Subject: [PATCH 28/57] Don't generate NOOBS files --- stage2/EXPORT_NOOBS | 2 -- stage4/EXPORT_NOOBS | 2 -- stage5/EXPORT_NOOBS | 2 -- 3 files changed, 6 deletions(-) delete mode 100644 stage2/EXPORT_NOOBS delete mode 100644 stage4/EXPORT_NOOBS delete mode 100644 stage5/EXPORT_NOOBS diff --git a/stage2/EXPORT_NOOBS b/stage2/EXPORT_NOOBS deleted file mode 100644 index 0d78ecfd03..0000000000 --- a/stage2/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Raspberry Pi OS Lite (32-bit)" -NOOBS_DESCRIPTION="A port of Debian with no desktop environment" diff --git a/stage4/EXPORT_NOOBS b/stage4/EXPORT_NOOBS deleted file mode 100644 index f197ee1db7..0000000000 --- a/stage4/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Raspberry Pi OS (32-bit)" -NOOBS_DESCRIPTION="A port of Debian with the Raspberry Pi Desktop" diff --git a/stage5/EXPORT_NOOBS b/stage5/EXPORT_NOOBS deleted file mode 100644 index ac7051f0c5..0000000000 --- a/stage5/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Raspberry Pi OS Full (32-bit)" -NOOBS_DESCRIPTION="A port of Debian with desktop and recommended applications" From 188c155717b68dbd5704f337fd3b2cbd1b80d966 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 8 Sep 2023 11:39:51 +0100 Subject: [PATCH 29/57] Migrate to raspberrypi.com --- stage0/00-configure-apt/files/raspi.list | 4 ++-- stage0/00-configure-apt/files/sources.list | 4 ++-- stage0/prerun.sh | 2 +- stage4/03-bookshelf/00-run.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stage0/00-configure-apt/files/raspi.list b/stage0/00-configure-apt/files/raspi.list index 41c5a70755..5f889b16a8 100644 --- a/stage0/00-configure-apt/files/raspi.list +++ b/stage0/00-configure-apt/files/raspi.list @@ -1,3 +1,3 @@ -deb http://archive.raspberrypi.org/debian/ RELEASE main +deb http://archive.raspberrypi.com/debian/ RELEASE main # Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://archive.raspberrypi.org/debian/ RELEASE main +#deb-src http://archive.raspberrypi.com/debian/ RELEASE main diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index 4a5dd8a9fd..cd339c5e10 100644 --- a/stage0/00-configure-apt/files/sources.list +++ b/stage0/00-configure-apt/files/sources.list @@ -1,3 +1,3 @@ -deb http://raspbian.raspberrypi.org/raspbian/ RELEASE main contrib non-free rpi +deb 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.org/raspbian/ RELEASE main contrib non-free rpi +#deb-src http://raspbian.raspberrypi.com/raspbian/ RELEASE main contrib non-free rpi diff --git a/stage0/prerun.sh b/stage0/prerun.sh index c8e51a426e..0252071470 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -6,5 +6,5 @@ if [ "$RELEASE" != "bookworm" ]; then fi if [ ! -d "${ROOTFS_DIR}" ] || [ "${USE_QCOW2}" = "1" ]; then - bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ + bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.com/raspbian/ fi diff --git a/stage4/03-bookshelf/00-run.sh b/stage4/03-bookshelf/00-run.sh index 8244568bd6..5bf017b738 100755 --- a/stage4/03-bookshelf/00-run.sh +++ b/stage4/03-bookshelf/00-run.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -BOOKSHELF_URL="https://magpi.raspberrypi.org/bookshelf.xml" +BOOKSHELF_URL="https://magpi.raspberrypi.com/bookshelf.xml" GUIDE_URL="$(curl -s "$BOOKSHELF_URL" | awk -F '[<>]' "/Raspberry Pi Beginner's Guide 4th Edition<\/TITLE>/ {f=1; next} f==1 && /PDF/ {print \$3; exit}")" OUTPUT="$(basename "$GUIDE_URL" | cut -f1 -d'?')" From e6dd7caa2b849cc22db42abb84b1a93c0818db39 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Tue, 12 Sep 2023 18:04:27 +0100 Subject: [PATCH 30/57] stage2: remove rng-tools See https://github.com/RPi-Distro/raspberrypi-sys-mods/pull/77 --- stage2/01-sys-tweaks/00-packages | 1 - 1 file changed, 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 86bdd9d351..64529c7f06 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -24,7 +24,6 @@ htop man-db policykit-1 ssh-import-id -rng-tools ethtool ntfs-3g pciutils From 574d3e705535ac4fc47fd3f801d47fcc07184a63 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 13 Sep 2023 13:20:51 +0100 Subject: [PATCH 31/57] stage0: only fetch armhf packages from Raspbian --- stage0/00-configure-apt/files/sources.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index cd339c5e10..3ef0699311 100644 --- a/stage0/00-configure-apt/files/sources.list +++ b/stage0/00-configure-apt/files/sources.list @@ -1,3 +1,3 @@ -deb http://raspbian.raspberrypi.com/raspbian/ RELEASE main contrib non-free rpi +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 From d7dde0ca5e02a7db400878f17267fde5f60429d4 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Thu, 7 Sep 2023 15:42:20 +0100 Subject: [PATCH 32/57] stage5: disable greenfoot and bluej as they don't seem to work --- stage5/00-install-extras/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage5/00-install-extras/00-packages b/stage5/00-install-extras/00-packages index 909480b296..331f958354 100644 --- a/stage5/00-install-extras/00-packages +++ b/stage5/00-install-extras/00-packages @@ -7,7 +7,7 @@ python3-sense-emu sense-emu-tools python-sense-emu-doc wolfram-engine claws-mail -greenfoot-unbundled bluej-unbundled +#greenfoot-unbundled bluej-unbundled realvnc-vnc-viewer code-the-classics From 6051f1da7669875baf7e3c74daf67cb795c2a16e Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 13 Sep 2023 16:00:39 +0100 Subject: [PATCH 33/57] stage4: remove pimoroni packages for now --- stage4/00-install-packages/01-packages | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 stage4/00-install-packages/01-packages diff --git a/stage4/00-install-packages/01-packages b/stage4/00-install-packages/01-packages deleted file mode 100644 index 5441d9dd16..0000000000 --- a/stage4/00-install-packages/01-packages +++ /dev/null @@ -1,22 +0,0 @@ -python3-automationhat -python3-blinkt -python3-cap1xxx -python3-drumhat -python3-envirophat -python3-explorerhat -python3-fourletterphat -python3-microdotphat -python3-mote -python3-motephat -python3-phatbeat -python3-pianohat -python3-piglow -python3-rainbowhat -python3-scrollphat -python3-scrollphathd -python3-sn3218 -python3-skywriter -python3-touchphat -python3-buttonshim -python3-unicornhathd -python3-pantilthat From 3a6342b63d21d2a3385d99fa1e8c0fa9ca55b94c Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Thu, 14 Sep 2023 14:49:03 +0100 Subject: [PATCH 34/57] stage0: install kernel headers --- stage0/02-firmware/01-packages | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stage0/02-firmware/01-packages b/stage0/02-firmware/01-packages index 150958a287..38f2f52262 100644 --- a/stage0/02-firmware/01-packages +++ b/stage0/02-firmware/01-packages @@ -4,3 +4,6 @@ linux-image-rpi-v6 linux-image-rpi-v7 linux-image-rpi-v7l linux-image-rpi-v8 +linux-headers-rpi-v6 +linux-headers-rpi-v7 +linux-headers-rpi-v7l From 7ae1a26ae93991a25d39217c07f0b6656319a5e1 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Thu, 14 Sep 2023 14:50:07 +0100 Subject: [PATCH 35/57] stage4: ignore power key and let raspberrypi-ui-mods handle it --- stage4/07-disable-pwr-button/00-run.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 stage4/07-disable-pwr-button/00-run.sh diff --git a/stage4/07-disable-pwr-button/00-run.sh b/stage4/07-disable-pwr-button/00-run.sh new file mode 100755 index 0000000000..44646bd122 --- /dev/null +++ b/stage4/07-disable-pwr-button/00-run.sh @@ -0,0 +1,3 @@ +#!/bin/bash -e + +sed -i 's/^.*HandlePowerKey=.*$/HandlePowerKey=ignore/' "${ROOTFS_DIR}/etc/systemd/logind.conf" From c4f98a873fd622c4ae01a65f38b1b11c8259acf5 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 23 Aug 2023 12:34:23 +0100 Subject: [PATCH 36/57] Move picamera2 to stage3 - PyAV takes up too much space for lite images --- stage2/01-sys-tweaks/00-packages-nr | 1 - stage3/00-install-packages/00-packages | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages-nr b/stage2/01-sys-tweaks/00-packages-nr index 453ada8be2..6bdb60069e 100644 --- a/stage2/01-sys-tweaks/00-packages-nr +++ b/stage2/01-sys-tweaks/00-packages-nr @@ -1,4 +1,3 @@ cifs-utils libcamera-apps-lite mkvtoolnix -python3-picamera2 diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 2d206cd17e..cc18081907 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -14,5 +14,6 @@ obconf arandr libcamera-tools libcamera-apps +python3-picamera2 python3-pyqt5 python3-opengl From 5b15e14ff930c97ce1365d36b7696877d124b878 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Mon, 25 Sep 2023 21:33:15 +0100 Subject: [PATCH 37/57] stage2: install GPIO libraries --- stage2/01-sys-tweaks/00-packages | 5 ++++- stage4/00-install-packages/00-packages | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 64529c7f06..6142e2eb1b 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -2,8 +2,11 @@ ssh less fbset sudo psmisc strace ed ncdu console-setup keyboard-configuration debconf-utils parted build-essential manpages-dev bash-completion gdb pkg-config python-is-python3 -python3-rpi.gpio v4l-utils +v4l-utils +python3-libgpiod python3-gpiozero +pigpio python3-pigpio raspi-gpio python3-rpi.gpio +python3-spidev avahi-daemon lua5.1 luajit diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index bfb3f0d587..567f3ce795 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -11,8 +11,6 @@ tree libgl1-mesa-dri libgles1 libgles2-mesa xcompmgr geany piclone -pigpio python3-pigpio raspi-gpio python3-rpi.gpio -python3-spidev python3-twython python3-smbus python3-flask From dc6a3c1dd869f07c5fa7a61d667f09b81c66fb4a Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Tue, 26 Sep 2023 14:19:01 +0100 Subject: [PATCH 38/57] stage2: install python3-smbus2 --- stage2/01-sys-tweaks/00-packages | 1 + stage4/00-install-packages/00-packages | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 6142e2eb1b..0e6bfb93e8 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -7,6 +7,7 @@ python3-libgpiod python3-gpiozero pigpio python3-pigpio raspi-gpio python3-rpi.gpio python3-spidev +python3-smbus2 avahi-daemon lua5.1 luajit diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index 567f3ce795..23077524c3 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -12,7 +12,6 @@ libgl1-mesa-dri libgles1 libgles2-mesa xcompmgr geany piclone python3-twython -python3-smbus python3-flask pprompt piwiz From a0b8868fbfd04da73d449b84773b7020bbf7c62b Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 27 Sep 2023 15:56:37 +0100 Subject: [PATCH 39/57] Update release notes --- .../00-release/files/release_notes.txt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 7ec34fde2c..1eeffe9d33 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,4 +1,26 @@ UNRELEASED: + * Based on Debian bookworm release + * Support for Raspberry Pi 5 + * Desktop now runs on the Wayfire Wayland compositing window manager on Raspberry Pi 4 and 5 platforms; on X11 using the openbox window manager on older platforms + * lxpanel replaced with new wf-panel-pi application when running Wayland; existing lxpanel plugins migrated; gpu performance and power plugins added + * pcmanfm modified to use Wayland backend when running on Wayland + * PipeWire used instead of PulseAudio as audio control subsystem; various changes made to volume control plugin to support this + * NetworkManager used instead of dhcpcd as networking interface; various changes made to networking plugin to support this + * Firefox browser added as alternative to Chromium; selection of default browser added to Raspberry Pi Configuration tool + * WayVNC VNC server used instead of RealVNC when running on Wayland + * All customisation and configuration applications modified to customise Wayfire environment as appropriate + * grim used as screenshot tool instead of scrot when running on Wayland + * eom image viewer used instead of gpicview + * evince document viewer used instead of qpdfview + * Chromium web browser updated to version 116 + * VLC media player updated to version 3.0.18 + * Magnifier program not available when running Wayland; Wayfire includes screen zoom capabilities + * CustomPC and Wireframe removed from Bookshelf + * Numerous small changes and bug fixes + * Switched from raspberrypi-kernel to Debian-based kernel packaging (linux-image-rpi-*) + * Switched from raspberrypi-bootloader to Debian based firmware packaging (raspi-firmware) + * /boot mount point moved to /boot/firmware +2023-05-03: * 64-bit Mathematica added to rp-prefapps * Bug fix - occasional segfault in CPU temperature plugin * Bug fix - X server crash when changing screen orientation From 325123ff221a4e118cfbbd0b5347b08dc9a75911 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Mon, 25 Sep 2023 15:51:38 +0100 Subject: [PATCH 40/57] stage0: add non-free-firmware --- stage0/00-configure-apt/files/sources.list | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index 51290f6806..13697cec09 100644 --- a/stage0/00-configure-apt/files/sources.list +++ b/stage0/00-configure-apt/files/sources.list @@ -1,7 +1,7 @@ -deb http://deb.debian.org/debian RELEASE main contrib non-free -deb http://security.debian.org/debian-security RELEASE-security main contrib non-free -deb http://deb.debian.org/debian RELEASE-updates main contrib non-free +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 -#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 +#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 From 5ef8b0d45c9d6ae10121994dfee80f9f3d338a05 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 27 Sep 2023 16:04:06 +0100 Subject: [PATCH 41/57] Remove 32-bit kernels and install 64-bit headers --- stage0/02-firmware/01-packages | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stage0/02-firmware/01-packages b/stage0/02-firmware/01-packages index 38f2f52262..5adc256daf 100644 --- a/stage0/02-firmware/01-packages +++ b/stage0/02-firmware/01-packages @@ -1,9 +1,4 @@ initramfs-tools raspi-firmware -linux-image-rpi-v6 -linux-image-rpi-v7 -linux-image-rpi-v7l linux-image-rpi-v8 -linux-headers-rpi-v6 -linux-headers-rpi-v7 -linux-headers-rpi-v7l +linux-headers-rpi-v8 From 5f2fe0f854c24496867191c0f854fd550a6a0a5f Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 29 Mar 2023 08:12:54 +0100 Subject: [PATCH 42/57] pi5 support --- stage0/02-firmware/01-packages | 2 ++ stage2/02-net-tweaks/01-run.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stage0/02-firmware/01-packages b/stage0/02-firmware/01-packages index 5adc256daf..a1c3135105 100644 --- a/stage0/02-firmware/01-packages +++ b/stage0/02-firmware/01-packages @@ -1,4 +1,6 @@ initramfs-tools raspi-firmware linux-image-rpi-v8 +linux-image-rpi-2712 linux-headers-rpi-v8 +linux-headers-rpi-2712 diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index d49bdebfcd..4aa8148113 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -14,7 +14,9 @@ mkdir -p "${ROOTFS_DIR}/var/lib/systemd/rfkill/" if [ -n "$WPA_COUNTRY" ]; then echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan" echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan" + echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-1001100000.mmc:wlan" else echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan" echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan" + echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-1001100000.mmc:wlan" fi From fb56ad562991cf3ae5c96ab50983e1deeaefc7b6 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 4 Oct 2023 00:05:53 +0100 Subject: [PATCH 43/57] stage5: match rp-prefapps package list --- stage5/00-install-extras/00-packages | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stage5/00-install-extras/00-packages b/stage5/00-install-extras/00-packages index 331f958354..ad5dcad6dc 100644 --- a/stage5/00-install-extras/00-packages +++ b/stage5/00-install-extras/00-packages @@ -1,13 +1,8 @@ mu-editor -sonic-pi scratch nuscratch scratch3 smartsim - -python3-sense-emu sense-emu-tools python-sense-emu-doc - wolfram-engine claws-mail -#greenfoot-unbundled bluej-unbundled realvnc-vnc-viewer - code-the-classics +kicad From 663401de3cbbcf54d393195cb2aa7d06e5127ffd Mon Sep 17 00:00:00 2001 From: marcone <48169102+marcone@users.noreply.github.com> Date: Mon, 16 Oct 2023 04:41:17 -0700 Subject: [PATCH 44/57] README.md: default release is bookworm (#715) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea276abc22..6369ac5c31 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ The following environment variables are supported: that the network block device is not disconnected correctly after the Docker process has ended abnormally. In that case see [Disconnect an image if something went wrong](#Disconnect-an-image-if-something-went-wrong) -* `RELEASE` (Default: bullseye) +* `RELEASE` (Default: bookworm) The release version to build images against. Valid values are any supported Debian release. However, since different releases will have different sets of From 0ef867e5eb949e9340d5d812527578a7d10162a2 Mon Sep 17 00:00:00 2001 From: Stefan Becker <stefanb2@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:42:07 +0300 Subject: [PATCH 45/57] Fix build-docker.sh CONTINUE=1 mode (#716) This fixes commit ed68013abbe46c0f665a157a9bdfd06603811101 Remove extra quotes so that docker sees pigen_work, not "pigen_work". --- build-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-docker.sh b/build-docker.sh index 3445a4069a..9549d90ab5 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -96,7 +96,7 @@ ${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}" if [ "${CONTAINER_EXISTS}" != "" ]; then DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont" DOCKER_CMDLINE_PRE="--rm" - DOCKER_CMDLINE_POST="--volumes-from=\"${CONTAINER_NAME}\"" + DOCKER_CMDLINE_POST="--volumes-from=${CONTAINER_NAME}" else DOCKER_CMDLINE_NAME="${CONTAINER_NAME}" DOCKER_CMDLINE_PRE="" From d9668973950853ce3dc026246cad24fcbb5dbcfa Mon Sep 17 00:00:00 2001 From: Stefan Becker <stefanb2@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:11:43 +0300 Subject: [PATCH 46/57] README.md: add PI_GEN_RELEASE (#720) This is the text written to "/etc/issue.txt" by update_issue(). The default is the name used by official Raspberry Pi builds. Fixes #719 --- README.md | 5 +++++ build.sh | 1 + scripts/common | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6369ac5c31..2fdb65e252 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,11 @@ The following environment variables are supported: but you should use something else for a customized version. Export files in stages may add suffixes to `IMG_NAME`. + * `PI_GEN_RELEASE` (Default: `Raspberry Pi reference`) + + The release name to use in `/etc/issue.txt`. The default should only be used + for official Raspberry Pi builds. + * `USE_QCOW2` **EXPERIMENTAL** (Default: `0` ) Instead of using traditional way of building the rootfs of every stage in diff --git a/build.sh b/build.sh index 22b605d822..7d7bc40368 100755 --- a/build.sh +++ b/build.sh @@ -194,6 +194,7 @@ trap term EXIT INT TERM 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} if [ -z "${IMG_NAME}" ]; then echo "IMG_NAME not set" 1>&2 diff --git a/scripts/common b/scripts/common index c94b0f0abb..74c7938d52 100644 --- a/scripts/common +++ b/scripts/common @@ -99,7 +99,7 @@ on_chroot() { export -f on_chroot update_issue() { - echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue" + echo -e "${PI_GEN_RELEASE} ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue" } export -f update_issue From 19acff02387a56c68259c5315769110d90e3f656 Mon Sep 17 00:00:00 2001 From: Ponj <breval.ferrari@gmail.com> Date: Wed, 22 Nov 2023 14:59:13 +0100 Subject: [PATCH 47/57] Fix typo (#725) depoy > deploy --- build-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-docker.sh b/build-docker.sh index 9549d90ab5..83e76a587c 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -165,7 +165,7 @@ time ${DOCKER} run \ echo "copying results from deploy/" ${DOCKER} cp "${CONTAINER_NAME}":/pi-gen/deploy - | tar -xf - -echo "copying log from container ${CONTAINER_NAME} to depoy/" +echo "copying log from container ${CONTAINER_NAME} to deploy/" ${DOCKER} logs --timestamps "${CONTAINER_NAME}" &>deploy/build-docker.log ls -lah deploy From 95c9fa8cb9c1b7c872d550824efa93628a50e733 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Mon, 27 Nov 2023 15:24:41 +0000 Subject: [PATCH 48/57] stage2: include gpiod binary tools --- stage2/01-sys-tweaks/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 0e6bfb93e8..55528ad070 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -3,7 +3,7 @@ console-setup keyboard-configuration debconf-utils parted build-essential manpages-dev bash-completion gdb pkg-config python-is-python3 v4l-utils -python3-libgpiod +gpiod python3-libgpiod python3-gpiozero pigpio python3-pigpio raspi-gpio python3-rpi.gpio python3-spidev From 5b22a553619c817d8ce563019d8a7a78eebb4966 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Mon, 27 Nov 2023 15:34:24 +0000 Subject: [PATCH 49/57] Update release notes --- .../00-release/files/release_notes.txt | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 1eeffe9d33..44778d126f 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,4 +1,39 @@ UNRELEASED: + * Serial port switching in rc_gui and raspi-config modified to support Raspberry Pi 5 + * Touch screens now identified with unique per-device strings to enable correct association with display devices + * Compatibility with RP1 displays added + * Theme files monitored by pixdecor plugin to load changes on the fly + * Main menu shortcut to The Magpi website restored + * GTK+2 theme harmonised with GTK+3 theme to enable more uniform theming of Qt applications + * Battery monitor plugin enabled + * Taskbar Preferences menu item added to panel right-click menu + * Better reloading of on-the-fly theme changes + * Various improvements to Wayfire rendering + * Dark GTK theme added + * Bug fix - suppressed warning notifications when removing USB devices without mounted filesystems + * Bug fix - volume keyboard shortcuts locked up on some devices + * Bug fix - correctly handling multiple USB audio devices with same name + * Bug fix - some translations not loading in panel plugins + * Bug fix - window titlebars disappearing when tiled + * Bug fix - local installer service failing to install local deb files + * Bug fix - wizard not correctly setting locale when explicit UTF-8 character set required + * Bug fix - system updates could fail if an update required the removal of an installed package + * Bug fix - prevent file manager windows opening larger than screen size + * Bug fix - GPU plugin displaying load percentage as -1 + * Bug fix - various window manager crashes associated with shadows on certain window types + * Bug fix - allow VNC to be enabled if either RealVNC or WayVNC are installed + * WayVNC - improved support for encrypted connections + * Mathematica now works on Raspberry Pi 5 and 64-bit + * Scratch 3 now works on Raspberry Pi 5 and 64-bit + * Thonny updated to version 4.1.4 + * Chromium updated to 119.0.6045.171 + * Firefox updated to 119.0 + * gpiod binary tools included in lite images + * Japanese translations updated + * German translation added to Appearance Settings + * Raspberry Pi firmware 12af703dd07d7721c1f2f58c6f71d9fe66270838 + * Linux kernel 6.1.63 +2023-10-10: * Based on Debian bookworm release * Support for Raspberry Pi 5 * Desktop now runs on the Wayfire Wayland compositing window manager on Raspberry Pi 4 and 5 platforms; on X11 using the openbox window manager on older platforms From 193bae26590f9b457f72ca122b7d4fbf9ea168f8 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Tue, 28 Nov 2023 14:25:26 +0000 Subject: [PATCH 50/57] Remove obsolete packages --- stage1/03-install-packages/00-packages | 1 - stage2/01-sys-tweaks/00-packages | 1 - 2 files changed, 2 deletions(-) diff --git a/stage1/03-install-packages/00-packages b/stage1/03-install-packages/00-packages index a3d2fb66fd..97ca0d2bc6 100644 --- a/stage1/03-install-packages/00-packages +++ b/stage1/03-install-packages/00-packages @@ -1,2 +1 @@ -libraspberrypi-bin libraspberrypi0 systemd-timesyncd diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 55528ad070..abeaa6a4be 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -13,7 +13,6 @@ lua5.1 luajit ca-certificates curl fake-hwclock nfs-common usbutils -libraspberrypi-dev libraspberrypi-doc libfreetype6-dev dosfstools dphys-swapfile raspberrypi-sys-mods From 399a5c2bcd46ff4ee18a9652fceca579d317acc7 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 29 Nov 2023 01:29:33 +0000 Subject: [PATCH 51/57] stage2: install python3-venv --- stage2/01-sys-tweaks/00-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index abeaa6a4be..93a69be89f 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -36,3 +36,4 @@ udisks2 unzip zip p7zip-full file kms++-utils +python3-venv From ae818349453dea51fa26c66f0d616e3d48aed1e3 Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 29 Nov 2023 01:32:10 +0000 Subject: [PATCH 52/57] export-image: Add issue.txt symlink --- export-image/05-finalise/01-run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/export-image/05-finalise/01-run.sh b/export-image/05-finalise/01-run.sh index eae7d6e901..826198f0df 100755 --- a/export-image/05-finalise/01-run.sh +++ b/export-image/05-finalise/01-run.sh @@ -57,6 +57,10 @@ rm -f "${ROOTFS_DIR}/etc/vnc/updateid" update_issue "$(basename "${EXPORT_DIR}")" install -m 644 "${ROOTFS_DIR}/etc/rpi-issue" "${ROOTFS_DIR}/boot/firmware/issue.txt" +if ! [ -L "${ROOTFS_DIR}/boot/issue.txt" ]; then + ln -s firmware/issue.txt "${ROOTFS_DIR}/boot/issue.txt" +fi + cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE" From e07ee9b98812355591de0b7a8c39762a7ca1ceda Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 29 Nov 2023 01:34:04 +0000 Subject: [PATCH 53/57] Update release notes --- export-noobs/00-release/files/release_notes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 44778d126f..6507e59f86 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -29,6 +29,7 @@ UNRELEASED: * Chromium updated to 119.0.6045.171 * Firefox updated to 119.0 * gpiod binary tools included in lite images + * python3-venv included in lite images * Japanese translations updated * German translation added to Appearance Settings * Raspberry Pi firmware 12af703dd07d7721c1f2f58c6f71d9fe66270838 From 02b371de1a87bbe70cfcbd498527067a7d2ee6ca Mon Sep 17 00:00:00 2001 From: Serge Schneider <serge@raspberrypi.com> Date: Wed, 29 Nov 2023 16:14:37 +0000 Subject: [PATCH 54/57] stage4: Update beginner's guide URL, assuming the latest version is always first --- stage4/03-bookshelf/00-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage4/03-bookshelf/00-run.sh b/stage4/03-bookshelf/00-run.sh index 5bf017b738..d62e70ead8 100755 --- a/stage4/03-bookshelf/00-run.sh +++ b/stage4/03-bookshelf/00-run.sh @@ -1,7 +1,7 @@ #!/bin/sh -e BOOKSHELF_URL="https://magpi.raspberrypi.com/bookshelf.xml" -GUIDE_URL="$(curl -s "$BOOKSHELF_URL" | awk -F '[<>]' "/<TITLE>Raspberry Pi Beginner's Guide 4th Edition<\/TITLE>/ {f=1; next} f==1 && /PDF/ {print \$3; exit}")" +GUIDE_URL="$(curl -s "$BOOKSHELF_URL" | awk -F '[<>]' "/<TITLE>Raspberry Pi Beginner's Guide .*<\/TITLE>/ {f=1; next} f==1 && /PDF/ {print \$3; exit}")" OUTPUT="$(basename "$GUIDE_URL" | cut -f1 -d'?')" if [ ! -f "files/$OUTPUT" ]; then From 3c92253c962206ca5619a72e690bd0a9573355f4 Mon Sep 17 00:00:00 2001 From: Peter Johnson <johnson.peter@gmail.com> Date: Tue, 19 Dec 2023 23:18:47 -0800 Subject: [PATCH 55/57] Update for bookworm (WIP) --- Dockerfile | 4 +- build-docker.sh | 2 +- deps/tools/configServer/src/Application.h | 5 +- .../configServer/src/NetworkSettings.cpp | 17 +- deps/tools/configServer/src/NetworkSettings.h | 5 +- deps/tools/configServer/src/RomiStatus.cpp | 8 +- deps/tools/configServer/src/RomiStatus.h | 9 +- deps/tools/configServer/src/SystemStatus.h | 5 +- .../tools/configServer/src/VisionSettings.cpp | 9 +- deps/tools/configServer/src/VisionSettings.h | 5 +- deps/tools/configServer/src/VisionStatus.h | 9 +- deps/tools/configServer/src/main.cpp | 4 +- .../src/multiCameraServer.cpp | 11 +- export-image/03-network/01-run.sh | 6 +- stage2/01-sys-tweaks/00-packages | 3 +- stage2/01-sys-tweaks/01-run.sh | 6 +- stage3/01-sys-tweaks/00-packages | 16 +- stage3/01-sys-tweaks/00-packages-nr | 2 +- stage3/01-sys-tweaks/01-run.sh | 339 +++--------------- .../01-sys-tweaks/files/pkgconfig/apriltag.pc | 4 +- .../files/pkgconfig/cameraserver.pc | 4 +- .../01-sys-tweaks/files/pkgconfig/cscore.pc | 4 +- .../01-sys-tweaks/files/pkgconfig/ntcore.pc | 4 +- .../01-sys-tweaks/files/pkgconfig/wpilibc.pc | 4 +- .../01-sys-tweaks/files/pkgconfig/wpimath.pc | 4 +- .../01-sys-tweaks/files/pkgconfig/wpinet.pc | 4 +- .../01-sys-tweaks/files/pkgconfig/wpiutil.pc | 4 +- stage4/01-sys-tweaks/01-run.sh | 4 + stage4/02-net-tweaks/01-run.sh | 8 +- stage5/01-sys-tweaks/01-run.sh | 2 +- 30 files changed, 137 insertions(+), 374 deletions(-) diff --git a/Dockerfile b/Dockerfile index e133a5c502..cba0b8b8d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=debian:bullseye +ARG BASE_IMAGE=debian:bookworm FROM ${BASE_IMAGE} ENV DEBIAN_FRONTEND noninteractive @@ -10,7 +10,7 @@ RUN apt-get -y update && \ libarchive-tools libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc\ binfmt-support ca-certificates qemu-utils kpartx fdisk gpg pigz\ crossbuild-essential-arm64 \ - build-essential cmake python3 python3-distutils python3-jinja2 ant sudo openjdk-17-jdk \ + build-essential cmake ninja-build protobuf-compiler python3 python3-distutils python3-jinja2 ant sudo openjdk-17-jdk \ && rm -rf /var/lib/apt/lists/* COPY . /pi-gen/ diff --git a/build-docker.sh b/build-docker.sh index 2416e8cdbf..05d7da1add 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -95,7 +95,7 @@ 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:bullseye -t pi-gen "${DIR}" +${DOCKER} build --build-arg BASE_IMAGE=debian:bookworm -t pi-gen "${DIR}" if [ "${CONTAINER_EXISTS}" != "" ]; then DOCKER_CMDLINE_NAME="${CONTAINER_NAME}_cont" diff --git a/deps/tools/configServer/src/Application.h b/deps/tools/configServer/src/Application.h index c438d14181..6d999abaf8 100644 --- a/deps/tools/configServer/src/Application.h +++ b/deps/tools/configServer/src/Application.h @@ -11,10 +11,7 @@ #include <string_view> #include <wpi/Signal.h> - -namespace wpi { -class json; -} // namespace wpi +#include <wpi/json_fwd.h> class UploadHelper; diff --git a/deps/tools/configServer/src/NetworkSettings.cpp b/deps/tools/configServer/src/NetworkSettings.cpp index 5c5e355fdb..00d1527c02 100644 --- a/deps/tools/configServer/src/NetworkSettings.cpp +++ b/deps/tools/configServer/src/NetworkSettings.cpp @@ -6,6 +6,7 @@ #include <unistd.h> +#include <bit> #include <string> #include <vector> @@ -56,8 +57,8 @@ bool NetmaskToCidr(std::string_view netmask, unsigned int* cidr) { in_addr addr; if (wpi::uv::NameToAddr(netmask, &addr) != 0) return false; uint32_t hostAddr = ntohl(addr.s_addr); - auto leadingOnes = wpi::countLeadingOnes(hostAddr); - auto trailingZeros = wpi::countTrailingZeros(hostAddr); + auto leadingOnes = std::countl_one(hostAddr); + auto trailingZeros = std::countr_zero(hostAddr); if (leadingOnes + trailingZeros != 32) return false; *cidr = leadingOnes; return true; @@ -123,19 +124,19 @@ static std::string BuildDhcpcdSetting( break; case NetworkSettings::kStatic: fmt::print(os, "interface {}\n", iface); - fmt::print(os, "static ip_address={}/{}\n", addressOut, cidr); + fmt::print(os, "static ip_address={}/{}\n", addressOut.str(), cidr); if (!gatewayOut.empty()) - fmt::print(os, "static routers={}\n", gatewayOut); + fmt::print(os, "static routers={}\n", gatewayOut.str()); if (!dnsOut.empty()) - fmt::print(os, "static domain_name_servers={}\n", dnsOut); + fmt::print(os, "static domain_name_servers={}\n", dnsOut.str()); break; case NetworkSettings::kDhcpStatic: fmt::print(os, "profile static_{}\n", iface); - fmt::print(os, "static ip_address={}/{}\n", addressOut, cidr); + fmt::print(os, "static ip_address={}/{}\n", addressOut.str(), cidr); if (!gatewayOut.empty()) - fmt::print(os, "static routers={}\n", gatewayOut); + fmt::print(os, "static routers={}\n", gatewayOut.str()); if (!dnsOut.empty()) - fmt::print(os, "static domain_name_servers={}\n", dnsOut); + fmt::print(os, "static domain_name_servers={}\n", dnsOut.str()); fmt::print(os, "interface {}\n", iface); fmt::print(os, "fallback static_{}\n", iface); break; diff --git a/deps/tools/configServer/src/NetworkSettings.h b/deps/tools/configServer/src/NetworkSettings.h index d9794dec12..1eb40591de 100644 --- a/deps/tools/configServer/src/NetworkSettings.h +++ b/deps/tools/configServer/src/NetworkSettings.h @@ -10,12 +10,9 @@ #include <string_view> #include <wpi/Signal.h> +#include <wpi/json_fwd.h> #include <wpinet/uv/Loop.h> -namespace wpi { -class json; -} // namespace wpi - class NetworkSettings { struct private_init {}; diff --git a/deps/tools/configServer/src/RomiStatus.cpp b/deps/tools/configServer/src/RomiStatus.cpp index df1f037123..6ceed71b5e 100644 --- a/deps/tools/configServer/src/RomiStatus.cpp +++ b/deps/tools/configServer/src/RomiStatus.cpp @@ -14,6 +14,7 @@ #include <string_view> #include <fmt/format.h> +#include <wpi/MemoryBuffer.h> #include <wpi/SmallString.h> #include <wpi/fmt/raw_ostream.h> #include <wpi/fs.h> @@ -237,9 +238,10 @@ wpi::json RomiStatus::ReadRomiConfigFile( std::function<void(std::string_view)> onFail) { // Read config file std::error_code ec; - wpi::raw_fd_istream is(ROMI_JSON, ec); + std::unique_ptr<wpi::MemoryBuffer> fileBuffer = + wpi::MemoryBuffer::GetFile(ROMI_JSON, ec); - if (ec) { + if (fileBuffer == nullptr || ec) { onFail("Could not read romi config file"); fmt::print(stderr, "could not read {}\n", ROMI_JSON); return wpi::json(); @@ -247,7 +249,7 @@ wpi::json RomiStatus::ReadRomiConfigFile( wpi::json j; try { - j = wpi::json::parse(is); + j = wpi::json::parse(fileBuffer->GetCharBuffer()); } catch(const wpi::json::parse_error& e) { onFail("Parse error in config file"); fmt::print(stderr, "Parse error in {}: byte {}: {}\n", ROMI_JSON, e.byte, diff --git a/deps/tools/configServer/src/RomiStatus.h b/deps/tools/configServer/src/RomiStatus.h index cfc56fe5a2..c976825db2 100644 --- a/deps/tools/configServer/src/RomiStatus.h +++ b/deps/tools/configServer/src/RomiStatus.h @@ -12,15 +12,12 @@ #include <cscore.h> #include <wpi/Signal.h> +#include <wpi/json_fwd.h> #include <wpinet/uv/Loop.h> -namespace wpi { -class json; - -namespace uv { +namespace wpi::uv { class Buffer; -} // namespace uv -} // namespace wpi +} // namespace wpi::uv class RomiStatus { struct private_init {}; diff --git a/deps/tools/configServer/src/SystemStatus.h b/deps/tools/configServer/src/SystemStatus.h index 8a8540f93d..3b356b43c8 100644 --- a/deps/tools/configServer/src/SystemStatus.h +++ b/deps/tools/configServer/src/SystemStatus.h @@ -8,13 +8,10 @@ #include <memory> #include <wpi/Signal.h> +#include <wpi/json_fwd.h> #include "DataHistory.h" -namespace wpi { -class json; -} // namespace wpi - class SystemStatus { struct private_init {}; diff --git a/deps/tools/configServer/src/VisionSettings.cpp b/deps/tools/configServer/src/VisionSettings.cpp index 05f398d7de..66d0d10ee1 100644 --- a/deps/tools/configServer/src/VisionSettings.cpp +++ b/deps/tools/configServer/src/VisionSettings.cpp @@ -5,6 +5,7 @@ #include "VisionSettings.h" #include <fmt/format.h> +#include <wpi/MemoryBuffer.h> #include <wpi/fs.h> #include <wpi/json.h> #include <wpi/raw_istream.h> @@ -41,15 +42,17 @@ void VisionSettings::UpdateStatus() { status(GetStatusJson()); } wpi::json VisionSettings::GetStatusJson() { std::error_code ec; - wpi::raw_fd_istream is(FRC_JSON, ec); - if (ec) { + std::unique_ptr<wpi::MemoryBuffer> fileBuffer = + wpi::MemoryBuffer::GetFile(FRC_JSON, ec); + + if (fileBuffer == nullptr || ec) { fmt::print(stderr, "could not read {}\n", FRC_JSON); return wpi::json(); } try { wpi::json j = {{"type", "visionSettings"}, - {"settings", wpi::json::parse(is)}}; + {"settings", wpi::json::parse(fileBuffer->GetCharBuffer())}}; return j; } catch (wpi::json::exception& e) { fmt::print(stderr, "could not parse {}\n", FRC_JSON); diff --git a/deps/tools/configServer/src/VisionSettings.h b/deps/tools/configServer/src/VisionSettings.h index a2acf6ea4a..1a21d89342 100644 --- a/deps/tools/configServer/src/VisionSettings.h +++ b/deps/tools/configServer/src/VisionSettings.h @@ -10,10 +10,7 @@ #include <string_view> #include <wpi/Signal.h> - -namespace wpi { -class json; -} // namespace wpi +#include <wpi/json_fwd.h> class VisionSettings { struct private_init {}; diff --git a/deps/tools/configServer/src/VisionStatus.h b/deps/tools/configServer/src/VisionStatus.h index 07736f0027..ba5638a9ed 100644 --- a/deps/tools/configServer/src/VisionStatus.h +++ b/deps/tools/configServer/src/VisionStatus.h @@ -12,15 +12,12 @@ #include <cscore.h> #include <wpi/Signal.h> +#include <wpi/json_fwd.h> #include <wpinet/uv/Loop.h> -namespace wpi { -class json; - -namespace uv { +namespace wpi::uv { class Buffer; -} // namespace uv -} // namespace wpi +} // namespace wpi::uv class VisionStatus { struct private_init {}; diff --git a/deps/tools/configServer/src/main.cpp b/deps/tools/configServer/src/main.cpp index 34a12f1bb3..ac39715d1f 100644 --- a/deps/tools/configServer/src/main.cpp +++ b/deps/tools/configServer/src/main.cpp @@ -9,6 +9,7 @@ #include <fmt/format.h> #include <wpi/MathExtras.h> +#include <wpi/bit.h> #include <wpi/timestamp.h> #include <wpinet/raw_uv_ostream.h> #include <wpinet/uv/Loop.h> @@ -129,7 +130,8 @@ int main(int argc, char* argv[]) { // Header is 2 byte len, 1 byte type, 4 byte timestamp, 2 byte // sequence num - uint32_t ts = wpi::FloatToBits((wpi::Now() - startTime) * 1.0e-6); + uint32_t ts = + wpi::bit_cast<uint32_t>((wpi::Now() - startTime) * 1.0e-6f); uint16_t pktlen = len + 1 + 4 + 2; const uint8_t contents[] = {static_cast<uint8_t>((pktlen >> 8) & 0xff), diff --git a/deps/tools/multiCameraServer/src/multiCameraServer.cpp b/deps/tools/multiCameraServer/src/multiCameraServer.cpp index b1ace5373f..70c0ccccef 100644 --- a/deps/tools/multiCameraServer/src/multiCameraServer.cpp +++ b/deps/tools/multiCameraServer/src/multiCameraServer.cpp @@ -10,9 +10,9 @@ #include <fmt/format.h> #include <networktables/NetworkTableInstance.h> +#include <wpi/MemoryBuffer.h> #include <wpi/StringExtras.h> #include <wpi/json.h> -#include <wpi/raw_istream.h> #include "cameraserver/CameraServer.h" @@ -152,8 +152,9 @@ bool ReadSwitchedCameraConfig(const wpi::json& config) { bool ReadConfig() { // open config file std::error_code ec; - wpi::raw_fd_istream is(configFile, ec); - if (ec) { + std::unique_ptr<wpi::MemoryBuffer> fileBuffer = + wpi::MemoryBuffer::GetFile(configFile, ec); + if (fileBuffer == nullptr || ec) { fmt::print(stderr, "could not open '{}': {}", configFile, ec.message()); return false; } @@ -161,7 +162,7 @@ bool ReadConfig() { // parse file wpi::json j; try { - j = wpi::json::parse(is); + j = wpi::json::parse(fileBuffer->GetCharBuffer()); } catch (const wpi::json::parse_error& e) { ParseError("byte {}: {}", e.byte, e.what()); return false; @@ -288,7 +289,7 @@ int main(int argc, char* argv[]) { // start cameras // work around wpilibsuite/allwpilib#5055 - frc::CameraServer::SetSize(frc::CameraServer::kSize160x120); + frc::CameraServer::RemoveCamera("unused"); for (const auto& config : cameraConfigs) cameras.emplace_back(StartCamera(config)); diff --git a/export-image/03-network/01-run.sh b/export-image/03-network/01-run.sh index 2e0cc7af73..4b1338ec87 100755 --- a/export-image/03-network/01-run.sh +++ b/export-image/03-network/01-run.sh @@ -10,9 +10,9 @@ ln -s /tmp/dhcpcd.resolv.conf /etc/resolv.conf #sed -i -e 's/\/run\//\/var\/run\//' /etc/systemd/system/dhcpcd5.service -cp /etc/dhcpcd.conf /boot/ -chown -f 0:0 /boot/dhcpcd.conf -ln -sf /boot/dhcpcd.conf /etc/dhcpcd.conf +#cp /etc/dhcpcd.conf /boot/ +#chown -f 0:0 /boot/dhcpcd.conf +#ln -sf /boot/dhcpcd.conf /etc/dhcpcd.conf cp /etc/wpa_supplicant/wpa_supplicant.conf /boot/wpa_supplicant_wpilibpi.conf chown -f 0:0 /boot/wpa_supplicant_wpilibpi.conf diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 819e874144..90e88b1d6f 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -9,7 +9,7 @@ build-essential manpages-dev bash-completion gdb pkg-config python-is-python3 v4l-utils gdbserver -python3-numpy libopenblas-base +python3-numpy libopenblas-dev gpiod python3-libgpiod python3-gpiozero pigpio python3-pigpio raspi-gpio python3-rpi.gpio @@ -35,7 +35,6 @@ ethtool ntfs-3g pciutils rpi-eeprom -python3-picamera raspi-utils udisks2 unzip zip p7zip-full diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index e0c4b717e1..f96b74b45e 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -34,17 +34,17 @@ ln -s /run /var/run ln -s /tmp /var/spool ln -s /tmp /var/lock sed -i -e 's/d \/var\/spool/#d \/var\/spool/' /usr/lib/tmpfiles.d/var.conf -sed -i -e 's/\/var\/lib\/ntp/\/var\/tmp/' /etc/ntp.conf EOF +#sed -i -e 's/\/var\/lib\/ntp/\/var\/tmp/' /etc/ntp.conf cat files/bash.bashrc >> "${ROOTFS_DIR}/etc/bash.bashrc" cat files/bash.logout >> "${ROOTFS_DIR}/etc/bash.bash_logout" +#systemctl disable nfs-common +#systemctl disable rpcbind on_chroot << EOF systemctl disable hwclock.sh -systemctl disable nfs-common -systemctl disable rpcbind if [ "${ENABLE_SSH}" == "1" ]; then systemctl enable ssh else diff --git a/stage3/01-sys-tweaks/00-packages b/stage3/01-sys-tweaks/00-packages index 77170e2e12..030c5f217d 100644 --- a/stage3/01-sys-tweaks/00-packages +++ b/stage3/01-sys-tweaks/00-packages @@ -1,20 +1,22 @@ cmake -libpython3.9-minimal -libpython3.9-dev -python3.9-minimal -python3.9-dev +libprotobuf-dev +libpython3.11-minimal +libpython3.11-dev +ninja-build +protobuf-compiler +python3.11-minimal +python3.11-dev python3-distutils python3-jinja2 python3-numpy python3-pip -python3-pycoral libedgetpu1-std libedgetpu-dev libtbb-dev -libtbb2 +libtbbmalloc2 +libssh-dev libusb-1.0-0-dev libz-dev swig pigpio -python-pigpio python3-pigpio diff --git a/stage3/01-sys-tweaks/00-packages-nr b/stage3/01-sys-tweaks/00-packages-nr index ebe1830774..1bc22fa8db 100644 --- a/stage3/01-sys-tweaks/00-packages-nr +++ b/stage3/01-sys-tweaks/00-packages-nr @@ -1,4 +1,4 @@ libopenblas-dev liblapacke-dev -libavcodec-dev libavformat-dev libswscale-dev libavresample-dev +libavcodec-dev libavformat-dev libswscale-dev libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev diff --git a/stage3/01-sys-tweaks/01-run.sh b/stage3/01-sys-tweaks/01-run.sh index 54d49b904f..94c6071462 100755 --- a/stage3/01-sys-tweaks/01-run.sh +++ b/stage3/01-sys-tweaks/01-run.sh @@ -42,13 +42,14 @@ pushd ${DOWNLOAD_DIR} # opencv sources wget -nc -nv \ - https://github.com/opencv/opencv/archive/4.6.0.tar.gz -wget -nc -nv -O contrib-4.6.0.tar.gz \ - https://github.com/opencv/opencv_contrib/archive/4.6.0.tar.gz + https://github.com/opencv/opencv/archive/4.8.0.tar.gz +wget -nc -nv -O contrib-4.8.0.tar.gz \ + https://github.com/opencv/opencv_contrib/archive/4.8.0.tar.gz # allwpilib wget -nc -nv -O allwpilib.tar.gz \ - https://github.com/wpilibsuite/allwpilib/archive/v2023.4.1.tar.gz + https://github.com/wpilibsuite/allwpilib/tarball/d9b504bc84019da6b2da3293d13264f2b01d2c4c + #https://github.com/wpilibsuite/allwpilib/archive/v2023.4.1.tar.gz ## robotpy-build #wget -nc -nv -O robotpy-build.tar.gz \ @@ -88,10 +89,10 @@ install -v -d ${EXTRACT_DIR} pushd ${EXTRACT_DIR} # opencv -rm -rf opencv-4.6.0 -tar xzf "${DOWNLOAD_DIR}/4.6.0.tar.gz" -tar xzf "${DOWNLOAD_DIR}/contrib-4.6.0.tar.gz" -pushd opencv-4.6.0 +rm -rf opencv-4.8.0 +tar xzf "${DOWNLOAD_DIR}/4.8.0.tar.gz" +tar xzf "${DOWNLOAD_DIR}/contrib-4.8.0.tar.gz" +pushd opencv-4.8.0 sed -i -e 's/javac sourcepath/javac target="1.8" source="1.8" sourcepath/' modules/java/jar/build.xml.in # disable extraneous data warnings; these are common with USB cameras sed -i -e '/JWRN_EXTRANEOUS_DATA/d' 3rdparty/libjpeg/jdmarker.c @@ -101,39 +102,11 @@ popd # allwpilib tar xzf "${DOWNLOAD_DIR}/allwpilib.tar.gz" rm -rf allwpilib -mv allwpilib-* allwpilib +#mv allwpilib-* allwpilib +mv wpilibsuite-allwpilib-* allwpilib pushd allwpilib popd -# robotpy-build -#tar xzf "${DOWNLOAD_DIR}/robotpy-build.tar.gz" -#mv robotpy-build-* robotpy-build - -# pybind11 -#tar xzf "${DOWNLOAD_DIR}/pybind11.tar.gz" -#rmdir robotpy-build/robotpy_build/pybind11 -#mv pybind11-* robotpy-build/robotpy_build/pybind11 - -# robotpy-wpiutil -#tar xzf "${DOWNLOAD_DIR}/robotpy-wpiutil.tar.gz" -#mv robotpy-wpiutil-* robotpy-wpiutil -#echo "__version__ = '2023.1.1.0'" > robotpy-wpiutil/wpiutil/version.py - -# robotpy-wpinet -#tar xzf "${DOWNLOAD_DIR}/robotpy-wpinet.tar.gz" -#mv robotpy-wpinet-* robotpy-wpinet -#echo "__version__ = '2023.1.1.0'" > robotpy-wpinet/wpinet/version.py - -# pyntcore -#tar xzf "${DOWNLOAD_DIR}/pyntcore.tar.gz" -#mv pyntcore-* pyntcore -#echo "__version__ = '2023.1.1.0'" > pyntcore/ntcore/version.py - -# robotpy-cscore -#tar xzf "${DOWNLOAD_DIR}/robotpy-cscore.tar.gz" -#mv robotpy-cscore-* robotpy-cscore -#echo "__version__ = '2023.1.1.0'" > robotpy-cscore/cscore/version.py - # pixy2 tar xzf "${DOWNLOAD_DIR}/pixy2.tar.gz" rm -rf pixy2 @@ -164,34 +137,34 @@ build_opencv () { rm -rf $1 mkdir -p $1 pushd $1 - cmake "${EXTRACT_DIR}/opencv-4.6.0" \ + cmake "${EXTRACT_DIR}/opencv-4.8.0" \ + -G Ninja \ -DWITH_FFMPEG=OFF \ -DBUILD_JPEG=ON \ -DBUILD_TIFF=ON \ -DBUILD_TESTS=OFF \ - -DPython_ADDITIONAL_VERSIONS=3.9 \ + -DPython_ADDITIONAL_VERSIONS=3.11 \ -DBUILD_JAVA=$3 \ -DENABLE_CXX11=ON \ -DBUILD_SHARED_LIBS=$3 \ -DCMAKE_BUILD_TYPE=$2 \ -DCMAKE_DEBUG_POSTFIX=d \ - -DCMAKE_TOOLCHAIN_FILE=${ROOTFS_DIR}/usr/src/opencv-4.6.0/platforms/linux/aarch64-gnu.toolchain.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${ROOTFS_DIR}/usr/src/opencv-4.8.0/platforms/linux/aarch64-gnu.toolchain.cmake \ -DARM_LINUX_SYSROOT=${ROOTFS_DIR} \ -DCMAKE_SYSROOT=${ROOTFS_DIR} \ - -DCMAKE_MAKE_PROGRAM=make \ -DENABLE_NEON=ON \ -DWITH_TBB=$3 \ -DBUILD_opencv_python3=$3 \ - -DPYTHON3_INCLUDE_PATH=${ROOTFS_DIR}/usr/include/python3.9 \ - -DPYTHON3_NUMPY_INCLUDE_DIRS=${ROOTFS_DIR}/usr/include/python3.9/numpy \ + -DPYTHON3_INCLUDE_PATH=${ROOTFS_DIR}/usr/include/python3.11 \ + -DPYTHON3_NUMPY_INCLUDE_DIRS=${ROOTFS_DIR}/usr/include/python3.11/numpy \ -DOPENCV_EXTRA_FLAGS_DEBUG=-Og \ -DOPENCV_GENERATE_PKGCONFIG=ON \ -DCMAKE_MODULE_PATH=${SUB_STAGE_DIR}/files \ -DCMAKE_INSTALL_PREFIX=/usr/local/frc$4 \ - -DOPENCV_EXTRA_MODULES_PATH=${EXTRACT_DIR}/opencv_contrib-4.6.0/modules/aruco \ + -DOPENCV_EXTRA_MODULES_PATH=${EXTRACT_DIR}/opencv_contrib-4.8.0/modules/aruco \ || exit 1 - make -j${NCPU} || exit 1 - make DESTDIR=${ROOTFS_DIR} install || exit 1 + ninja || exit 1 + env DESTDIR=${ROOTFS_DIR} ninja install || exit 1 popd } @@ -200,19 +173,19 @@ build_opencv build/opencv-build Release ON "" || exit 1 build_opencv build/opencv-static Release OFF "-static" || exit 1 # fix up java install -cp -p ${ROOTFS_DIR}/usr/local/frc/share/java/opencv4/libopencv_java460*.so "${ROOTFS_DIR}/usr/local/frc/lib/" +cp -p ${ROOTFS_DIR}/usr/local/frc/share/java/opencv4/libopencv_java480*.so "${ROOTFS_DIR}/usr/local/frc/lib/" mkdir -p "${ROOTFS_DIR}/usr/local/frc/java" -cp -p "${ROOTFS_DIR}/usr/local/frc/share/java/opencv4/opencv-460.jar" "${ROOTFS_DIR}/usr/local/frc/java/" +cp -p "${ROOTFS_DIR}/usr/local/frc/share/java/opencv4/opencv-480.jar" "${ROOTFS_DIR}/usr/local/frc/java/" # the opencv build names the python .so with the build platform name # instead of the target platform, so rename it -pushd "${ROOTFS_DIR}/usr/local/frc/lib/python3.9/site-packages/cv2/python-3.9" -mv cv2.cpython-39-*-gnu.so cv2.cpython-39-aarch64-linux-gnu.so -mv cv2d.cpython-39-*-gnu.so cv2d.cpython-39-aarch64-linux-gnu.so +pushd "${ROOTFS_DIR}/usr/local/frc/lib/python3.11/dist-packages/cv2/python-3.11" +mv cv2.cpython-311-*-gnu.so cv2.cpython-311-aarch64-linux-gnu.so +mv cv2d.cpython-311-*-gnu.so cv2d.cpython-311-aarch64-linux-gnu.so popd -# link python package to site-packages -ln -sf /usr/local/frc/lib/python3.9/site-packages/cv2 "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/cv2" +# link python package to dist-packages +ln -sf /usr/local/frc/lib/python3.11/dist-packages/cv2 "${ROOTFS_DIR}/usr/local/lib/python3.11/dist-packages/cv2" # # Build wpiutil, cscore, ntcore, cameraserver @@ -223,22 +196,24 @@ build_wpilib () { mkdir -p $1 pushd $1 cmake "${EXTRACT_DIR}/allwpilib" \ + -G Ninja \ -DWITH_GUI=OFF \ -DWITH_TESTS=OFF \ -DWITH_SIMULATION_MODULES=OFF \ - -DWPILIB_TARGET_WARNINGS=-Wno-deprecated-declarations \ + -DWPILIB_TARGET_WARNINGS=-Wno-maybe-uninitialized \ -DCMAKE_BUILD_TYPE=$2 \ - -DCMAKE_TOOLCHAIN_FILE=${ROOTFS_DIR}/usr/src/opencv-4.6.0/platforms/linux/aarch64-gnu.toolchain.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${ROOTFS_DIR}/usr/src/opencv-4.8.0/platforms/linux/aarch64-gnu.toolchain.cmake \ -DARM_LINUX_SYSROOT=${ROOTFS_DIR} \ -DCMAKE_SYSROOT=${ROOTFS_DIR} \ -DCMAKE_MODULE_PATH=${SUB_STAGE_DIR}/files \ - -DOPENCV_JAR_FILE=`ls ${ROOTFS_DIR}/usr/local/frc/java/opencv-460.jar` \ - -DOPENCV_JNI_FILE=`ls ${ROOTFS_DIR}/usr/local/frc/lib/libopencv_java460.so` \ + -DOPENCV_JAR_FILE=`ls ${ROOTFS_DIR}/usr/local/frc/java/opencv-480.jar` \ + -DOPENCV_JNI_FILE=`ls ${ROOTFS_DIR}/usr/local/frc/lib/libopencv_java480.so` \ -DOpenCV_DIR=${ROOTFS_DIR}/usr/local/frc/share/opencv4 \ -DTHREADS_PTHREAD_ARG=-pthread \ -DCMAKE_INSTALL_PREFIX=/usr/local/frc \ || exit 1 - make -j${NCPU} || exit 1 + ninja || exit 1 + env DESTDIR=${ROOTFS_DIR} ninja install || exit 1 popd } @@ -251,12 +226,13 @@ build_static_wpilib() { mkdir -p $1 pushd $1 cmake "${EXTRACT_DIR}/allwpilib" \ + -G Ninja \ -DWITH_GUI=OFF \ -DWITH_TESTS=OFF \ -DWITH_SIMULATION_MODULES=OFF \ - -DWPILIB_TARGET_WARNINGS=-Wno-deprecated-declarations \ + -DWPILIB_TARGET_WARNINGS=-Wno-maybe-uninitialized \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_TOOLCHAIN_FILE=${ROOTFS_DIR}/usr/src/opencv-4.6.0/platforms/linux/aarch64-gnu.toolchain.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${ROOTFS_DIR}/usr/src/opencv-4.8.0/platforms/linux/aarch64-gnu.toolchain.cmake \ -DARM_LINUX_SYSROOT=${ROOTFS_DIR} \ -DCMAKE_MODULE_PATH=${SUB_STAGE_DIR}/files \ -DOpenCV_DIR=${ROOTFS_DIR}/usr/local/frc/share/OpenCV \ @@ -265,87 +241,19 @@ build_static_wpilib() { -DTHREADS_PTHREAD_ARG=-pthread \ -DCMAKE_INSTALL_PREFIX=/usr/local/frc-static \ || exit 1 - make -j${NCPU} || exit 1 + ninja || exit 1 + env DESTDIR=${ROOTFS_DIR} ninja install || exit 1 popd } build_static_wpilib build/allwpilib-static || exit 1 -# manually install, since cmake install is a bit weirdly set up -install -v -d "${ROOTFS_DIR}/usr/local/frc/bin" -install -v -d "${ROOTFS_DIR}/usr/local/frc/include" -install -v -d "${ROOTFS_DIR}/usr/local/frc/java" -install -v -d "${ROOTFS_DIR}/usr/local/frc/lib" -install -v -d "${ROOTFS_DIR}/usr/local/frc-static/lib" - -# built libs -sh -c 'cd build/allwpilib-build/lib && tar cf - lib*' | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib && tar xf -" -sh -c 'cd build/allwpilib-build-debug/lib && tar cf - lib*' | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib && tar xf -" -sh -c 'cd build/allwpilib-static/lib && tar cf - lib*' | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc-static/lib && tar xf -" - -# built headers -sh -c 'cd build/allwpilib-build/hal/gen && tar cf - .' | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c 'cd build/allwpilib-build/ntcore/generated/main/native/include && tar cf - .' | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" - -# built jars -sh -c 'cd build/allwpilib-build/jar && tar cf - *.jar' | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/java && tar xf -" - -# headers -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/thirdparty/fmtlib/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/thirdparty/ghc/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/thirdparty/json/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/thirdparty/memory/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/thirdparty/mpack/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpiutil/src/main/native/thirdparty/sigslot/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpinet/src/main/native/thirdparty/libuv/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpinet/src/main/native/thirdparty/tcpsockets/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpinet/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/cscore/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/ntcore/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/cameraserver/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/hal/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpimath/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpimath/src/main/native/thirdparty/drake/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpimath/src/main/native/thirdparty/eigen/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpimath/src/main/native/thirdparty/gcem/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/apriltag/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" -sh -c "cd ${EXTRACT_DIR}/allwpilib/wpilibc/src/main/native/include && tar cf - ." | \ - sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include && tar xf -" - # executables (use static build to ensure they don't break) sh -c 'cd build/allwpilib-static/bin && tar cf - cscore_* netconsoleTee*' | \ sh -c "cd ${ROOTFS_DIR}/usr/local/frc/bin && tar xf -" # pkgconfig files install -v -d "${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig" -install -m 644 ${SUB_STAGE_DIR}/files/pkgconfig/* "${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig" +install -m 644 ${SUB_STAGE_DIR}/files/pkgconfig/*.pc "${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig" install -v -d "${ROOTFS_DIR}/usr/local/frc-static/lib/pkgconfig" for f in ${SUB_STAGE_DIR}/files/pkgconfig/*.pc; do install -m 644 $f "${ROOTFS_DIR}/usr/local/frc-static/lib/pkgconfig" @@ -359,164 +267,23 @@ ln -sf ../frc/include "${ROOTFS_DIR}/usr/local/frc-static/include" rm -rf "${ROOTFS_DIR}/usr/local/frc-static/python" # fix up frc-static opencv pkgconfig Libs.private -sed -i -e 's, -L/pi-gen[^ ]*,,g' "${ROOTFS_DIR}/usr/local/frc-static/lib/pkgconfig/opencv.pc" +sed -i -e 's, -L/pi-gen[^ ]*,,g' "${ROOTFS_DIR}/usr/local/frc-static/lib/pkgconfig/opencv4.pc" popd +ROBOTPY_REPO=https://frcmaven.wpi.edu/api/download/wpilib-python-release-2024 +ROBOTPY_VERSION=2024.0.0b3 +ROBOTPY_ARCH=aarch64 + on_chroot << EOF -pip3 install https://www.tortall.net/~robotpy/wheels/2023/raspbian/robotpy_wpiutil-2023.4.1.0-cp39-cp39-linux_aarch64.whl -pip3 install https://www.tortall.net/~robotpy/wheels/2023/raspbian/robotpy_wpinet-2023.4.1.0-cp39-cp39-linux_aarch64.whl -pip3 install https://www.tortall.net/~robotpy/wheels/2023/raspbian/pyntcore-2023.4.1.1-cp39-cp39-linux_aarch64.whl -pip3 install https://www.tortall.net/~robotpy/wheels/2023/raspbian/robotpy_cscore-2023.4.1.0-cp39-cp39-linux_aarch64.whl -pip3 install https://www.tortall.net/~robotpy/wheels/2023/raspbian/robotpy_wpimath-2023.4.1.0-cp39-cp39-linux_aarch64.whl -pip3 install https://www.tortall.net/~robotpy/wheels/2023/raspbian/robotpy_apriltag-2023.4.1.0-cp39-cp39-linux_aarch64.whl +pip3 install --break-system-packages ${ROBOTPY_REPO}/robotpy-wpiutil/${ROBOTPY_VERSION}/robotpy_wpiutil-${ROBOTPY_VERSION}-cp311-cp311-linux_${ROBOTPY_ARCH}.whl +pip3 install --break-system-packages ${ROBOTPY_REPO}/robotpy-wpinet/${ROBOTPY_VERSION}/robotpy_wpinet-${ROBOTPY_VERSION}-cp311-cp311-linux_${ROBOTPY_ARCH}.whl +pip3 install --break-system-packages ${ROBOTPY_REPO}/pyntcore/${ROBOTPY_VERSION}/pyntcore-${ROBOTPY_VERSION}-cp311-cp311-linux_${ROBOTPY_ARCH}.whl +pip3 install --break-system-packages ${ROBOTPY_REPO}/robotpy-cscore/${ROBOTPY_VERSION}/robotpy_cscore-${ROBOTPY_VERSION}-cp311-cp311-linux_${ROBOTPY_ARCH}.whl +pip3 install --break-system-packages ${ROBOTPY_REPO}/robotpy-wpimath/${ROBOTPY_VERSION}/robotpy_wpimath-${ROBOTPY_VERSION}-cp311-cp311-linux_${ROBOTPY_ARCH}.whl +pip3 install --break-system-packages ${ROBOTPY_REPO}/robotpy-apriltag/${ROBOTPY_VERSION}/robotpy_apriltag-${ROBOTPY_VERSION}-cp311-cp311-linux_${ROBOTPY_ARCH}.whl EOF - -### We install wheels instead of using this, but keeping it because it *almost* works -# -## these builds arepretty cpu-intensive, so we don't want to build it in a chroot, -## and setup.py doesn't support cross-builds, so build it manually -#pip3 install robotpy-build==2023.0.0 -# -## -## Build robotpy-wpiutil -## -#pushd ${EXTRACT_DIR}/robotpy-wpiutil -# -## install Python sources -#sh -c 'tar cf - wpiutil' | \ -# sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages && tar xf -" -# -## install blank _init_wpiutil.py -#touch "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/wpiutil/_init_wpiutil.py" -# -## generate sources -#python3 setup.py build_gen -# -## build module -#aarch64-linux-gnu-g++ \ -# --sysroot=${ROOTFS_DIR} \ -# -g -O -Wall -fvisibility=hidden -shared -fPIC -std=c++20 \ -# -o "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/_wpiutil.cpython-39-aarch64-linux-gnu.so" \ -# -I build/temp.*/gensrc/* \ -# -I../robotpy-build/robotpy_build/include \ -# -I../robotpy-build/robotpy_build/pybind11/include \ -# -Iwpiutil/src/type_casters \ -# -Iwpiutil/rpy-include \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --cflags python3 wpiutil` \ -# wpiutil/src/main.cpp \ -# wpiutil/src/safethread_gil.cpp \ -# wpiutil/src/stacktracehook.cpp \ -# build/temp.*/gensrc/*/*.cpp \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --libs wpiutil` \ -# || exit 1 -# -#popd -# -#pip3 install robotpy-wpiutil==2023.1.1.0 -# -## -## Build robotpy-wpinet -## -#pushd ${EXTRACT_DIR}/robotpy-wpinet -# -## install Python sources -#sh -c 'tar cf - wpinet' | \ -# sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages && tar xf -" -# -## install blank _init_wpinet.py -#touch "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/wpinet/_init_wpinet.py" -# -## generate sources -#python3 setup.py build_gen -# -## build module -#aarch64-linux-gnu-g++ \ -# --sysroot=${ROOTFS_DIR} \ -# -g -O -Wall -fvisibility=hidden -shared -fPIC -std=c++20 \ -# -o "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/_wpinet.cpython-39-aarch64-linux-gnu.so" \ -# -I build/temp.*/gensrc/* \ -# -I../robotpy-build/robotpy_build/include \ -# -I../robotpy-build/robotpy_build/pybind11/include \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --cflags python3 wpinet wpiutil` \ -# wpinet/src/main.cpp \ -# build/temp.*/gensrc/*/*.cpp \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --libs wpinet wpiutil` \ -# || exit 1 -# -#popd -# -#pip3 install robotpy-wpinet==2023.1.1.0 -# -## -## Build pyntcore -## -#pushd ${EXTRACT_DIR}/pyntcore -# -## install Python sources -#sh -c 'tar cf - ntcore' | \ -# sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages && tar xf -" -# -## install blank _init_ntcore.py -#touch "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/cscore/_init_ntcore.py" -# -## generate sources -#python3 setup.py build_gen -# -## build module -#aarch64-linux-gnu-g++ \ -# --sysroot=${ROOTFS_DIR} \ -# -g -O -Wall -fvisibility=hidden -shared -fPIC -std=c++20 \ -# -o "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/_cscore.cpython-39-aarch64-linux-gnu.so" \ -# -I build/temp.*/gensrc/* \ -# -I../robotpy-build/robotpy_build/include \ -# -I../robotpy-build/robotpy_build/pybind11/include \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --cflags python3 ntcore wpiutil` \ -# ntcore/src/ntcore.cpp \ -# ntcore/src/nt_instance.cpp \ -# ntcore/src/py2value.cpp \ -# ntcore/src/pyentry.cpp \ -# build/temp.*/gensrc/*/*.cpp \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --libs ntcore wpiutil` \ -# || exit 1 -# -#popd -# -#pip3 install pyntcore==2023.1.1.0 -# -## -## Build robotpy-cscore -## -#pushd ${EXTRACT_DIR}/robotpy-cscore -# -## install Python sources -#sh -c 'tar cf - cscore' | \ -# sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages && tar xf -" -# -## install blank _init_cscore.py -#touch "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/cscore/_init_cscore.py" -# -## generate sources -#python3 setup.py build_gen -# -## build module -#aarch64-linux-gnu-g++ \ -# --sysroot=${ROOTFS_DIR} \ -# -g -O -Wall -fvisibility=hidden -shared -fPIC -std=c++20 \ -# -o "${ROOTFS_DIR}/usr/local/lib/python3.9/dist-packages/_cscore.cpython-39-aarch64-linux-gnu.so" \ -# -I build/temp.*/gensrc/* \ -# -I../robotpy-build/robotpy_build/include \ -# -I../robotpy-build/robotpy_build/pybind11/include \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --cflags python3 cameraserver cscore wpiutil` \ -# cscore/src/main.cpp \ -# cscore/cvnp/cvnp.cpp \ -# cscore/cvnp/cvnp_synonyms.cpp \ -# `env PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR}:${ROOTFS_DIR}/usr/local/frc/lib/pkgconfig pkg-config --libs cameraserver cscore wpiutil` \ -# || exit 1 -# -#popd - # # Build pixy2 # @@ -528,8 +295,8 @@ popd EOF install -m 644 "${EXTRACT_DIR}/pixy2/build/libpixyusb2/libpixy2.a" "${ROOTFS_DIR}/usr/local/frc/lib/" -install -m 644 "${EXTRACT_DIR}/pixy2/build/python_demos/pixy.py" "${ROOTFS_DIR}/usr/local/lib/python3.9/site-packages/" -install -m 755 ${EXTRACT_DIR}/pixy2/build/python_demos/_pixy.*.so "${ROOTFS_DIR}/usr/local/lib/python3.9/site-packages/" +install -m 644 "${EXTRACT_DIR}/pixy2/build/python_demos/pixy.py" "${ROOTFS_DIR}/usr/local/lib/python3.11/dist-packages/" +install -m 755 ${EXTRACT_DIR}/pixy2/build/python_demos/_pixy.*.so "${ROOTFS_DIR}/usr/local/lib/python3.11/dist-packages/" rm -rf "${EXTRACT_DIR}/pixy2/build" # diff --git a/stage3/01-sys-tweaks/files/pkgconfig/apriltag.pc b/stage3/01-sys-tweaks/files/pkgconfig/apriltag.pc index 65b3967b40..b4461afbbc 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/apriltag.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/apriltag.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/apriltag libdir=${exec_prefix}/lib Name: apriltag Description: WPILib Robotics Library AprilTags -Version: 2023.1.1 +Version: 2024.1.1 Requires: wpimath wpiutil Libs: -L${libdir} -lapriltag Libs.private: -lpthread diff --git a/stage3/01-sys-tweaks/files/pkgconfig/cameraserver.pc b/stage3/01-sys-tweaks/files/pkgconfig/cameraserver.pc index 245b35da8c..64c7d2fff7 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/cameraserver.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/cameraserver.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/cameraserver libdir=${exec_prefix}/lib Name: cameraserver Description: WPILib Robotics Library CameraServer -Version: 2023.1.1 +Version: 2024.1.1 Requires: cscore wpiutil Requires.private: ntcore Libs: -L${libdir} -lcameraserver diff --git a/stage3/01-sys-tweaks/files/pkgconfig/cscore.pc b/stage3/01-sys-tweaks/files/pkgconfig/cscore.pc index e3d9f8e5e3..c9d7aaed0d 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/cscore.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/cscore.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/cscore libdir=${exec_prefix}/lib Name: cscore Description: WPILib Robotics Library CameraServer Core -Version: 2023.1.1 +Version: 2024.1.1 Requires: wpiutil opencv4 Requires.private: wpinet Libs: -L${libdir} -lcscore diff --git a/stage3/01-sys-tweaks/files/pkgconfig/ntcore.pc b/stage3/01-sys-tweaks/files/pkgconfig/ntcore.pc index c3da5c47de..d12ec26312 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/ntcore.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/ntcore.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/ntcore libdir=${exec_prefix}/lib Name: ntcore Description: WPILib Robotics Library NetworkTables -Version: 2023.1.1 +Version: 2024.1.1 Requires: wpiutil Requires.private: wpinet Libs: -L${libdir} -lntcore diff --git a/stage3/01-sys-tweaks/files/pkgconfig/wpilibc.pc b/stage3/01-sys-tweaks/files/pkgconfig/wpilibc.pc index bb97c9cf1f..e477a4489f 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/wpilibc.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/wpilibc.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/wpilibc libdir=${exec_prefix}/lib Name: wpilibc Description: WPILib Robotics Library -Version: 2023.1.1 +Version: 2024.1.1 Requires: apriltag cameraserver ntcore cscore wpimath wpinet wpiutil Libs: -L${libdir} -lwpilibc -lwpiHal Cflags: -I${includedir} diff --git a/stage3/01-sys-tweaks/files/pkgconfig/wpimath.pc b/stage3/01-sys-tweaks/files/pkgconfig/wpimath.pc index 21eba35381..6edcee8737 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/wpimath.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/wpimath.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/wpimath libdir=${exec_prefix}/lib Name: wpimath Description: WPILib Robotics Library Math -Version: 2023.1.1 +Version: 2024.1.1 Requires: wpiutil Libs: -L${libdir} -lwpimath Cflags: -I${includedir} diff --git a/stage3/01-sys-tweaks/files/pkgconfig/wpinet.pc b/stage3/01-sys-tweaks/files/pkgconfig/wpinet.pc index 0946d3e8de..00424a0e2f 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/wpinet.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/wpinet.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/wpinet libdir=${exec_prefix}/lib Name: wpinet Description: WPILib Robotics Library Networking -Version: 2023.1.1 +Version: 2024.1.1 Requires: wpiutil Libs: -L${libdir} -lwpinet Libs.private: -lpthread -lutil diff --git a/stage3/01-sys-tweaks/files/pkgconfig/wpiutil.pc b/stage3/01-sys-tweaks/files/pkgconfig/wpiutil.pc index e0526dbe29..839b84baeb 100644 --- a/stage3/01-sys-tweaks/files/pkgconfig/wpiutil.pc +++ b/stage3/01-sys-tweaks/files/pkgconfig/wpiutil.pc @@ -2,12 +2,12 @@ prefix=/usr/local/frc exec_prefix=${prefix} -includedir=${prefix}/include +includedir=${prefix}/include/wpiutil libdir=${exec_prefix}/lib Name: wpiutil Description: WPILib Robotics Library utilities -Version: 2023.1.1 +Version: 2024.1.1 Libs: -L${libdir} -lwpiutil -latomic Libs.private: -lpthread Cflags: -I${includedir} diff --git a/stage4/01-sys-tweaks/01-run.sh b/stage4/01-sys-tweaks/01-run.sh index 6ea5f24d67..39cae7eddb 100755 --- a/stage4/01-sys-tweaks/01-run.sh +++ b/stage4/01-sys-tweaks/01-run.sh @@ -21,6 +21,10 @@ sh -c "cd ${BASE_DIR}/deps && tar cf - tools" | \ # pushd "${STAGE_WORK_DIR}/tools" +ls -l ${ROOTFS_DIR}/usr/local/frc-static/include +ls -l ${ROOTFS_DIR}/usr/local/frc/include +ls ${ROOTFS_DIR}/usr/local/frc-static/include/wpiutil + export CXXFLAGS="-std=c++20 --sysroot=${ROOTFS_DIR} -Wl,-rpath -Wl,${ROOTFS_DIR}/opt/vc/lib" export PKG_CONFIG_DIR= export PKG_CONFIG_LIBDIR=${ROOTFS_DIR}/usr/lib/aarch64-linux-gnu/pkgconfig:${ROOTFS_DIR}/usr/lib/pkgconfig:${ROOTFS_DIR}/usr/share/pkgconfig:${ROOTFS_DIR}/usr/local/frc-static/lib/pkgconfig diff --git a/stage4/02-net-tweaks/01-run.sh b/stage4/02-net-tweaks/01-run.sh index 01035095e8..d6150f538b 100755 --- a/stage4/02-net-tweaks/01-run.sh +++ b/stage4/02-net-tweaks/01-run.sh @@ -6,10 +6,10 @@ install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/" # disable wireless install -m 644 files/raspi-blacklist.conf "${ROOTFS_DIR}/etc/modprobe.d/" -on_chroot << EOF - SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_wait 0 - SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_netconf 1 -EOF +#on_chroot << EOF +# SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_wait 0 +# SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_netconf 1 +#EOF if [ -v WPA_COUNTRY ]; then on_chroot <<- EOF diff --git a/stage5/01-sys-tweaks/01-run.sh b/stage5/01-sys-tweaks/01-run.sh index 0077243ac9..f89bd406ed 100755 --- a/stage5/01-sys-tweaks/01-run.sh +++ b/stage5/01-sys-tweaks/01-run.sh @@ -36,8 +36,8 @@ source "/home/${FIRST_USER_NAME}/.nvm/nvm.sh" nvm install 14.15.0 npm --unsafe-perm --user=1000 --group=1000 install -g @wpilib/wpilib-ws-robot-romi -npm --unsafe-perm --user=1000 --group=1000 install -g i2c-bus EOF +#npm --unsafe-perm --user=1000 --group=1000 install -g i2c-bus # Fix NVM/NPM owner/group chown -R 1000:1000 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.nvm" From 27bc31c8d91b3d2e560059776ef656d69d0332ec Mon Sep 17 00:00:00 2001 From: Peter Johnson <johnson.peter@gmail.com> Date: Sun, 7 Jan 2024 17:07:22 -0800 Subject: [PATCH 56/57] Update to kickoff releases --- stage3/01-sys-tweaks/01-run.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/stage3/01-sys-tweaks/01-run.sh b/stage3/01-sys-tweaks/01-run.sh index 94c6071462..8a4db68215 100755 --- a/stage3/01-sys-tweaks/01-run.sh +++ b/stage3/01-sys-tweaks/01-run.sh @@ -48,8 +48,7 @@ wget -nc -nv -O contrib-4.8.0.tar.gz \ # allwpilib wget -nc -nv -O allwpilib.tar.gz \ - https://github.com/wpilibsuite/allwpilib/tarball/d9b504bc84019da6b2da3293d13264f2b01d2c4c - #https://github.com/wpilibsuite/allwpilib/archive/v2023.4.1.tar.gz + https://github.com/wpilibsuite/allwpilib/archive/v2024.1.1.tar.gz ## robotpy-build #wget -nc -nv -O robotpy-build.tar.gz \ @@ -102,8 +101,7 @@ popd # allwpilib tar xzf "${DOWNLOAD_DIR}/allwpilib.tar.gz" rm -rf allwpilib -#mv allwpilib-* allwpilib -mv wpilibsuite-allwpilib-* allwpilib +mv allwpilib-* allwpilib pushd allwpilib popd @@ -272,7 +270,7 @@ sed -i -e 's, -L/pi-gen[^ ]*,,g' "${ROOTFS_DIR}/usr/local/frc-static/lib/pkgconf popd ROBOTPY_REPO=https://frcmaven.wpi.edu/api/download/wpilib-python-release-2024 -ROBOTPY_VERSION=2024.0.0b3 +ROBOTPY_VERSION=2024.1.1.0 ROBOTPY_ARCH=aarch64 on_chroot << EOF From cb31e5407d51360273b5063e785933dc2428b34a Mon Sep 17 00:00:00 2001 From: Peter Johnson <johnson.peter@gmail.com> Date: Mon, 19 Feb 2024 21:17:07 -0800 Subject: [PATCH 57/57] Update to 2024.3.1 --- stage3/01-sys-tweaks/01-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stage3/01-sys-tweaks/01-run.sh b/stage3/01-sys-tweaks/01-run.sh index 8a4db68215..c1d7430ff0 100755 --- a/stage3/01-sys-tweaks/01-run.sh +++ b/stage3/01-sys-tweaks/01-run.sh @@ -48,7 +48,7 @@ wget -nc -nv -O contrib-4.8.0.tar.gz \ # allwpilib wget -nc -nv -O allwpilib.tar.gz \ - https://github.com/wpilibsuite/allwpilib/archive/v2024.1.1.tar.gz + https://github.com/wpilibsuite/allwpilib/archive/v2024.3.1.tar.gz ## robotpy-build #wget -nc -nv -O robotpy-build.tar.gz \ @@ -270,7 +270,7 @@ sed -i -e 's, -L/pi-gen[^ ]*,,g' "${ROOTFS_DIR}/usr/local/frc-static/lib/pkgconf popd ROBOTPY_REPO=https://frcmaven.wpi.edu/api/download/wpilib-python-release-2024 -ROBOTPY_VERSION=2024.1.1.0 +ROBOTPY_VERSION=2024.3.1.0 ROBOTPY_ARCH=aarch64 on_chroot << EOF