setupcon looks for VARIANT in wrong path: /usr/etc/default/

Bug #1578540 reported by TJ
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
console-setup (Ubuntu)
New
Medium
Unassigned

Bug Description

On 16.04 amd64:

$ ls /etc/default/console-setup*
/etc/default/console-setup /etc/default/console-setup.tj

$ sudo setupcon -v tj
[sudo] password for tj:
setupcon: None of /usr/etc/default/keyboard.tj nor /home/tj/.console-setup.tj exists.

Tags: patch
Revision history for this message
TJ (tj) wrote :

$ sh -x /bin/setupcon tj
+ do_font=yes
+ do_kbd=yes
+ do_check=yes
+ do_verbose=
+ do_save=
+ savekbdfile=
+ setupdir=
+ SETUP=
+ TMPFILE=
+ [ tj ]
+ [ -z ]
+ VARIANT=tj
+ shift
+ [ ]
+ installdir=/bin
+ installdir=
+ [ -n -a -d /bin ]
+ installdir=/usr
+ [ tj ]
+ VARIANT=.tj
+ USER_CONFIG=/home/tj/.console-setup.tj
+ USER_CONFIG2=/home/tj/.keyboard.tj
+ MAIN_CONFIG=/etc/default/keyboard.tj
+ [ -f /etc/default/keyboard.tj ]
+ MAIN_CONFIG=/usr/etc/default/keyboard.tj
+ MAIN_CONFIG2=/etc/default/console-setup.tj
+ [ -f /etc/default/console-setup.tj ]
+ [ -f /home/tj/.console-setup.tj ]
+ [ -f /usr/etc/default/keyboard.tj ]
+ echo setupcon: None of /usr/etc/default/keyboard.tj nor /home/tj/.console-setup.tj exists.
setupcon: None of /usr/etc/default/keyboard.tj nor /home/tj/.console-setup.tj exists.
+ exit 1
tj@T300CHI:/home/all/SourceCode/console-setup-1.108ubuntu15$ ll /etc/default/console-setup.tj
-rw-r--r-- 1 root root 289 May 5 09:26 /etc/default/console-setup.tj

Revision history for this message
TJ (tj) wrote :

I noticed the existing code to set {USER,MAIN}_CONFIG{,2} is a bit messed up; USER_CONFIG refers to console-setup but MAIN_CONFIG refers to keyboard which means lack of a keyboard.${VARIANT} causes the incorrect error message and failure.

The assignments to CONFIG{,2} are also reversed; when USER_CONFIG CONFIG=console-setup but when MAIN_CONFIG CONFIG=keyboard.

I've replaced all that code with a new function find_config() which makes a call to findfile() and handles a graceful fallback if the variant file isn't located. The /etc/default/ path is added into the list searched by findfiles().

The actual config file(s) used are reported.

$ /bin/setupcon -v tj
Unable to find keyboard.tj.
setupcon: using configuration from /etc/default/console-setup.tj
Configuring /dev/tty1 /dev/tty2 /dev/tty3 /dev/tty4 /dev/tty5 /dev/tty6
The charmap is UTF-8
BackSpace is ^?
We are not on the console, the console is left unconfigured.

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

The attachment "Patch that uses findfile() to locate the variant config" 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.]

tags: added: patch
Mathew Hodson (mhodson)
Changed in console-setup (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I don't know much about this package, but it looks to me like this applies to the version in Debian there. Have you considered sending the patch to them?

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I agree with Michael here. For changes like these (e.g. not really ubuntu-specific) we would need at least someone from upstream reviewing the diff before considering any sponsoring.

@TJ Could you please submit this patch upstream [1] and get it reviewed (and ultimately merged) before asking for sponsorship?

Once this is done, please re-subscribe ubuntu-sponsors to the bug. Until then, I remove this from the sponsorship queue.

[1] https://anonscm.debian.org/cgit/d-i/console-setup.git

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.