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 committed Oct 12, 2023
1 parent f6a5b96 commit bb393ab
Show file tree
Hide file tree
Showing 2 changed files with 18 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 -D -t $(DESTDIR)/usr/lib/bootupd/grub2-static/configs.d grub2/ignition.cfg

.PHONY: vendor
vendor:
@go mod vendor
Expand Down
15 changes: 15 additions & 0 deletions grub2/ignition.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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 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 bb393ab

Please sign in to comment.