Skip to content

Conversation

@frhuelsz
Copy link
Contributor

@frhuelsz frhuelsz commented Jan 8, 2026

🔍 Description

  • Merge mkcosi code to make an ubuntu COSI file.
  • Generalize setting OS architecture in metadata.

Copilot AI review requested due to automatic review settings January 8, 2026 00:44
@frhuelsz frhuelsz requested a review from a team as a code owner January 8, 2026 00:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Ubuntu COSI build support and generalizes OS architecture configuration. Previously, the architecture was hardcoded to x86_64; now users can specify either aarch64 or x86_64 via a command-line flag.

Key changes:

  • Adds new Ubuntu build variant with separate boot and root partitions
  • Introduces configurable architecture parameter (aarch64 or x86_64)
  • Increases zstd decoder max window size to support larger compression dictionaries

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tools/cmd/mkcosi/main.go Adds Ubuntu subcommand to build CLI
tools/cmd/mkcosi/builder/ubuntu.go Implements BuildUbuntu with ESP, boot, and root partition configuration
tools/cmd/mkcosi/builder/common.go Adds Arch field to CommonOpts, replaces hardcoded x86_64 with configurable architecture, increases zstd decoder window size to 1GB

},
{
Name: "root",
PartType: metadata.PartitionTypeRoot,
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The PartitionTypeRoot constant is hardcoded to PartitionTypeRootAmd64 in the metadata package, but this builder now supports both aarch64 and x86_64 architectures. When building for aarch64 architecture, the partition type should be PartitionTypeRootArm64 instead. This will cause incorrect partition type GUIDs to be written for ARM64 builds. The partition type should be selected based on the Arch field from CommonOpts.

Copilot uses AI. Check for mistakes.
Source string `arg:"" help:"Source directory to build COSI from." required:"" type:"path"`
Output string `arg:"" help:"Output file to write COSI to." required:"" type:"path"`
SourceExtension string `name:"extension" short:"e" help:"Source file extension." default:"rawzst"`
Arch string `short:"a" help:"Architecture to build for" default:"aarch64" enum:"aarch64,x86_64"`
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The default architecture has been changed from x86_64 to aarch64. This is a breaking change for existing users who rely on the previous default behavior. Users building for x86_64 will now need to explicitly specify -a x86_64, whereas they didn't need to specify anything before. Consider whether x86_64 should remain the default for backward compatibility, or if this change is intentional and documented.

Suggested change
Arch string `short:"a" help:"Architecture to build for" default:"aarch64" enum:"aarch64,x86_64"`
Arch string `short:"a" help:"Architecture to build for" default:"x86_64" enum:"aarch64,x86_64"`

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

is this an intentional change in default behavior?

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.

5 participants