Skip to content

Fix UKI build. #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests-functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

# grub2-pc is only available on x86.
if [[ "$HOST_ARCH" == "amd64" ]]; then
sudo tdnf install -y grub2-pc
sudo tdnf install -y grub2-pc systemd-ukify
fi

sudo tdnf list installed
Expand All @@ -70,7 +70,7 @@ jobs:

sudo apt -y install qemu-utils rpm coreutils util-linux mount fdisk udev openssl \
sed createrepo-c squashfs-tools genisoimage e2fsprogs dosfstools \
xfsprogs zstd cryptsetup-bin grub2-common binutils lsof
xfsprogs zstd cryptsetup-bin grub2-common binutils lsof systemd-ukify

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

Expand Down
5 changes: 3 additions & 2 deletions toolkit/tools/pkg/imagecustomizerlib/customizeuki.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func findSpecificKernelsAndInitramfs(bootDir string, versions []string) (map[str
}

func createUki(ctx context.Context, uki *imagecustomizerapi.Uki, buildDir string, buildImageFile string) error {
logger.Log.Debugf("Customizing UKI")
logger.Log.Infof("Creating UKIs")

_, span := otel.GetTracerProvider().Tracer(OtelTracerName).Start(ctx, "customize_uki")
defer span.End()
Expand Down Expand Up @@ -340,6 +340,7 @@ func createUki(ctx context.Context, uki *imagecustomizerapi.Uki, buildDir string
defer systemBootPartitionMount.Close()

bootPartitionTmpDir := filepath.Join(buildDir, tmpBootPartitionDirName)
stubPath := filepath.Join(buildDir, UkiBuildDir, bootConfig.ukiEfiStubBinary)
bootPartitionMount, err := safemount.NewMount(bootPartition.Path, bootPartitionTmpDir, bootPartition.FileSystemType, 0, "", true)
if err != nil {
return fmt.Errorf("failed to mount partition (%s):\n%w", bootPartition.Path, err)
Expand All @@ -356,7 +357,7 @@ func createUki(ctx context.Context, uki *imagecustomizerapi.Uki, buildDir string
}

for kernel, initramfs := range kernelToInitramfs {
err := buildUki(kernel, initramfs, cmdlineFilePath, osSubreleaseFullPath, bootConfig.ukiEfiStubBinaryPath, buildDir,
err := buildUki(kernel, initramfs, cmdlineFilePath, osSubreleaseFullPath, stubPath, buildDir,
systemBootPartitionTmpDir,
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion toolkit/tools/pkg/imagecustomizerlib/liveosisoutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
const (
osEspBootloaderDir = "/boot/efi/EFI/BOOT"
isoBootloaderDir = "/efi/boot"
ukiEfiStubDir = "/usr/lib/systemd/boot/efi/"
ukiEfiStubDir = "/usr/lib/systemd/boot/efi"

bootx64Binary = "bootx64.efi"
bootAA64Binary = "bootaa64.efi"
Expand Down
Loading