vmimage.subr (32dbc829820b1b03bf2e27d204cb3fee8d072da9) vmimage.subr (30a20c89bf905f464bf62a3904e74802fb86b80d)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5#
6# Common functions for virtual machine image build scripts.
7#
8

--- 76 unchanged lines hidden (view full) ---

85 fi
86
87 mkdir -p ${DESTDIR}/dev
88 mount -t devfs devfs ${DESTDIR}/dev
89 chroot ${DESTDIR} /usr/bin/newaliases
90 chroot ${DESTDIR} /etc/rc.d/ldconfig forcestart
91 umount ${DESTDIR}/dev
92
1#!/bin/sh
2#
3# $FreeBSD$
4#
5#
6# Common functions for virtual machine image build scripts.
7#
8

--- 76 unchanged lines hidden (view full) ---

85 fi
86
87 mkdir -p ${DESTDIR}/dev
88 mount -t devfs devfs ${DESTDIR}/dev
89 chroot ${DESTDIR} /usr/bin/newaliases
90 chroot ${DESTDIR} /etc/rc.d/ldconfig forcestart
91 umount ${DESTDIR}/dev
92
93 cp /etc/resolv.conf ${DESTDIR}/etc/resolv.conf
94
93 return 0
94}
95
96vm_extra_install_base() {
97 # Prototype. When overridden, runs extra post-installworld commands
98 # as needed, based on the target virtual machine image or cloud
99 # provider image target.
100

--- 6 unchanged lines hidden (view full) ---

107 echo ${_rcvar}_enable="YES" >> ${DESTDIR}/etc/rc.conf
108 done
109 fi
110
111 return 0
112}
113
114vm_extra_install_packages() {
95 return 0
96}
97
98vm_extra_install_base() {
99 # Prototype. When overridden, runs extra post-installworld commands
100 # as needed, based on the target virtual machine image or cloud
101 # provider image target.
102

--- 6 unchanged lines hidden (view full) ---

109 echo ${_rcvar}_enable="YES" >> ${DESTDIR}/etc/rc.conf
110 done
111 fi
112
113 return 0
114}
115
116vm_extra_install_packages() {
117 mkdir -p ${DESTDIR}/dev
118 mount -t devfs devfs ${DESTDIR}/dev
119 chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \
120 /usr/sbin/pkg bootstrap -y
115 if [ ! -z "${VM_EXTRA_PACKAGES}" ]; then
121 if [ ! -z "${VM_EXTRA_PACKAGES}" ]; then
116 PKGSDIR=`mktemp -d`
117 ABI=`/usr/sbin/pkg -c ${DESTDIR} config abi`
118 /usr/sbin/pkg -o ABI=${ABI} fetch -o ${PKGSDIR} -d -y ${VM_EXTRA_PACKAGES}
119 for PKG in ${PKGSDIR}/All/*; do
120 /usr/sbin/pkg -c ${DESTDIR} add -M - < ${PKG}
121 done
122 rm -r ${PKGSDIR}
123 if [ -z "${NOREPOSQLITE}" ]; then
124 cp /var/db/pkg/repo-FreeBSD.sqlite ${DESTDIR}/var/db/pkg
125 fi
122 chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \
123 /usr/sbin/pkg install -y ${VM_EXTRA_PACKAGES}
126 fi
124 fi
125 umount ${DESTDIR}/dev
127
128 return 0
129}
130
131vm_extra_install_ports() {
132 # Prototype. When overridden, installs additional ports within the
133 # virtual machine environment.
134
135 return 0
136}
137
138vm_extra_pre_umount() {
139 # Prototype. When overridden, installs additional ports within the
140 # virtual machine environment.
141
126
127 return 0
128}
129
130vm_extra_install_ports() {
131 # Prototype. When overridden, installs additional ports within the
132 # virtual machine environment.
133
134 return 0
135}
136
137vm_extra_pre_umount() {
138 # Prototype. When overridden, installs additional ports within the
139 # virtual machine environment.
140
141 rm -f ${DESTDIR}/etc/resolv.conf
142
142 return 0
143}
144
145vm_umount_base() {
146 i=0
147 sync
148 while ! umount ${DESTDIR}/dev ${DESTDIR}; do
149 i=$(( $i + 1 ))

--- 26 unchanged lines hidden ---
143 return 0
144}
145
146vm_umount_base() {
147 i=0
148 sync
149 while ! umount ${DESTDIR}/dev ${DESTDIR}; do
150 i=$(( $i + 1 ))

--- 26 unchanged lines hidden ---