Skip to content

Commit

Permalink
Feature kbd: Require gpu-drm if framebuffer is used on vtconsole
Browse files Browse the repository at this point in the history
This should fix the following issue: the console is in text mode, kbd
feature initializes the console font and the boot continues. The real
system loads framebuffer module and this breaks the console font setup.

A technically real system must reconfigure the console font after
loading framebuffer module, but not all systems seem to be able to do
this.

So if at the time of initramfs creation the framebuffer is used in
the console, then we add the feature gpu-drm feature to the image.

In this case, modules for the framebuffer will get into the initramfs,
they will be loaded from the initramfs and the console font will be
configured correctly.

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
  • Loading branch information
legionus committed Jun 24, 2021
1 parent a164b9b commit 35b26ef
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions features/kbd/guess/common
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
#!/bin/bash -efu
#!/bin/bash -eu

. guess-functions

! grep -qs -E '^[[:space:]]*(KEYTABLE|SYSFONT)=' \
grep -qs -E '^[[:space:]]*(KEYTABLE|SYSFONT)=' \
"$SYSCONFDIR/sysconfig/consolefont" \
"$SYSCONFDIR/sysconfig/keyboard" \
2>/dev/null ||
guess_feature kbd
exit 0

guess_feature kbd

# Check (M)odular console driver.
# See: linux/Documentation/driver-api/console.rst

for f in "$SYSFS_PATH"/class/vtconsole/vtcon*/name; do
[ -e "$f" ] ||
continue

p="${f%/*}"

bind=0
readline bind "$p/bind"

[ "$bind" = 1 ] ||
continue

name=
readline name "$p/name"

[ "$name" = "(M) frame buffer device" ] ||
continue

guess_feature gpu-drm
done

0 comments on commit 35b26ef

Please sign in to comment.