Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 946499 - sys-apps/kbd-2.7 breaks sys-apps/openrc-0.55.1
Summary: sys-apps/kbd-2.7 breaks sys-apps/openrc-0.55.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
: 946591 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-12-15 09:40 UTC by Another Mortal
Modified: 2024-12-17 18:30 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/init.d/consolefont restart --debug (consolefont.debug.log,13.88 KB, text/plain)
2024-12-15 09:43 UTC, Another Mortal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Another Mortal 2024-12-15 09:40:46 UTC
`sys-apps/kbd-2.7` appears to have become strict about the ordering of options vs non-options on the command-line, which breaks the invocation in `/etc/init.d/consolefont` in `sys-apps/openrc-0.55.1`.

> setfont: ERROR setfont.c:312 kfont_load_fonts: Unable to find file: -C

Note that this behavior CANNOT be tested on a graphical terminal, since option processing in `setfont` is largely skipped when a "graphics terminal" is detected.

See: https://github.com/legionus/kbd/blob/master/src/setfont.c#L307


```console
$ equery belongs $(which setfont)
 * Searching for /usr/bin/setfont ... 
sys-apps/kbd-2.7 (/usr/bin/setfont)
$ equery belongs /etc/init.d/consolefont 
 * Searching for /etc/init.d/consolefont ... 
sys-apps/openrc-0.55.1 (/etc/init.d/consolefont)
$ setfont --verbose
setfont: graphics console  skipped
$ 
```

Reproducible: Always

Steps to Reproduce:
Boot system with `sys-apps/kbd-2.7` and `sys-apps/openrc-0.55.1` installed.



Actual Results:  
Fonts on the console remain unchanged. The following error is printed instead:

> setfont: ERROR setfont.c:312 kfont_load_fonts: Unable to find file: -C

Expected Results:  
Font on the console should be set to whatever is configured in `/etc/conf.d/consolefont`.

I'll attach the output from `/etc/init.d/consolefont restart --debug` that shows both the original issue and a trivial fix (simply switch the order of the arguments in the init-script).
Comment 1 Another Mortal 2024-12-15 09:43:45 UTC
Created attachment 914075 [details]
/etc/init.d/consolefont restart --debug

This is a bit of a mess.  Just search for `setfont`...
Comment 2 Another Mortal 2024-12-15 09:49:07 UTC
Just in case it's unclear, the attached logs are generated by a slightly modified `/etc/init.d/consolefont` script that both demonstrates the error *and* fixes it...

```diff
--- openrc-0.55.1/init.d/consolefont.in	2024-09-18 20:11:58.000000000 +0200
+++ /etc/init.d/consolefont	2024-12-15 10:47:10.704688022 +0100
@@ -1,4 +1,4 @@
-#!@SBINDIR@/openrc-run
+#!/sbin/openrc-run
 # Copyright (c) 2007-2015 The OpenRC Authors.
 # See the Authors file at the top-level directory of this distribution and
 # https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS
@@ -53,8 +53,10 @@
 	x=1
 	while [ $x -le $ttyn ]; do
 		if ! setfont $consolefont $param -C $ttydev$x >/dev/null; then
+		 if ! setfont $param -C $ttydev$x $consolefont >/dev/null; then
 			retval=1
 			break
+		 fi
 		fi
 		: $(( x += 1 ))
 	done
```

Clearly, in the end, only the fix needs to be kept... ;-)
Comment 4 Larry the Git Cow gentoo-dev 2024-12-16 21:03:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6537b19c559b36f5bc94af5a5cb6f1a54a6ee33e

commit 6537b19c559b36f5bc94af5a5cb6f1a54a6ee33e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-12-16 21:02:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-16 21:02:40 +0000

    sys-apps/kbd: add 2.7.1, drop 2.7
    
    kbd-2.7 broke OpenRC.
    
    Closes: https://bugs.gentoo.org/946499
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/kbd/Manifest                             | 2 +-
 sys-apps/kbd/{kbd-2.7.ebuild => kbd-2.7.1.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
Comment 5 Mike Gilbert gentoo-dev 2024-12-17 18:30:56 UTC
*** Bug 946591 has been marked as a duplicate of this bug. ***