Skip to content

Commit e9beb14

Browse files
authored
Merge pull request #5135 from Aneesh-Hegde/sudo-fuse-check
refactor: drop sudo requirement for fuse.conf check
2 parents 6a7ee2a + fcb1203 commit e9beb14

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

pkg/cidata/cidata.TEMPLATE.d/boot.Linux/35-setup-packages.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ EOF
3434
# otherwise apt-get fails with conflict
3535
if [ "${LIMA_CIDATA_MOUNTTYPE}" = "reverse-sshfs" ]; then
3636
update_fuse_conf
37+
echo "${LIMA_CIDATA_IID}" >/run/lima-fuse-ready
3738
fi
3839

3940
SETUP_DNS=0

pkg/hostagent/requirements.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ A possible workaround is to run "apt-get install sshfs" in the guest.
210210
})
211211
req = append(req, requirement{
212212
description: "fuse to allow_other as user",
213-
script: `#!/bin/sh
213+
script: fmt.Sprintf(`#!/bin/sh
214214
set -eux
215-
sudo grep -q ^user_allow_other /etc/fuse*.conf
216-
`,
217-
debugHint: `Append "user_allow_other" to /etc/fuse.conf (/etc/fuse3.conf) in the guest`,
215+
[ "$(cat /run/lima-fuse-ready 2>/dev/null)" = "%s" ]
216+
`, a.iid),
217+
debugHint: `Waiting for /run/lima-fuse-ready to be created by the boot scripts.`,
218218
})
219219
} else {
220220
req = append(req, startControlMasterReq)

website/content/en/docs/dev/internals.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,15 @@ The volume label is "cidata", as defined by [cloud-init NoCloud](https://docs.cl
220220
- `LIMA_CIDATA_PLAIN`: set to "1" when the instance is in plain mode (no mounts, port forwarding, or containerd), empty otherwise.
221221
- `LIMA_CIDATA_NO_CLOUD_INIT`: set to "1" if cloud-init should be skipped on this boot, empty otherwise.
222222

223+
224+
## Guest runtime files
225+
226+
Boot scripts create the following marker files inside the guest at `/run/`:
227+
228+
- `/run/lima-boot-done`: Written by `boot.sh` when provisioning is complete. Contains `LIMA_CIDATA_IID`.
229+
- `/run/lima-ssh-ready`: Written by `boot.Linux/07-etc-environment.sh` when SSH is ready. Contains `LIMA_CIDATA_IID`.
230+
- `/run/lima-fuse-ready`: Written by `boot.Linux/35-setup-packages.sh` after fuse.conf is configured for `allow_other`. Contains `LIMA_CIDATA_IID`. Only created when `LIMA_CIDATA_MOUNTTYPE=reverse-sshfs`.
231+
223232
# VM lifecycle
224233

225234
![](/images/internals/lima-sequence-diagram.png)

0 commit comments

Comments
 (0)