Date: Thu, 11 Oct 2007 21:53:29 -0700 From: "Wes Peters" <barnaclewes@gmail.com> To: "Dmitry Morozovsky" <marck@rinet.ru> Cc: current@freebsd.org Subject: Re: INSTKERNNAME= foolproof check Message-ID: <f83770800710112153g5df789dcla94cdd6f6c7341e0@mail.gmail.com> In-Reply-To: <20071011224937.D97516@woozle.rinet.ru> References: <20071011224937.D97516@woozle.rinet.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/11/07, Dmitry Morozovsky <marck@rinet.ru> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f83770800710112153g5df789dcla94cdd6f6c7341e0>
