FONT="x/y/z" is not applied due to setupcon script bug

Bug #1763100 reported by TJ
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
console-setup (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

apt-cache policy console-setup
console-setup:
  Installed: 1.178ubuntu1
  Candidate: 1.178ubuntu1
  Version table:
 *** 1.178ubuntu1 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://gb.archive.ubuntu.com/ubuntu bionic/main i386 Packages
        100 /var/lib/dpkg/status

On 18.04 I wanted to set the TTY font to use a Powerline font. Despite being able to set the font manually it wasn't being set at boot-time.

/etc/default/console-setup contains:

FONT="/usr/local/share/fonts/ter-powerline-v22n.psf.gz"

"setupcon -v -f" reported an error:

putfont: KDFONTOP: Invalid argument

due to passing the font filename twice:

executing setfont -C /dev/tty1 /usr/local/share/fonts/ter-powerline-v22n.psf.gz /usr/local/share/fonts/ter-powerline-v22n.psf.gz.

The problem is in /bin/setupcon where the collecting variable FONTFILES has the font added twice, once at the top of the for loop

FONTFILES="$FONTFILES `findfile $fontdir $f`"

and again at the bottom

FONTFILES="$FONTFILES $RES"

Removing the first assignment fixes it.

FONTFILES=''
echo "DEBUG: FONT=$FONT"
if [ "$FONT" ]; then
    for f in $FONT; do
      echo "DEBUG: for loop"
        FONTFILES="$FONTFILES `findfile $fontdir $f`"
        RES=`findfile $fontdir $f`
        if [ -z "$RES" ]; then
            fdec="${f%.gz}"
            RES=`findfile $fontdir $fdec`
        fi
        FONTFILES="$FONTFILES $RES"
    done
fi
FONTFILES=`echo $FONTFILES` # remove extra spaces

Tags: bionic patch
tags: added: bionic patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in console-setup (Ubuntu):
status: New → Confirmed
Revision history for this message
Harvald (harvald) wrote :

This solution seems to work. Thanks! ;)

Revision history for this message
John Zaitseff (zaitseff) wrote :

Here is an actual patch that fixes the problem.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "console-setup-1.178ubuntu9-JNZ-1.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Revision history for this message
wolnosc (wolnosc92) wrote :

I confirm the bug also on Ubuntu 19.04.
Patch on post #3 resolve the problem.

Nowadays on laptop we have more and more 4K screen, the default font in TTY framebuffer is very too small. For people who have Xorg no starting, TTY is unique path to fix configuration.

Revision history for this message
Harvald (harvald) wrote :

I confirm the bug also on Ubuntu 20.04.1
Patch on post #3 resolve the problem.

Revision history for this message
UbuntuOne (tigerinus) wrote :

I confirm this bug still reproduces on Ubuntu 21.10 impish.

Please release a fix with the above patch. Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.