Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8f53926fb5 | ||
|
155a7bc17f |
6
main.go
6
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/<kernel> 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
|
||||
@@ -614,7 +616,7 @@ func stripExts(file string) string {
|
||||
if filepath.Ext(file) == "" {
|
||||
break
|
||||
}
|
||||
file = strings.Trim(file, filepath.Ext(file))
|
||||
file = strings.TrimSuffix(file, filepath.Ext(file))
|
||||
}
|
||||
return file
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@ func TestStripExts(t *testing.T) {
|
||||
{"file.tar.gz.xz.zip", "file"},
|
||||
{"another_file", "another_file"},
|
||||
{"a.b.c.d.e.f.g.h.i", "a"},
|
||||
{"virtio_blk.ko", "virtio_blk"},
|
||||
}
|
||||
for _, table := range tables {
|
||||
out := stripExts(table.in)
|
||||
|
Reference in New Issue
Block a user