You are not logged in.

#1 2022-10-20 00:12:34

zwa
Member
Registered: 2005-12-05
Posts: 105

[Solved] Conditional loading of console keymay at boot

So I have a notebook with an 'es' keyboard layout, thus, vconsole.conf look like this:

KEYMAP=es

This works fine.

However I also have a dvorak usb keyboard which is always connected to the notebook (it is most of the time stationary). This usb keyboard is what I actually use. So I would need vconsole.conf to look like this when the usb keyboard is connected at boot:

KEYMAP=dvorak-es

So I naively put this in the aforesaid file:

lsusb |grep -E  "ID[[:space:]]13ba:0013"
RETVAL=$?

if [ ! $RETVAL ]
then
KEYMAP=dvorak-es 
else
KEYMAP=es 
fi

Which of course does not work.

How could I achieve my purpose?
Thx

Last edited by zwa (2022-10-24 01:27:13)

Offline

#2 2022-10-20 06:12:08

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [Solved] Conditional loading of console keymay at boot

udev rule and loadkeys, https://wiki.archlinux.org/title/Udev
You can monitor add, remove or change and run loadkeys for the desired layout.

Offline

#3 2022-10-23 22:47:49

zwa
Member
Registered: 2005-12-05
Posts: 105

Re: [Solved] Conditional loading of console keymay at boot

FWIW, the device is a ps/2 to usb attached to a usb hub. After doing some reading here I came up with this:

ATTRS{idVendor}=="13ba", ATTRS{idProduct}=="0018", RUN+="loadkeys dvorak-es"

also tried with

ATTRS{idVendor}=="0x13ba", ATTRS{idProduct}=="0x0018", RUN+="loadkeys dvorak-es"

But it does not work after

udevadm control --reload
#or
udevadm trigger
#or re-plugging the device

The device from lsusb, is:

lsusb -v -d 13ba:0018 

Bus 003 Device 015: ID 13ba:0018 PCPlay Barcode PCP-BCG4209
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x13ba PCPlay
  idProduct          0x0018 Barcode PCP-BCG4209
  bcdDevice            0.01
  iManufacturer           0 
  iProduct                1 Barcode Reader 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              400mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      62
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               8
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     130
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0005  1x 5 bytes
        bInterval               8
Device Status:     0x0000
  (Bus Powered)

Looking for the device path:

sudo find /sys /dev -iname '*0018*' -o -iname '*13ba*'

/sys/kernel/slab/:A-0000184
/sys/kernel/slab/:0000184
/sys/kernel/debug/hid/0003:13BA:0018.0014
/sys/kernel/debug/hid/0003:13BA:0018.0013
/sys/kernel/debug/hid/0018:04F3:31B8.0002
/sys/devices/platform/AMDI0010:01/i2c-1/i2c-MSFT0001:00/0018:04F3:31B8.0002
/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1/3-1.3/3-1.3:1.0/0003:13BA:0018.0013
/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1/3-1.3/3-1.3:1.1/0003:13BA:0018.0014
/sys/bus/hid/devices/0003:13BA:0018.0013
/sys/bus/hid/devices/0018:04F3:31B8.0002
/sys/bus/hid/devices/0003:13BA:0018.0014
/sys/bus/hid/drivers/hid-generic/0003:13BA:0018.0013
/sys/bus/hid/drivers/hid-generic/0003:13BA:0018.0014
/sys/bus/hid/drivers/hid-multitouch/0018:04F3:31B8.0002
/sys/firmware/efi/efivars/Boot0018-8be4df61-93ca-11d2-aa0d-00e098032b8c
/sys/firmware/efi/efivars/lBoot0018-146b234d-4052-4e07-b326-11220f8e1fe8
/dev/input/by-id/usb-13ba_Barcode_Reader-if01-event-mouse
/dev/input/by-id/usb-13ba_Barcode_Reader-event-kbd
/dev/input/by-id/usb-13ba_Barcode_Reader-event-if01
/dev/input/by-id/usb-13ba_Barcode_Reader-if01-mouse

It seems this is the device

/dev/input/by-id/usb-13ba_Barcode_Reader-event-kbd

Listing udev info:

udevadm info --attribute-walk --name=/dev/input/by-id/usb-13ba_Barcode_Reader-event-kbd 

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1/3-1.3/3-1.3:1.0/0003:13BA:0018.0013/input/input48/event10':
    KERNEL=="event10"
    SUBSYSTEM=="input"
    DRIVER==""
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1/3-1.3/3-1.3:1.0/0003:13BA:0018.0013/input/input48':
    KERNELS=="input48"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{capabilities/abs}=="0"
    ATTRS{capabilities/ev}=="120013"
    ATTRS{capabilities/ff}=="0"
    ATTRS{capabilities/key}=="1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe"
    ATTRS{capabilities/led}=="7"
    ATTRS{capabilities/msc}=="10"
    ATTRS{capabilities/rel}=="0"
    ATTRS{capabilities/snd}=="0"
    ATTRS{capabilities/sw}=="0"
    ATTRS{id/bustype}=="0003"
    ATTRS{id/product}=="0018"
    ATTRS{id/vendor}=="13ba"
    ATTRS{id/version}=="0110"
    ATTRS{inhibited}=="0"
    ATTRS{name}=="Barcode Reader "
    ATTRS{phys}=="usb-0000:03:00.4-1.3/input0"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{properties}=="0"
    ATTRS{uniq}==""

  looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1/3-1.3/3-1.3:1.0/0003:13BA:0018.0013':
    KERNELS=="0003:13BA:0018.0013"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1/3-1.3/3-1.3:1.0':
    KERNELS=="3-1.3:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceProtocol}=="01"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1/3-1.3':
    KERNELS=="3-1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{bMaxPower}=="400mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 2"
    ATTRS{bcdDevice}=="0001"
    ATTRS{bmAttributes}=="a0"
    ATTRS{busnum}=="3"
    ATTRS{configuration}==""
    ATTRS{devnum}=="15"
    ATTRS{devpath}=="1.3"
    ATTRS{idProduct}=="0018"
    ATTRS{idVendor}=="13ba"
    ATTRS{ltm_capable}=="no"
    ATTRS{maxchild}=="0"
    ATTRS{power/active_duration}=="1170198"
    ATTRS{power/autosuspend}=="2"
    ATTRS{power/autosuspend_delay_ms}=="2000"
    ATTRS{power/connected_duration}=="1170198"
    ATTRS{power/control}=="on"
    ATTRS{power/level}=="on"
    ATTRS{power/persist}=="1"
    ATTRS{power/runtime_active_time}=="1169940"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{power/wakeup}=="enabled"
    ATTRS{power/wakeup_abort_count}=="0"
    ATTRS{power/wakeup_active}=="0"
    ATTRS{power/wakeup_active_count}=="0"
    ATTRS{power/wakeup_count}=="0"
    ATTRS{power/wakeup_expire_count}=="0"
    ATTRS{power/wakeup_last_time_ms}=="0"
    ATTRS{power/wakeup_max_time_ms}=="0"
    ATTRS{power/wakeup_total_time_ms}=="0"
    ATTRS{product}=="Barcode Reader "
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{remove}=="(not readable)"
    ATTRS{rx_lanes}=="1"
    ATTRS{speed}=="1.5"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="2492"
    ATTRS{version}==" 1.10"

  looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-1':
    KERNELS=="3-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0221"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="3"
    ATTRS{configuration}==""
    ATTRS{devnum}=="8"
    ATTRS{devpath}=="1"
    ATTRS{idProduct}=="2813"
    ATTRS{idVendor}=="2109"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="VIA Labs, Inc.         "
    ATTRS{maxchild}=="4"
    ATTRS{physical_location/dock}=="no"
    ATTRS{physical_location/horizontal_position}=="left"
    ATTRS{physical_location/lid}=="no"
    ATTRS{physical_location/panel}=="unknown"
    ATTRS{physical_location/vertical_position}=="upper"
    ATTRS{power/active_duration}=="14036874"
    ATTRS{power/autosuspend}=="0"
    ATTRS{power/autosuspend_delay_ms}=="0"
    ATTRS{power/connected_duration}=="14036874"
    ATTRS{power/control}=="auto"
    ATTRS{power/level}=="auto"
    ATTRS{power/runtime_active_time}=="14036631"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{power/wakeup}=="disabled"
    ATTRS{power/wakeup_abort_count}==""
    ATTRS{power/wakeup_active}==""
    ATTRS{power/wakeup_active_count}==""
    ATTRS{power/wakeup_count}==""
    ATTRS{power/wakeup_expire_count}==""
    ATTRS{power/wakeup_last_time_ms}==""
    ATTRS{power/wakeup_max_time_ms}==""
    ATTRS{power/wakeup_total_time_ms}==""
    ATTRS{product}=="USB2.0 Hub             "
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="removable"
    ATTRS{remove}=="(not readable)"
    ATTRS{rx_lanes}=="1"
    ATTRS{speed}=="480"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="153"
    ATTRS{version}==" 2.10"

  looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3':
    KERNELS=="usb3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0600"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="3"
    ATTRS{configuration}==""
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{idProduct}=="0002"
    ATTRS{idVendor}=="1d6b"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 6.0.2-zen1-1-zen xhci-hcd"
    ATTRS{maxchild}=="4"
    ATTRS{power/active_duration}=="76391946"
    ATTRS{power/autosuspend}=="0"
    ATTRS{power/autosuspend_delay_ms}=="0"
    ATTRS{power/connected_duration}=="76413464"
    ATTRS{power/control}=="auto"
    ATTRS{power/level}=="auto"
    ATTRS{power/runtime_active_time}=="76391946"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="21517"
    ATTRS{power/wakeup}=="disabled"
    ATTRS{power/wakeup_abort_count}==""
    ATTRS{power/wakeup_active}==""
    ATTRS{power/wakeup_active_count}==""
    ATTRS{power/wakeup_count}==""
    ATTRS{power/wakeup_expire_count}==""
    ATTRS{power/wakeup_last_time_ms}==""
    ATTRS{power/wakeup_max_time_ms}==""
    ATTRS{power/wakeup_total_time_ms}==""
    ATTRS{product}=="xHCI Host Controller"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{remove}=="(not readable)"
    ATTRS{rx_lanes}=="1"
    ATTRS{serial}=="0000:03:00.4"
    ATTRS{speed}=="480"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="63"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/pci0000:00/0000:00:08.1/0000:03:00.4':
    KERNELS=="0000:03:00.4"
    SUBSYSTEMS=="pci"
    DRIVERS=="xhci_hcd"
    ATTRS{ari_enabled}=="0"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x0c0330"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{current_link_speed}=="8.0 GT/s PCIe"
    ATTRS{current_link_width}=="16"
    ATTRS{d3cold_allowed}=="1"
    ATTRS{device}=="0x1639"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{driver_override}=="(null)"
    ATTRS{enable}=="1"
    ATTRS{irq}=="43"
    ATTRS{local_cpulist}=="0-7"
    ATTRS{local_cpus}=="00ff"
    ATTRS{max_link_speed}=="16.0 GT/s PCIe"
    ATTRS{max_link_width}=="16"
    ATTRS{msi_bus}=="1"
    ATTRS{msi_irqs/44}=="msix"
    ATTRS{msi_irqs/45}=="msix"
    ATTRS{msi_irqs/46}=="msix"
    ATTRS{msi_irqs/47}=="msix"
    ATTRS{msi_irqs/48}=="msix"
    ATTRS{msi_irqs/49}=="msix"
    ATTRS{msi_irqs/50}=="msix"
    ATTRS{msi_irqs/51}=="msix"
    ATTRS{numa_node}=="-1"
    ATTRS{power/control}=="on"
    ATTRS{power/runtime_active_time}=="76414158"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{power/wakeup}=="enabled"
    ATTRS{power/wakeup_abort_count}=="0"
    ATTRS{power/wakeup_active}=="0"
    ATTRS{power/wakeup_active_count}=="0"
    ATTRS{power/wakeup_count}=="0"
    ATTRS{power/wakeup_expire_count}=="0"
    ATTRS{power/wakeup_last_time_ms}=="0"
    ATTRS{power/wakeup_max_time_ms}=="0"
    ATTRS{power/wakeup_total_time_ms}=="0"
    ATTRS{power_state}=="D0"
    ATTRS{remove}=="(not readable)"
    ATTRS{rescan}=="(not readable)"
    ATTRS{reset}=="(not readable)"
    ATTRS{reset_method}=="pm"
    ATTRS{resource0}=="(not readable)"
    ATTRS{revision}=="0x00"
    ATTRS{subsystem_device}=="0x1639"
    ATTRS{subsystem_vendor}=="0x1022"
    ATTRS{vendor}=="0x1022"

  looking at parent device '/devices/pci0000:00/0000:00:08.1':
    KERNELS=="0000:00:08.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="pcieport"
    ATTRS{ari_enabled}=="0"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x060400"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{current_link_speed}=="8.0 GT/s PCIe"
    ATTRS{current_link_width}=="16"
    ATTRS{d3cold_allowed}=="1"
    ATTRS{device}=="0x1635"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{driver_override}=="(null)"
    ATTRS{enable}=="2"
    ATTRS{irq}=="28"
    ATTRS{local_cpulist}=="0-7"
    ATTRS{local_cpus}=="00ff"
    ATTRS{max_link_speed}=="16.0 GT/s PCIe"
    ATTRS{max_link_width}=="16"
    ATTRS{msi_bus}=="1"
    ATTRS{msi_irqs/28}=="msi"
    ATTRS{numa_node}=="-1"
    ATTRS{power/autosuspend_delay_ms}=="100"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="76414161"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{power/wakeup}=="enabled"
    ATTRS{power/wakeup_abort_count}=="0"
    ATTRS{power/wakeup_active}=="0"
    ATTRS{power/wakeup_active_count}=="0"
    ATTRS{power/wakeup_count}=="0"
    ATTRS{power/wakeup_expire_count}=="0"
    ATTRS{power/wakeup_last_time_ms}=="0"
    ATTRS{power/wakeup_max_time_ms}=="0"
    ATTRS{power/wakeup_total_time_ms}=="0"
    ATTRS{power_state}=="D0"
    ATTRS{remove}=="(not readable)"
    ATTRS{rescan}=="(not readable)"
    ATTRS{reset}=="(not readable)"
    ATTRS{reset_method}=="pm"
    ATTRS{revision}=="0x00"
    ATTRS{secondary_bus_number}=="3"
    ATTRS{subordinate_bus_number}=="3"
    ATTRS{subsystem_device}=="0x1635"
    ATTRS{subsystem_vendor}=="0x1022"
    ATTRS{vendor}=="0x1022"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{waiting_for_supplier}=="0"

How should I modify the file /etc/udev/rules.d/10-local.rules  I made?
Thx

Offline

#4 2022-10-23 23:23:31

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 242

Re: [Solved] Conditional loading of console keymay at boot

zwa wrote:
ATTRS{idVendor}=="13ba", ATTRS{idProduct}=="0018", RUN+="loadkeys dvorak-es"

You should specify full path to executable in udev rule. E.g. "/usr/bin/loadkeys dvorak-es". Didn't it log "Process ... failed" in journal?

Offline

#5 2022-10-24 01:28:16

zwa
Member
Registered: 2005-12-05
Posts: 105

Re: [Solved] Conditional loading of console keymay at boot

dimich wrote:
zwa wrote:
ATTRS{idVendor}=="13ba", ATTRS{idProduct}=="0018", RUN+="loadkeys dvorak-es"

You should specify full path to executable in udev rule. E.g. "/usr/bin/loadkeys dvorak-es". Didn't it log "Process ... failed" in journal?

Full path was the problem. And yes, I checked journal after reading you comment and it indeed appeared.
Thx.

Offline

#6 2023-03-20 21:27:17

zwa
Member
Registered: 2005-12-05
Posts: 105

Re: [Solved] Conditional loading of console keymay at boot

I have to run

udevadm trigger

after every reboot for the rules to be applied. How can I fix this?

journalctl -b -u systemd-udevd

Mar 20 12:34:03 al4j systemd[1]: Starting Rule-based Manager for Device Events and Files...
Mar 20 12:34:03 al4j systemd-udevd[276]: Using default interface naming scheme 'v253'.
Mar 20 12:34:03 al4j systemd[1]: Started Rule-based Manager for Device Events and Files.
Mar 20 12:34:03 al4j mtp-probe[312]: checking bus 1, device 5: "/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb1/1-1/1-1.2"
Mar 20 12:34:03 al4j mtp-probe[311]: checking bus 1, device 6: "/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb1/1-1/1-1.4"
Mar 20 12:34:03 al4j mtp-probe[311]: bus: 1, device: 6 was not an MTP device
Mar 20 12:34:03 al4j mtp-probe[312]: bus: 1, device: 5 was not an MTP device
Mar 20 12:34:03 al4j mtp-probe[308]: checking bus 2, device 2: "/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb2/2-2"
Mar 20 12:34:03 al4j mtp-probe[308]: bus: 2, device: 2 was not an MTP device
Mar 20 12:34:03 al4j mtp-probe[341]: checking bus 1, device 4: "/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb1/1-1/1-1.1"
Mar 20 12:34:03 al4j mtp-probe[341]: bus: 1, device: 4 was not an MTP device
Mar 20 12:34:03 al4j mtp-probe[347]: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb2/2-3"
Mar 20 12:34:03 al4j mtp-probe[347]: bus: 2, device: 3 was not an MTP device

/etc/udev/rules.d/99-local.rules

ATTRS{idVendor}=="13ba", ATTRS{idProduct}=="0018", RUN+="/usr/bin/loadkeys dvorak-es"
ATTRS{idVendor}=="1a2c", ATTRS{idProduct}=="2d43", RUN+="/usr/bin/loadkeys dvorak-es"

Offline

#7 2023-03-20 21:41:11

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [Solved] Conditional loading of console keymay at boot

Probably add the rule to your initramfs, https://wiki.archlinux.org/title/Mkinit … _and_FILES

Offline

#8 2023-03-21 13:50:07

zwa
Member
Registered: 2005-12-05
Posts: 105

Re: [Solved] Conditional loading of console keymay at boot

seth wrote:

Probably add the rule to your initramfs, https://wiki.archlinux.org/title/Mkinit … _and_FILES

/etc/mkinitcpio.conf:

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(usbhid xhci_hcd)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=(/etc/udev/rules.d/99-local.rules)

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No RAID, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect modconf block filesystems fsck)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev modconf block filesystems fsck)
#
##   This setup assembles a mdadm array with an encrypted root file system.
##   Note: See 'mkinitcpio -H mdadm_udev' for more information on RAID devices.
#    HOOKS=(base udev modconf keyboard keymap consolefont block mdadm_udev encrypt filesystems fsck)
#
##   This setup loads an lvm2 volume group.
#    HOOKS=(base udev modconf block lvm2 filesystems fsck)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr and fsck hooks.
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

# MODULES_DECOMPRESS
# Decompress kernel modules during initramfs creation.
# Enable to speedup boot process, disable to save RAM
# during early userspace. Switch (yes/no).
#MODULES_DECOMPRESS="yes"

Did a

mkinitcpio -P

but rules are not loaded at boot.

Offline

#9 2023-03-21 14:10:12

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [Solved] Conditional loading of console keymay at boot

I suspect they are, but "keyboard keymap consolefont" steamroll vconsole over them.
Is this a recent-ish regression only?

Offline

#10 2023-03-21 16:02:39

zwa
Member
Registered: 2005-12-05
Posts: 105

Re: [Solved] Conditional loading of console keymay at boot

seth wrote:

I suspect they are, but "keyboard keymap consolefont" steamroll vconsole over them.
Is this a recent-ish regression only?

Never got this udev rule to load at boot. To login I had (and still have) to type the credentials with the onboard notebook keyboard and then also run a custom "xinit" (would it be winit for wayland?) script with the same qwerty keyboard. From there sway manages to correctly assign the proper layout to each keyboard. So I can't really tell if there is a regression here going on or not.

Offline

#11 2023-03-22 06:54:15

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [Solved] Conditional loading of console keymay at boot

run a custom "xinit" … From there sway manages

Just some init script for/starting sway and calling "udevadm trigger"?
sway doesn't use the console layout, though - https://wiki.archlinux.org/title/Sway#Keymap

If you care about the layout of the console (at boot), you could add a systemd service that just checks for the presence of the USB device and sets the layout, https://wiki.archlinux.org/title/System … unit_files

Offline

#12 2023-03-22 21:06:56

zwa
Member
Registered: 2005-12-05
Posts: 105

Re: [Solved] Conditional loading of console keymay at boot

seth wrote:

run a custom "xinit" … From there sway manages

Just some init script for/starting sway and calling "udevadm trigger"?
sway doesn't use the console layout, though - https://wiki.archlinux.org/title/Sway#Keymap

If you care about the layout of the console (at boot), you could add a systemd service that just checks for the presence of the USB device and sets the layout, https://wiki.archlinux.org/title/System … unit_files


A systemd service did the trick, thanks.

Offline

Board footer

Powered by FluxBB