Skip to content

Commit

Permalink
Merge from upstream 2024-02 (#19)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update release notes

* stage0: Only disable initramfs updates if update-initramfs.conf exists

* stage0: Check whether foreign architecture is needed

* stage0: prevent kernel packages from creating useless symlinks

* stage3: add vulkan support

* Remove cmdline.txt and config.txt symlinks

* stage2: rc.local drop-in no longer required, since Debian ships its own version

* export-image: make sure initramfs is created

Fixes #749

* README on how to merge from upstream.

---------

Signed-off-by: Vasilis Tsiligiannis <[email protected]>
Co-authored-by: Vasilis Tsiligiannis <[email protected]>
Co-authored-by: Serge Schneider <[email protected]>
  • Loading branch information
3 people authored Feb 5, 2024
1 parent 66a9d56 commit c439a2a
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 19 deletions.
14 changes: 13 additions & 1 deletion GL-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,16 @@ export PASSWORD=<password>

## What's up with this file?

This file is called `GL-README.md` and is elevated to the github repo homepage by a symlink `.github/README.md`.
This file is called `GL-README.md` and is elevated to the github repo homepage by a symlink `.github/README.md`.

## Merging from upstream

Here's the process

```
git remote add upstream https://github.com/RPi-Distro/pi-gen
git fetch upstream
git merge upstream/arm64
```

Then test test test.
2 changes: 1 addition & 1 deletion export-image/05-finalise/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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
update-initramfs -k all -c
if [ -x /etc/init.d/fake-hwclock ]; then
/etc/init.d/fake-hwclock stop
fi
Expand Down
1 change: 1 addition & 0 deletions export-image/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions export-noobs/00-release/files/release_notes.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions export-noobs/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 14 additions & 0 deletions scripts/common
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,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
13 changes: 9 additions & 4 deletions stage0/00-configure-apt/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 armhf
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
9 changes: 8 additions & 1 deletion stage0/02-firmware/02-run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/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

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}*
11 changes: 4 additions & 7 deletions stage1/00-boot-files/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ if ! [ -L "${ROOTFS_DIR}/boot/overlays" ]; then
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

for file in cmdline.txt config.txt; do
printf "DO NOT EDIT THIS FILE\n\nThe file you are looking for has moved to %s\n" "/boot/firmware/${file}" > "${ROOTFS_DIR}/boot/${file}"
done
3 changes: 0 additions & 3 deletions stage2/01-sys-tweaks/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/"

install -d "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d"
install -m 644 files/ttyoutput.conf "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/"

install -m 644 files/50raspi "${ROOTFS_DIR}/etc/apt/apt.conf.d/"

install -m 644 files/console-setup "${ROOTFS_DIR}/etc/default/"
Expand Down
2 changes: 0 additions & 2 deletions stage2/01-sys-tweaks/files/ttyoutput.conf

This file was deleted.

1 change: 1 addition & 0 deletions stage3/00-install-packages/00-packages
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ libcamera-apps
python3-picamera2
python3-pyqt5
python3-opengl
vulkan-tools mesa-vulkan-drivers

0 comments on commit c439a2a

Please sign in to comment.