-
Notifications
You must be signed in to change notification settings - Fork 15
infra: mkcosi: ubuntu support #443
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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, |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
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.
| 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"` |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
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.
| 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"` |
There was a problem hiding this comment.
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?
🔍 Description