Skip to content

Commit 7c13a72

Browse files
committed
Remove mounting vz-rosetta from 05-rosetta-volume.sh
Since the mount option workaround for selinux to vz-rosetta will be covered in 05-lima-mounts.sh. Signed-off-by: Norio Nomura <[email protected]>
1 parent 50c10f3 commit 7c13a72

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

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

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,8 @@ if [ -f /etc/alpine-release ]; then
1010
rc-service qemu-binfmt stop --ifstarted
1111
fi
1212

13-
# Mount the rosetta volume for non cloud-init based images
14-
rosetta_interpreter=/mnt/lima-rosetta/rosetta
15-
if [ ! -f "$rosetta_interpreter" ]; then
16-
rosetta_mountpoint=$(dirname "$rosetta_interpreter")
17-
mkdir -p "$rosetta_mountpoint"
18-
19-
#Check selinux is enabled by kernel
20-
if [ -d /sys/fs/selinux ]; then
21-
##########################################################################################
22-
## When using vz & virtiofs, initially container_file_t selinux label
23-
## was considered which works perfectly for container work loads
24-
## but it might break for other work loads if the process is running with
25-
## different label. Also these are the remote mounts from the host machine,
26-
## so keeping the label as nfs_t fits right. Package container-selinux by
27-
## default adds rules for nfs_t context which allows container workloads to work as well.
28-
## https://github.com/lima-vm/lima/pull/1965
29-
##########################################################################################
30-
mount -t virtiofs vz-rosetta "$rosetta_mountpoint" -o context="system_u:object_r:nfs_t:s0"
31-
else
32-
mount -t virtiofs vz-rosetta "$rosetta_mountpoint"
33-
fi
34-
fi
35-
3613
if [ "$LIMA_CIDATA_ROSETTA_BINFMT" = "true" ]; then
37-
rosetta_binfmt=":rosetta:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:$rosetta_interpreter:OCF"
14+
rosetta_binfmt=":rosetta:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/mnt/lima-rosetta/rosetta:OCF"
3815

3916
# If rosetta is not registered in binfmt_misc, register it.
4017
[ -f /proc/sys/fs/binfmt_misc/rosetta ] || echo "$rosetta_binfmt" >/proc/sys/fs/binfmt_misc/register

pkg/cidata/cidata.TEMPLATE.d/user-data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ package_reboot_if_required: true
1414
{{- if or .RosettaEnabled (or (eq .MountType "9p") (eq .MountType "virtiofs")) }}
1515
mounts:
1616
{{- if .RosettaEnabled }}{{/* Mount the rosetta volume before systemd-binfmt.service(8) starts */}}
17-
- ["vz-rosetta", "/mnt/lima-rosetta", "virtiofs", "context=\"system_u:object_r:nfs_t:s0\""]
17+
- [vz-rosetta, /mnt/lima-rosetta, virtiofs]
1818
{{- end }}
1919
{{- if .Mounts }}
2020
{{- range $m := $.Mounts}}

0 commit comments

Comments
 (0)