Page MenuHomeFreeBSD

Makefile.inc1: Allow safe installkernel with pkgbase
ClosedPublic

Authored by ivy on Tue, Dec 23, 11:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 17, 3:09 PM
Unknown Object (File)
Sat, Jan 17, 3:08 PM
Unknown Object (File)
Fri, Jan 16, 8:04 PM
Unknown Object (File)
Fri, Jan 16, 4:53 AM
Unknown Object (File)
Fri, Jan 16, 3:30 AM
Unknown Object (File)
Tue, Jan 13, 6:17 PM
Unknown Object (File)
Sat, Jan 10, 3:35 PM
Unknown Object (File)
Sat, Jan 10, 3:24 PM
Subscribers

Details

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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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

1887

Maybe suggest INSTKERNNAME

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

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
This revision now requires review to proceed.Sat, Jan 3, 8:57 PM
This revision is now accepted and ready to land.Mon, Jan 5, 4:38 PM