From 1377e903b864673138908165572a18933400e8eb Mon Sep 17 00:00:00 2001 From: Vasilis Tsiligiannis Date: Thu, 4 Jan 2024 13:05:51 +0200 Subject: [PATCH 1/6] Ensure loop device partition nodes are created (#741) Although the loop block device is created before attaching the image to it, the devices for the partition that the image contains are still not created. This patch creates those devices as well, when they are not already available. Fixes #482 Signed-off-by: Vasilis Tsiligiannis --- export-image/prerun.sh | 1 + export-noobs/prerun.sh | 1 + scripts/common | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index a5f94e9..d042c6a 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -46,6 +46,7 @@ if [ "${NO_PRERUN_QCOW2}" = "0" ]; then fi done + ensure_loopdev_partitions "$LOOP_DEV" BOOT_DEV="${LOOP_DEV}p1" ROOT_DEV="${LOOP_DEV}p2" diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index 6282836..80cbb8e 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -22,6 +22,7 @@ until ensure_next_loopdev && LOOP_DEV="$(losetup --show --find --partscan "$IMG_ fi done +ensure_loopdev_partitions "$LOOP_DEV" BOOT_DEV="${LOOP_DEV}p1" ROOT_DEV="${LOOP_DEV}p2" diff --git a/scripts/common b/scripts/common index 74c7938..cda5551 100644 --- a/scripts/common +++ b/scripts/common @@ -110,3 +110,17 @@ ensure_next_loopdev() { [[ -b "$loopdev" ]] || mknod "$loopdev" b 7 "$loopmaj" } export -f ensure_next_loopdev + +ensure_loopdev_partitions() { + local line + local partition + local majmin + lsblk -r -n -o "NAME,MAJ:MIN" "$1" | grep -v "^${1#/dev/} " | while read -r line; do + partition="${line%% *}" + majmin="${line#* }" + if [ ! -b "/dev/$partition" ]; then + mknod "/dev/$partition" b "${majmin%:*}" "${majmin#*:}" + fi + done +} +export -f ensure_loopdev_partitions From c5fdb01eac6a802957ad1eed5b6b9d4f06f791c4 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 8 Dec 2023 07:58:19 +0000 Subject: [PATCH 2/6] Update release notes --- export-noobs/00-release/files/release_notes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 6507e59..d305e33 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,4 +1,6 @@ UNRELEASED: + * Fix Raspberry Pi Imager's WLAN configuration for lite images +2023-12-05: * 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 From ec04064a552372b64a2cb7a1feb1bbda0c86ecac Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 18 Dec 2023 11:01:37 +0000 Subject: [PATCH 3/6] stage0: Only disable initramfs updates if update-initramfs.conf exists --- stage0/02-firmware/02-run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stage0/02-firmware/02-run.sh b/stage0/02-firmware/02-run.sh index 0b2bca9..9cf9154 100755 --- a/stage0/02-firmware/02-run.sh +++ b/stage0/02-firmware/02-run.sh @@ -1,3 +1,5 @@ #!/bin/bash -e -sed -i 's/^update_initramfs=.*/update_initramfs=no/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" +if [ -f "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" ]; then + sed -i 's/^update_initramfs=.*/update_initramfs=no/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" +fi From a143895f0a465ffcd20323264e648cba3f39ccc6 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 18 Dec 2023 11:04:13 +0000 Subject: [PATCH 4/6] stage0: Check whether foreign architecture is needed --- stage0/00-configure-apt/00-run.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index fa4f59f..926c4c6 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -14,8 +14,13 @@ 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 +on_chroot <<- \EOF + ARCH="$(dpkg --print-architecture)" + if [ "$ARCH" = "armhf" ]; then + dpkg --add-architecture arm64 + elif [ "$ARCH" = "arm64" ]; then + dpkg --add-architecture armhf + fi + apt-get update + apt-get dist-upgrade -y EOF From 30fa760eb166cfe8a8f1350b1cfd7d356c3753de Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 17 Jan 2024 17:30:10 +0000 Subject: [PATCH 5/6] stage0: prevent kernel packages from creating useless symlinks --- stage0/02-firmware/02-run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stage0/02-firmware/02-run.sh b/stage0/02-firmware/02-run.sh index 9cf9154..677cd81 100755 --- a/stage0/02-firmware/02-run.sh +++ b/stage0/02-firmware/02-run.sh @@ -3,3 +3,8 @@ if [ -f "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" ]; then sed -i 's/^update_initramfs=.*/update_initramfs=no/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" fi + +if [ ! -f "${ROOTFS_DIR}/etc/kernel-img.conf" ]; then + echo "do_symlinks=0" > "${ROOTFS_DIR}/etc/kernel-img.conf" +fi +rm -f "${ROOTFS_DIR}/"{vmlinuz,initrd.img}* From e682f62aed71be53fd8d49ac94c4d11f01996efe Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 17 Jan 2024 17:34:49 +0000 Subject: [PATCH 6/6] stage3: add vulkan support --- 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 cc18081..9175bcc 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -17,3 +17,4 @@ libcamera-apps python3-picamera2 python3-pyqt5 python3-opengl +vulkan-tools mesa-vulkan-drivers