diff --git a/image/Makefile b/image/Makefile index 4de6ba2f9..1f0d7323a 100644 --- a/image/Makefile +++ b/image/Makefile @@ -11,8 +11,10 @@ IMAGE_VERSION ?= v0.0.0 csps := aws qemu gcp azure certs := $(PKI)/PK.cer $(PKI)/KEK.cer $(PKI)/db.cer +AZURE_FIXED_KERNEL_RPMS := kernel-5.19.4-300.fc37.x86_64.rpm kernel-core-5.19.4-300.fc37.x86_64.rpm kernel-modules-5.19.4-300.fc37.x86_64.rpm 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)) +PREBUILT_RPMS_AZURE := $(addprefix prebuilt/rpms/azure/,$(AZURE_FIXED_KERNEL_RPMS)) +PREBUILT_RPMS_GCP := $(addprefix prebuilt/rpms/gcp/,$(GCP_FIXED_KERNEL_RPMS)) .PHONY: all clean inject-bins $(csps) @@ -20,11 +22,16 @@ all: $(csps) $(csps): %: mkosi.output.%/fedora~37/image.raw -prebuilt/rpms/%.rpm: +prebuilt/rpms/gcp/%.rpm: @echo "Downloading $*" @mkdir -p $(@D) @curl -sL -o $@ https://kojipkgs.fedoraproject.org/packages/kernel/5.19.17/300.fc37/x86_64/$*.rpm +prebuilt/rpms/azure/%.rpm: + @echo "Downloading $*" + @mkdir -p $(@D) + @curl -sL -o $@ https://kojipkgs.fedoraproject.org/packages/kernel/5.19.4/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 $@ @@ -33,7 +40,7 @@ mkosi.output.%/fedora~37/image.raw: mkosi.files/mkosi.%.conf inject-bins inject- fi @echo "Image is ready: $@" -inject-bins: $(PREBUILT_RPMS) +inject-bins: $(PREBUILT_RPMS_AZURE) $(PREBUILT_RPMS_GCP) mkdir -p $(MKOSI_EXTRA)/usr/bin mkdir -p $(MKOSI_EXTRA)/usr/sbin cp $(BOOTSTRAPPER_BINARY) $(MKOSI_EXTRA)/usr/bin/bootstrapper @@ -61,5 +68,6 @@ clean-%: clean: rm -rf mkosi.output.* + rm -rf prebuilt/rpms rm -rf $(MKOSI_EXTRA) mkdir -p $(MKOSI_EXTRA) diff --git a/image/mkosi.conf.d/mkosi.conf b/image/mkosi.conf.d/mkosi.conf index e2334fbc9..66a100598 100644 --- a/image/mkosi.conf.d/mkosi.conf +++ b/image/mkosi.conf.d/mkosi.conf @@ -6,7 +6,7 @@ Release=37 Format=gpt_squashfs ManifestFormat=json,changelog Bootable=yes -KernelCommandLine=mitigations=auto,nosmt preempt=full +KernelCommandLine=mitigations=auto,nosmt preempt=full loglevel=8 WithUnifiedKernelImages=yes Verity=yes CompressFs=zstd diff --git a/image/mkosi.files/mkosi.azure.conf b/image/mkosi.files/mkosi.azure.conf index b9af2db26..bc81fda0a 100644 --- a/image/mkosi.files/mkosi.azure.conf +++ b/image/mkosi.files/mkosi.azure.conf @@ -1,3 +1,13 @@ [Output] KernelCommandLine=constel.csp=azure OutputDirectory=mkosi.output.azure + +# replace kernel +[Content] +BasePackages=conditional +Packages=systemd + util-linux + dracut + prebuilt/rpms/azure/kernel-5.19.4-300.fc37.x86_64.rpm + prebuilt/rpms/azure/kernel-core-5.19.4-300.fc37.x86_64.rpm + prebuilt/rpms/azure/kernel-modules-5.19.4-300.fc37.x86_64.rpm diff --git a/image/mkosi.files/mkosi.gcp.conf b/image/mkosi.files/mkosi.gcp.conf index b00e6228b..23ed4bd76 100644 --- a/image/mkosi.files/mkosi.gcp.conf +++ b/image/mkosi.files/mkosi.gcp.conf @@ -8,6 +8,6 @@ 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 + prebuilt/rpms/gcp/kernel-5.19.17-300.fc37.x86_64.rpm + prebuilt/rpms/gcp/kernel-core-5.19.17-300.fc37.x86_64.rpm + prebuilt/rpms/gcp/kernel-modules-5.19.17-300.fc37.x86_64.rpm