distro/f32: manually relabel cp in buildroot with install_t
By labeling `cp` with `system_u:object_r:install_exec_t:s0` we allow it
to copy labels unknown to the host.
See also corresponding commit in osbuild:
e80130a830
This commit is contained in:
parent
f8f35016d6
commit
3fc03503a5
11 changed files with 69 additions and 7 deletions
|
|
@ -298,7 +298,15 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
func (t *imageType) buildPipeline(repos []rpmmd.RepoConfig, arch architecture, buildPackageSpecs []rpmmd.PackageSpec) *osbuild.Pipeline {
|
||||
p := &osbuild.Pipeline{}
|
||||
p.AddStage(osbuild.NewRPMStage(t.rpmStageOptions(arch, repos, buildPackageSpecs)))
|
||||
p.AddStage(osbuild.NewSELinuxStage(t.selinuxStageOptions()))
|
||||
|
||||
selinuxOptions := osbuild.SELinuxStageOptions{
|
||||
FileContexts: "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
Labels: map[string]string{
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0",
|
||||
},
|
||||
}
|
||||
|
||||
p.AddStage(osbuild.NewSELinuxStage(&selinuxOptions))
|
||||
return p
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1982,6 +1982,15 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2053,6 +2053,15 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1963,6 +1963,15 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1975,7 +1975,10 @@
|
|||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2207,7 +2207,10 @@
|
|||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2046,7 +2046,10 @@
|
|||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1977,7 +1977,10 @@
|
|||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2025,6 +2025,15 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1911,7 +1911,10 @@
|
|||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1932,7 +1932,10 @@
|
|||
{
|
||||
"name": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
|
||||
"labels": {
|
||||
"/usr/bin/cp": "system_u:object_r:install_exec_t:s0"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue