Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cd97df108a | ||
|
1fed057a82 | ||
|
5efdb9f170 |
@@ -146,7 +146,7 @@ create/manage. mkinitfs reads configuration from */usr/share/mkinitfs* first, an
|
|||||||
## /usr/share/mkinitfs/modules, /etc/mkinitfs/modules
|
## /usr/share/mkinitfs/modules, /etc/mkinitfs/modules
|
||||||
## /usr/share/mkinitfs/modules-extra, /etc/mkinitfs/modules-extra
|
## /usr/share/mkinitfs/modules-extra, /etc/mkinitfs/modules-extra
|
||||||
|
|
||||||
Files with the *.modules* extention in these directories are lists of
|
Files with the *.modules* extension in these directories are lists of
|
||||||
kernel modules to include in the initramfs. Individual modules and
|
kernel modules to include in the initramfs. Individual modules and
|
||||||
directories can be listed in the files here. Globbing is also supported.
|
directories can be listed in the files here. Globbing is also supported.
|
||||||
|
|
||||||
|
@@ -421,6 +421,7 @@ func (archive *Archive) writeCpio() error {
|
|||||||
archive.addSymlink("/bin", "/bin")
|
archive.addSymlink("/bin", "/bin")
|
||||||
archive.addSymlink("/sbin", "/sbin")
|
archive.addSymlink("/sbin", "/sbin")
|
||||||
archive.addSymlink("/lib", "/lib")
|
archive.addSymlink("/lib", "/lib")
|
||||||
|
archive.addSymlink("/usr/sbin", "/usr/sbin")
|
||||||
}
|
}
|
||||||
// having a transient function for actually adding files to the archive
|
// having a transient function for actually adding files to the archive
|
||||||
// allows the deferred fd.close to run after every copy and prevent having
|
// allows the deferred fd.close to run after every copy and prevent having
|
||||||
|
@@ -44,7 +44,7 @@ func (h *HookDirs) List() (*filelist.FileList, error) {
|
|||||||
|
|
||||||
s := bufio.NewScanner(f)
|
s := bufio.NewScanner(f)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
dir := s.Text()
|
dir := strings.TrimSpace(s.Text())
|
||||||
if len(dir) == 0 || strings.HasPrefix(dir, "#") {
|
if len(dir) == 0 || strings.HasPrefix(dir, "#") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,7 @@ func slurpFiles(fd io.Reader) (*filelist.FileList, error) {
|
|||||||
|
|
||||||
s := bufio.NewScanner(fd)
|
s := bufio.NewScanner(fd)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
line := s.Text()
|
line := strings.TrimSpace(s.Text())
|
||||||
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@@ -83,7 +83,7 @@ func slurpModules(fd io.Reader, modDir string) (*filelist.FileList, error) {
|
|||||||
files := filelist.NewFileList()
|
files := filelist.NewFileList()
|
||||||
s := bufio.NewScanner(fd)
|
s := bufio.NewScanner(fd)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
line := s.Text()
|
line := strings.TrimSpace(s.Text())
|
||||||
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -103,8 +103,8 @@ func slurpModules(fd io.Reader, modDir string) (*filelist.FileList, error) {
|
|||||||
}
|
}
|
||||||
} else if dir == "" {
|
} else if dir == "" {
|
||||||
// item is a module name
|
// item is a module name
|
||||||
if modFilelist, err := getModule(s.Text(), modDir); err != nil {
|
if modFilelist, err := getModule(line, modDir); err != nil {
|
||||||
return nil, fmt.Errorf("unable to get module file %q: %w", s.Text(), err)
|
return nil, fmt.Errorf("unable to get module file %q: %w", line, err)
|
||||||
} else {
|
} else {
|
||||||
for _, file := range modFilelist {
|
for _, file := range modFilelist {
|
||||||
files.Add(file, file)
|
files.Add(file, file)
|
||||||
@@ -188,7 +188,7 @@ func getModuleDeps(modName string, modulesDep io.Reader) ([]string, error) {
|
|||||||
|
|
||||||
s := bufio.NewScanner(modulesDep)
|
s := bufio.NewScanner(modulesDep)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
line := s.Text()
|
line := strings.TrimSpace(s.Text())
|
||||||
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
if len(line) == 0 || strings.HasPrefix(line, "#") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@ func TestStripExts(t *testing.T) {
|
|||||||
{"another_file", "another_file"},
|
{"another_file", "another_file"},
|
||||||
{"a.b.c.d.e.f.g.h.i", "a"},
|
{"a.b.c.d.e.f.g.h.i", "a"},
|
||||||
{"virtio_blk.ko", "virtio_blk"},
|
{"virtio_blk.ko", "virtio_blk"},
|
||||||
|
{"virtio_blk.ko ", "virtio_blk"},
|
||||||
}
|
}
|
||||||
for _, table := range tables {
|
for _, table := range tables {
|
||||||
out := stripExts(table.in)
|
out := stripExts(table.in)
|
||||||
|
Reference in New Issue
Block a user