Use Jinja to manage includes
The drawback to the native `%include` Kickstart directive is that it requires a static, hard-coded, absolute path. This means that we cannot, for example, host a copy of the kickstarts from a different branch for testing, without modifying the URLs of all the included files. Switching to using Jinja templates introduces a build step, but the result is that the artifacts are self-contained. This way, they can be deployed anywhere. I'm not sure where I'll put them, though, and they'll need a Jenkins job to run the build and publish them.master
parent
8933e517fb
commit
1822514b36
|
@ -0,0 +1,5 @@
|
|||
fedora.ks
|
||||
fedora-rpi-common.ks
|
||||
fedora-rpi.ks
|
||||
fedora-rpi-nvme.ks
|
||||
fedora-rpi-nvme-noswap.ks
|
|
@ -0,0 +1,15 @@
|
|||
KICKSTARTS = \
|
||||
fedora-rpi-nvme-noswap.ks \
|
||||
fedora-rpi-nvme.ks \
|
||||
fedora-rpi.ks \
|
||||
fedora.ks
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: $(KICKSTARTS)
|
||||
|
||||
%.ks: %.ks.j2
|
||||
python3 render.py $< > $@
|
||||
|
||||
clean:
|
||||
rm -f $(KICKSTARTS)
|
|
@ -1,4 +1,4 @@
|
|||
# vim: set ft=sh :
|
||||
{# vim: set ft=sh.jinja : -#}
|
||||
bootloader --location none
|
||||
clearpart --all --initlabel --disklabel msdos
|
||||
part /boot/efi --fstype vfat --size 128 --label RASPBERRYPI
|
||||
|
@ -11,7 +11,7 @@ bcm283x-overlays
|
|||
uboot-images-armv8
|
||||
%end
|
||||
|
||||
%include http://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-common.ks
|
||||
{% include "fedora-common.ks" %}
|
||||
|
||||
%post --erroronfail
|
||||
cp -P /usr/share/uboot/rpi_arm64/u-boot.bin /boot/efi/rpi-u-boot.bin
|
|
@ -1,6 +0,0 @@
|
|||
# vim: set ft=sh :
|
||||
%include http://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-disk-dch.ks
|
||||
%include http://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-rpi-common.ks
|
||||
|
||||
ignoredisk --only-use /dev/nvme0n1
|
||||
logvol /tmp --fstype ext4 --name tmp --vgname fedora --size 2048 --label tmp
|
|
@ -0,0 +1,6 @@
|
|||
{# vim: set ft=sh.jinja : -#}
|
||||
{% include "fedora-disk-dch.ks" %}
|
||||
{% include "fedora-rpi-common.ks.j2" %}
|
||||
|
||||
ignoredisk --only-use /dev/nvme0n1
|
||||
logvol /tmp --fstype ext4 --name tmp --vgname fedora --size 2048 --label tmp
|
|
@ -1,4 +0,0 @@
|
|||
# vim: set ft=sh :
|
||||
%include http://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-rpi-nvme-noswap.ks
|
||||
|
||||
logvol swap --fstype swap --name swap --vgname fedora --size 1024 --maxsize 8192 --label swap --grow
|
|
@ -0,0 +1,4 @@
|
|||
{# vim: set ft=sh.jinja : -#}
|
||||
{% include "fedora-rpi-nvme-noswap.ks.j2" %}
|
||||
|
||||
logvol swap --fstype swap --name swap --vgname fedora --size 1024 --maxsize 8192 --label swap --grow
|
|
@ -1,5 +0,0 @@
|
|||
# vim: set ft=sh :
|
||||
ignoredisk --only-use /dev/mmcblk0
|
||||
%include http://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-disk-dch.ks
|
||||
%include http://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-rpi-common.ks
|
||||
%include http://git.pyrocufflink.net/infra/kickstart/raw/branch/master/autoprovision.ks
|
|
@ -0,0 +1,5 @@
|
|||
{# vim: set ft=sh.jinja : -#}
|
||||
ignoredisk --only-use /dev/mmcblk0
|
||||
{% include "fedora-disk-dch.ks" %}
|
||||
{% include "fedora-rpi-common.ks.j2" %}
|
||||
{% include "autoprovision.ks" %}
|
17
fedora.ks
17
fedora.ks
|
@ -1,17 +0,0 @@
|
|||
# vim: set ft=sh sw=4 ts=4 sts=4 et :
|
||||
|
||||
# Create the "standard" disk layout using only the first disk
|
||||
# Other disks are left alone in case they already contain data, e.g.
|
||||
# migrated from another system.
|
||||
bootloader --location mbr
|
||||
clearpart --all --initlabel --drives vda
|
||||
reqpart
|
||||
|
||||
%include https://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-disk-dch.ks
|
||||
%include https://git.pyrocufflink.net/infra/kickstart/raw/branch/master/fedora-common.ks
|
||||
|
||||
%packages
|
||||
qemu-guest-agent
|
||||
%end
|
||||
|
||||
%include https://git.pyrocufflink.net/infra/kickstart/raw/branch/master/autoprovision.ks
|
|
@ -0,0 +1,17 @@
|
|||
{# vim: set ft=sh.jinja sw=4 ts=4 sts=4 et : -#}
|
||||
|
||||
# Create the "standard" disk layout using only the first disk
|
||||
# Other disks are left alone in case they already contain data, e.g.
|
||||
# migrated from another system.
|
||||
bootloader --location mbr
|
||||
clearpart --all --initlabel --drives vda
|
||||
reqpart
|
||||
|
||||
{% include "fedora-disk-dch.ks" %}
|
||||
{% include "fedora-common.ks" %}
|
||||
|
||||
%packages
|
||||
qemu-guest-agent
|
||||
%end
|
||||
|
||||
{% include "autoprovision.ks" %}
|
Loading…
Reference in New Issue