Page MenuHomeFreeBSD

Makefile.inc1: Fix INSTALLEXTRAKERNELS for one-kernel case
ClosedPublic

Authored by ivy on Mon, Jan 5, 8:52 PM.
Tags
None
Referenced Files
F142859789: D54539.diff
Sat, Jan 24, 6:01 AM
Unknown Object (File)
Tue, Jan 20, 11:21 AM
Unknown Object (File)
Tue, Jan 20, 8:15 AM
Unknown Object (File)
Mon, Jan 19, 11:00 PM
Unknown Object (File)
Sun, Jan 18, 3:15 AM
Unknown Object (File)
Mon, Jan 12, 3:32 AM
Unknown Object (File)
Sun, Jan 11, 1:57 PM
Unknown Object (File)
Sat, Jan 10, 4:41 PM
Subscribers

Details

Summary

If BUILDKERNELS contains a single kernel, and NO_INSTALLEXTRAKERNELS=no,
then ${BUILDKERNELS:[2..-1]} returns the first kernel in the list and
that kernel ends up in both INSTALLKERNEL and INSTALLEXTRAKERNELS.

This breaks the package build because it means we generate that package
twice, once with an incorrect install path of /boot/kernel.NAME instead
of /boot/kernel.

Only set INSTALLEXTRAKERNELS if we're building at least two kernels.

Fixes: 2c0e9a76c1ce ("Makefile.inc1: Make NO_INSTALLKERNEL less of a hack")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Mon, Jan 5, 8:52 PM

That's... unhelpful. Also not sure how I managed to miss testing that case :(

Seems like this is a confusing result of "If start is greater than end, the words are output in reverse order" - -1 becomes 1 as there's only 1 item in the list, and that's before 2 (I note that "greater" is a confusing term in the manpage, too, given you can index from the end using negative integers). Of course, reversing the one-element list does nothing, but playing around with other similar ranges I can see it reversing them.

This revision is now accepted and ready to land.Mon, Jan 5, 9:17 PM

use .elif to make this a bit neater

This revision now requires review to proceed.Mon, Jan 5, 9:20 PM

Seems like this is a confusing result of "If start is greater than end, the words are output in reverse order"

yes, i was rather surprised by this and thought it was a make bug at first, but it's actually documented behaviour... i feel like there should be a syntax for what we actually want to do here, but i couldn't find one.

This revision was not accepted when it landed; it landed in state Needs Review.Tue, Jan 6, 1:49 AM
This revision was automatically updated to reflect the committed changes.