Add support for ubuntu-style dracut image names

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-02-25 17:01:26 -07:00
parent 93fc742d80
commit 94b2c3ba84
3 changed files with 10 additions and 1 deletions

View File

@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## v4.6.0, unreleased
### Added
- Support Ubuntu-style dracut initrd images.
### Fixed
- Fix nightly builds.

View File

@@ -14,6 +14,7 @@ var (
initramfsSearchPaths = []string{
"/boot/initramfs-*",
"/boot/initrd-*",
"/boot/initrd.img-*",
}
versionPattern *regexp.Regexp

View File

@@ -20,7 +20,6 @@ func TestFindInitramfs(t *testing.T) {
assert.NoError(t, os.MkdirAll(filepath.Join(RootFsDir("image"), "boot"), 0700))
tests := map[string]struct {
name string
initramfs []string
ver string
path string
@@ -45,6 +44,11 @@ func TestFindInitramfs(t *testing.T) {
ver: "1.1.1",
path: "/boot/initrd-1.1.1.aarch64.img",
},
"ok case 5 (ubuntu)": {
initramfs: []string{"/boot/initrd.img-6.11.0-18-generic"},
ver: "6.11.0-18",
path: "/boot/initrd.img-6.11.0-18-generic",
},
"prefix match": {
initramfs: []string{"/boot/initrd-1.1.1.aarch64.img"},
ver: "1.1",