ignition-dracut: backport patch for finding ignition.firstboot file on UEFI systems

https://github.com/coreos/ignition-dracut/pull/52
This commit is contained in:
Dusty Mabe 2019-03-04 20:32:50 -05:00
parent ed359188d7
commit 14c71e122e
No known key found for this signature in database
GPG Key ID: 3302DBD73952E671
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 552edb5c959bb4a99be6cba15423bf357d016aa8 Mon Sep 17 00:00:00 2001
From: Dusty Mabe <dusty@dustymabe.com>
Date: Mon, 4 Mar 2019 16:42:28 -0500
Subject: [PATCH] grub: find boot partition and use it directly
On UEFI systems the grub $root might be the /boot/efi/
partition and not the /boot/ partition so let's search
for the partition with the `boot` label and then detect
the file directly.
Fixes #51
---
grub/02_ignition_firstboot | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/grub/02_ignition_firstboot b/grub/02_ignition_firstboot
index 9ceca5d..a154918 100755
--- a/grub/02_ignition_firstboot
+++ b/grub/02_ignition_firstboot
@@ -1,7 +1,13 @@
#!/bin/sh
exec tail -n +3 $0
+# We store the file on the /boot/ partition so find the
+# boot partition. On UEFI this may different than the grub
+# $root so we search for it here.
+# https://github.com/coreos/ignition-dracut/issues/51
+search --set=bootpart --label boot
+# Determine if this is a first boot and set the variable
+# to be used later on the kernel command line.
set ignition_firstboot=""
-# Determine if this is a first boot.
-if [ -f "/ignition.firstboot" ]; then
+if [ -f "(${bootpart})/ignition.firstboot" ]; then
set ignition_firstboot="ignition.firstboot"
fi
--
2.20.1

View File

@ -73,7 +73,7 @@
Name: ignition
Version: 0.31.0
Release: 1.git%{shortcommit}%{?dist}
Release: 2.git%{shortcommit}%{?dist}
Summary: First boot installer and configuration tool
License: ASL 2.0
URL: https://%{provider_prefix}
@ -318,6 +318,8 @@ Requires: dracut
Requires: dracut-network
BuildArchitectures: noarch
Patch0: 0001-grub-find-boot-partition-and-use-it-directly.patch
%description dracut
Dracut modules for ignition to enable ignition services to run in the
initramfs on boot.
@ -338,6 +340,8 @@ initramfs on boot.
# unpack source1 (dracut modules)
%setup -T -D -a 1 -q -n %{repo}-%{commit}
cd %{dracutrepo}-%{dracutcommit}
%patch0 -p1
%build
# Set up PWD as a proper import path for go
@ -480,6 +484,10 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
%endif
%changelog
* Mon Mar 04 2019 Dusty Mabe <dusty@dustymabe.com> - 0.31.0-2.gitf59a653
- ignition-dracut: backport patch for finding ignition.firstboot file on UEFI systems
https://github.com/coreos/ignition-dracut/pull/52
* Wed Feb 20 2019 Andrew Jeddeloh <andrew.jeddeloh@redhat.com> - 0.31.0-1.gitf59a653
- New release 0.31.0