azure.conf (32dbc829820b1b03bf2e27d204cb3fee8d072da9) azure.conf (30a20c89bf905f464bf62a3904e74802fb86b80d)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# Set to a list of packages to install.
7# Example:
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# Set to a list of packages to install.
7# Example:
8#export VM_EXTRA_PACKAGES="www/apache24 ports-mgmt/pkg"
8#export VM_EXTRA_PACKAGES="www/apache24"
9export VM_EXTRA_PACKAGES=
10
11# Set to a list of third-party software to enable in rc.conf(5).
12# Example:
13#export VM_RC_LIST="apache24"
14export VM_RC_LIST=
15
16vm_extra_install_base() {
17 fetch -o ${DESTDIR}/usr/sbin/waagent \
18 http://people.freebsd.org/~gjb/waagent
19 chmod +x ${DESTDIR}/usr/sbin/waagent
9export VM_EXTRA_PACKAGES=
10
11# Set to a list of third-party software to enable in rc.conf(5).
12# Example:
13#export VM_RC_LIST="apache24"
14export VM_RC_LIST=
15
16vm_extra_install_base() {
17 fetch -o ${DESTDIR}/usr/sbin/waagent \
18 http://people.freebsd.org/~gjb/waagent
19 chmod +x ${DESTDIR}/usr/sbin/waagent
20 rm -f ${DESTDIR}/etc/resolv.conf
20
21 return 0
22}
23
24vm_extra_pre_umount() {
25 chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg install -y \
26 python python2 python27 py27-asn1 sudo bash
27 chroot ${DESTDIR} /usr/sbin/waagent -verbose -install
28 yes | chroot ${DESTDIR} /usr/sbin/waagent -deprovision
29 echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
30 echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
31 echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf
32 echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf
33 echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf
34
21
22 return 0
23}
24
25vm_extra_pre_umount() {
26 chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes /usr/sbin/pkg install -y \
27 python python2 python27 py27-asn1 sudo bash
28 chroot ${DESTDIR} /usr/sbin/waagent -verbose -install
29 yes | chroot ${DESTDIR} /usr/sbin/waagent -deprovision
30 echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
31 echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
32 echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf
33 echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf
34 echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf
35
36 rm -f ${DESTDIR}/etc/resolv.conf
37
35 return 0
36}
37
38vm_extra_create_disk() {
39 if [ ! -x "/usr/local/bin/qemu-img" ]; then
40 env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu-devel
41 fi
42
43 mv ${VMIMAGE} ${VMIMAGE}.raw
44 size=$(qemu-img info -f raw --output json ${VMIMAGE}.raw | awk '/virtual-size/ {print $2}' | tr -d ',')
45 size=$(( ( ${size} / ( 1024 * 1024 ) + 1 ) * ( 1024 * 1024 ) ))
46 qemu-img resize ${VMIMAGE}.raw ${size}
47 qemu-img convert -f raw -o subformat=fixed -O vpc ${VMIMAGE}.raw ${VMIMAGE}
48
49 return 0
50}
38 return 0
39}
40
41vm_extra_create_disk() {
42 if [ ! -x "/usr/local/bin/qemu-img" ]; then
43 env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu-devel
44 fi
45
46 mv ${VMIMAGE} ${VMIMAGE}.raw
47 size=$(qemu-img info -f raw --output json ${VMIMAGE}.raw | awk '/virtual-size/ {print $2}' | tr -d ',')
48 size=$(( ( ${size} / ( 1024 * 1024 ) + 1 ) * ( 1024 * 1024 ) ))
49 qemu-img resize ${VMIMAGE}.raw ${size}
50 qemu-img convert -f raw -o subformat=fixed -O vpc ${VMIMAGE}.raw ${VMIMAGE}
51
52 return 0
53}