Uh oh!
There was an error while loading. Please reload this page.
Allow custom kernel boot args via --kernel-arg - #1744
Merged
Conversation
arirubinsteinforce-pushed
the
kernel-arg-boot-args
branch
from
June 24, 2026 21:48
36d3c96 to
ce82987Comparenoah-thor
commented
Jul 22, 2026
Contributor
Can you please sign the commit: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits Actual code change looks good to me |
arirubinsteinforce-pushed
the
kernel-arg-boot-args
branch
from
July 22, 2026 23:06
ce82987 to
36f45a5CompareAdd a repeatable --kernel-arg flag to plumb arbitrary boot arguments onto the kernel command line. User-supplied args are persisted on the kernel in the bundle, and the runtime's built-in defaults (oops=panic, lsm=...) are now applied per-key only when the user has not already supplied that key. This lets custom kernels override the LSM stack, e.g. to enable BPF LSM with: --kernel-arg lsm=lockdown,capability,landlock,yama,apparmor,bpf Signed-off-by: Ari Rubinstein <22369+arirubinstein@users.noreply.github.com>
arirubinsteinforce-pushed
the
kernel-arg-boot-args
branch
from
July 22, 2026 23:07
36f45a5 to
8fb74feComparearirubinstein
commented
Jul 22, 2026
ContributorAuthor
Signed and rebased |
noah-thor
approved these changes
Jul 23, 2026
Code Coverage
|
crosbymichael
approved these changes
Jul 27, 2026
Uh oh!
There was an error while loading. Please reload this page.
Merged
6 tasks
andrewkomkov added a commit
to getgantry/gantry
that referenced
this pull request
Aug 1, 2026
…ot args (#14) apple/container **1.2.0** is out (previously tracked: `1.1.0`). Upstream notes: https://github.com/apple/container/releases/tag/1.2.0 — mirrored in `docs/upstream/apple-container-1.2.0.md`. ## Review checklist - [ ] New or changed CLI flags Gantry should surface (`container run/create/machine/build`) - [ ] Changed `--format json` shapes the DockerKit apple transport decodes - [ ] Fixed upstream bugs Gantry currently works around - [ ] `ContainerTooling.recommendedVersion` / feature gates need moving to `1.2.0` - [ ] MCP tools and App Intents that expose the affected commands - [ ] README and CHANGELOG entries for whatever is adopted Merging records the version as reviewed. Implement the adopted parts on this branch, or merge as-is and open follow-ups. --- <details><summary>Upstream release notes</summary> ## What's Changed * Add TestCLISystemLogs and TestCLITermIO integration tests in new integration test suite by @katiewasnothere in apple/container#1879 * Restore reverted migrations, migrate last tests. by @jglogan in apple/container#1880 * Removes obsolete CLITests directory. by @jglogan in apple/container#1886 * Integration coverage xpc helpers by @noah-thor in apple/container#1551 * Upgrade grpc-swift-nio-transport to 2.9.0 and remove HTTP2ConnectBuff… by @adityabagchi24 in apple/container#1790 * Updates containerization to 0.36.0. by @jglogan in apple/container#1912 * Use containerization version 0.37.0 by @adityaramani in apple/container#1932 * Verify kernel archive integrity by @haoruilee in apple/container#1703 * Add commit/issue alert to PR template. by @jglogan in apple/container#1945 * Remove `--skip-build` from test Makefile target. by @jglogan in apple/container#1951 * Restore `--skip-build`, enable `import testable` for release builds. by @jglogan in apple/container#1955 * [package]: bump container-builder-shim to 0.13.0 by @saehejkang in apple/container#1953 * Validate container ID from XPC requests by @katiewasnothere in apple/container#1956 * Remove force unwraps on XPC error set/get by @katiewasnothere in apple/container#1958 * Do not follow destination symlink when copying user configuration by @katiewasnothere in apple/container#1957 * Fix machine ID length test. by @jglogan in apple/container#1971 * Address flaky TestCLIKernelSetSerial suite. by @jglogan in apple/container#1976 * [gitignore]: ignore vscode workspace files by @saehejkang in apple/container#1966 * Update containerization dependency with new EXT4Unpacker func definition by @katiewasnothere in apple/container#1973 * Periodic dependency updates. by @jglogan in apple/container#1981 * Use ordered journal mode for unpacked images. by @jglogan in apple/container#1974 * Reword DNS container name resolution doc information by @katiewasnothere in apple/container#1960 * ci: bump the github-actions group across 1 directory with 3 updates by @dependabot[bot] in apple/container#1983 * Pass build config in when building protoc dependencies by @katiewasnothere in apple/container#1972 * Container test fixture package by @katiewasnothere in apple/container#1887 * Downgrade swift-collections to 1.5.1. by @jglogan in apple/container#1984 * Use `enum` for warmup images. by @jglogan in apple/container#1990 * Add missing dependencies to new ContainerTestSupport package by @katiewasnothere in apple/container#1994 * Add OCI maskedPaths and readonlyPaths support to Container API. by @jglogan in apple/container#1996 * Integration test - miscellaneous fixture and test refinements. by @jglogan in apple/container#1993 * Use log instead of print for system start status messages by @adityabagchi24 in apple/container#1889 * Fix BuilderStart race, parallelize `container build` tests. by @jglogan in apple/container#2002 * Allow custom kernel boot args via --kernel-arg by @arirubinstein in apple/container#1744 * fix: Increase XPC timeout for Machine API operations by @dev-kvt in apple/container#2006 * Update containerization import to latest 0.40.0 by @katiewasnothere in apple/container#2028 * Fix image env vars, build context checks, TCP/UDP port forward buffer, and validate plugin name by @katiewasnothere in apple/container#2027 * Update containerization import to 0.40.1 by @katiewasnothere in apple/container#2038 ## New Contributors * @haoruilee made their first contribution in apple/container#1703 * @arirubinstein made their first contribution in apple/container#1744 * @dev-kvt made their first contribution in apple/container#2006 **Full Changelog**: apple/container@1.1.0...1.2.0 </details> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrew <Andrew.Komkov@gmail.com>
This was referenced Aug 4, 2026
henrywang added a commit
to henrywang/Berthly
that referenced
this pull request
Aug 4, 2026
## Summary - container 1.2.0 added a repeatable `--kernel-arg` flag (apple/container#1744) for appending raw boot arguments to the kernel command line — e.g. adding `bpf` to the runtime's hardcoded LSM list to enable BPF LSM, previously impossible. `Flags.Management` gained a required `kernelArgs` parameter in the same release, confirming the API is reachable from Berthly's native XPC calls, not just the CLI. - `RunOptions` gained `kernelArgs: [String]`, threaded through `LiveContainerService.runManagementFlags(for:)` into `Flags.Management.kernelArgs`. - New "Kernel boot arguments" `StringListEditor` on the Run/Create sheet's Security tab, alongside the existing capAdd/capDrop editors it mirrors. - `PARITY.md`'s flag-surface list updated in the same commit. - `Localizable.xcstrings` synced for the new field's string. ## Why Part of the container 1.2.0 milestone (#78) — the SPM bump (#75) surfaced this as a newly-required parameter, confirming the feature is implementable at the API level Berthly actually calls. Closes#78 ## Test plan - [x] `xcodebuild build` succeeds - [x] `xcodebuild test -only-testing:BerthlyTests` — full suite passes, including new coverage for `kernelArgs` in `managementFlagsMapInteractiveVirtualizationCapsAndCidFile` - [x] `swiftlint lint --strict` — 0 violations - [x] Verified visually via Xcode's live preview renderer — confirmed the new field renders on the Security tab using the working `capAdd` pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
What
Adds a repeatable
--kernel-argflag tocontainer run/container createfor appending arbitrary boot arguments to the kernel command line.Why
The runtime hardcodes
lsm=lockdown,capability,landlock,yama,apparmor(andoops=panic) onto every kernel command line inRuntimeService.bootstrap. With a custom kernel there is no way to adjust this — e.g. to enable BPF LSM you needlsm=...,bpf, which is currently impossible. More generally there is no escape hatch for any boot-time kernel argument.How
--kernel-arg <arg>option (repeatable) onFlags.Management.Utility.getKernelappends the user args ontokernel.commandLine.kernelArgs, which is persisted into the container bundle.RuntimeService.bootstrapnow applies its built-in defaults per-key, skipping any default whose key the user already supplied. Defaults are expressed as a small keyed table, so this also letsoops=be overridden and makes future defaults easy to add.Default behavior is unchanged for anyone who does not pass
--kernel-arg— the sameoops=panicandlsm=...args are applied.Testing
swift buildclean.container run --helprenders the new flag.