NetBSD Problem Report #59591
From www@netbsd.org Tue Aug 12 17:36:59 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id E83311A923A
for <gnats-bugs@gnats.NetBSD.org>; Tue, 12 Aug 2025 17:36:58 +0000 (UTC)
Message-Id: <20250812173657.C96BE1A923C@mollari.NetBSD.org>
Date: Tue, 12 Aug 2025 17:36:57 +0000 (UTC)
From: chonmediano@gmail.com
Reply-To: chonmediano@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Latin american layout "la" is incorrectly mapped to Lao in Xorg
X-Send-Pr-Version: www-1.0
>Number: 59591
>Category: misc
>Synopsis: Latin american layout "la" is incorrectly mapped to Lao in Xorg
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: misc-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Aug 12 17:40:00 +0000 2025
>Last-Modified: Thu Aug 14 00:15:01 +0000 2025
>Originator: Jon Chon
>Release: 10.1
>Organization:
>Environment:
NetBSD 10.1 x86_64
>Description:
In wskbd (wscons), the Latin American keyboard layout is identified as "la".
When Xorg auto-configures the keyboard, it sees la and sets the layout to Lao (since "la" is the ISO 639-1 code for Lao in XKB).
The correct XKB layout for Latin American Spanish is "latam".
Result:
Users cannot type their username/password correctly in XDM (or other login managers) because the keyboard outputs Lao characters instead of Latin American.
Manual intervention (e.g., switching to a TTY or pre-configuring Xorg) is required to fix the layout.
>How-To-Repeat:
Select latin american layout during installation. Do the full install. Try to log in.
>Fix:
>Audit-Trail:
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc: mrg@netbsd.org
Subject: Re: misc/59591: Latin american layout "la" is incorrectly mapped to
Lao in Xorg
Date: Wed, 13 Aug 2025 00:14:16 +0000 (UTC)
On Tue, 12 Aug 2025, chonmediano@gmail.com wrote:
> In wskbd (wscons), the Latin American keyboard layout is identified as "la".
>
> When Xorg auto-configures the keyboard, it sees la and sets the layout to Lao (since "la" is the ISO 639-1 code for Lao in XKB).
>
> The correct XKB layout for Latin American Spanish is "latam".
>
Back in 2005, the various `#define KB_XXX' were converted to enums:
https://github.com/NetBSD/src/commit/e3f3e5cc51a5dd9156972365bb9e8a89154399b4
This should've has no effect on the Xorg server code, except that another
change was made in 2016 which made it rely on it being `#defines' again:
https://github.com/NetBSD/xsrc/commit/6629ff98e8379e4935ae98ff6626c360f6f4c028
Not sure why it was done. Patch below which essentially brings the file
up to date with the latest Xorg code. Should fix this.
-RVP
---Start PATCH---
diff -urN a/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c b/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c
--- a/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c 2021-12-05 21:14:12.000000000 +0000
+++ b/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c 2025-08-12 23:23:04.866905642 +0000
@@ -21,21 +21,18 @@
* DEALINGS IN THE SOFTWARE.
*/
-#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
-#endif
-#include <sys/types.h>
-#include <sys/ioctl.h>
#include <sys/time.h>
-#include <fcntl.h>
+#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsksymdef.h>
+
+#include <sys/ioctl.h>
#include <errno.h>
+#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wsksymdef.h>
-
#include "input.h"
#include "inputstr.h"
#include "os.h"
@@ -44,7 +41,6 @@
#define WSCONS_KBD_DEVICE "/dev/wskbd"
#define WSCONS_MOUSE_PREFIX "/dev/wsmouse"
-#if defined(KB_LA) && defined(KB_CF)
#define KB_OVRENC \
{ KB_UK, "gb" }, \
{ KB_SV, "se" }, \
@@ -52,22 +48,15 @@
{ KB_SF, "ch" }, \
{ KB_LA, "latam" }, \
{ KB_CF, "ca" }
-#else
-#define KB_OVRENC \
- { KB_UK, "gb" }, \
- { KB_SV, "se" }, \
- { KB_SG, "ch" }, \
- { KB_SF, "ch" }
-#endif
struct nameint {
int val;
- char *name;
+ const char *name;
} kbdenc[] = {
KB_OVRENC,
KB_ENCTAB
#ifndef __NetBSD__
- ,
+ ,
#endif
{0}
};
@@ -76,14 +65,10 @@
{KB_NODEAD | KB_SG, "de_nodeadkeys"},
{KB_NODEAD | KB_SF, "fr_nodeadkeys"},
{KB_SF, "fr"},
-#if defined(KB_CF)
{KB_DVORAK | KB_CF, "fr-dvorak"},
-#endif
{KB_DVORAK | KB_FR, "bepo"},
{KB_DVORAK, "dvorak"},
-#if defined(KB_CF)
{KB_CF, "fr-legacy"},
-#endif
{KB_NODEAD, "nodeadkeys"},
{0}
};
@@ -236,10 +221,10 @@
for (i = 0; i < 4; i++) {
snprintf(devname, sizeof(devname), "%s%d", WSCONS_MOUSE_PREFIX, i);
LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname);
-#ifdef __NetBSD__
- fd = open(devname, O_RDWR | O_NONBLOCK | O_EXCL);
-#else
+#ifdef HAVE_OPEN_DEVICE
fd = open_device(devname, O_RDWR | O_NONBLOCK | O_EXCL);
+#else
+ fd = open(devname, O_RDWR | O_NONBLOCK | O_EXCL);
#endif
if (fd == -1) {
LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname, strerror(errno));
@@ -253,7 +238,7 @@
}
close(fd);
switch (wsmouse_type) {
-#if defined(WSMOUSE_TYPE_SYNAPTICS)
+#ifdef WSMOUSE_TYPE_SYNAPTICS
case WSMOUSE_TYPE_SYNAPTICS:
wscons_add_pointer(devname, "synaptics", ATTR_TOUCHPAD);
break;
@@ -265,7 +250,7 @@
break;
}
}
- /* Add a default entry catching all other mux elements as "ws" */
+ /* Add a default entry catching all other mux elements as pointers */
wscons_add_pointer(WSCONS_MOUSE_PREFIX, "ws", ATTR_POINTER);
}
---END PATCH---
From: "David H. Gutteridge" <david@gutteridge.ca>
To: gnats-bugs@netbsd.org, rvp@SDF.ORG
Cc:
Subject: Re: misc/59591: Latin american layout "la" is incorrectly mapped to
Lao in Xorg
Date: Wed, 13 Aug 2025 20:11:28 -0400
I wonder if it would also make sense to change "la" to "latam" here:
--- wsksymdef.h.orig
+++ wsksymdef.h
@@ -672,7 +672,7 @@
action(KB_IS, 0, 0x1a00, "is", , "Icelandic") \
action(KB_IT, 0, 0x0500, "it", , "Italian") \
action(KB_JP, 0, 0x0800, "jp", , "Japanese") \
-action(KB_LA, 0, 0x1b00, "la", , "Latin American") \
+action(KB_LA, 0, 0x1b00, "latam", , "Latin American") \
action(KB_NO, 0, 0x0a00, "no", , "Norwegian") \
action(KB_PL, 0, 0x0d00, "pl", , "Polish") \
action(KB_PT, 0, 0x1100, "pt", , "Portuguese") \
"la" seems ambiguous, not only can it refer to Laotian, in some FOSS
contexts it's actually a code for Latin (not a character set, the
actual language), e.g., in translation files for GTK applications
(where "windows" becomes "fenestrarum", and such).
I see Linux has both "latam" and one legacy "la-latin1" definition
for Latin American keymaps. At least, that's what I see on Fedora 42.
Regards,
Dave
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.