From 723517eb57307a3af25cf0a5ed6eebc98cbcb6a4 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sun, 5 Sep 2021 14:22:07 -0700 Subject: [PATCH] getInitfsModules: don't fail if kernel modules dir does not exist (MR 7) This directory doesn't exist all the time, e.g. if the kernel was built without modules or no modules were installed for some reason. Assume the kernel package knows what it is doing and just print a message that might be helpful if the kernel package ends up not knowing what it is doing. --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 68f0114..1b3f153 100644 --- a/main.go +++ b/main.go @@ -427,7 +427,9 @@ func getInitfsModules(files misc.StringSet, devinfo deviceinfo.DeviceInfo, kerne modDir := filepath.Join("/lib/modules", kernelVer) if !exists(modDir) { - return errors.New("Kernel module directory not found: " + modDir) + // dir /lib/modules/ if kernel built without module support, so just print a message + log.Printf("-- kernel module directory not found: %q, not including modules", modDir) + return nil } // modules.* required by modprobe