Skip to content

Commit

Permalink
Use plain squashfs root for selected Anaconda isos
Browse files Browse the repository at this point in the history
Fedora 41 and later, and RHEL 10 use plain squashfs instead of
compressing an ext4 filesystem.
  • Loading branch information
bcl committed Dec 17, 2024
1 parent ad09763 commit 0ff71ed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
18 changes: 14 additions & 4 deletions pkg/distro/fedora/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ func liveInstallerImage(workload workload.Workload,

img.Filename = t.Filename()

if common.VersionGreaterThanOrEqual(img.OSVersion, VERSION_ROOTFS_SQUASHFS) {
img.RootfsType = manifest.SquashfsRootfs
}

return img, nil
}

Expand Down Expand Up @@ -456,8 +460,6 @@ func imageInstallerImage(workload workload.Workload,

img.ExtraBasePackages = packageSets[installerPkgsKey]

img.SquashfsCompression = "lz4"

d := t.arch.distro

img.Product = d.product
Expand All @@ -477,6 +479,11 @@ func imageInstallerImage(workload workload.Workload,

img.Filename = t.Filename()

img.SquashfsCompression = "lz4"
if common.VersionGreaterThanOrEqual(img.OSVersion, VERSION_ROOTFS_SQUASHFS) {
img.RootfsType = manifest.SquashfsRootfs
}

return img, nil
}

Expand Down Expand Up @@ -660,8 +667,6 @@ func iotInstallerImage(workload workload.Workload,
anaconda.ModuleUsers,
}...)

img.SquashfsCompression = "lz4"

img.Product = d.product
img.Variant = "IoT"
img.OSVersion = d.osVersion
Expand All @@ -675,6 +680,11 @@ func iotInstallerImage(workload workload.Workload,

img.Filename = t.Filename()

img.SquashfsCompression = "lz4"
if common.VersionGreaterThanOrEqual(img.OSVersion, VERSION_ROOTFS_SQUASHFS) {
img.RootfsType = manifest.SquashfsRootfs
}

return img, nil
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/distro/fedora/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ package fedora

const VERSION_BRANCHED = "42"
const VERSION_RAWHIDE = "42"

// Fedora version 41 and later use a plain squashfs rootfs on the iso instead of
// compressing an ext4 filesystem.
const VERSION_ROOTFS_SQUASHFS = "41"
6 changes: 6 additions & 0 deletions pkg/distro/rhel/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@ func EdgeInstallerImage(workload workload.Workload,
img.Kickstart.Timezone, _ = customizations.GetTimezoneSettings()

img.SquashfsCompression = "xz"
if t.Arch().Distro().Releasever() == "10" {
img.RootfsType = manifest.SquashfsRootfs
}

installerConfig, err := t.getDefaultInstallerConfig()
if err != nil {
Expand Down Expand Up @@ -714,6 +717,9 @@ func ImageInstallerImage(workload workload.Workload,
img.AdditionalAnacondaModules = append(img.AdditionalAnacondaModules, anaconda.ModuleUsers)

img.SquashfsCompression = "xz"
if t.Arch().Distro().Releasever() == "10" {
img.RootfsType = manifest.SquashfsRootfs
}

// put the kickstart file in the root of the iso
img.ISORootKickstart = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel/rhel10/bare_metal.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func mkImageInstallerImgType() *rhel.ImageType {
},
rhel.ImageInstallerImage,
[]string{"build"},
[]string{"anaconda-tree", "rootfs-image", "efiboot-tree", "os", "bootiso-tree", "bootiso"},
[]string{"anaconda-tree", "efiboot-tree", "os", "bootiso-tree", "bootiso"},
[]string{"bootiso"},
)

Expand Down

0 comments on commit 0ff71ed

Please sign in to comment.