Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-detect-virt survey 20250209 #9608

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ else
fi

# Notify bootloader
if ! systemd-detect-virt -cq; then
# Note: Both "systemd-detect-virt -q --container" and "systemd-detect-virt -q --chroot" return 0 in arch-chroot.
if ! systemd-detect-virt -q --container || ( systemd-detect-virt -q --container && systemd-detect-virt -q --chroot ) ; then
if [[ -x /usr/bin/grub-mkconfig ]]; then
echo -e "\033[36m**\033[0m\tUpdating GRUB for the new kernel..."
update-grub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ else
fi

# Notify bootloader
if ! systemd-detect-virt -cq; then
# Note: Both "systemd-detect-virt -q --container" and "systemd-detect-virt -q --chroot" return 0 in arch-chroot.
if ! systemd-detect-virt -q --container || ( systemd-detect-virt -q --container && systemd-detect-virt -q --chroot ) ; then
if [[ -x /usr/bin/grub-mkconfig ]]; then
echo -e "\033[36m**\033[0m\tUpdating GRUB for the new kernel..."
update-grub
Expand Down
2 changes: 1 addition & 1 deletion app-admin/dracut-ng/spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VER=105
REL=1
REL=2
SRCS="git::commit=tags/$VER::https://github.com/dracut-ng/dracut-ng"
CHKSUMS="SKIP"
CHKUPDATE="anitya::id=372171"
4 changes: 3 additions & 1 deletion runtime-cryptography/opencryptoki/autobuild/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ getent group pkcs11 > /dev/null || groupadd -r pkcs11

systemd-tmpfiles --create opencryptoki.conf

systemctl enable pkcsslotd.service

# FIXME: This should be run when nspawn is launched in boot mode, but there is
# currently no way to distinguish between different container implementations.
if ! systemd-detect-virt --container; then
systemctl enable pkcsslotd.service --now
systemctl start pkcsslotd.service
fi
2 changes: 1 addition & 1 deletion runtime-cryptography/opencryptoki/spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VER=3.21.0
REL=2
REL=3
SRCS="git::commit=tags/v$VER::https://github.com/opencryptoki/opencryptoki"
CHKSUMS="SKIP"
CHKUPDATE="anitya::id=112179"
6 changes: 4 additions & 2 deletions runtime-kernel/linux-kernel-rpi64-lts/autobuild/postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ if [ -x /etc/kernel/postinst.d/apt-auto-removal ]; then
/etc/kernel/postinst.d/apt-auto-removal
fi

if systemd-detect-virt -q -c ; then
echo "Running in build environment, skipping kernel update."
if systemd-detect-virt -q --container ; then
if ! systemd-detect-virt -q --chroot ; then
echo "Running in a container, skipping kernel update."
fi
elif grep -q /boot/rpi /proc/mounts; then
echo "Updating kernel..."
cp -r /usr/lib/rpi64/kernel/"$VER"/* /boot/rpi/
Expand Down
2 changes: 1 addition & 1 deletion runtime-kernel/linux-kernel-rpi64-lts/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VER=6.6.69
# Downstream kernels often rebases upon upstream releases.
COMMIT=eec7048c4e3aec1aadc21fcffcf6be9f5385f72a
# Use this for stable releases.
#REL=1
REL=1

SRCS="git::commit=${COMMIT}::https://github.com/raspberrypi/linux.git"
CHKSUMS="SKIP"
8 changes: 5 additions & 3 deletions runtime-kernel/rpi-firmware-boot/autobuild/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# In case of building a raw image, the post installation must handle this
# manually.
# Check if the system is running in a container.
if systemd-detect-virt -q -c ; then
echo "Running in build environment, skipping firmware update."
exit 0
if systemd-detect-virt -q --container ; then
if ! systemd-detect-virt -q --chroot ; then
echo "Running in a container, skipping firmware update."
exit 0
fi
fi

if ! grep -q "/boot/rpi" /proc/mounts; then
Expand Down
1 change: 1 addition & 0 deletions runtime-kernel/rpi-firmware-boot/spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
UPSTREAM_VER=1.20250127
VER="${UPSTREAM_VER}"
REL=1
SRCS="tbl::https://github.com/raspberrypi/firmware/releases/download/$VER/raspi-firmware_$VER.orig.tar.xz"
CHKSUMS="sha256::0b8e290c829f5deee53b01037e4307d9f9242ea262949043e702e033d088eeb4"
CHKUPDATE="anitya::id=21744"