CachyOS / CachyOS/New-Cli-Installer
Headless server install ignores default_kernel; always installs linux-cachyos instead of linux-cachyos-server
- Dominant language
- C++
- Stars
- 145
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
ai generated, sorry. I think it is sensible you get a server kernel when installing a server profile.
A headless install with server_profile set (e.g. minimal) installs the desktop kernel linux-cachyos by default, even though server-profiles.toml declares default_kernel = "linux-cachyos-server". The field is parsed but never used.
Repro
Config without a kernel key:
```
{
"install_type": "simple",
"headless_mode": true,
"device": "/dev/nvme0n1",
"allow_auto_partition": true,
"fs_name": "btrfs",
"user_name": "user",
"user_pass": "user",
"root_pass": "user",
"bootloader": "limine",
"server_profile": "minimal"
}
```
Result after install: uname -r → *-1-cachyos (linux-cachyos); linux-cachyos-server not installed.
Root cause
- Headless defaults hardcode the kernel, unconditionally (installer-lib/src/installer_config.cpp, headless defaults block):
```
if (!config.kernel) {
config.kernel = "linux-cachyos";
}
```
- default_kernel is parsed into the profile struct (gucc/src/server_profiles.cpp:130, gucc/include/gucc/server_profiles.hpp:42) but is never consumed by the install flow — its only other reference is a unit test asserting the parse round-trips.
- docs/config.md doesn't mention that server installs need an explicit "kernel"; it's only demonstrated by the example server JSONs.
Suggested fix
Plumb default_kernel through the resolved server profile, then apply it in the headless defaults when the user didn't set kernel explicitly:
1. Add default_kernel to the resolved-profile struct (populated from the [server] table in resolve_server_profile).
2. Track whether kernel was user-provided at parse time (e.g. kernel_explicit).
3. In installer_config_to_inputs() after init_server_profile() succeeds:
```
if (!cfg.kernel_explicit && inputs.ctx.resolved_server
&& !inputs.ctx.resolved_server->default_kernel.empty()) {
inputs.ctx.kernel = inputs.ctx.resolved_server->default_kernel;
}
```
Minimal fallback (no plumbing): default on server_profile presence —
config.kernel = config.server_profile ? "linux-cachyos-server" : "linux-cachyos";
— and/or document in docs/config.md that server installs should set "kernel": "linux-cachyos-server".
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in installer-lib/src/installer_config.cpp at the headless defaults block, then trace init_server_profile() and installer_config_to_inputs(). Check the resolved-profile definitions in gucc/include/gucc/server_profiles.hpp and gucc/src/server_profiles.cpp, along with the existing default_kernel parsing test. Done means an explicit kernel remains unchanged and a headless server profile installs its resolved default kernel when none is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100