Skip to content

Conversation

liulanze
Copy link
Contributor

@liulanze liulanze commented Aug 28, 2025

This PR optimizes the UKI (Unified Kernel Image) build process by eliminating redundant calls to getKernelToInitramfsMap() and consolidating kernel information into a single, well-structured data format.

In addition, resolved the comment of "Use GrubArgsToString to convert args list to a string."

Before:

{
  "vmlinuz-6.6.51.1-5.azl3": "console=tty0 console=ttyS0 ..."
}

After:

{
  "vmlinuz-6.6.51.1-5.azl3": {
    "cmdline": "console=tty0 console=ttyS0 ...",
    "initramfs": "initramfs-6.6.51.1-5.azl3.img"
  }
}

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • Code conforms to style guidelines

@liulanze liulanze requested a review from a team as a code owner August 28, 2025 21:58
@liulanze liulanze force-pushed the user/lanzeliu/uki-optimization-1 branch from 784461f to 8c0f9ae Compare August 29, 2025 21:38
@liulanze liulanze requested a review from cwize1 August 29, 2025 21:39
Copy link
Contributor

@cwize1 cwize1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

BootDir = "boot"
EspDir = "boot/efi"
DefaultGrubCfgPath = "grub2/grub.cfg"
UkiKernelInfoJson = "uki-kernel-info.json"
Copy link
Contributor

@himaja-kesari himaja-kesari Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of these constants are only used in this file, unexport them ?

var ukiNamePattern = regexp.MustCompile(`^vmlinuz-(.+)\.efi$`)

// UkiKernelInfo holds both command line arguments and initramfs name for a UKI kernel
type UkiKernelInfo struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to ukiKernelInfo as its only being used in this file, see my comment above.

@liulanze liulanze merged commit 2ea81ac into main Sep 11, 2025
23 checks passed
@liulanze liulanze deleted the user/lanzeliu/uki-optimization-1 branch September 11, 2025 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants