Skip to content

Commit ea9aa42

Browse files
committed
Fix UKI build.
PR #360 accidentally broke the UKI build. Instead of pointing ukify at the image's EFI stub, it pointed it at the host's EFI stub instead. This change fixes this. This change also fixes the GitHub workflows so that the UKI functional tests are run instead of being skipped.
1 parent 584bda9 commit ea9aa42

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/tests-functional.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
5353
# grub2-pc is only available on x86.
5454
if [[ "$HOST_ARCH" == "amd64" ]]; then
55-
sudo tdnf install -y grub2-pc
55+
sudo tdnf install -y grub2-pc systemd-ukify
5656
fi
5757
5858
sudo tdnf list installed
@@ -70,7 +70,7 @@ jobs:
7070
7171
sudo apt -y install qemu-utils rpm coreutils util-linux mount fdisk udev openssl \
7272
sed createrepo-c squashfs-tools genisoimage e2fsprogs dosfstools \
73-
xfsprogs zstd cryptsetup-bin grub2-common binutils lsof
73+
xfsprogs zstd cryptsetup-bin grub2-common binutils lsof systemd-ukify
7474
7575
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
7676

toolkit/tools/pkg/imagecustomizerlib/customizeuki.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func findSpecificKernelsAndInitramfs(bootDir string, versions []string) (map[str
300300
}
301301

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

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

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

358359
for kernel, initramfs := range kernelToInitramfs {
359-
err := buildUki(kernel, initramfs, cmdlineFilePath, osSubreleaseFullPath, bootConfig.ukiEfiStubBinaryPath, buildDir,
360+
err := buildUki(kernel, initramfs, cmdlineFilePath, osSubreleaseFullPath, stubPath, buildDir,
360361
systemBootPartitionTmpDir,
361362
)
362363
if err != nil {

toolkit/tools/pkg/imagecustomizerlib/liveosisoutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
const (
1717
osEspBootloaderDir = "/boot/efi/EFI/BOOT"
1818
isoBootloaderDir = "/efi/boot"
19-
ukiEfiStubDir = "/usr/lib/systemd/boot/efi/"
19+
ukiEfiStubDir = "/usr/lib/systemd/boot/efi"
2020

2121
bootx64Binary = "bootx64.efi"
2222
bootAA64Binary = "bootaa64.efi"

0 commit comments

Comments
 (0)