Merge ~jawn-smith/grub:systemd-ordering into ~ubuntu-core-dev/grub/+git/ubuntu:master

Proposed by William Wilson
Status: Merged
Merge reported by: Dimitri John Ledkov
Merged at revision: fc9c4ad7406b0b3142f7bf07578d078be87fdbf1
Proposed branch: ~jawn-smith/grub:systemd-ordering
Merge into: ~ubuntu-core-dev/grub/+git/ubuntu:master
Diff against target: 52 lines (+30/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu-systemd-service-ordering.patch (+22/-0)
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Review via email: mp+397765@code.launchpad.net

Commit message

LP: #1910815 add After= in grub-initrd-fallback.service to avoid race condition around boot directory creation

Description of the change

grub-common.service creates the directory /boot/grub, and grub-initrd-fallback.service attempts to fopen a file in /boot/grub, so it is important for grub-common.service to run before grub-initrd-fallback.service.

To post a comment you must log in.
Revision history for this message
Steve Dodd (anarchetic) wrote :

If you'd prefer not to actually patch the grub package, you could probably implement this as an systemd override file..

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

never mind me.

Revision history for this message
Dimitri John Ledkov (xnox) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 2294af4..50b857f 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+grub2 (2.04-1ubuntu39) UNRELEASED; urgency=medium
7+
8+ * Ensure grub-initrd-fallback.service starts after grub-common.service
9+ to avoid race condition on /boot/grub directory creation (LP: #1910815)
10+
11+ -- William 'jawn-smith' Wilson <william.wilson@canonical.com> Tue, 09 Feb 2021 15:39:06 -0600
12+
13 grub2 (2.04-1ubuntu38) hirsute; urgency=medium
14
15 [ Jean-Baptiste Lallement ]
16diff --git a/debian/patches/series b/debian/patches/series
17index 07193df..886e4ed 100644
18--- a/debian/patches/series
19+++ b/debian/patches/series
20@@ -120,3 +120,4 @@ rhboot-f34-support-non-ethernet.patch
21 ubuntu-fixup-rhboot-f34-support-non-ethernet.patch
22 ubuntu-fixup-rhboot-f34-support-non-ethernet-2.patch
23 rhboot-f34-make-pmtimer-tsc-calibration-fast.patch
24+ubuntu-systemd-service-ordering.patch
25diff --git a/debian/patches/ubuntu-systemd-service-ordering.patch b/debian/patches/ubuntu-systemd-service-ordering.patch
26new file mode 100644
27index 0000000..6de9ef1
28--- /dev/null
29+++ b/debian/patches/ubuntu-systemd-service-ordering.patch
30@@ -0,0 +1,22 @@
31+Description: Ensure grub-initrd-fallback.service runs after grub-common.service
32+ If grub-common.service and grub-initrd-fallback.service are started at the
33+ same time it causes a race condition wherein grub-initrd-fallback.service
34+ attempts to fopen a file in /boot/grub/ which may not exist yet if
35+ grub-common.service has not had a change to create the directory.
36+Author: William 'jawn-smith' Wilson <william.wilson@canonical.com>
37+Origin: vendor
38+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1910815
39+Forwarded: not-needed
40+Last-Update: 2021-02-09
41+---
42+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
43+--- a/grub-initrd-fallback.service
44++++ b/grub-initrd-fallback.service
45+@@ -1,6 +1,7 @@
46+ [Unit]
47+ Description=GRUB failed boot detection
48+ After=local-fs.target
49++After=grub-common.service
50+
51+ [Service]
52+ Type=oneshot

Subscribers

People subscribed via source and target branches