Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pkg/cidata/cidata.TEMPLATE.d/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,17 @@ CODE=0
# has run because it might move the directories to /mnt/data on first boot. In that
# case changes made on restart would be lost.

# The boot.essential scripts are executed in plain mode too.
for f in "${LIMA_CIDATA_MNT}"/boot.essential/*.sh; do
INFO "Executing $f"
if ! "$f"; then
WARNING "Failed to execute $f"
CODE=1
fi
done

if [ "$LIMA_CIDATA_PLAIN" = "1" ]; then
INFO "Plain mode. Skipping to run boot scripts. Provisioning scripts will be still executed. Guest agent will not be running."
INFO "Plain mode. Skipping to run non-essential boot scripts. Provisioning scripts will be still executed. Guest agent will not be running."
else
for f in "${LIMA_CIDATA_MNT}"/boot/*; do
INFO "Executing $f"
Expand Down
3 changes: 3 additions & 0 deletions pkg/cidata/cidata.TEMPLATE.d/boot/DO_NOT_ADD_MORE_SCRIPTS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The "essential" scripts are limited to scripts that are essential even in the "plain" mode (`limactl create --plain`).

Do not add more scripts to this `boot.essential` directory, unless they are really essential.
1 change: 1 addition & 0 deletions website/content/en/docs/dev/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ See [Building Ansible inventories](https://docs.ansible.com/ansible/latest/inven
- `lima-guestagent`: Lima guest agent binary
- `nerdctl-full.tgz`: [`nerdctl-full-<VERSION>-<OS>-<ARCH>.tar.gz`](https://github.com/containerd/nerdctl/releases)
- `boot.sh`: Boot script
- `boot.essential/*`: Boot script modules (executed in "plain" mode too)
- `boot/*`: Boot script modules
- `util/*`: Utility command scripts, executed in the boot script modules
- `provision.system/*`: Custom provision scripts (system)
Expand Down
Loading