--- Begin Message ---
Package: initramfs-tools
Version: 0.142
Severity: normal
X-Debbugs-Cc: vkou...@gmail.com
Hello,
Thank you for your work on initramfs-tools.
I have just installed Debian bookworm on a new machine.
I am using a USB keyboard, which works fine when the system boots normally, but
was unusable when booting with init=/bin/bash.
I had to add usbhid, hid-generic to /etc/initramfs-tools/modules and rebuild
initramfs to fix this. This doesn't align with
https://wiki.debian.org/Keyboard, which seems to imply that everything would
just work since in my case I was running with MODULES=most, and I shouldn't
have to add anything to /etc/initramfs-tools/modules.
Also noting that the suggested modules in /etc/initramfs-tools/modules should
include hid-generic anyway.
It's not obvious to me why I had to update /etc/initramfs-tools/modules. I
understand that listing modules in /etc/initramfs-tools/modules asks initramfs
to load them explicitly.
While looking into the problem, I verified that MODULES=most and lsinitramfs
showed both modules present in the initramfs. But it seems somehow they weren't
loaded into the kernel, so the device was unusable.
One more thing that may be relevant:
When booting, it takes some time for the keyboard to be detected:
The bash prompt appears, then after 3-4 seconds the kernel logs show new USB
devices being detected, including the keyboard. Then, the keyboard is usable,
but only if I've taken care to list both usbhid, hid-generic in
/etc/initramfs-tools/modules, despite setting MODULES=most.
Could this be a funny interaction with udev? Maybe initramfs-tools runs udev
explicitly, at certain parts of the process, before the USB keyboard actually
appears, so by the time it appears there is no-one there to actually load the
necessary modules? I would have run "udevadm settle" myself to verify, but
hey, no keyboard :)
I looked at the code and saw initramfs-tools does attempt to load HID-related
modules early on when breaking early, since udev does not yet run. Why not do
it anyway, since a keyboard is critical to debugging?
Looking forward to any insight you may have.
Thank you,
Vangelis.
-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 40M Apr 1 18:44 /boot/initrd.img-6.1.0-18-amd64
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-6.1.0-18-amd64 root=/dev/mapper/maxwellvg-root ro quiet
-- resume
RESUME=/dev/mapper/maxwellvg-swap_1
-- /proc/filesystems
ext3
ext2
ext4
fuseblk
vfat
-- lsmod
Module Size Used by
tls 135168 0
joydev 28672 0
uvcvideo 131072 0
videobuf2_vmalloc 20480 1 uvcvideo
videobuf2_memops 20480 1 videobuf2_vmalloc
videobuf2_v4l2 36864 1 uvcvideo
snd_usb_audio 376832 0
videobuf2_common 73728 4
videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
snd_usbmidi_lib 45056 1 snd_usb_audio
videodev 294912 3 videobuf2_v4l2,uvcvideo,videobuf2_common
snd_rawmidi 53248 1 snd_usbmidi_lib
snd_seq_device 16384 1 snd_rawmidi
mc 77824 5
videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
binfmt_misc 24576 1
snd_hda_codec_hdmi 81920 1
nls_ascii 16384 1
nls_cp437 20480 1
vfat 24576 1
fat 90112 1 vfat
intel_rapl_msr 20480 0
intel_rapl_common 32768 1 intel_rapl_msr
snd_sof_pci_intel_tgl 16384 0
x86_pkg_temp_thermal 20480 0
intel_powerclamp 20480 0
snd_sof_intel_hda_common 188416 1 snd_sof_pci_intel_tgl
coretemp 20480 0
soundwire_intel 49152 1 snd_sof_intel_hda_common
soundwire_generic_allocation 16384 1 soundwire_intel
soundwire_cadence 40960 1 soundwire_intel
snd_sof_intel_hda 20480 1 snd_sof_intel_hda_common
kvm_intel 380928 0
snd_sof_pci 24576 2 snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
snd_sof_xtensa_dsp 16384 1 snd_sof_intel_hda_common
kvm 1142784 1 kvm_intel
i915 3055616 2
irqbypass 16384 1 kvm
snd_sof 274432 2 snd_sof_pci,snd_sof_intel_hda_common
snd_sof_utils 20480 1 snd_sof
snd_soc_hdac_hda 24576 1 snd_sof_intel_hda_common
snd_hda_ext_core 40960 2 snd_sof_intel_hda_common,snd_soc_hdac_hda
snd_soc_acpi_intel_match 81920 2
snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
snd_soc_acpi 16384 2
snd_soc_acpi_intel_match,snd_sof_intel_hda_common
ghash_clmulni_intel 16384 0
sha512_ssse3 49152 0
snd_soc_core 352256 4
soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda
sha512_generic 16384 1 sha512_ssse3
sha256_ssse3 32768 0
snd_compress 28672 1 snd_soc_core
sha1_ssse3 32768 0
soundwire_bus 102400 3
soundwire_intel,soundwire_generic_allocation,soundwire_cadence
snd_hda_intel 57344 0
snd_intel_dspcfg 36864 3 snd_hda_intel,snd_sof,snd_sof_intel_hda_common
snd_intel_sdw_acpi 20480 2 snd_sof_intel_hda_common,snd_intel_dspcfg
snd_hda_codec 184320 4
snd_hda_codec_hdmi,snd_hda_intel,snd_soc_hdac_hda,snd_sof_intel_hda
drm_buddy 20480 1 i915
drm_display_helper 184320 1 i915
snd_hda_core 122880 7
snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
aesni_intel 393216 0
snd_hwdep 16384 2 snd_usb_audio,snd_hda_codec
cec 61440 2 drm_display_helper,i915
crypto_simd 16384 1 aesni_intel
cryptd 28672 2 crypto_simd,ghash_clmulni_intel
snd_pcm 159744 11
snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_sof_utils,snd_hda_core
rapl 20480 0
rc_core 69632 1 cec
mei_hdcp 24576 0
intel_cstate 20480 0
evdev 28672 8
snd_timer 49152 1 snd_pcm
ttm 94208 1 i915
intel_uncore 217088 0
pcspkr 16384 0
wmi_bmof 16384 0
drm_kms_helper 204800 2 drm_display_helper,i915
iTCO_wdt 16384 0
mei_me 53248 1
intel_pmc_bxt 16384 1 iTCO_wdt
iTCO_vendor_support 16384 1 iTCO_wdt
watchdog 45056 1 iTCO_wdt
snd 126976 13
snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_sof,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
soundcore 16384 1 snd
mei 159744 3 mei_hdcp,mei_me
i2c_algo_bit 16384 1 i915
intel_pmc_core 53248 0
acpi_tad 20480 0
acpi_pad 184320 0
button 24576 0
sg 40960 0
fuse 176128 1
drm 614400 6
drm_kms_helper,drm_display_helper,drm_buddy,i915,ttm
loop 32768 0
efi_pstore 16384 0
configfs 57344 1
efivarfs 24576 1
ip_tables 36864 0
x_tables 61440 1 ip_tables
autofs4 53248 2
ext4 983040 2
crc16 16384 1 ext4
mbcache 16384 1 ext4
jbd2 167936 1 ext4
crc32c_generic 16384 0
hid_generic 16384 0
usbhid 65536 0
hid 159744 2 usbhid,hid_generic
dm_mod 184320 7
sd_mod 65536 4
t10_pi 16384 1 sd_mod
crc64_rocksoft 20480 1 t10_pi
crc64 20480 1 crc64_rocksoft
crc_t10dif 20480 1 t10_pi
crct10dif_generic 16384 0
crct10dif_pclmul 16384 1
crct10dif_common 16384 3 crct10dif_generic,crc_t10dif,crct10dif_pclmul
ahci 49152 3
libahci 49152 1 ahci
crc32_pclmul 16384 0
crc32c_intel 24576 3
libata 401408 2 libahci,ahci
i2c_i801 36864 0
xhci_pci 24576 0
xhci_hcd 315392 1 xhci_pci
i2c_smbus 20480 1 i2c_i801
scsi_mod 286720 3 sd_mod,libata,sg
usbcore 348160 6
xhci_hcd,snd_usb_audio,usbhid,snd_usbmidi_lib,uvcvideo,xhci_pci
igc 163840 0
intel_lpss_pci 28672 0
intel_lpss 16384 1 intel_lpss_pci
idma64 20480 0
scsi_common 16384 3 scsi_mod,libata,sg
usb_common 16384 3 xhci_hcd,usbcore,uvcvideo
fan 20480 0
video 65536 1 i915
wmi 36864 2 video,wmi_bmof
-- /etc/initramfs-tools/modules
usbhid
hid-generic
-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
do_bootloader = no
do_initrd = yes
link_in_boot = no
-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=auto
KEYMAP=n
COMPRESS=zstd
DEVICE=
NFSROOT=auto
RUNSIZE=10%
FSTYPE=auto
-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no
-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:
/usr/share/initramfs-tools/hooks:
dmsetup
fsck
intel_microcode
keymap
klibc-utils
kmod
lvm2
resume
thermal
udev
zz-busybox
-- System Information:
Debian Release: 12.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-18-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages initramfs-tools depends on:
ii initramfs-tools-core 0.142
ii linux-base 4.9
initramfs-tools recommends no packages.
Versions of packages initramfs-tools suggests:
ii bash-completion 1:2.11-6
-- no debconf information
--- End Message ---
--- Begin Message ---
On Mon, 01 Apr 2024 19:07:31 +0300 Vangelis Koukis <vkou...@gmail.com>
wrote:
[...]
> One more thing that may be relevant:
> When booting, it takes some time for the keyboard to be detected:
> The bash prompt appears, then after 3-4 seconds the kernel logs show new USB
> devices being detected, including the keyboard. Then, the keyboard is usable,
> but only if I've taken care to list both usbhid, hid-generic in
> /etc/initramfs-tools/modules, despite setting MODULES=most.
The problem here is that your keyboard takes longer to enumerate, than
the kernel and initramfs take to boot.
You should be able to work around this by adding "rootdelay=10" to the
kernel command line.
> Could this be a funny interaction with udev? Maybe initramfs-tools runs udev
> explicitly, at certain parts of the process, before the USB keyboard actually
> appears, so by the time it appears there is no-one there to actually load the
> necessary modules?
Sort of. Within the initramfs, udev is started as a daemon early on
and then stopped immediately before switching over to the main init
system, because that will normally start a new instance of it.
Obviously that doesn't happen with "init=/bin/bash".
[...]
> I looked at the code and saw initramfs-tools does attempt to load HID-related
> modules early on when breaking early, since udev does not yet run. Why not do
> it anyway, since a keyboard is critical to debugging?
[...]
Because udev does a better job of deciding which modules are actually
needed.
I'm not seeing a bug here, so closing this report.
Ben.
--
Ben Hutchings
Reality is just a crutch for people who can't handle science fiction.
signature.asc
Description: This is a digitally signed message part
--- End Message ---