diff --git a/image/Makefile b/image/Makefile index 8f8b960e7..482cf73c1 100644 --- a/image/Makefile +++ b/image/Makefile @@ -10,12 +10,20 @@ IMAGE_VERSION ?= v0.0.0 csps := aws qemu gcp azure certs := $(PKI)/PK.cer $(PKI)/KEK.cer $(PKI)/db.cer +GCP_FIXED_KERNEL_RPMS := kernel-5.19.17-300.fc37.x86_64.rpm kernel-core-5.19.17-300.fc37.x86_64.rpm kernel-modules-5.19.17-300.fc37.x86_64.rpm +PREBUILT_RPMS := $(addprefix prebuilt/rpms/,$(GCP_FIXED_KERNEL_RPMS)) + .PHONY: all clean inject-bins $(csps) all: $(csps) $(csps): %: mkosi.output.%/fedora~37/image.raw +prebuilt/rpms/%.rpm: + @echo "Downloading $*" + @mkdir -p $(@D) + @curl -sL -o $@ https://kojipkgs.fedoraproject.org/packages/kernel/5.19.17/300.fc37/x86_64/$*.rpm + mkosi.output.%/fedora~37/image.raw: mkosi.files/mkosi.%.conf inject-bins inject-certs mkosi --config mkosi.files/mkosi.$*.conf --image-version=$(IMAGE_VERSION) build secure-boot/signed-shim.sh $@ @@ -24,7 +32,7 @@ mkosi.output.%/fedora~37/image.raw: mkosi.files/mkosi.%.conf inject-bins inject- fi @echo "Image is ready: $@" -inject-bins: +inject-bins: $(PREBUILT_RPMS) mkdir -p $(MKOSI_EXTRA)/usr/bin mkdir -p $(MKOSI_EXTRA)/usr/sbin cp $(BOOTSTRAPPER_BINARY) $(MKOSI_EXTRA)/usr/bin/bootstrapper diff --git a/image/README.md b/image/README.md index 91b4a6fe5..6803c4916 100644 --- a/image/README.md +++ b/image/README.md @@ -225,7 +225,7 @@ export AZURE_RESOURCE_GROUP_NAME=constellation-images export AZURE_REGION=northeurope export AZURE_REPLICATION_REGIONS="northeurope eastus westeurope westus" export AZURE_IMAGE_OFFER=constellation -export AZURE_SKU=constellation +export AZURE_SKU=${AZURE_IMAGE_DEFINITION} export AZURE_PUBLISHER=edgelesssys export AZURE_DISK_NAME=constellation-$(date +%s) export AZURE_RAW_IMAGE_PATH=${PWD}/mkosi.output.azure/fedora~37/image.raw diff --git a/image/mkosi.files/mkosi.gcp.conf b/image/mkosi.files/mkosi.gcp.conf index 07314201a..b00e6228b 100644 --- a/image/mkosi.files/mkosi.gcp.conf +++ b/image/mkosi.files/mkosi.gcp.conf @@ -1,3 +1,13 @@ [Output] KernelCommandLine=constel.csp=gcp OutputDirectory=mkosi.output.gcp + +# replace kernel +[Content] +BasePackages=conditional +Packages=systemd + util-linux + dracut + prebuilt/rpms/kernel-5.19.17-300.fc37.x86_64.rpm + prebuilt/rpms/kernel-core-5.19.17-300.fc37.x86_64.rpm + prebuilt/rpms/kernel-modules-5.19.17-300.fc37.x86_64.rpm