Skip to content

Commit

Permalink
Convert FreeBSD 9 to use pkgng.
Browse files Browse the repository at this point in the history
Closes #296.
  • Loading branch information
Julian C. Dunn committed Nov 25, 2014
1 parent f8a0014 commit 1b961b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
21 changes: 10 additions & 11 deletions packer/scripts/freebsd/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ chmod +x /tmp/freebsd-update
env PAGER=/bin/cat /tmp/freebsd-update fetch
env PAGER=/bin/cat /tmp/freebsd-update install

#Install sudo, curl and ca_root_nss
if [ $freebsd_major -gt 9 ]; then
# Use pkgng
env ASSUME_ALWAYS_YES=true pkg bootstrap
pkg update
pkg install -y sudo
pkg install -y curl
pkg install -y ca_root_nss
else
# Use old pkg
pkg_add -r sudo curl ca_root_nss
# always use pkgng - pkg_add is EOL as of 1 September 2014
env ASSUME_ALWAYS_YES=true pkg bootstrap
if [ $freebsd_major -lt 10 ]; then
echo WITH_PKGNG=yes >> /etc/make.conf
fi

#Install sudo, curl and ca_root_nss
pkg update
pkg install -y sudo
pkg install -y curl
pkg install -y ca_root_nss

# Emulate the ETCSYMLINK behavior of ca_root_nss; this is for FreeBSD 10, where fetch(1) was
# massively refactored and doesn't come with SSL CAcerts anymore
ln -sf /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem
Expand Down
3 changes: 1 addition & 2 deletions packer/scripts/freebsd/vmtools.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/sh

freebsd_major=`uname -r | awk -F. '{ print $1 }'`
pkg_command="pkg install -y"
if [ $freebsd_major -gt 9 ]; then
pkg_command="pkg install -y"
perl_pkg="perl5"
else
pkg_command="pkg_add -r"
perl_pkg="perl"
fi

Expand Down

0 comments on commit 1b961b4

Please sign in to comment.