e73cbc8e2b
As advised in I072cf8bf6748d0c910fecffdf2282bcc4656d038, code should use 4 spaces for indentation. This commit enforces the use of 4 spaces indentation. In order to simplify the review process, this patch only cover the following elements: - nagios3 - network-utils - neutron-openvswitch - nova-api - nova-baremetal - nova-compute - nova-kvm - openstack-client - openstack-db - openstack-ssl Change-Id: I489746d384c0c2c5a4f2b12444606e3bf8e3ce11
40 lines
1.0 KiB
Bash
Executable File
40 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
set -eux
|
|
|
|
install-packages syslinux tftpd-hpa xinetd
|
|
|
|
mkdir -p /tftpboot/pxelinux.cfg/
|
|
if [ -f /usr/lib/syslinux/pxelinux.0 ]; then
|
|
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ # Ubuntu
|
|
elif [ -f /usr/share/syslinux/pxelinux.0 ]; then
|
|
cp /usr/share/syslinux/pxelinux.0 /tftpboot/ # Fedora/RHEL
|
|
else
|
|
echo "Failed to find pxelinux.0."
|
|
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
|
|
|
|
# Disable the tftpd-hpa SysV script for the same reason
|
|
[ -f /etc/init.d/tftpd-hpa ] && update-rc.d -f tftpd-hpa disable
|
|
|
|
cat > /etc/xinetd.d/tftp << EOF
|
|
service tftp
|
|
{
|
|
protocol = udp
|
|
port = 69
|
|
socket_type = dgram
|
|
wait = yes
|
|
user = root
|
|
server = /usr/sbin/in.tftpd
|
|
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
|
|
|
|
os-svc-enable -n xinetd
|