On 8/24/2021 7:12 PM, Ben Hutchings wrote:
Text-based sysfs attributes are limited to a page, but udev receives
uevents through netlink, not sysfs.
The current limit on the environment of a uevent appears to be 2 KB
(UEVENT_BUFFER_SIZE defined in <linux/kobject.h>). That seems like it
*might* be easier to change, so long as user-space doesn't have a
similar limit.
I looked into systemd/udev, and it seems to use an 8 KB buffer for
receiving uevents:
https://sources.debian.org/src/systemd/247.9-1/src/libsystemd/sd-device/device-monitor.c/?hl=390#L390
But as a first step I think increasing the kernel buffer size to 4 KB
would be enough. Perhaps someone could test whether this patch to the
domU kernel makes udev happier:
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -30,7 +30,7 @@
#define UEVENT_HELPER_PATH_LEN 256
#define UEVENT_NUM_ENVP 64 /* number of env
pointers */
-#define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */
+#define UEVENT_BUFFER_SIZE 4096 /* buffer for the variables */
#ifdef CONFIG_UEVENT_HELPER
/* path to the userspace helper executed on an event */
--- END ---
?
Ben.
I tried this patch but the build failed - it ran for over an hour. I am not
sure why as I have not built a Linux kernel in many years. So I will
this:
1) Try to build the unmodified kernel on my system just to be sure I
am building the kernel correctly and that my hardware is OK. Once
I could not build the Linux kernel until I replaced a bad memory
card.
2) If that succeeds, I will try the patch with a bump to the abi version.
From the output of the failed build and what I read in the section on
the Debian kernel ABI name, I think that the system detected an
ABI change and so it failed. The build was checking symbols when
it failed.
This will take a little while because it takes over an hour to build the
kernel on my system.
Chuck