Skip to content

Commit a774255

Browse files
authored
Merge pull request #1728 from cgwalters/add-grub2
Add optionally-installed grub2 code
2 parents 1415150 + f878c9d commit a774255

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ install: all
3030
ln -sf ../lib/dracut/modules.d/30ignition/ignition $(DESTDIR)/usr/libexec/ignition-apply
3131
ln -sf ../lib/dracut/modules.d/30ignition/ignition $(DESTDIR)/usr/libexec/ignition-rmcfg
3232

33+
install-grub-for-bootupd:
34+
install -m 0644 -D -t $(DESTDIR)/usr/lib/bootupd/grub2-static/configs.d grub2/ignition.cfg
35+
3336
.PHONY: vendor
3437
vendor:
3538
@go mod vendor

docs/release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ nav_order: 9
1212
### Features
1313

1414
- Support Hetzner Cloud
15+
- A GRUB configuration suitable for use with https://github.com/coreos/bootupd
16+
can now be installed; use `make install-grub-for-bootupd` to install it
1517

1618
### Changes
1719

grub2/ignition.cfg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This GRUB config snippet implements the `ignition.firstboot` semantic using a
2+
# stamp file in the bootfs. This is used at least on CoreOS-based systems where
3+
# it's injected by https://github.com/coreos/bootupd.
4+
5+
# Determine if this is a first boot and set the ${ignition_firstboot} variable
6+
# which is used in the kernel command line.
7+
set ignition_firstboot=""
8+
if [ -f "/ignition.firstboot" ]; then
9+
# Default networking parameters to be used with Ignition.
10+
set ignition_network_kcmdline=''
11+
12+
# Source in the `ignition.firstboot` file which could override the
13+
# above $ignition_network_kcmdline with static networking config.
14+
# This override feature is also used by coreos-installer to persist static
15+
# networking config provided during install to the first boot of the machine.
16+
source "/ignition.firstboot"
17+
18+
set ignition_firstboot="ignition.firstboot ${ignition_network_kcmdline}"
19+
fi

0 commit comments

Comments
 (0)