aboutsummaryrefslogtreecommitdiff
path: root/release/tools/vmimage.subr
diff options
context:
space:
mode:
Diffstat (limited to 'release/tools/vmimage.subr')
-rw-r--r--release/tools/vmimage.subr68
1 files changed, 36 insertions, 32 deletions
diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index 842a808c623e..3bfef585f613 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -97,7 +97,7 @@ vm_install_base() {
if [ -z "${NOPKGBASE}" ]; then
local pkg_cmd
- pkg_cmd="pkg --rootdir ${DESTDIR} --repo-conf-dir ${PKGBASE_REPO_DIR}
+ pkg_cmd="${PKG_CMD} --rootdir ${DESTDIR} --repo-conf-dir ${PKGBASE_REPO_DIR}
-o ASSUME_ALWAYS_YES=yes -o IGNORE_OSVERSION=yes
-o ABI=${PKG_ABI} -o INSTALL_AS_USER=yes "
if [ -n "${NO_ROOT}" ]; then
@@ -213,16 +213,6 @@ vm_extra_install_packages() {
install -y -r ${PKG_REPO_NAME} $pkg
done
metalog_add_data ./var/db/pkg/local.sqlite
-
- # Add some database files which are created by pkg triggers;
- # at some point in the future the tools which create these
- # files should probably learn how to record them in METALOG
- # (which would simplify no-root installworld as well).
- metalog_add_data ./etc/login.conf.db
- metalog_add_data ./etc/passwd
- metalog_add_data ./etc/pwd.db
- metalog_add_data ./etc/spwd.db 600
- metalog_add_data ./var/db/services.db
else
if [ -n "${WITHOUT_QEMU}" ]; then
return 0
@@ -290,28 +280,42 @@ buildfs() {
cat ${DESTDIR}/METALOG.pkg >> ${DESTDIR}/METALOG
fi
- # Check for any directories in the staging tree which weren't
- # recorded in METALOG, and record them now. This is a quick hack
- # to avoid creating unusable VM images and should go away once
- # the bugs which produce such unlogged directories are gone.
- grep type=dir ${DESTDIR}/METALOG |
- cut -f 1 -d ' ' |
- sort -u > ${DESTDIR}/METALOG.dirs
- ( cd ${DESTDIR} && find . -type d ) |
- sort |
- comm -23 - ${DESTDIR}/METALOG.dirs > ${DESTDIR}/METALOG.missingdirs
- if [ -s ${DESTDIR}/METALOG.missingdirs ]; then
- echo "WARNING: Directories exist but were not in METALOG"
- cat ${DESTDIR}/METALOG.missingdirs
+ if [ -n "${NO_ROOT}" ]; then
+ # Check for any directories in the staging tree which weren't
+ # recorded in METALOG, and record them now. This is a quick hack
+ # to avoid creating unusable VM images and should go away once
+ # the bugs which produce such unlogged directories are gone.
+ grep type=dir ${DESTDIR}/METALOG |
+ cut -f 1 -d ' ' |
+ sort -u > ${DESTDIR}/METALOG.dirs
+ ( cd ${DESTDIR} && find . -type d ) |
+ sort |
+ comm -23 - ${DESTDIR}/METALOG.dirs > ${DESTDIR}/METALOG.missingdirs
+ if [ -s ${DESTDIR}/METALOG.missingdirs ]; then
+ echo "WARNING: Directories exist but were not in METALOG"
+ cat ${DESTDIR}/METALOG.missingdirs
+ fi
+ while read DIR; do
+ metalog_add_data ${DIR}
+ done < ${DESTDIR}/METALOG.missingdirs
+
+ if [ -z "${NOPKGBASE}" ]; then
+ # Add some database files which are created by pkg triggers;
+ # at some point in the future the tools which create these
+ # files should probably learn how to record them in METALOG
+ # (which would simplify no-root installworld as well).
+ metalog_add_data ./etc/login.conf.db
+ metalog_add_data ./etc/passwd
+ metalog_add_data ./etc/pwd.db
+ metalog_add_data ./etc/spwd.db 600
+ metalog_add_data ./var/db/services.db
+ fi
+
+ # Sort METALOG file; makefs produces directories with 000 permissions
+ # if their contents are seen before the directories themselves.
+ env -i LC_COLLATE=C sort -u ${DESTDIR}/METALOG > ${DESTDIR}/METALOG.sorted
+ mv ${DESTDIR}/METALOG.sorted ${DESTDIR}/METALOG
fi
- while read DIR; do
- metalog_add_data ${DIR}
- done < ${DESTDIR}/METALOG.missingdirs
-
- # Sort METALOG file; makefs produces directories with 000 permissions
- # if their contents are seen before the directories themselves.
- env -i LC_COLLATE=C sort -u ${DESTDIR}/METALOG > ${DESTDIR}/METALOG.sorted
- mv ${DESTDIR}/METALOG.sorted ${DESTDIR}/METALOG
case "${VMFS}" in
ufs)