fedora: set sysroot read-only only for Fedora 37+ iot-raw-image
This commit is contained in:
parent
785f9cb7dd
commit
547f7a66b3
5 changed files with 12 additions and 4 deletions
|
|
@ -2,8 +2,10 @@ package fedora
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
"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/distro"
|
||||||
"github.com/osbuild/osbuild-composer/internal/image"
|
"github.com/osbuild/osbuild-composer/internal/image"
|
||||||
"github.com/osbuild/osbuild-composer/internal/manifest"
|
"github.com/osbuild/osbuild-composer/internal/manifest"
|
||||||
|
|
@ -281,6 +283,12 @@ func iotRawImage(workload workload.Workload,
|
||||||
}
|
}
|
||||||
img := image.NewOSTreeRawImage(commit)
|
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.Users = users.UsersFromBP(customizations.GetUsers())
|
||||||
img.Groups = users.GroupsFromBP(customizations.GetGroups())
|
img.Groups = users.GroupsFromBP(customizations.GetGroups())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1856,7 +1856,7 @@
|
||||||
"repo": "/ostree/repo",
|
"repo": "/ostree/repo",
|
||||||
"config": {
|
"config": {
|
||||||
"sysroot": {
|
"sysroot": {
|
||||||
"readonly": true,
|
"readonly": false,
|
||||||
"bootloader": "none"
|
"bootloader": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1880,7 +1880,7 @@
|
||||||
"repo": "/ostree/repo",
|
"repo": "/ostree/repo",
|
||||||
"config": {
|
"config": {
|
||||||
"sysroot": {
|
"sysroot": {
|
||||||
"readonly": true,
|
"readonly": false,
|
||||||
"bootloader": "none"
|
"bootloader": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2104,7 +2104,7 @@
|
||||||
"repo": "/ostree/repo",
|
"repo": "/ostree/repo",
|
||||||
"config": {
|
"config": {
|
||||||
"sysroot": {
|
"sysroot": {
|
||||||
"readonly": true,
|
"readonly": false,
|
||||||
"bootloader": "none"
|
"bootloader": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2128,7 +2128,7 @@
|
||||||
"repo": "/ostree/repo",
|
"repo": "/ostree/repo",
|
||||||
"config": {
|
"config": {
|
||||||
"sysroot": {
|
"sysroot": {
|
||||||
"readonly": true,
|
"readonly": false,
|
||||||
"bootloader": "none"
|
"bootloader": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue