Skip to content

Commit

Permalink
ci: verify shasum for finch dependencies (#326)
Browse files Browse the repository at this point in the history
Issue #, if available:

Some of Finch's dependencies are not verified at pull time. e.g. the
file monitor application, the lima tarball for Finch on Mac, and the
rootfs tarball for Finch on Windows.

*Description of changes:*
This change adds a mechanism for pulling and verifying dependencies for
such as lima and rootfs via configuration files. This mechanism is a
refactor of existing logic pulled out of Makefile into bash scripts to
simplify and enable local testing.

This change also fixes rootfs update automation which has broken with
the swap from zstd compression to gzip compression of rootfs tarballs.

*Testing done:*
Ran shellcheck on `bin/update-rootfs.sh`, `bin/update-deps.sh`,
`bin/install-file-monitor.sh`, and `deps/install.sh`.

Tested on MacOS 14.4.1

Test install rootfs:
```
BUILD_OS=Windows_NT make install.rootfs
```

Test install lima dependencies:
```
make install.lima-dependencies
```

Test download OS:
```
make download.os
```

- [x] I've reviewed the guidance in CONTRIBUTING.md

#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: Austin Vazquez <[email protected]>
  • Loading branch information
austinvazquez authored Jun 20, 2024
1 parent 6d9e482 commit ab5fc46
Show file tree
Hide file tree
Showing 18 changed files with 457 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
which libtool
# Install socket_vmnet to `_output/bin` which is used in $PATH
SOCKET_VMNET_TEMP_PREFIX=$(pwd)/_output/ make lima-socket-vmnet
make install.lima-dependencies binaries
make install.lima-dependencies dependencies
- name: Run e2e tests
shell: zsh {0}
run: make test-e2e
8 changes: 2 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ jobs:
brew install cpanm
brew upgrade
sudo cpanm install JSON
curl -OL https://bitbucket.org/objective-see/deploy/downloads/FileMonitor_1.3.0.zip
rm -rf /Applications/FileMonitor.app
unzip FileMonitor_1.3.0.zip -d /Applications
bash bin/install-file-monitor.sh
shell: zsh {0}

- name: Make and release deps
Expand Down Expand Up @@ -109,9 +107,7 @@ jobs:
brew install cpanm
brew upgrade
sudo cpanm install JSON
curl -OL https://bitbucket.org/objective-see/deploy/downloads/FileMonitor_1.3.0.zip
rm -rf /Applications/FileMonitor.app
unzip FileMonitor_1.3.0.zip -d /Applications
bash bin/install-file-monitor.sh
shell: zsh {0}

- name: Make and release deps
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/rootfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ jobs:
docker container create --platform linux/${{ matrix.arch }} --name ${{ matrix.arch }}-rootfs finch-rootfs-image-production:intermediate
docker container export -o finch-rootfs-production-${{ matrix.arch }}.tar ${{ matrix.arch }}-rootfs
gzip -9 -c finch-rootfs-production-${{ matrix.arch }}.tar > finch-rootfs-production-${{ matrix.arch }}-"$TIMESTAMP".tar.gz
compressed_archive=finch-rootfs-production-${{ matrix.arch }}-"$TIMESTAMP".tar.gz
gzip -9 -c finch-rootfs-production-${{ matrix.arch }}.tar > $compressed_archive
sha512sum $compressed_archive | cut -d " " -f 1 > $compressed_archive.sha512sum
ARCHPATH="x86-64"
if [ ${{ matrix.arch }} == "arm64" ]; then
ARCHPATH="aarch64"
fi
aws s3 cp ./finch-rootfs-production-${{ matrix.arch }}-"$TIMESTAMP".tar.gz s3://${{ secrets.DEPENDENCY_BUCKET_NAME }}/${{ matrix.platform }}/$ARCHPATH/
# Upload tarball and shasum to S3
aws s3 cp ./finch-rootfs-production-${{ matrix.arch }}-"$TIMESTAMP".tar.gz* s3://${{ secrets.DEPENDENCY_BUCKET_NAME }}/${{ matrix.platform }}/$ARCHPATH/
205 changes: 10 additions & 195 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,228 +2,43 @@
PREFIX ?= $(CURDIR)/_output
DEST := $(shell echo "$(DESTDIR)/$(PREFIX)" | sed 's:///*:/:g; s://*$$::')
OUTDIR ?= $(CURDIR)/_output
HASH_DIR ?= $(CURDIR)/hashes
DOWNLOAD_DIR := $(CURDIR)/downloads
OS_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/os
LIMA_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/dependencies
LIMA_OUTDIR ?= $(OUTDIR)/lima
ROOTFS_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/os
DEPENDENCIES_DOWNLOAD_DIR := $(DOWNLOAD_DIR)/dependencies
SOCKET_VMNET_TEMP_PREFIX ?= $(OUTDIR)/dependencies/lima-socket_vmnet/opt/finch
UNAME := $(shell uname -m)
ARCH ?= $(UNAME)
BUILD_TS := $(shell date +%s)

# Set these variables if they aren't set, or if they are set to ""
# Allows callers to override these default values
# From https://dl.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/
FINCH_OS_x86_URL := $(or $(FINCH_OS_x86_URL),https://deps.runfinch.com/Fedora-Cloud-Base-40-1.14.x86_64-20240514214655.qcow2)
FINCH_OS_x86_DIGEST := $(or $(FINCH_OS_x86_DIGEST),"sha256:a7d5203d353ea6f5b4de73fdb0f36fe4f58b844c8d401f57015430f553a873c4")
# From https://dl.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/aarch64/images/
FINCH_OS_AARCH64_URL := $(or $(FINCH_OS_AARCH64_URL),https://deps.runfinch.com/Fedora-Cloud-Base-40-1.14.aarch64-20240514214641.qcow2)
FINCH_OS_AARCH64_DIGEST := $(or $(FINCH_OS_AARCH64_DIGEST),"sha256:16268745d1f401cc543cb89bf354c49f8bc3d00ce723d59aa289d21b9c872b60")

FINCH_ROOTFS_x86_URL := $(or $(FINCH_ROOTFS_x86_URL),https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1715724303.tar.gz)
FINCH_ROOTFS_x86_DIGEST := $(or $(FINCH_ROOTFS_x86_DIGEST),"sha256:8bf3e620782ac8991102120b80c0d1be259cd880451c900dd7e8bd284c86f171")
OUTPUT_DIRECTORIES=$(OUTDIR) $(DOWNLOAD_DIR) $(LIMA_DOWNLOAD_DIR) $(LIMA_OUTDIR)

LIMA_DEPENDENCY_FILE_NAME ?= lima-and-qemu.tar.gz
.DEFAULT_GOAL := all

WINGIT_TEMP_DIR := $(CURDIR)/wingit-temp
WINGIT_x86_URL := $(or $(WINGIT_x86_URL),https://github.com/git-for-windows/git/releases/download/v2.42.0.windows.2/Git-2.42.0.2-64-bit.tar.bz2)
WINGIT_x86_BASENAME ?= $(notdir $(WINGIT_x86_URL))
WINGIT_x86_HASH := $(or $(WINGIT_x86_HASH),"sha256:c192e56f8ed3d364acc87ad04d1f5aa6ae03c23b32b67bf65fcc6f9b8f032e65")

ifneq (,$(findstring arm64,$(ARCH)))
LIMA_ARCH = aarch64
LIMA_URL ?= https://deps.runfinch.com/aarch64/lima-and-qemu.macos-aarch64.1715099032.tar.gz
FINCH_OS_BASENAME := $(notdir $(FINCH_OS_AARCH64_URL))
FINCH_OS_IMAGE_URL := $(FINCH_OS_AARCH64_URL)
FINCH_OS_DIGEST ?= $(FINCH_OS_AARCH64_DIGEST)
# TODO: Use Finch rootfs in Finch on Windows testing
FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_AARCH64_URL))
FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_AARCH64_URL)
FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_AARCH64_DIGEST)
HOMEBREW_PREFIX ?= /opt/homebrew

else ifneq (,$(findstring x86_64,$(ARCH)))
LIMA_ARCH = x86_64
LIMA_URL ?= https://deps.runfinch.com/x86-64/lima-and-qemu.macos-x86_64.1715099032.tar.gz
FINCH_OS_BASENAME := $(notdir $(FINCH_OS_x86_URL))
FINCH_OS_IMAGE_URL := $(FINCH_OS_x86_URL)
FINCH_OS_DIGEST ?= $(FINCH_OS_x86_DIGEST)
# TODO: Use Finch rootfs in Finch on Windows testing
FINCH_ROOTFS_BASENAME := $(notdir $(FINCH_ROOTFS_x86_URL))
FINCH_ROOTFS_URL ?= $(FINCH_ROOTFS_x86_URL)
FINCH_ROOTFS_DIGEST ?= $(FINCH_ROOTFS_x86_DIGEST)
HOMEBREW_PREFIX ?= /usr/local

endif

FINCH_OS_IMAGE_LOCATION ?= $(OUTDIR)/os/$(FINCH_OS_BASENAME)
FINCH_OS_IMAGE_INSTALLATION_LOCATION ?= $(DEST)/os/$(FINCH_OS_BASENAME)

FINCH_ROOTFS_LOCATION ?= $(OUTDIR)/os/$(FINCH_ROOTFS_BASENAME)

.PHONY: all
all: binaries
all: dependencies

.PHONY: binaries
.PHONY: download
# dependencies is a make target defined by the respective platform makefile
# pull the required finch core dependencies for the platform.
.PHONY: dependencies

# Rootfs required for Windows, require full OS for Linux and Mac
# Rootfs required for Windows, require full OS for Mac
FINCH_IMAGE_LOCATION ?=
FINCH_IMAGE_DIGEST ?=
FEDORA_YAML ?=
BUILD_OS ?= $(OS)
ifeq ($(BUILD_OS), Windows_NT)
binaries: rootfs lima
download: download.rootfs
lima: lima-exe install.lima-dependencies-wsl2
FINCH_IMAGE_LOCATION := $(FINCH_ROOTFS_LOCATION)
FINCH_IMAGE_DIGEST := $(FINCH_ROOTFS_DIGEST)
include Makefile.windows
else
binaries: os lima-socket-vmnet lima-template
download: download.os
FINCH_IMAGE_LOCATION := $(FINCH_OS_IMAGE_LOCATION)
FINCH_IMAGE_DIGEST := $(FINCH_OS_DIGEST)
FEDORA_YAML := fedora.yaml
include Makefile.darwin
endif

$(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME):
mkdir -p $(OS_DOWNLOAD_DIR)
curl -L --fail $(FINCH_OS_IMAGE_URL) > "$(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME)"
cd $(OS_DOWNLOAD_DIR) && shasum -a 512 --check $(HASH_DIR)/$(FINCH_OS_BASENAME).sha512 || exit 1

$(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME):
mkdir -p $(ROOTFS_DOWNLOAD_DIR)
mkdir -p $(OUTDIR)/os
curl -L --fail $(FINCH_ROOTFS_URL) > "$(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME)"
cp $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME) $(OUTDIR)/os


.PHONY: download.os
download.os: $(OS_DOWNLOAD_DIR)/$(FINCH_OS_BASENAME)

.PHONY: download.rootfs
download.rootfs: $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME)
$(eval FINCH_ROOTFS_DIGEST := "sha256:$(sha256 $(ROOTFS_DOWNLOAD_DIR)/$(FINCH_ROOTFS_BASENAME))")

$(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME):
mkdir -p $(DEPENDENCIES_DOWNLOAD_DIR)
curl -L --fail $(LIMA_URL) > "$(DEPENDENCIES_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME)"
mkdir -p ${OUTDIR}
tar -xvzf ${DEPENDENCIES_DOWNLOAD_DIR}/${LIMA_DEPENDENCY_FILE_NAME} -C ${OUTDIR}

.PHONY: download.lima-dependencies
download.lima-dependencies: $(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME)

.PHONY: install.lima-dependencies
install.lima-dependencies: download.lima-dependencies

# Only redownload/extract if this file is missing (there's no particular reason for choosing this file instead of any other)
$(LIMA_OUTDIR)/bin/ssh.exe:
mkdir -p $(DEPENDENCIES_DOWNLOAD_DIR)
mkdir -p $(OUTDIR)/bin

curl -L --fail $(WINGIT_x86_URL) > $(DEPENDENCIES_DOWNLOAD_DIR)/$(WINGIT_x86_BASENAME)
pwsh.exe -NoLogo -NoProfile -c ./bin/verify_hash.ps1 "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" $(WINGIT_x86_HASH)
mkdir -p $(WINGIT_TEMP_DIR)
# this takes a long time because of an almost 4:1 compression ratio and needing to extract many small files
tar --force-local -xvjf "$(DEPENDENCIES_DOWNLOAD_DIR)\$(WINGIT_x86_BASENAME)" -C $(WINGIT_TEMP_DIR)

# Lima runtime dependencies
mkdir -p $(LIMA_OUTDIR)/bin

# From https://packages.msys2.org/package/gzip?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/gzip.exe $(LIMA_OUTDIR)/bin/
# From https://packages.msys2.org/package/msys2-runtime?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/cygpath.exe $(LIMA_OUTDIR)/bin/
# From https://packages.msys2.org/package/tar?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/tar.exe $(LIMA_OUTDIR)/bin/
# From https://packages.msys2.org/package/openssh?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/ssh.exe $(LIMA_OUTDIR)/bin/
# From https://packages.msys2.org/package/openssh?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/ssh-keygen.exe $(LIMA_OUTDIR)/bin/

# Dependency DLLs, extracted with https://github.com/lucasg/Dependencies
# Dependencies.exe -chain $(WINGIT_TEMP_DIR)\usr\bin\ssh.exe -depth 3 -json
# Depth 3 is only needed for ssh.exe, everything else only needs depth 1
# TODO: Automate

# Required by all MSYS2 programs, from https://github.com/msys2/msys2-runtime
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-2.0.dll $(LIMA_OUTDIR)/bin/
# Required by tar.exe, from https://packages.msys2.org/package/libiconv?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-iconv-2.dll $(LIMA_OUTDIR)/bin/
# Required by msys-iconv-2.dll, from https://packages.msys2.org/package/libintl?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-intl-8.dll $(LIMA_OUTDIR)/bin/
# GCC exception handling, required for all programs that throw exceptions, from https://packages.msys2.org/package/gcc-libs?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-gcc_s-seh-1.dll $(LIMA_OUTDIR)/bin/

# Required by ssh.exe, from https://packages.msys2.org/package/libopenssl?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypto-3.dll $(LIMA_OUTDIR)/bin/
# Required by ssh.exe, from https://packages.msys2.org/package/zlib-devel?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-z.dll $(LIMA_OUTDIR)/bin/
# Required by ssh.exe, from https://packages.msys2.org/package/libcrypt?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-crypt-0.dll $(LIMA_OUTDIR)/bin/
# Required by heimdal-libs, from https://packages.msys2.org/package/libsqlite?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-sqlite3-0.dll $(LIMA_OUTDIR)/bin/

# Required by ssh.exe, from https://packages.msys2.org/package/heimdal-libs?repo=msys&variant=x86_64
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-asn1-8.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-com_err-1.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-gssapi-3.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-hcrypto-4.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-heimbase-1.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-heimntlm-0.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-hx509-5.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-krb5-26.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-roken-18.dll $(LIMA_OUTDIR)/bin/
cp $(WINGIT_TEMP_DIR)/usr/bin/msys-wind-0.dll $(LIMA_OUTDIR)/bin/

-@rm -rf $(WINGIT_TEMP_DIR)

.PHONY: install.lima-dependencies-wsl2
install.lima-dependencies-wsl2: $(LIMA_OUTDIR)/bin/ssh.exe

.PHONY: lima-template
lima-template: download
mkdir -p $(OUTDIR)/lima-template
cp lima-template/fedora.yaml $(OUTDIR)/lima-template
# using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed
# this sed command uses the alternative separator of "|" because the image location uses "/"
sed -i.bak -e "s|<image_location>|$(FINCH_IMAGE_LOCATION)|g" $(OUTDIR)/lima-template/fedora.yaml
sed -i.bak -e "s/<image_arch>/$(LIMA_ARCH)/g" $(OUTDIR)/lima-template/fedora.yaml
sed -i.bak -e "s/<image_digest>/$(FINCH_IMAGE_DIGEST)/g" $(OUTDIR)/lima-template/fedora.yaml
rm $(OUTDIR)/lima-template/*.yaml.bak

.PHONY: lima-socket-vmnet
lima-socket-vmnet:
git submodule update --init --recursive src/socket_vmnet
cd src/socket_vmnet && git clean -f -d
cd src/socket_vmnet && PREFIX=$(SOCKET_VMNET_TEMP_PREFIX) "$(MAKE)" install.bin

.PHONY: lima lima-exe
lima-exe:
cd src/lima && \
"$(MAKE)" exe _output/share/lima/lima-guestagent.Linux-x86_64
mkdir -p ${OUTDIR}/lima
cp -r src/lima/_output/* ${OUTDIR}/lima
$(OUTPUT_DIRECTORIES):
@mkdir -p $@

.PHONY: download-sources
download-sources:
./bin/download-sources.pl

.PHONY: os
os: download
mkdir -p $(OUTDIR)/os
lz4 -dcf $(DOWNLOAD_DIR)/os/$(FINCH_OS_BASENAME) > "$(OUTDIR)/os/$(FINCH_OS_BASENAME)"

.PHONY: rootfs
rootfs: download
mkdir -p $(OUTDIR)/os
cp $(DOWNLOAD_DIR)/os/$(FINCH_ROOTFS_BASENAME) "$(OUTDIR)/os/$(FINCH_ROOTFS_BASENAME)"

.PHONY: install
install: uninstall
mkdir -p $(DEST)
Expand Down
56 changes: 56 additions & 0 deletions Makefile.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

OS_OUTDIR := $(OUTDIR)/os
LIMA_TEMPLATE_OUTDIR := $(OUTDIR)/lima-template
OUTPUT_DIRECTORIES += $(OS_OUTDIR) $(LIMA_TEMPLATE_OUTDIR)
SOCKET_VMNET_TEMP_PREFIX ?= $(OUTDIR)/dependencies/lima-socket_vmnet/opt/finch

include $(CURDIR)/deps/full-os.conf
ifeq ($(ARCH),x86_64)
FINCH_OS_BASENAME ?= $(X86_64_ARTIFACT)
FINCH_OS_DIGEST ?= $(X86_64_512_DIGEST)
LIMA_ARCH = x86_64
else
FINCH_OS_BASENAME ?= $(AARCH64_ARTIFACT)
FINCH_OS_DIGEST ?= $(AARCH64_512_DIGEST)
LIMA_ARCH = aarch64
endif

FINCH_IMAGE_LOCATION := $(OS_OUTDIR)/$(FINCH_OS_BASENAME)
FINCH_IMAGE_DIGEST := "sha512:$(FINCH_OS_DIGEST)"
FEDORA_YAML := fedora.yaml

dependencies: download.os install.lima-dependencies lima-socket-vmnet lima-template

.PHONY: download.os
download.os: $(OS_OUTDIR)/$(FINCH_OS_BASENAME)

$(OS_OUTDIR)/$(FINCH_OS_BASENAME): $(OS_OUTDIR) $(CURDIR)/deps/full-os.conf
bash deps/install.sh --output $@ $(CURDIR)/deps/full-os.conf

.PHONY: install.lima-dependencies
install.lima-dependencies: download.lima-dependencies $(OUTDIR)
tar -xvzf ${LIMA_DOWNLOAD_DIR}/${LIMA_DEPENDENCY_FILE_NAME} -C $(OUTDIR)

.PHONY: download.lima-dependencies
download.lima-dependencies: $(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME)

$(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME): $(LIMA_DOWNLOAD_DIR) $(CURDIR)/deps/lima-bundles.conf
bash deps/install.sh --output $@ $(CURDIR)/deps/lima-bundles.conf

.PHONY: lima-socket-vmnet
lima-socket-vmnet:
git submodule update --init --recursive src/socket_vmnet
cd src/socket_vmnet && git clean -f -d
cd src/socket_vmnet && PREFIX=$(SOCKET_VMNET_TEMP_PREFIX) "$(MAKE)" install.bin

.PHONY: lima-template
lima-template: $(LIMA_TEMPLATE_OUTDIR)
cp lima-template/fedora.yaml $(LIMA_TEMPLATE_OUTDIR)
# using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed
# this sed command uses the alternative separator of "|" because the image location uses "/"
sed -i.bak -e "s|<image_location>|$(FINCH_IMAGE_LOCATION)|g" $(LIMA_TEMPLATE_OUTDIR)/fedora.yaml
sed -i.bak -e "s/<image_arch>/$(LIMA_ARCH)/g" $(LIMA_TEMPLATE_OUTDIR)/fedora.yaml
sed -i.bak -e "s/<image_digest>/$(FINCH_IMAGE_DIGEST)/g" $(LIMA_TEMPLATE_OUTDIR)/fedora.yaml
rm $(LIMA_TEMPLATE_OUTDIR)/*.yaml.bak
Loading

0 comments on commit ab5fc46

Please sign in to comment.