lima-vm / lima-vm/lima

Renumber (and reorder) boot scripts

Open
#5,121 0 comments 0 reactions 0 assignees View on GitHub
expert kind/refactoring
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

There are 6 scripts in the `00` group now, with more cluster later:

```
❯ ls -1
00-alpine-user-group.sh
00-check-rtc-and-wait-ntp.sh
00-guest-home.sh
00-modprobe.sh
00-reboot-if-required.sh
00-systemd-user-group.sh
01-alpine-ash-as-bash.sh
04-persistent-data-volume.sh
05-lima-disks.sh
05-lima-mounts.sh
06-enable-mdns-on-systemd.sh
06-etc-hosts.sh
...
```

Now we rely on alphabetic ordering of the script names within a group for sequencing.

Today I noticed that `pkg/driver/wsl2/boot.Linux/02-no-cloud-init-setup.sh` should really be sorted before `pkg/cidata/cidata.TEMPLATE.d/boot.Linux/00-systemd-user-group.sh`[^1]. But conceptually after `00-alpine-user-group.sh`, even though right now that doesn't matter.

[^1]: I noticed only because when running without msys/git for Windows, the WSL2 driver uses UID 1000, and then the `00` script tries to modify a user that will only be created in `02`. But in this case it is an error that the `00` script touches a UID above 999, so #5120 is the right fix for this situation. Still, all user creation scripts should come before scripts that assume the users already exist.

But having all the scripts clumped together in `00` makes this hard and error-prone. So I think it would be good to spread scripts out a bit and find some logical groupings, where the order within a group doesn't matter. I haven't thought this through, so I don't have a suggestion for this yet, but want to raise the issue already for awareness.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.