fedora: set sysroot read-only only for Fedora 37+ iot-raw-image

This commit is contained in:
Achilleas Koutsou 2022-09-30 17:01:23 +02:00 committed by Tomáš Hozza
parent 785f9cb7dd
commit 547f7a66b3
5 changed files with 12 additions and 4 deletions

View file

@ -2,8 +2,10 @@ package fedora
import (
"math/rand"
"strings"
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/image"
"github.com/osbuild/osbuild-composer/internal/manifest"
@ -281,6 +283,12 @@ func iotRawImage(workload workload.Workload,
}
img := image.NewOSTreeRawImage(commit)
// Set sysroot read-only only for Fedora 37+
distro := t.Arch().Distro()
if strings.HasPrefix(distro.Name(), "fedora") && !common.VersionLessThan(distro.Releasever(), "37") {
img.SysrootReadOnly = true
}
img.Users = users.UsersFromBP(customizations.GetUsers())
img.Groups = users.GroupsFromBP(customizations.GetGroups())

View file

@ -1856,7 +1856,7 @@
"repo": "/ostree/repo",
"config": {
"sysroot": {
"readonly": true,
"readonly": false,
"bootloader": "none"
}
}

View file

@ -1880,7 +1880,7 @@
"repo": "/ostree/repo",
"config": {
"sysroot": {
"readonly": true,
"readonly": false,
"bootloader": "none"
}
}

View file

@ -2104,7 +2104,7 @@
"repo": "/ostree/repo",
"config": {
"sysroot": {
"readonly": true,
"readonly": false,
"bootloader": "none"
}
}

View file

@ -2128,7 +2128,7 @@
"repo": "/ostree/repo",
"config": {
"sysroot": {
"readonly": true,
"readonly": false,
"bootloader": "none"
}
}