INSTKERNNAME= foolproof check
    Dmitry Morozovsky 
    marck at rinet.ru
       
    Thu Oct 11 11:53:14 PDT 2007
    
    
  
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
@@ -742,6 +742,10 @@
        @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
        false
 .endif
+.if empty(INSTKERNNAME)
+       @echo "ERROR: Kernel install directory is empty."; \
+       false
+.endif
        @echo "--------------------------------------------------------------"
        @echo ">>> Installing kernel"
        @echo "--------------------------------------------------------------"
    
    
More information about the freebsd-current
mailing list