Skip to content

Instantly share code, notes, and snippets.

@mark-kubacki
Created August 13, 2017 19:49
Show Gist options
  • Save mark-kubacki/6edb1aeeea63cc2d2c0542b5e71dc8c5 to your computer and use it in GitHub Desktop.
Save mark-kubacki/6edb1aeeea63cc2d2c0542b5e71dc8c5 to your computer and use it in GitHub Desktop.
boot CoreOS and other images over the network, utilizing iPXE
[Unit]
Description=netboot server
Wants=network-online.target
After=network-online.target sys-subsystem-net-devices-ext0.device
AssertPathExists=/srv/ftp/tftproot
[Service]
Slice=machine.slice
KillMode=mixed
Restart=on-abort
# Resource limits
Delegate=true
CPUShares=512
MemoryLimit=256M
ExecStartPre=/usr/bin/mkdir --parents /var/lib/coreos
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/lib/coreos/%p.uuid
ExecStart=/usr/bin/rkt run \
--uuid-file-save=/var/lib/coreos/%p.uuid \
--net=host --dns=host \
--volume tftpboot,kind=host,source=/srv/ftp/tftproot \
blitznote.com/aci/netboot-server-tftp \
--caps-retain=CAP_SYS_CHROOT,CAP_NET_BIND_SERVICE,CAP_SETGID,CAP_SETUID \
--readonly-rootfs=true \
blitznote.com/aci/netboot-server-http \
--caps-retain=CAP_SYS_CHROOT,CAP_NET_BIND_SERVICE,CAP_SETGID,CAP_SETUID \
--readonly-rootfs=true
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/lib/coreos/%p.uuid
ExecStopPost=-/usr/bin/rkt gc --mark-only
[Install]
WantedBy=multi-user.target
default vesamenu.c32
MENU WIDTH 80
MENU MARGIN 10
MENU ROWS 12
MENU ENDROW 24
MENU TIMEOUTROW 18
MENU VSHIFT 2
prompt 0
timeout 150
ontimeout coreos
menu title PXE Network Boot
label memtest86
menu label Memtest86+ 5.01
kernel ::images/memtest/memtest86+
label coreos
menu default
menu label CoreOS amd64 1465.4.0
kernel ::coreos/1465.4.0/coreos_production_pxe.vmlinuz
initrd ::coreos/1465.4.0/coreos_production_pxe_image.cpio.gz
append sshkey="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHFUL/SXo3o6BAgGGI7ay+87n+r0ofH9x3vAVklfBLiU mark@surfdev" coreos.autologin=tty1
label winpe_10x64
menu label Windows 10 PE x64
kernel memdisk
initrd http://192.168.1.555:69/images/winpe/WinPE_10x64.iso
append iso raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment