Page MenuHomeFreeBSD

Makefile.inc1: unbreak bootstrap when kbdcontrol does not exist
ClosedPublic

Authored by gjb on Mar 10 2021, 8:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 9, 8:58 AM
Unknown Object (File)
Tue, May 7, 9:48 PM
Unknown Object (File)
Mon, Apr 29, 9:20 AM
Unknown Object (File)
Feb 4 2024, 6:25 AM
Unknown Object (File)
Jan 13 2024, 1:04 PM
Unknown Object (File)
Dec 20 2023, 2:45 AM
Unknown Object (File)
Dec 18 2023, 1:29 PM
Unknown Object (File)
Dec 15 2023, 6:03 AM
Subscribers

Details

Summary

Bootstrap kbdcontrol if it does not exist on a FreeBSD system.

This unbreaks buildworld when /usr/sbin/kbdcontrol does not exist.

PR: 254008

Test Plan

mv /usr/sbin/kbdcontrol /usr/sbin/kbdcontrol.bak
cd /usr/src
make buildworld
(observe instant bootstrap failure without this fix)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

2khramtsov_gmail.com added inline comments.
Makefile.inc1
2303

Should this absolute path be replaced with a variable?

Makefile.inc1
2303

I would like to clarify. I am not sure if kbdcontrol in a custom directory should be supported now or not. Other binaries use stuff like ${LOCALBASE}, so I am not sure. Also, I'll add someone I know to be an expert in bootstrap as a reviewer, so this fix could probably make into 13.0.

Makefile.inc1
2300

Maybe this should just be disabled for MK_LEGACY_CONSOLE==no? I guess the problem happens when creating the symlink for the bootstrap tools?

Makefile.inc1
2300

Maybe this should just be disabled for MK_LEGACY_CONSOLE==no?

If one for some reason wants to get kbdcontrol back (e.g. removing WITHOUT_LEGACY_CONSOLE from src.conf and rebuilding world), or building world for some other system while not having kbdcontrol, then the buildworld would fail. Check for existence ensures that this use case still works.

I guess the problem happens when creating the symlink for the bootstrap tools?

'make -d x buildworld' reveals that failure happens after 'which kbdcontrol'. It seems that kbdcontrol is also used later for keymap purposes (e.g. sys/conf/kern.pre.mk).

Makefile.inc1
2300

Update: kbdcontrol is needed both for WITHOUT_LEGACY_CONSOLE and not if kernel has the KBDMUX_DFLT_KEYMAP option (see: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209055#c2). So, kbdcontrol should always be bootstrapped.

I think making this change is fine, but please wait for @bdrewery to take a look.

Makefile.inc1
2300

I've been building world+kernels fine on Linux/macOS (where kbdcontrol does not build), so it doesn't seem to be strictly required.

This revision is now accepted and ready to land.Mar 15 2021, 2:28 PM