Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
8f1ff5c374 | |||
|
15c95f6b13 | ||
|
bab4be1a89 | ||
|
1428f27b4a |
@@ -56,6 +56,9 @@ build:
|
||||
variables:
|
||||
DEVICE_NAME: qemu-$CPU_ARCH
|
||||
KERNEL_VARIANT: lts
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG != null'
|
||||
when: never
|
||||
|
||||
.build-ci-tron-qemu:
|
||||
stage: hardware tests
|
||||
|
@@ -111,7 +111,9 @@ func main() {
|
||||
hookfiles.New("/etc/mkinitfs/files"),
|
||||
hookscripts.New("/usr/share/mkinitfs/hooks", "/hooks"),
|
||||
hookscripts.New("/etc/mkinitfs/hooks", "/hooks"),
|
||||
modules.New("/usr/share/mkinitfs/modules"),
|
||||
hookscripts.New("/usr/share/mkinitfs/hooks-cleanup", "/hooks-cleanup"),
|
||||
hookscripts.New("/etc/mkinitfs/hooks-cleanup", "/hooks-cleanup"),
|
||||
//modules.New("/usr/share/mkinitfs/modules"),
|
||||
modules.New("/etc/mkinitfs/modules"),
|
||||
})
|
||||
initfsExtra := initramfs.New([]filelist.FileLister{
|
||||
|
@@ -134,7 +134,8 @@ create/manage. mkinitfs reads configuration from */usr/share/mkinitfs* first, an
|
||||
skipped.
|
||||
|
||||
## /usr/share/mkinitfs/hooks, /etc/mkinitfs/hooks
|
||||
## /usr/share/mkinitfs/hooks-extra*, /etc/mkinitfs/hooks-extra
|
||||
## /usr/share/mkinitfs/hooks-cleanup, /etc/mkinitfs/hooks-cleanup
|
||||
## /usr/share/mkinitfs/hooks-extra, /etc/mkinitfs/hooks-extra
|
||||
|
||||
Any files listed under these directories are copied as-is into the
|
||||
relevant archives. Hooks are generally script files, but how they are
|
||||
|
@@ -47,14 +47,14 @@ func getFile(file string, required bool) (files []string, err error) {
|
||||
// 2) set file to dereferenced target
|
||||
// 4) continue this function to either walk it if the target is a dir or add the
|
||||
// target to the list of files
|
||||
if s, err := os.Lstat(file); err != nil {
|
||||
return files, err
|
||||
} else if s.Mode()&fs.ModeSymlink != 0 {
|
||||
files = append(files, file)
|
||||
if target, err := filepath.EvalSymlinks(file); err != nil {
|
||||
return files, err
|
||||
} else {
|
||||
file = target
|
||||
if s, err := os.Lstat(file); err == nil {
|
||||
if s.Mode()&fs.ModeSymlink != 0 {
|
||||
files = append(files, file)
|
||||
if target, err := filepath.EvalSymlinks(file); err != nil {
|
||||
return files, err
|
||||
} else {
|
||||
file = target
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -107,6 +107,24 @@ func TestGetFile(t *testing.T) {
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "zst compressed file fallback",
|
||||
setup: func(tmpDir string) (string, []string, error) {
|
||||
// Create a .zst file but NOT the original file
|
||||
zstFile := filepath.Join(tmpDir, "firmware.bin.zst")
|
||||
if err := os.WriteFile(zstFile, []byte("compressed content"), 0644); err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
// Request the original file (without .zst extension)
|
||||
originalFile := filepath.Join(tmpDir, "firmware.bin")
|
||||
|
||||
// Expected: should find and return the .zst version
|
||||
expected := []string{zstFile}
|
||||
return originalFile, expected, nil
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, st := range subtests {
|
||||
|
Reference in New Issue
Block a user