Author: cperciva
Date: Thu Apr 18 00:38:54 2019
New Revision: 346340
URL: https://svnweb.freebsd.org/changeset/base/346340

Log:
  Fix cross-building VMs with a non-/usr/src source directory.
  
  The path /usr/src was hard-coded here, resulting in mkimg not being able
  to find the bootfiles.
  
  Direct commit to stable/11 because the code in HEAD and stable/12 is
  completely different due to changes in OBJDIR layout.

Modified:
  stable/11/release/tools/vmimage.subr

Modified: stable/11/release/tools/vmimage.subr
==============================================================================
--- stable/11/release/tools/vmimage.subr        Wed Apr 17 23:32:38 2019        
(r346339)
+++ stable/11/release/tools/vmimage.subr        Thu Apr 18 00:38:54 2019        
(r346340)
@@ -16,8 +16,9 @@ write_partition_layout() {
 
        _OBJDIR="$(make -C ${WORLDDIR} -V .OBJDIR)"
        _OBJDIR="$(realpath ${_OBJDIR})"
-       if [ -d "${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}" ]; then
-               
BOOTFILES="/${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}/usr/src/stand"
+       _WORLDDIR="$(realpath ${WORLDDIR})"
+       if [ -d "${_OBJDIR%%${_WORLDDIR}}/${TARGET}.${TARGET_ARCH}" ]; then
+               
BOOTFILES="/${_OBJDIR%%${_WORLDDIR}}/${TARGET}.${TARGET_ARCH}${_WORLDDIR}/stand"
        else
                BOOTFILES="/${_OBJDIR}/stand"
        fi
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to