From 386d411a71ecfef1d191b57a881bcdd1e0587dde Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 24 Feb 2019 19:54:08 +0100 Subject: [PATCH] tftp: boot from UEFI --- server.yml | 60 ++++++++++++++++++++++++++++----------- tftp/pxelinux.cfg/default | 4 +-- tftp/pxelinux.cfg/tpl | 8 +++--- 3 files changed, 50 insertions(+), 22 deletions(-) diff --git a/server.yml b/server.yml index f498d6d..56e3dec 100644 --- a/server.yml +++ b/server.yml @@ -121,7 +121,8 @@ services: - all binds: - /srv/tftp:/srv/tftp:ro - - /var/tftp/pxelinux.cfg:/srv/tftp/pxelinux.cfg + - /var/lib/adlin/pxelinux.cfg:/srv/tftp/bios/pxelinux.cfg + - /var/lib/adlin/pxelinux.cfg:/srv/tftp/e64/pxelinux.cfg - name: login-validator image: nemunaire/adlin-login-validator:137bdec06d5e09885e7a0cd5d603bd4b2b2aa3ad @@ -130,8 +131,8 @@ services: net: /run/netns/login binds: - /etc/resolv.conf:/etc/resolv.conf:ro - - /srv/students.csv:/students.csv:ro - - /var/tftp/pxelinux.cfg:/var/tftp/pxelinux.cfg + - /var/lib/adlin/students.csv:/students.csv:ro + - /var/lib/adlin/pxelinux.cfg:/var/tftp/pxelinux.cfg - /etc/ssl/certs:/etc/ssl/certs:ro - /usr/share/ca-certificates:/usr/share/ca-certificates:ro - name: nginx-login @@ -212,7 +213,7 @@ files: contents: | #!/bin/sh mkdir -p /var/tftp/ - cp -r /srv/tftp/pxelinux.cfg /var/tftp/pxelinux.cfg + cp -r /srv/tftp/pxelinux.cfg /var/lib/adlin/pxelinux.cfg mode: "0755" - path: etc/init.d/021-nameserver @@ -523,11 +524,12 @@ files: max-lease-time 7200; subnet 172.23.255.0 netmask 255.255.255.0 { range 172.23.255.10 172.23.255.254; - option routers 172.23.255.1; + #option routers 172.23.255.1; option subnet-mask 255.255.255.0; option broadcast-address 172.23.255.255; next-server 172.23.255.1; - filename "pxelinux.0"; + #filename "bios/pxelinux.0"; + filename "e64/syslinux.efi"; } mode: "0440" @@ -544,36 +546,62 @@ files: directory: true mode: "0755" - - path: srv/tftp/ldlinux.c32 + - path: srv/tftp/bios/ldlinux.c32 source: /usr/share/syslinux/ldlinux.c32 mode: "0644" - - path: srv/tftp/libcom32.c32 + - path: srv/tftp/bios/libcom32.c32 source: /usr/share/syslinux/libcom32.c32 mode: "0644" - - path: srv/tftp/libutil.c32 + - path: srv/tftp/bios/libutil.c32 source: /usr/share/syslinux/libutil.c32 mode: "0644" - - path: srv/tftp/menu.c32 + - path: srv/tftp/bios/menu.c32 source: /usr/share/syslinux/menu.c32 mode: "0644" - - path: srv/tftp/poweroff.c32 + - path: srv/tftp/bios/poweroff.c32 source: /usr/share/syslinux/poweroff.c32 mode: "0644" - - path: srv/tftp/pxelinux.0 + - path: srv/tftp/bios/pxelinux.0 source: /usr/share/syslinux/pxelinux.0 mode: "0644" - - path: srv/tftp/pxelinux.cfg + - path: srv/tftp/bios/vesamenu.c32 + source: /usr/share/syslinux/vesamenu.c32 + mode: "0644" + - path: srv/tftp/bios/pxelinux.cfg directory: true mode: "0755" + + - path: srv/tftp/e64/ldlinux.e64 + source: /usr/share/syslinux/efi64/ldlinux.e64 + mode: "0644" + - path: srv/tftp/e64/libcom32.c32 + source: /usr/share/syslinux/efi64/libcom32.c32 + mode: "0644" + - path: srv/tftp/e64/libutil.c32 + source: /usr/share/syslinux/efi64/libutil.c32 + mode: "0644" + - path: srv/tftp/e64/menu.c32 + source: /usr/share/syslinux/menu.c32 + mode: "0644" + - path: srv/tftp/e64/poweroff.c32 + source: /usr/share/syslinux/poweroff.c32 + mode: "0644" + - path: srv/tftp/e64/vesamenu.c32 + source: /usr/share/syslinux/efi64/vesamenu.c32 + mode: "0644" + - path: srv/tftp/e64/syslinux.efi + source: /usr/share/syslinux/efi64/syslinux.efi + mode: "0644" + - path: srv/tftp/e64/pxelinux.cfg + directory: true + mode: "0755" + - path: srv/tftp/pxelinux.cfg/default source: tftp/pxelinux.cfg/default mode: "0644" - path: srv/tftp/pxelinux.cfg/tpl source: tftp/pxelinux.cfg/tpl mode: "0644" - - path: srv/tftp/vesamenu.c32 - source: /usr/share/syslinux/vesamenu.c32 - mode: "0644" - path: srv/tftp/bzImage source: tftp/bzImage diff --git a/tftp/pxelinux.cfg/default b/tftp/pxelinux.cfg/default index 2511e0f..9c5b5f7 100644 --- a/tftp/pxelinux.cfg/default +++ b/tftp/pxelinux.cfg/default @@ -2,8 +2,8 @@ DEFAULT login LABEL login MENU LABEL ^Login - KERNEL bzImage - INITRD login-initrd.img + KERNEL ../bzImage + INITRD ../login-initrd.img APPEND console=tty0 quiet TEXT help You are currently not identified. diff --git a/tftp/pxelinux.cfg/tpl b/tftp/pxelinux.cfg/tpl index 42c042a..217dbcc 100644 --- a/tftp/pxelinux.cfg/tpl +++ b/tftp/pxelinux.cfg/tpl @@ -19,8 +19,8 @@ menu title Welcome {{ .username }} to the EPITA ADvanced LINux administration co LABEL challenge MENU LABEL ^Enter Challenge - KERNEL bzImage - INITRD challenge-initrd.img + KERNEL ../bzImage + INITRD ../challenge-initrd.img APPEND console=tty0 adlin.login={{ .username }} adlin.key={{ .pkey }} quiet text help You are currently identified as {{ .username }}. @@ -31,8 +31,8 @@ MENU SEPARATOR LABEL logout MENU LABEL Not {{ .username }}? ^logout - KERNEL bzImage - INITRD login-initrd.img + KERNEL ../bzImage + INITRD ../login-initrd.img APPEND console=tty0 quiet text help You are currently identified as {{ .username }}.