From 81f07c26a0092e14e306af188076d27601b92328 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 3 Jul 2018 20:15:17 +0800 Subject: [PATCH] Do not auto build rescue tools when ${DESTDIR} != "/" When installworld to an alternative root (i.e., ${DESTDIR} != "/"), do not automatically build the rescue tools. This change won't affect the nrelease build, since it will explicitly do 'make initrd'. Suggested-by: swildner --- Makefile.inc1 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 5d792b0372..a514702941 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -488,16 +488,18 @@ installworld: installcheck echo "Cannot write to ${AUTO_BACKUP} - world not backed up" cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//} - ${INSTALL} -o root -g wheel -m 644 ${.CURDIR}/Makefile_upgrade.inc ${DESTDIR}/etc/upgrade/ - - # Do not leave an empty /rescue directory when switching the rescue - # tools from /usr/share/initrd to /rescue. - @(if ! test -x ${DESTDIR}/rescue/rescue; then \ - echo "--------------------------------------------------------------"; \ - echo ">>> build and install rescue tools"; \ - echo "--------------------------------------------------------------"; \ - cd ${.CURDIR}; make rescue; \ - fi) + ${INSTALL} -o root -g wheel -m 644 ${.CURDIR}/Makefile_upgrade.inc \ + ${DESTDIR}/etc/upgrade/ + +.if !exists(/rescue/rescue) && \ + (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") + # Do not leave an empty '/rescue' directory when switching the rescue + # tools from '/usr/share/initrd' to '/rescue'. + @echo "--------------------------------------------------------------" + @echo ">>> build and install rescue tools" + @echo "--------------------------------------------------------------" + (cd ${.CURDIR} && make rescue) +.endif sync @echo "--------------------------------------------------------------" -- 2.41.0