Numlock on early stage

Hi there, I want to activate my numlock when my pc boot up. Ideally, I want to ensure numlock is on even during full-disk encryption password entry.

I have tested the following solution without any result so far :

For information, I use EOS with KDE plasma on a Tuxedo computer (TUXEDO InfinityBook Pro Gen8 (MK1)) with X11 and GRUB.

Is it normal that I don’t have an .xinitrc file even though I’m using X11? Does Dracut have a parameter I can edit to activate numlock?

From the test with mkinitcpio I have three .img on my /boot :

/boot🔒 
󰣇 lsa
total 107M
drwxr-xr-x  4 root root 4.0K Aug 21 11:20 .
drwxr-xr-x 17 root root 4.0K Aug 17 10:14 ..
drwxr-xr-x  3 root root 4.0K Jan  1  1970 efi
drwxr-xr-x  6 root root 4.0K Aug 17 10:18 grub
-rw-------  1 root root  74M Aug 21 11:20 initramfs-linux-fallback.img
-rw-------  1 root root  15M Aug 21 11:19 initramfs-linux.img
-rw-r--r--  1 root root 7.1M Aug  8 20:19 intel-ucode.img
-rw-r--r--  1 root root  13M Aug 21 10:28 vmlinuz-linux

Do I have to keep it (I only have generated the initramfs-linux img, the intel img have been already there) ?

Dracut replace mkinitcpio, right ?
What I miss ? I’m misunderstood something ?

Thanks for any help, if you need more logs or details, feel free to ask !

1 Like

Dracut and mkinitcpio - you have one or the other they do not co-exist. As to your question - no idea, never used encryption.

What does yay dracut | grep -i installed show? If it returns some results then you are on dracut.

This should work if you are indeed using mkinitcpio and if you have regenerated your initramfs after doing this.

Maybe you forgot to regenerate your initramfs after you changed the configuration, though I could be mistaken and something else is going on.

The dates of the files say they were last modified on 21 August. When did you attempt this? Was the attempt made a few days ago? Or is it today?

@xircon yes I’m on dracut, I have made any change with the way EOS was shipped :

~ via  v18.17.1 
󰣇 yay dracut | grep -i installed
2 endeavouros/eos-dracut 1.2-1 (15.1 KiB 3.4 KiB) (Installed)
1 extra/dracut 059-3 (287.3 KiB 1.0 MiB) (Installed)

@xircon
Dracut and mkinitcpio - you have one or the other they do not co-exist. As to your question - no idea, never used encryption.

I learned that after all my test :sweat_smile: when I found this topic : Dracut replacing mkinitcpio? effects - #30 by dalto

@anthony93 I misunderstood the role and the way all this work, I do not use mkinitcpio so it’s no relevant to test that. fyi yes I made the test some day ago (21 aug yes) :slight_smile:

Can you explain what steps you followed to test this?

1 Like
  • clone the repo
  • sudo cp -r 50numlock/ /usr/lib/dracut/modules.d/
  • sudo dracut -f
  • Reboot
  • Test on the session login page if the numpad is on

The log for sudo dracut -f :

󰣇 sudo dracut -f
[sudo] password for a2n: 
dracut: Executing: /usr/bin/dracut -f
dracut: dracut module 'dash' will not be installed, because command 'dash' could not be found!
dracut: dracut module 'mksh' will not be installed, because command 'mksh' could not be found!
dracut: dracut module 'busybox' will not be installed, because command 'busybox' could not be found!
dracut: dracut module 'dbus-broker' will not be installed, because command 'dbus-broker' could not be found!
dracut: dracut module 'rngd' will not be installed, because command 'rngd' could not be found!
dracut: dracut module 'connman' will not be installed, because command 'connmand' could not be found!
dracut: dracut module 'connman' will not be installed, because command 'connmanctl' could not be found!
dracut: dracut module 'connman' will not be installed, because command 'connmand-wait-online' could not be found!
dracut: dracut module 'network-wicked' will not be installed, because command 'wicked' could not be found!
dracut: dracut module 'dmraid' will not be installed, because command 'kpartx' could not be found!
dracut: dracut module 'multipath' will not be installed, because command 'multipath' could not be found!
dracut: dracut module 'tpm2-tss' will not be installed, because command 'tpm2' could not be found!
dracut: dracut module 'fcoe' will not be installed, because command 'dcbtool' could not be found!
dracut: dracut module 'fcoe' will not be installed, because command 'fipvlan' could not be found!
dracut: dracut module 'fcoe' will not be installed, because command 'lldpad' could not be found!
dracut: dracut module 'fcoe' will not be installed, because command 'fcoemon' could not be found!
dracut: dracut module 'fcoe' will not be installed, because command 'fcoeadm' could not be found!
dracut: dracut module 'fcoe-uefi' will not be installed, because command 'dcbtool' could not be found!
dracut: dracut module 'fcoe-uefi' will not be installed, because command 'fipvlan' could not be found!
dracut: dracut module 'fcoe-uefi' will not be installed, because command 'lldpad' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsi-iname' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsiadm' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command 'iscsid' could not be found!
dracut: dracut module 'nbd' will not be installed, because command 'nbd-client' could not be found!
dracut: dracut module 'nvmf' will not be installed, because command 'nvme' could not be found!
dracut: dracut module 'biosdevname' will not be installed, because command 'biosdevname' could not be found!
dracut: dracut module 'memstrack' will not be installed, because command 'memstrack' could not be found!
dracut: memstrack is not available
dracut: If you need to use rd.memdebug>=4, please install memstrack and procps-ng
dracut: dracut module 'squash' will not be installed, because command 'mksquashfs' could not be found!
dracut: dracut module 'squash' will not be installed, because command 'unsquashfs' could not be found!
dracut: *** Including module: systemd ***
dracut: *** Including module: systemd-initrd ***
dracut: *** Including module: modsign ***
dracut: *** Including module: i18n ***
dracut: *** Including module: numlock ***
dracut: *** Including module: btrfs ***
dracut: *** Including module: crypt ***
dracut: *** Including module: dm ***
dracut: Skipping udev rule: 64-device-mapper.rules
dracut: Skipping udev rule: 60-persistent-storage-dm.rules
dracut: Skipping udev rule: 55-dm.rules
dracut: *** Including module: kernel-modules ***
dracut: *** Including module: kernel-modules-extra ***
dracut: *** Including module: lvm ***
dracut: Skipping udev rule: 64-device-mapper.rules
dracut: Skipping udev rule: 56-lvm.rules
dracut: Skipping udev rule: 60-persistent-storage-lvm.rules
dracut: *** Including module: mdraid ***
dracut: Skipping udev rule: 64-md-raid.rules
dracut: *** Including module: nvdimm ***
dracut: *** Including module: qemu ***
dracut: *** Including module: qemu-net ***
dracut: *** Including module: btrfs-snapshot-overlay ***
dracut: *** Including module: lunmask ***
dracut: *** Including module: resume ***
dracut: *** Including module: rootfs-block ***
dracut: *** Including module: terminfo ***
dracut: *** Including module: udev-rules ***
dracut: Skipping udev rule: 40-redhat.rules
dracut: Skipping udev rule: 50-firmware.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: *** Including module: virtiofs ***
dracut: *** Including module: dracut-systemd ***
dracut: *** Including module: usrmount ***
dracut: *** Including module: base ***
dracut: *** Including module: fs-lib ***
dracut: *** Including module: shutdown ***
dracut: *** Including modules done ***
dracut: *** Installing kernel module dependencies ***
dracut: *** Installing kernel module dependencies done ***
dracut: *** Resolving executable dependencies ***
dracut: *** Resolving executable dependencies done ***
dracut: *** Hardlinking files ***
dracut: Mode:                     real
dracut: Method:                   sha256
dracut: Files:                    2026
dracut: Linked:                   8 files
dracut: Compared:                 0 xattrs
dracut: Compared:                 445 files
dracut: Saved:                    1.42 MiB
dracut: Duration:                 0.019793 seconds
dracut: *** Hardlinking files done ***
dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing AuthenticAMD.bin ***
dracut: *** Using microcode found in '/boot/intel-ucode.img' ***
dracut: *** Store current command line parameters ***
dracut: *** Stripping files ***
dracut: *** Stripping files done ***
dracut: *** Creating image file '/usr/lib/modules/6.4.11-arch2-1/initrd' ***
dracut: *** Creating initramfs image file '/usr/lib/modules/6.4.11-arch2-1/initrd' done ***
~ via  v18.17.1 as 🧙 
󰣇 ls /usr/lib/dracut/modules.d/ 
00bash                        01systemd-rfkill       35network-legacy       90dmsquash-live-autooverlay  95cifs          95zfcp
00dash                        01systemd-sysctl       35network-manager      90dmsquash-live-ntfs         95dasd          95zfcp_rules
00mksh                        01systemd-sysext       35network-wicked       90kernel-modules             95dasd_mod      95znet
00systemd                     01systemd-sysusers     40network              90kernel-modules-extra       95dasd_rules    96securityfs
00systemd-network-management  01systemd-timedated    45ifcfg                90kernel-network-modules     95dcssblk       97biosdevname
00warpclock                   01systemd-timesyncd    45url-lib              90livenet                    95debug         97masterkey
01fips                        01systemd-tmpfiles     50drm                  90lvm                        95fcoe          98dracut-systemd
01systemd-ac-power            01systemd-udevd        50numlock              90mdraid                     95fcoe-uefi     98ecryptfs
01systemd-ask-password        01systemd-veritysetup  50plymouth             90multipath                  95fstab-sys     98integrity
01systemd-coredump            02caps                 62bluetooth            90nvdimm                     95iscsi         98pollcdrom
01systemd-hostnamed           03modsign              80cms                  90overlayfs                  95lunmask       98selinux
01systemd-initrd              03rescue               80lvmmerge             90ppcmac                     95nbd           98syslog
01systemd-integritysetup      04watchdog             80lvmthinpool-monitor  90qemu                       95nfs           98usrmount
01systemd-journald            04watchdog-modules     80test                 90qemu-net                   95nvmf          99base
01systemd-ldconfig            05busybox              80test-makeroot        91btrfs-snapshot-overlay     95qeth_rules    99fs-lib
01systemd-modules-load        06dbus-broker          80test-root            91crypt-gpg                  95resume        99img-lib
01systemd-networkd            06dbus-daemon          81cio_ignore           91crypt-loop                 95rootfs-block  99memstrack
01systemd-pcrphase            06rngd                 90btrfs                91fido2                      95ssh-client    99shutdown
01systemd-portabled           09dbus                 90crypt                91pcsc                       95terminfo      99squash
01systemd-pstore              10i18n                 90dm                   91pkcs11                     95udev-rules    99uefi-lib
01systemd-repart              30convertfs            90dmraid               91tpm2-tss                   95virtfs
01systemd-resolved            35connman              90dmsquash-live        91zipl                       95virtiofs
1 Like

I use the systemd service, I gave a try for this dracut-numlock, it didn’t work, I mean I had no numlock in Ly, the (console) display manager or the other TTYs.

Oh I forgot, I made the shell scripts in 50numlock executable, because it was like this for other modules.

2 Likes

Ho god I’m so stupid […] I forgot about the right on that file…

So after a chmod ugo+x of the files, I have the numlock active in all the tty but not in the login page of KDE.

1 Like

I don’t understand, I did exactly what you did, the numlock module was added to dracut, no error message or anything, I’ll try another time later.

For KDE, I guess numlockx should be launched by the display manager SDDM.

Ok that cool, with the dracut module and the right config in SDDM everything works fine.

I’ve lost my PC and haven’t used EOS or any other linux for 3 months, it’s hard to remember all the things you’ve seen or learned sometimes :sweat_smile:

Thanks, all.

Just a heads up that you should use sudo dracut-rebuild instead.

3 Likes

What is the difference between the two ?

dracut-rebuild will build all the boot images including the fallback images(unless disabled). dracut -f will not always put the final image in the correct location. In your case, it did. However, often it doesn’t.

1 Like

Ho that maybe why @vazicebon have a problem with his config. Many thanks for the information !

I can confirm, after the rebuild, it works fine, I can remove the systemd service. :smiley:

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.