Skip to content

Commit

Permalink
Merge branch 'main' into feature/debian11-arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Stromweld authored Jul 22, 2024
2 parents 5dce863 + 4496079 commit e3c8f65
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions packer_templates/http/freebsd/installerconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,22 @@ EOT
# zfs doesn't use an fstab, but some rc scripts expect one
touch /etc/fstab

# Since FreeBSD 14.0 bsdinstall again creates dataset for /home rather then /usr/home
# Thus on versions prior to 14.0 we have to create /home -> /usr/home symlink,
# otherwise just use /home as the base for vagrant's home
version=$(freebsd-version -u)
if [ "${version%%.*}" -lt "14" ]; then
home_base="/usr/home"
ln -s $home_base /home
else
home_base="/home"
fi

# Set up user accounts
echo "vagrant" | pw -V /etc useradd vagrant -h 0 -s /bin/sh -G wheel -d /usr/home/vagrant -c "Vagrant User"
echo "vagrant" | pw -V /etc useradd vagrant -h 0 -s /bin/sh -G wheel -d ${home_base}/vagrant -c "Vagrant User"
echo "vagrant" | pw -V /etc usermod root

mkdir -p /usr/home/vagrant
chown 1001:1001 /usr/home/vagrant
ln -s /usr/home /home
mkdir -p ${home_base}/vagrant
chown 1001:1001 ${home_base}/vagrant

reboot
2 changes: 1 addition & 1 deletion packer_templates/http/ubuntu/user-data
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ autoinstall:
late-commands:
- |
if [ -f /target/etc/netplan/00-installer-config.yaml ]; then
'sed -i "s/dhcp4: true/&\n dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'
sed -i "s/dhcp4: true/&\n dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml
fi
- echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/vagrant
# Enable hyper-v daemons only if using hyper-v virtualization
Expand Down

0 comments on commit e3c8f65

Please sign in to comment.