Skip to content

Fix/misc#6

Open
Firstp1ck wants to merge 3 commits intomainfrom
fix/misc
Open

Fix/misc#6
Firstp1ck wants to merge 3 commits intomainfrom
fix/misc

Conversation

@Firstp1ck
Copy link
Copy Markdown
Owner

@Firstp1ck Firstp1ck commented Mar 26, 2026

Summary

  • Add RAM detection and compute a recommended swap size (capped at 16 GiB), then use it consistently in the storage planner + partitioning service.
  • Fix install-mode package selection so desktop environments/login manager/polkit are only installed in Desktop mode (avoid “desktop package bleed” into other modes).
  • Fix legacy (non-UEFI) installs by auto-switching invalid bootloader selections (systemd-boot/efistub) to GRUB at install start.
  • Revert the legacy bootloader auto-switch if install preflight exits early (avoid silently changing the user’s selection on cancel/failure).
  • Enable sshd when the sshd server type is selected.
  • Only enable sshd when openssh is actually planned for installation (avoid enabling a missing unit).
  • Fix automatic partitioning device paths for NVMe-style disks by using the partition path helper (e.g. /dev/nvme0n1p2).
  • Update swap/disk info screens to display detected RAM and planned swap size.

Type of change

  • feat (new feature)
  • fix (bug fix)
  • docs (documentation only)
  • refactor (no functional change)
  • perf (performance)
  • test (add/update tests)
  • chore (build/infra/CI)
  • ui (visual/interaction changes in the TUI)
  • breaking change (incompatible behavior or config)

Related issues

Closes #

How to test

cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo test -- --test-threads=1
cargo run -- --dry-run
  • Logic tests added/updated: cargo test -- --test-threads=1 should cover swap sizing, legacy bootloader auto-switching, desktop package gating, and sshd enabling.
  • Extra regression coverage: validates legacy bootloader auto-switch does not persist across early returns, sshd enabling is gated on openssh, and auto partitioning uses correct NVMe partition paths.
  • Dry-run sanity:
    • Go through storage planning with swap enabled and confirm the planned swap size matches the “Detected RAM / Planned swap” text.
    • Try a legacy (non-UEFI) run (or use the firmware override if available) and confirm selecting systemd-boot/efistub ends up using GRUB.

On a live Arch ISO (when your change touches partitioning, mounts, or install): describe the disk layout and menu path you used.

Screenshots / recordings (if UI changes)

  • Optional: capture the updated swap/disk info screens showing detected RAM and planned swap size.

Checklist

Code quality

  • cargo check succeeds
  • cargo fmt --all produces no diff
  • cargo clippy --all-targets --all-features -- -D warnings is clean
  • cargo test -- --test-threads=1 passes
  • New public API or non-obvious behavior has rustdoc where it helps reviewers

Testing

  • Added or updated tests when behavior is non-trivial (storage planner, command redaction, parsing, etc.)
  • For bug fixes: reproduced first, then verified the fix (ideally with a test)

Documentation

  • Updated README.md if user-visible behavior, options, or roadmap claims changed
  • Updated Documents/ (e.g. arch_manual.md, plans) if installer steps or constraints changed

Installer safety

  • Respects --dry-run where applicable (no destructive commands without user confirmation)
  • Partitioning / LUKS / mount / pacstrap paths reviewed for wrong-device or ordering mistakes
  • No intentional breaking changes — or they are called out under Breaking changes below

Scope

  • Not a third-party packaging-only change (AUR/distros); those belong in their respective packaging repos

Notes for reviewers

  • Swap sizing uses a simple RAM-based formula and is capped at 16 GiB; UI shows both detected RAM and the planned swap size for transparency.
  • This branch also changes the crate version (0.2.3 -> 0.2.2) and removes Documents/RELEASE_v0.2.3.md. If that’s unintended, we should revert those before merging.

Breaking changes

None intended.

Additional context

N/A

sshd enabling
- fix: install desktop env packages/login manager/polkit only in Desktop
  mode
- fix: switch systemd-boot or efistub to GRUB automatically on legacy
  (non-UEFI)
- fix: enable sshd service when the `sshd` server type is selected
- test: add regression tests for desktop bleed, legacy GRUB switching,
  and sshd enablement
- feat: detect system RAM and compute recommended swap size (max 16GiB)
- change: use dynamic swap size in storage planner and partitioning
  service
- change: show detected RAM and planned swap size in swap + disk info
  screens
- test: add swap sizing formula tests
@Firstp1ck Firstp1ck self-assigned this Mar 26, 2026
Copilot AI review requested due to automatic review settings March 26, 2026 22:08
@Firstp1ck Firstp1ck added bug Something isn't working enhancement New feature or request labels Mar 26, 2026
Copy link
Copy Markdown
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 improves installer correctness and UX by introducing RAM-based swap sizing (used consistently across planning/partitioning/UI), tightening package selection based on install mode, and adding install-time safety fixes (legacy bootloader auto-correction, sshd enablement) with accompanying logic tests.

Changes:

  • Detect RAM and compute a recommended swap size (capped), then use it across storage planning/partitioning and display it in the TUI.
  • Gate desktop environment/login manager/polkit packages to Desktop mode only.
  • Auto-switch invalid legacy bootloader selections to GRUB and enable sshd when the sshd server type is selected; add/extend logic tests.

Reviewed changes

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

Show a summary per file
File Description
tests/logic.rs Adds logic tests for sshd enablement, desktop package gating, legacy bootloader auto-switching, and swap sizing formula.
src/render/sections/info/swap.rs Displays detected RAM and planned swap size in the swap info panel.
src/render/sections/info/disks.rs Shows planned swap size in the planned disk layout preview.
src/core/storage/planner.rs Uses swap_size_mib to size the planned swap partition and adjust root start.
src/core/state.rs Adds detected_ram_mib and swap_size_mib to app state and initializes them at startup.
src/core/services/system.rs Prevents desktop-only packages (DE/LM/polkit) from being included outside Desktop mode.
src/core/services/sysconfig.rs Enables sshd based on selected server type.
src/core/services/partitioning.rs Uses swap_size_mib for swap end calculation in the legacy partitioning service.
src/common/utils.rs Adds /proc/meminfo RAM detection and swap sizing helper function.
src/app/swap_partition.rs Displays detected RAM and planned swap size on the swap screen.
src/app/install/flow.rs Auto-corrects legacy bootloader selection to GRUB at install start.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- fix: revert legacy bootloader auto-correction when install exits early
- fix: enable sshd only when openssh is planned for installation
- fix: use partition path helper in auto partitioning for NVMe-style
  devices
- test: add regression tests for early-return bootloader revert, sshd
  gating, and NVMe partition paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants