From c135a83cb30be8f28895b2b394157bea26e5b49d Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 20 Mar 2017 20:36:46 +0100 Subject: [PATCH] Check if /proc/bus/usb exists before trying to mount it Most newer kernels have usbfs disabled by default. See issue #69 for details. Signed-off-by: Joachim Nilsson --- src/finit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/finit.c b/src/finit.c index 6a5f6238..8550a6ee 100644 --- a/src/finit.c +++ b/src/finit.c @@ -257,8 +257,9 @@ int main(int argc, char* argv[]) chdir("/"); umask(0); mount("none", "/proc", "proc", 0, NULL); - mount("none", "/proc/bus/usb", "usbfs", 0, NULL); mount("none", "/sys", "sysfs", 0, NULL); + if (fisdir("/proc/bus/usb")) + mount("none", "/proc/bus/usb", "usbfs", 0, NULL); /* * Check file filesystems in /etc/fstab