Skip to content

Commit cc11a12

Browse files
committed
Create filesystem on xvda1 on update
The new systemd (Debian trixie, Fedora 43) really insist on having proper filesystem on the EFI partition, otherwise it marks several units as failed. Create a filesystem there on package update too. Fixes QubesOS/qubes-issues#8954
1 parent e6854b6 commit cc11a12

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

archlinux/PKGBUILD.install

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ update_qubesconfig() {
8585
mount /usr/local || :
8686
fi
8787

88+
rootdev=$(grep -o '^[^ ]* / ' /proc/mounts | cut -f 1 -d ' ') || rootdev=
89+
# if root volume uses partitions, and is mounted directly (no dm-snapshot),
90+
# check if xvda1 needs filesystem to be created
91+
if [ -n "$rootdev" ] && [ "$(readlink -f "$rootdev")" = "/dev/xvda3" ]; then
92+
if [ "$(file -s -b /dev/xvda1)" = "data" ]; then
93+
/sbin/mkfs.vfat -S 4096 -n EFI /dev/xvda1
94+
fi
95+
fi
96+
8897
# Install qubes version of fstab
8998
if ! grep -q dmroot /etc/fstab; then
9099
cp -f /etc/fstab.qubes /etc/fstab

debian/qubes-core-agent.postinst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ case "${1}" in
166166
mount /usr/local || :
167167
fi
168168

169+
rootdev=$(grep -o '^[^ ]* / ' /proc/mounts | cut -f 1 -d ' ') || rootdev=
170+
# if root volume uses partitions, and is mounted directly (no dm-snapshot),
171+
# check if xvda1 needs filesystem to be created
172+
if [ -n "$rootdev" ] && [ "$(readlink -f "$rootdev")" = "/dev/xvda3" ]; then
173+
if [ "$(file -s -b /dev/xvda1)" = "data" ]; then
174+
/sbin/mkfs.vfat -S 4096 -n EFI /dev/xvda1
175+
fi
176+
fi
177+
169178
# remove old symlinks
170179
if [ -L /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service ]; then
171180
rm /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service

rpm_spec/core-agent.spec.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,15 @@ if [ -L /usr/local ]; then
574574
mount /usr/local || :
575575
fi
576576

577+
rootdev=$(grep -o '^[^ ]* / ' /proc/mounts | cut -f 1 -d ' ') || rootdev=
578+
# if root volume uses partitions, and is mounted directly (no dm-snapshot),
579+
# check if xvda1 needs filesystem to be created
580+
if [ -n "$rootdev" ] && [ "$(readlink -f "$rootdev")" = "/dev/xvda3" ]; then
581+
if [ "$(file -s -b /dev/xvda1)" = "data" ]; then
582+
/sbin/mkfs.vfat -S 4096 -n EFI /dev/xvda1
583+
fi
584+
fi
585+
577586
%if 0%{?fedora} < 41
578587
if [ ! -f /etc/qubes-dnf-hardened ]; then
579588
dnf config-manager --setopt=zchunk=0 --setopt=deltarpm=0 --save &&

0 commit comments

Comments
 (0)