INSTKERNNAME= foolproof check

From: Dmitry Morozovsky <marck_at_rinet.ru>
Date: Thu, 11 Oct 2007 22:53:12 +0400 (MSD)
Colleagues,

Today I successfully shoot myself in the foot by typing

make installkernel KERNCONF=GENERIC INSTKERNNAME=

instead of usual

make installkernel KERNCONF=GENERIC INSTKERNNAME=GENERIC

Empty INSTKERNNAME leads to wiping /boot completely - rather annoying, 
especially in my case, where I had some non-trivial (and, of course, no backups 
;-) loader.conf

What do you think about the following patch?

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:				     marck_at_FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck_at_rinet.ru ***
------------------------------------------------------------------------


Index: Makefile.inc1
===================================================================
RCS file: /home/ncvs/src/Makefile.inc1,v
retrieving revision 1.588.2.1
diff -u -r1.588.2.1 Makefile.inc1
--- Makefile.inc1       11 Oct 2007 06:08:51 -0000      1.588.2.1
+++ Makefile.inc1       11 Oct 2007 18:49:19 -0000
_at__at_ -742,6 +742,10 _at__at_
        _at_echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
        false
 .endif
+.if empty(INSTKERNNAME)
+       _at_echo "ERROR: Kernel install directory is empty."; \
+       false
+.endif
        _at_echo "--------------------------------------------------------------"
        _at_echo ">>> Installing kernel"
        _at_echo "--------------------------------------------------------------"
Received on Thu Oct 11 2007 - 16:53:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:19 UTC