Last active
January 22, 2020 14:27
-
-
Save lhw/e0e19003147e7af5314004a573eaead7 to your computer and use it in GitHub Desktop.
CoreOS PXE VLAN install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env make | |
# As per CoreOS/ContainerLinux suggestion | |
# https://coreos.com/os/docs/latest/booting-with-pxe.html#adding-a-custom-oem | |
ifndef VLAN | |
$(error VLAN is not set) | |
endif | |
all: oem.cpio.gz | |
@gzip --stdout --decompress oem.cpio.gz | cpio -it | |
@mv oem.cpio.gz ${VLAN}.cpio.gz | |
etc/systemd/network: | |
@mkdir -p $@ | |
vlan.netdev vlan.network eth0.network: etc/systemd/network | |
@sed "s;{VLAN};${VLAN};" tpl/$@ > etc/systemd/network/00-$@ | |
oem.cpio: vlan.netdev vlan.network eth0.network | |
@find etc | cpio -o -H newc -O oem.cpio | |
oem.cpio.gz: oem.cpio | |
@gzip -f oem.cpio | |
clean: | |
@rm -rf ${VLAN}.cpio.gz etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Match] | |
Name=eth0 | |
[Network] | |
DHCP=no | |
VLAN=vlan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[NetDev] | |
Name=eth0.{VLAN} | |
Kind=vlan | |
[VLAN] | |
Id={VLAN} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Match] | |
Name=eth0.{VLAN} | |
[Network] | |
DHCP=yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment