Skip to content

Remove VMType check from the lima-init boot script #3861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Aug 18, 2025

Do this when setting up the cidata instead, next to the decision on whether to use "cidata/" directory or "cidata.iso".

This means that this particular boot script is not depending on the driver, but can be used from all container drivers.

We probably want to add an explicit bool config for it to the driver, instead of checking for the driver name?

And there are still some features left to add to the script (from cloud-config), like the hostname and timezone.

Currently we dont use user-data, but lima.env (+ ssh key)

We execute this script through the boot.sh directly (lima-init).

Do this when setting up the cidata instead, next to the
decision on whether to use "cidata" dir or "cidata.iso".

This means that this particular boot script is not depending
on the driver, but can be used from all container drivers.

Signed-off-by: Anders F Björklund <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the file name should be changed.
e.g. 02-no-cloudinit.sh

@@ -4,8 +4,7 @@
# SPDX-License-Identifier: Apache-2.0

# This script replaces the cloud-init functionality of creating a user and setting its SSH keys
# when using a WSL2 VM.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# when cloud-init is not available 

@@ -4,8 +4,7 @@
# SPDX-License-Identifier: Apache-2.0

# This script replaces the cloud-init functionality of creating a user and setting its SSH keys
# when using a WSL2 VM.
[ "$LIMA_CIDATA_VMTYPE" = "wsl2" ] || exit 0
[ "$LIMA_CIDATA_LIMA_INIT" = "1" ] || exit 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can just check the existence of cloud-init here, then the variable can be just dropped

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still needed (in the Go code, that is) to know if we should create a "cidata" directory, or a cidata.iso

@afbjorklund afbjorklund marked this pull request as draft August 20, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants