Skip to content

Commit b265edb

Browse files
authored
Merge pull request #1926 from hasan4791/issue-1920
Set secontext for rosetta in selinux supported distros
2 parents 2c55303 + 5eee69d commit b265edb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/05-rosetta-volume.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ if [ -f /etc/alpine-release ]; then
1111
fi
1212

1313
mkdir -p /mnt/lima-rosetta
14-
mount -t virtiofs vz-rosetta /mnt/lima-rosetta
14+
15+
#Check selinux is enabled by kernel
16+
if [ -d /sys/fs/selinux ]; then
17+
mount -t virtiofs vz-rosetta /mnt/lima-rosetta -o context="system_u:object_r:container_file_t:s0"
18+
else
19+
mount -t virtiofs vz-rosetta /mnt/lima-rosetta
20+
fi
1521

1622
if [ "$LIMA_CIDATA_ROSETTA_BINFMT" = "true" ]; then
1723
echo \

0 commit comments

Comments
 (0)