Skip to content

Commit

Permalink
Add optionally-installed grub2 code
Browse files Browse the repository at this point in the history
This pairs with coreos/bootupd#543
Basically we want bootupd to take care of installing this.  Add
the config here (where it more closely arguably belongs) so
that it can be optionally installed.

My proposal for at least the Fedora packaging of Ignition
is that we unconditionally depend on bootupd and install this,
because there's no one there using Ignition who doesn't want bootupd.
  • Loading branch information
cgwalters authored and jlebon committed Oct 19, 2023
1 parent f6a5b96 commit f878c9d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ install: all
ln -sf ../lib/dracut/modules.d/30ignition/ignition $(DESTDIR)/usr/libexec/ignition-apply
ln -sf ../lib/dracut/modules.d/30ignition/ignition $(DESTDIR)/usr/libexec/ignition-rmcfg

install-grub-for-bootupd:
install -m 0644 -D -t $(DESTDIR)/usr/lib/bootupd/grub2-static/configs.d grub2/ignition.cfg

.PHONY: vendor
vendor:
@go mod vendor
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ nav_order: 9
### Features

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

### Changes

Expand Down
19 changes: 19 additions & 0 deletions grub2/ignition.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This GRUB config snippet implements the `ignition.firstboot` semantic using a
# stamp file in the bootfs. This is used at least on CoreOS-based systems where
# it's injected by https://github.com/coreos/bootupd.

# Determine if this is a first boot and set the ${ignition_firstboot} variable
# which is used in the kernel command line.
set ignition_firstboot=""
if [ -f "/ignition.firstboot" ]; then
# Default networking parameters to be used with Ignition.
set ignition_network_kcmdline=''

# Source in the `ignition.firstboot` file which could override the
# above $ignition_network_kcmdline with static networking config.
# This override feature is also used by coreos-installer to persist static
# networking config provided during install to the first boot of the machine.
source "/ignition.firstboot"

set ignition_firstboot="ignition.firstboot ${ignition_network_kcmdline}"
fi

0 comments on commit f878c9d

Please sign in to comment.