Set a default hostname for virtual machine images.
A recent bug in security/sudo causes segmentation faults when the system is not configured with a hostname, which causes issues with some virtual machine setups, notably Vagrant. Set the default hostname to the output of 'uname -o'. Submitted by: Nicholas Fiorentini Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
6b23b8248c
commit
e2b3cfc07c
@ -140,6 +140,10 @@ vm_install_base() {
|
||||
>> ${DESTDIR}/etc/fstab
|
||||
fi
|
||||
|
||||
local hostname
|
||||
hostname="$(echo $(uname -o) | tr '[:upper:]' '[:lower:]')"
|
||||
echo "hostname=\"${hostname}\"" >> ${DESTDIR}/etc/rc.conf
|
||||
|
||||
mkdir -p ${DESTDIR}/dev
|
||||
mount -t devfs devfs ${DESTDIR}/dev
|
||||
chroot ${DESTDIR} /usr/bin/newaliases
|
||||
|
Loading…
Reference in New Issue
Block a user