diff --git a/elements/nova-baremetal/install.d/80-pxelinux b/elements/nova-baremetal/install.d/80-pxelinux index a9a44953d..4d5dc232f 100755 --- a/elements/nova-baremetal/install.d/80-pxelinux +++ b/elements/nova-baremetal/install.d/80-pxelinux @@ -2,7 +2,7 @@ set -eux # syslinux is installed by nova-compute, which contains pxelinux.0 -install-packages atftpd xinetd +install-packages tftpd-hpa xinetd mkdir -p /tftpboot/pxelinux.cfg/ if [ -f /usr/lib/syslinux/pxelinux.0 ]; then @@ -14,6 +14,9 @@ else exit 1 fi +# Disable the tftp-hpa upstart job, we're using xinetd +[ -f /etc/init/tftpd-hpa.conf ] && echo "manual" > /etc/init/tftpd-hpa.override + cat > /etc/xinetd.d/tftp << EOF service tftp { @@ -21,9 +24,12 @@ service tftp port = 69 socket_type = dgram wait = yes - user = nobody + user = root server = /usr/sbin/in.tftpd - server_args = /tftpboot + server_args = --map-file /tftpboot/map-file /tftpboot disable = no } EOF + +# Adds support for tftp requests that don't include the directory name. +echo 'r ^([^/]) /tftpboot/\1' > /tftpboot/map-file