Page MenuHomeFreeBSD

Makefile.inc1: Allow safe installkernel with pkgbase
AcceptedPublic

Authored by ivy on Tue, Dec 23, 11:16 AM.

Details

Reviewers
emaste
jrtc27
christos
jhb
Group Reviewers
pkgbase
Summary
Commit 74a6bb524e5b added a check to install{world,kernel} to avoid
people accidentally running this on pkgbase systems and leaving their
system broken.  This had two issues:

(1) The warning was not sufficiently scary, leading people to think
    this was safe to do as long as they set DESTDIR=/.

(2) The installkernel check was too strict, and prevented installing
    kernels that don't conflict with packaged kernels.

Fix (1) by rewording the warning to be scarier, and while here, add
two new variables (ALLOW_PKGBASE_INSTALL{WORLD,KERNEL}) which could
be set in /etc/make.conf for people who want to break their systems
by default.

Fix (2) by improving the installkernel check to see if the kernel(s)
we're actually installing are packaged.  This means a new kernel can
be installed to /boot/kernel as long as there's no packaged kernel
installed there.  This check understands INSTKERNNAME, so if there
is a packaged kernel in /boot/kernel, the new kernel can still be
installed using INSTKERNNAME=testkernel (or whatever).

MFC after:	2 weeks
Reported by:	christos, jhb, others

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69452
Build 66335: arc lint + arc unit

Event Timeline

ivy requested review of this revision.Tue, Dec 23, 11:16 AM
Makefile.inc1
1875–1879

hrm, our kernel selection logic is quite a mess :(

1889

Maybe suggest INSTKERNNAME

This revision is now accepted and ready to land.Tue, Dec 23, 1:43 PM
Makefile.inc1
1875–1879

D54291 should improve the logic here, but that hasn't landed yet and i'd like to get this one in quickly since people have been complaining.

suggest using INSTKERNNAME for installkernel

(but don't provide an example, because the user should probably read the
manual before adding this option without understanding what it does.)

This revision now requires review to proceed.Tue, Dec 23, 1:53 PM

but don't provide an example

Yes, this makes sense. Mainly I hope it's a useful hint either for someone to find the right section in the documentation, or as a reminder for someone who has read the documentation but doesn't recall the variable name.

D54291 should improve the logic here

I'll try to take a look at that too but probably will be after the break.

This revision is now accepted and ready to land.Tue, Dec 23, 2:03 PM