ifpxelinux.lua is a trivial Lua script that I made to work like ifcpu64.c32. In that way we can have two differents syslinux menus depending if booting from PXE or from non-PXE. * By default NBD PXE option is selected for booting on timeout. * As server (NDB/NFS/HTTP/FTP) is used the same ip from pxeserver. --- configs/releng/syslinux/archiso.cfg | 14 ++++++-- configs/releng/syslinux/archiso_pxe.cfg | 46 +++++++++++++++++++++++++++ configs/releng/syslinux/archiso_pxe_inc.cfg | 3 ++ configs/releng/syslinux/archiso_sys.cfg | 1 - configs/releng/syslinux/archiso_sys_inc.cfg | 3 ++ configs/releng/syslinux/ifpxelinux.lua | 5 +++ 6 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 configs/releng/syslinux/archiso_pxe.cfg create mode 100644 configs/releng/syslinux/archiso_pxe_inc.cfg create mode 100644 configs/releng/syslinux/archiso_sys_inc.cfg create mode 100644 configs/releng/syslinux/ifpxelinux.lua diff --git a/configs/releng/syslinux/archiso.cfg b/configs/releng/syslinux/archiso.cfg index 1228355..3f98442 100644 --- a/configs/releng/syslinux/archiso.cfg +++ b/configs/releng/syslinux/archiso.cfg @@ -1,3 +1,11 @@ -INCLUDE boot/syslinux/archiso_head.cfg -INCLUDE boot/syslinux/archiso_arch.cfg -INCLUDE boot/syslinux/archiso_tail.cfg +DEFAULT select + +LABEL select +COM32 boot/syslinux/lua.c32 +APPEND boot/syslinux/ifpxelinux.lua ispxe nonpxe + +LABEL ispxe +CONFIG boot/syslinux/archiso_pxe_inc.cfg + +LABEL nonpxe +CONFIG boot/syslinux/archiso_sys_inc.cfg diff --git a/configs/releng/syslinux/archiso_pxe.cfg b/configs/releng/syslinux/archiso_pxe.cfg new file mode 100644 index 0000000..16cbd46 --- /dev/null +++ b/configs/releng/syslinux/archiso_pxe.cfg @@ -0,0 +1,46 @@ +LABEL arch +arch_nbd + +LABEL arch_nbd +TEXT HELP +Boot the Arch Linux live medium (Using NBD). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (NBD) +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} +IPAPPEND 3 + +LABEL arch_nfs +TEXT HELP +Boot the Arch Linux live medium (Using NFS). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (NFS) +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt +IPAPPEND 3 + +LABEL arch_http +TEXT HELP +Boot the Arch Linux live medium (Using HTTP). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (HTTP) +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=http://${pxeserver}/ +IPAPPEND 3 + +LABEL arch_ftp +TEXT HELP +Boot the Arch Linux live medium (Using FTP). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (FTP) +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=ftp://${pxeserver}/ +IPAPPEND 3 diff --git a/configs/releng/syslinux/archiso_pxe_inc.cfg b/configs/releng/syslinux/archiso_pxe_inc.cfg new file mode 100644 index 0000000..b2b6887 --- /dev/null +++ b/configs/releng/syslinux/archiso_pxe_inc.cfg @@ -0,0 +1,3 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_pxe.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux/archiso_sys.cfg b/configs/releng/syslinux/archiso_sys.cfg index 1326db8..35303db 100644 --- a/configs/releng/syslinux/archiso_sys.cfg +++ b/configs/releng/syslinux/archiso_sys.cfg @@ -7,4 +7,3 @@ MENU LABEL Boot Arch Linux LINUX boot/%ARCH%/vmlinuz INITRD boot/%ARCH%/archiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% -IPAPPEND 3 diff --git a/configs/releng/syslinux/archiso_sys_inc.cfg b/configs/releng/syslinux/archiso_sys_inc.cfg new file mode 100644 index 0000000..56c6a17 --- /dev/null +++ b/configs/releng/syslinux/archiso_sys_inc.cfg @@ -0,0 +1,3 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_sys.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux/ifpxelinux.lua b/configs/releng/syslinux/ifpxelinux.lua new file mode 100644 index 0000000..21cafae --- /dev/null +++ b/configs/releng/syslinux/ifpxelinux.lua @@ -0,0 +1,5 @@ +if syslinux.derivative() == "PXELINUX" then + syslinux.run_command(arg[1]) +else + syslinux.run_command(arg[2]) +end -- 1.7.7.4