From owner-freebsd-current@FreeBSD.ORG Fri Oct 12 05:19:03 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A68116A51A for ; Fri, 12 Oct 2007 05:19:03 +0000 (UTC) (envelope-from barnaclewes@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE2F13C459 for ; Fri, 12 Oct 2007 05:19:02 +0000 (UTC) (envelope-from barnaclewes@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so668112nfb for ; Thu, 11 Oct 2007 22:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=EoGY2jd2vKthp4bkpRe5aawZSuGkJDPdJzWNKBBPuos=; b=dChEkI5IXu/aFV2KLv8nPSHMu3D+1Yk7tvoiXoQH222DmO7q+zRqNJOG2OffdYinGyckDsqiY9wLec2txjUE9dvB8OEUDa0Vhy6hGTCsJLDfQA1K/GYASgPllCdes+jpGlc3WvigpUJ98+pvK3CHxxJemKo3400GOhi82WcXYI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nHFUMlRPuybOjL6GjGJZZfrqRHTS/wedP8P74NYSXlkEA3jBYKkWP++5Nz6Etpl1/HWSdCmPDe7AdqaTS1IjynuuFM/zncobxKkiz02h30WrJ9TPS2YPxziYeXmaZi0XKbjStskqd5Hj76xIriaAypt9FyQVjzfpF78iOOZquP4= Received: by 10.78.142.14 with SMTP id p14mr1978778hud.1192164809570; Thu, 11 Oct 2007 21:53:29 -0700 (PDT) Received: by 10.78.198.4 with HTTP; Thu, 11 Oct 2007 21:53:29 -0700 (PDT) Message-ID: Date: Thu, 11 Oct 2007 21:53:29 -0700 From: "Wes Peters" To: "Dmitry Morozovsky" In-Reply-To: <20071011224937.D97516@woozle.rinet.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071011224937.D97516@woozle.rinet.ru> Cc: current@freebsd.org Subject: Re: INSTKERNNAME= foolproof check X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2007 05:19:03 -0000 On 10/11/07, Dmitry Morozovsky wrote: > 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@FreeBSD.org ] > ------------------------------------------------------------------------ > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@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 "--------------------------------------------------------------" > Seems like a very good idea to me. -- Against stupidity the very gods Themselves contend in vain. Friedrich Schiller Wes Peters barnaclewes@gmail.com