Page MenuHomeFreeBSD

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

Authored by gjb on Mar 10 2021, 8:08 PM.

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
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

evgeniy_khramtsov.org 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.Mon, Mar 15, 2:28 PM