Skip to content

Commit b55824c

Browse files
committed
cidata: deduplicate iso9660 mounter
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 8c75ebd commit b55824c

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/25-guestagent-base.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ chown "{{$.User}}" "{{$val}}" || true
88
{{- end}}
99

1010
# Install or update the guestagent binary
11-
mkdir -p -m 600 /mnt/lima-cidata
12-
mount -t iso9660 -o ro /dev/disk/by-label/cidata /mnt/lima-cidata
13-
install -m 755 /mnt/lima-cidata/lima-guestagent /usr/local/bin/lima-guestagent
14-
umount /mnt/lima-cidata
11+
install -m 755 "${LIMA_CIDATA_MNT}"/lima-guestagent /usr/local/bin/lima-guestagent
1512

1613
# Launch the guestagent service
1714
if [ -f /etc/alpine-release ]; then

pkg/cidata/cidata.TEMPLATE.d/boot/40-install-containerd.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ set -eux -o pipefail
55
command -v systemctl 2>&1 >/dev/null || exit 0
66

77
if [ ! -x /usr/local/bin/nerdctl ]; then
8-
mkdir -p -m 600 /mnt/lima-cidata
9-
mount -t iso9660 -o ro /dev/disk/by-label/cidata /mnt/lima-cidata
10-
tar Cxzf /usr/local /mnt/lima-cidata/nerdctl-full.tgz
11-
umount /mnt/lima-cidata
8+
tar Cxzf /usr/local "${LIMA_CIDATA_MNT}"/nerdctl-full.tgz
129
fi
1310
{{- if .Containerd.System}}
1411
mkdir -p /etc/containerd

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ write_files:
2121
- content: |
2222
#!/bin/sh
2323
set -eu
24-
# TODO: rename lima-cidata.boot to lima-cidata,
25-
# after deduplicating it in 25-guestagent-base-boot.sh
26-
LIMA_CIDATA_MNT="/mnt/lima-cidata.boot"
24+
LIMA_CIDATA_MNT="/mnt/lima-cidata"
2725
LIMA_CIDATA_DEV="/dev/disk/by-label/cidata"
2826
mkdir -p -m 700 "${LIMA_CIDATA_MNT}"
2927
mount -o ro,mode=0700,dmode=0700,overriderockperm,exec,uid=0 "${LIMA_CIDATA_DEV}" "${LIMA_CIDATA_MNT}"

0 commit comments

Comments
 (0)