git: a10a92d34ca7 - stable/13 - linsysfs: create /sys/bus/ and /sys/subsystem/

From: Edward Tomasz Napierala <trasz_at_FreeBSD.org>
Date: Thu, 17 Feb 2022 13:46:21 UTC
The branch stable/13 has been updated by trasz:

URL: https://cgit.FreeBSD.org/src/commit/?id=a10a92d34ca7ae4a78646c9daa49be5a1e7a3859

commit a10a92d34ca7ae4a78646c9daa49be5a1e7a3859
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-03-08 20:55:44 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2022-02-13 23:19:21 +0000

    linsysfs: create /sys/bus/ and /sys/subsystem/
    
    This looks like a no-op, but it prevents udevadm(8) with failing
    loudly, which in turn unbreaks installation of libfprint-2-2, which
    in Focal is a dependency for make-4.2.1-1.2.
    
    One might wonder why installing a build utility involves messing
    with device handling...
    
    Sponsored By:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D29133
    
    (cherry picked from commit dc0119c28194b537cfa2ad95ce2e62589da7ceb0)
---
 sys/compat/linsysfs/linsysfs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c
index 66cb36db9868..8d3be1507de9 100644
--- a/sys/compat/linsysfs/linsysfs.c
+++ b/sys/compat/linsysfs/linsysfs.c
@@ -633,6 +633,9 @@ linsysfs_init(PFS_INIT_ARGS)
 
 	root = pi->pi_root;
 
+	/* /sys/bus/... */
+	dir = pfs_create_dir(root, "bus", NULL, NULL, NULL, 0);
+
 	/* /sys/class/... */
 	class = pfs_create_dir(root, "class", NULL, NULL, NULL, 0);
 	scsi = pfs_create_dir(class, "scsi_host", NULL, NULL, NULL, 0);
@@ -679,6 +682,9 @@ linsysfs_init(PFS_INIT_ARGS)
 	/* /sys/kernel/debug, mountpoint for lindebugfs. */
 	debug = pfs_create_dir(kernel, "debug", NULL, NULL, NULL, 0);
 
+	/* /sys/subsystem/... */
+	dir = pfs_create_dir(root, "subsystem", NULL, NULL, NULL, 0);
+
 	return (0);
 }