mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-29 11:54:38 +01:00
vmimage.subr: Fix NO_ROOT build in ..._rmcache
When doing a NO_ROOT build we can't run pkg inside a chroot, for multiple reasons including not having /dev mounted. MFC after: 6 hours Sponsored by: https://www.patreon.com/cperciva
This commit is contained in:
1 parent
5c5c0571c2
commit
86221f965c
1 file changed
+10
-3
@@ -250,9 +250,16 @@ vm_emulation_cleanup() {
|
||||
}
|
||||
|
||||
vm_extra_pkg_rmcache() {
|
||||
if [ -e ${DESTDIR}/usr/local/sbin/pkg ]; then
|
||||
chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
|
||||
/usr/local/sbin/pkg clean -y -a
|
||||
if [ -n "${NO_ROOT}" ]; then
|
||||
${PKG_CMD} \
|
||||
-o ASSUME_ALWAYS_YES=yes \
|
||||
-r ${DESTDIR} \
|
||||
clean -y -a
|
||||
else
|
||||
if [ -e ${DESTDIR}/usr/local/sbin/pkg ]; then
|
||||
chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
|
||||
/usr/local/sbin/pkg clean -y -a
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user