From 6c243dd175e4660a75ba85bb41b643f9d53c8ff1 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Fri, 25 Aug 2000 19:16:43 +0000 Subject: [PATCH] Add some anti-foot-shooting protection to the kernel install target. Do not install a kernel unless a device.hints exists. Yes, you can create an empty hints file if you refuse to use them. --- sys/conf/Makefile.alpha | 8 ++++++++ sys/conf/Makefile.i386 | 8 ++++++++ sys/conf/Makefile.pc98 | 8 ++++++++ sys/conf/Makefile.powerpc | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/sys/conf/Makefile.alpha b/sys/conf/Makefile.alpha index 12d899e5656..87559cee5ff 100644 --- a/sys/conf/Makefile.alpha +++ b/sys/conf/Makefile.alpha @@ -259,6 +259,14 @@ kernel-tags: sed -e 's, ../, ,' tags > tags1 kernel-install kernel-install.debug: + @if [ ! -f ${DESTDIR}/boot/device.hints ] ; then \ + echo "You must set up a /boot/device.hints file first." ; \ + exit 1 ; \ + fi + @if [ x"`grep device.hints /boot/defaults/loader.conf /boot/loader.conf`" = "x" ]; then \ + echo "You must activate /boot/device.hints in loader.conf." ; \ + exit 1 ; \ + fi @if [ ! -f ${KERNEL}${.TARGET:S/kernel-install//} ] ; then \ echo "You must build a kernel first." ; \ exit 1 ; \ diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index deb6eccf5d9..8bbb953659f 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -214,6 +214,14 @@ kernel-tags: sed -e 's, ../, ,' tags > tags1 kernel-install kernel-install.debug: + @if [ ! -f ${DESTDIR}/boot/device.hints ] ; then \ + echo "You must set up a /boot/device.hints file first." ; \ + exit 1 ; \ + fi + @if [ x"`grep device.hints /boot/defaults/loader.conf /boot/loader.conf`" = "x" ]; then \ + echo "You must activate /boot/device.hints in loader.conf." ; \ + exit 1 ; \ + fi @if [ ! -f ${KERNEL}${.TARGET:S/kernel-install//} ] ; then \ echo "You must build a kernel first." ; \ exit 1 ; \ diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98 index 28b6ce8140b..2f52ccb0ef4 100644 --- a/sys/conf/Makefile.pc98 +++ b/sys/conf/Makefile.pc98 @@ -217,6 +217,14 @@ kernel-tags: sed -e 's, ../, ,' tags > tags1 kernel-install kernel-install.debug: + @if [ ! -f ${DESTDIR}/boot/device.hints ] ; then \ + echo "You must set up a /boot/device.hints file first." ; \ + exit 1 ; \ + fi + @if [ x"`grep device.hints /boot/defaults/loader.conf /boot/loader.conf`" = "x" ]; then \ + echo "You must activate /boot/device.hints in loader.conf." ; \ + exit 1 ; \ + fi @if [ ! -f ${KERNEL}${.TARGET:S/kernel-install//} ] ; then \ echo "You must build a kernel first." ; \ exit 1 ; \ diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index deb6eccf5d9..8bbb953659f 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -214,6 +214,14 @@ kernel-tags: sed -e 's, ../, ,' tags > tags1 kernel-install kernel-install.debug: + @if [ ! -f ${DESTDIR}/boot/device.hints ] ; then \ + echo "You must set up a /boot/device.hints file first." ; \ + exit 1 ; \ + fi + @if [ x"`grep device.hints /boot/defaults/loader.conf /boot/loader.conf`" = "x" ]; then \ + echo "You must activate /boot/device.hints in loader.conf." ; \ + exit 1 ; \ + fi @if [ ! -f ${KERNEL}${.TARGET:S/kernel-install//} ] ; then \ echo "You must build a kernel first." ; \ exit 1 ; \