INSTKERNNAME= foolproof check

Wes Peters barnaclewes at gmail.com
Thu Oct 11 22:19:03 PDT 2007


On 10/11/07, Dmitry Morozovsky <marck at 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 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 "--------------------------------------------------------------"
>

Seems like a very good idea to me.

-- 
Against stupidity the very gods Themselves contend in vain.
                                         Friedrich Schiller

Wes Peters
barnaclewes at gmail.com


More information about the freebsd-current mailing list