From 8f53926fb5484174fb8aba9115e4dbc91988caef 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 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 699de0a..8d1d6f9 100644 --- a/main.go +++ b/main.go @@ -444,7 +444,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