summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-04-23 12:37:28 +0000
committerAlyssa Ross <hi@alyssa.is>2022-04-23 14:38:44 +0000
commit0b3b366653030de498e73e51b1c12a6f4c5f4d3b (patch)
treea8073743eaa85d6e120119dabc1fc922c8ac0f89
parentb4c0c3eb020587c057c647ad0c18c35d0727f000 (diff)
downloadspectrum-0b3b366653030de498e73e51b1c12a6f4c5f4d3b.tar
spectrum-0b3b366653030de498e73e51b1c12a6f4c5f4d3b.tar.gz
spectrum-0b3b366653030de498e73e51b1c12a6f4c5f4d3b.tar.bz2
spectrum-0b3b366653030de498e73e51b1c12a6f4c5f4d3b.tar.lz
spectrum-0b3b366653030de498e73e51b1c12a6f4c5f4d3b.tar.xz
spectrum-0b3b366653030de498e73e51b1c12a6f4c5f4d3b.tar.zst
spectrum-0b3b366653030de498e73e51b1c12a6f4c5f4d3b.zip
host: use a bigger kernel buffer for mdevd
This should fix a boot error on a Thinkpad P51s:

> mdevd: fatal: unable to receive netlink message: No buffer space available

From the mdevd documentation[1]:

> • -b kbufsz : try and reserve a kernel buffer of kbufsz bytes for
>   the netlink queue. Too large a buffer wastes kernel memory; too
>   small a buffer risks losing events. The default is 500 kB, which
>   should be enough for most systems; if you're getting "No buffer
>   space available" errors from mdevd at coldplug time, try
>   increasing this number.

The new value of 128MiB is used by default by both udev and Busybox's mdev.

[1]: https://skarnet.org/software/mdevd/mdevd.html

Reported-by: Tero Tervala <tero.tervala@unikie.com>
Message-Id: <20220423124630.749434-1-hi@alyssa.is>
Tested-by: Tero Tervala <tero.tervala@unikie.com>
-rwxr-xr-xhost/initramfs/etc/init4
-rw-r--r--host/rootfs/etc/s6-rc/mdevd/run4
2 files changed, 4 insertions, 4 deletions
diff --git a/host/initramfs/etc/init b/host/initramfs/etc/init
index bb58c84..cc07a2b 100755
--- a/host/initramfs/etc/init
+++ b/host/initramfs/etc/init
@@ -1,5 +1,5 @@
 #!/bin/execlineb -S0
-# SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is>
 # SPDX-License-Identifier: EUPL-1.2
 
 export PATH /bin
@@ -19,7 +19,7 @@ if { mkfifo /dev/rootfs.poll }
 
 background {
   fdclose 3
-  mdevd -C
+  mdevd -C -b134217728
 }
 importas -iu mdevd_pid !
 
diff --git a/host/rootfs/etc/s6-rc/mdevd/run b/host/rootfs/etc/s6-rc/mdevd/run
index 03ad5e3..f838d2d 100644
--- a/host/rootfs/etc/s6-rc/mdevd/run
+++ b/host/rootfs/etc/s6-rc/mdevd/run
@@ -1,5 +1,5 @@
 #!/bin/execlineb -P
 # SPDX-License-Identifier: EUPL-1.2
-# SPDX-FileCopyrightText: 2020-2021 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2020-2022 Alyssa Ross <hi@alyssa.is>
 
-mdevd -D3
+mdevd -D3 -b134217728