From 56c1daf14db3ef339f5f2f8b292fbad7c098f6fb Mon Sep 17 00:00:00 2001 From: Pete Cheslock Date: Sun, 24 Nov 2013 00:08:54 -0500 Subject: [PATCH] Bash is dead, Long live Bash. This adjusts the following * Remove bash - no longer needed for vagrant * Removes installing portsclean - as cleanup script does this * Add a Freebsd i386 9.1 build config --- packer/freebsd-9.1-i386.json | 91 ++++++++++++++++++++++++++ packer/scripts/freebsd/postinstall.csh | 8 +-- 2 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 packer/freebsd-9.1-i386.json diff --git a/packer/freebsd-9.1-i386.json b/packer/freebsd-9.1-i386.json new file mode 100644 index 000000000..5ea957b5e --- /dev/null +++ b/packer/freebsd-9.1-i386.json @@ -0,0 +1,91 @@ +{ + "provisioners": [ + { + "type": "shell", + "scripts": [ + "scripts/freebsd/postinstall.csh", + "scripts/freebsd/cleanup.sh", + "scripts/common/minimize.sh" + ], + "execute_command": "cat '{{.Path}}' | su -" + } + ], + "builders": [ + { + "type": "virtualbox", + "boot_command": [ + "", + "load geom_mbr", + "", + "load zfs", + "", + "boot -s", + "", + "", + "/bin/sh", + "mdmfs -s 100m md1 /tmp", + "dhclient -l /tmp/dhclient.lease.em0 em0", + "fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-9.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}" + ], + "boot_wait": "10s", + "disk_size": 10140, + "guest_os_type": "FreeBSD_64", + "http_directory": "http", + "iso_checksum": "e37d86ce83908bf4b667fdae7298bca5", + "iso_checksum_type": "md5", + "iso_url": "http://ftp.freebsd.org/pub/FreeBSD/releases/i386/i386/ISO-IMAGES/9.1/FreeBSD-9.1-RELEASE-i386-disc1.iso", + "ssh_username": "vagrant", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_wait_timeout": "10000s", + "shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -", + "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", + "virtualbox_version_file": ".vbox_version", + "vboxmanage": [ + [ "modifyvm", "{{.Name}}", "--memory", "768" ], + [ "modifyvm", "{{.Name}}", "--cpus", "1" ] + ] + }, + { + "type": "vmware", + "boot_command": [ + "", + "load geom_mbr", + "", + "load zfs", + "", + "boot -s", + "", + "", + "/bin/sh", + "mdmfs -s 100m md1 /tmp", + "dhclient -l /tmp/dhclient.lease.em0 em0", + "", + "fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-9.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}" + ], + "boot_wait": "10s", + "disk_size": 10140, + "guest_os_type": "freebsd-64", + "http_directory": "http", + "iso_checksum": "e37d86ce83908bf4b667fdae7298bca5", + "iso_checksum_type": "md5", + "iso_url": "http://ftp.freebsd.org/pub/FreeBSD/releases/i386/i386/ISO-IMAGES/9.1/FreeBSD-9.1-RELEASE-i386-disc1.iso", + "ssh_username": "vagrant", + "ssh_password": "vagrant", + "ssh_port": 22, + "ssh_wait_timeout": "10000s", + "shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -", + "vmx_data": { + "memsize": "768", + "numvcpus": "1", + "cpuid.coresPerSocket": "1" + } + } + ], + "post-processors": [ + { + "output": "../builds/{{.Provider}}/opscode_freebsd-9.1_provisionerless.box", + "type": "vagrant" + } + ] +} diff --git a/packer/scripts/freebsd/postinstall.csh b/packer/scripts/freebsd/postinstall.csh index b76fc7690..6b3cb70bd 100644 --- a/packer/scripts/freebsd/postinstall.csh +++ b/packer/scripts/freebsd/postinstall.csh @@ -17,7 +17,7 @@ env PAGER=/bin/cat /tmp/freebsd-update fetch env PAGER=/bin/cat /tmp/freebsd-update install #Install sudo and bash and curl -pkg_add -r sudo bash-static curl +pkg_add -r sudo curl #Installing vagrant keys mkdir /home/vagrant/.ssh @@ -27,12 +27,6 @@ fetch -am -o authorized_keys 'https://raw.github.com/mitchellh/vagrant/master/ke chown -R vagrant /home/vagrant/.ssh chmod -R go-rwsx /home/vagrant/.ssh -# Cleaning portstree to save space -# http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html -pkg_add -r portupgrade - -/usr/local/sbin/portsclean -C - # As sharedfolders are not in defaults ports tree # We will use vagrant via NFS # Enable NFS