From 85caac818c80a16cfd956ac02de33f89f62a7c44 Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" Date: Mon, 24 Jun 2024 14:16:00 -0700 Subject: [PATCH 1/2] Support compressed kernel modules When generating an ISO image, we have a fixed list of kernel modules that should be included. Add logic to determine whether those kernel modules are named '*.ko.zst', '*.ko.gz', or '*.ko.xz' instead of only '*.ko'. --- isoutils/isoutils.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/isoutils/isoutils.go b/isoutils/isoutils.go index 801c1ae5..a91f3f3c 100644 --- a/isoutils/isoutils.go +++ b/isoutils/isoutils.go @@ -194,6 +194,13 @@ func mkInitrdInitScript(templatePath string) error { "/kernel/fs/overlayfs/overlay.ko", } + //Compression extensions + compressionExtensions := []string{ + ".zst", + ".gz", + ".xz", + } + /* Find kernel, then break the name into kernelVersion */ kernelGlob, err := filepath.Glob(tmpPaths[clrRootfs] + "/lib/kernel/org.clearlinux.*") if err != nil || len(kernelGlob) != 1 { @@ -209,6 +216,15 @@ func mkInitrdInitScript(templatePath string) error { for _, i := range modules { rootfsModPath := tmpPaths[clrRootfs] + "/usr/lib/modules/" + kernelVersion + "." + kernelType + i + /* check for compression extensions on module filenames */ + for _, ext := range compressionExtensions { + if _, err := os.Stat(rootfsModPath + ext); err == nil { + rootfsModPath = rootfsModPath + ext + i = i + ext + break + } + } + /* copy kernel module to initramfs */ initrdModPath := filepath.Dir(tmpPaths[clrInitrd] + "/usr/lib/modules/" + kernelVersion + "." + kernelType + i) From 6b64f47ad991a2126cbfb24e0bb18b03a20bf7f7 Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" Date: Mon, 24 Jun 2024 14:44:08 -0700 Subject: [PATCH 2/2] Increase space allocations in baseline image test Double /boot to 100M and rootfs to 4G so today's content will fit. --- tests/baseline.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baseline.yaml b/tests/baseline.yaml index 232a33af..9474dfe3 100644 --- a/tests/baseline.yaml +++ b/tests/baseline.yaml @@ -21,12 +21,12 @@ targetMedia: - name: ${baseimg}1 fstype: vfat mountpoint: /boot - size: "50M" + size: "100M" type: part - name: ${baseimg}2 fstype: ext4 mountpoint: / - size: "2.0G" + size: "4.0G" type: part bundles: [os-core, os-core-update, NetworkManager, vim]