diff --git a/.gitignore b/.gitignore index 376bdbd5..c628a285 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ requirements.txt /cmd_output.txt node_modules/ uv.lock +/docs/mddos/.obsidian diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..08ab8411 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,97 @@ +# MDDOS Installer Development Guide for AI SWE Agents + +This is a Python 3.10+ CLI application, heavily forked from `archinstall`. It uses the built-in `curses` library for its TUI, and relies on strict type hinting. It is designed to be a secure, bare-bones Arch Linux installer that strictly sets up Hyprland + Quickshell, locking down other options to provide a predictable environment for a subsequent post-install wizard. + +Read more about the purpose and business logic of the app in `docs/obsidian/1.1.prd-installer-mvp.md` and `docs/obsidian/1.2.wbs-installer-mvp.md`. + +## Python Environment + +This project requires Python 3.10+. Assume the virtual environment is already activated in the agent environment. If starting fresh, activate it with: + +```bash +python -m venv venv && source venv/bin/activate +``` + +Dependencies are managed via `pip`. Install from `requirements.txt` for runtime deps. **Do not add new dependencies to `pyproject.toml` or `requirements.txt` without explicit user authorization.** Prioritize Python standard libraries to maintain a minimal, secure attack surface. + +## Commands + +- `sudo python -m archinstall --dry-run`: Runs the installer in dry-run mode. **Scope of dry-run:** This flag safely skips all destructive side effects, including disk formatting, `pacstrap` package installation, and `chroot` operations. It only simulates the workflow, outputs the TUI, and writes the `user_configuration.json` and logs to `/var/log/archinstall/`. +- `sudo python -m archinstall`: Runs the full destructive installer. + +Always use `--dry-run` when iterating. If a real installation fails mid-way, there is no automatic rollback — the system will be left in a dirty state (partitions mounted at `/mnt`, partially installed packages). Recovery requires `umount -R /mnt` and wiping affected partitions, or rebooting the live environment. + +## Validation Pipeline (Linting & Formatting) + +After editing any file, run the following in exact order. All must pass before presenting a solution: + +1. `ruff format .` +2. `ruff check --fix .` +3. `mypy .` + +This project strictly uses Ruff for linting/formatting and Mypy for static type analysis. Use your judgement for linter violations that are not auto-fixable, but never ignore typing errors. + +## Testing + +- **Unit tests (fast):** `pytest` +- **System testing (simulated):** `sudo python -m archinstall --dry-run` +- **Quality Gate:** All existing tests must pass before considering a task complete. Avoid silent regressions. + +Because this is a `curses`-based TUI, standard interactive testing does not apply. Rely on verifying data model logic, testing isolated functions, and `pytest`. Use individual Python scripts or `pdb` for tracing complex state. + +**Give-Up Condition:** If an issue cannot be resolved within 3 isolated test attempts, stop and ask the user for architectural clarification to avoid hallucination loops and wasted context. + +## Debugging + +When investigating a problem, follow this sequence: + +1. Restate the problem clearly. +2. List the likely causes. +3. Suggest small, targeted tests to isolate the cause. +4. Only then propose a fix. + +The following log files are available to aid investigation: + +- `/var/log/archinstall/install.log` — full installer log. +- `/var/log/archinstall/cmd_history.txt` — every shell command that was triggered. +- `/var/log/archinstall/cmd_output.txt` — stdout from those commands. + +You can also run specific files directly or drop into `pdb` for complex state inspection. + +## Architecture + +Key files and what they own: + +- `archinstall/lib/menu/global_menu.py` — main TUI entry point. Implements the strict 7-step hierarchy that guides the user without overwhelming them. +- `archinstall/lib/command.py` — defines `SysCommand`, which **must** be used for all shell commands. Bypassing it (e.g., with `subprocess.run`) means commands go unlogged, breaking the `cmd_history.txt` audit trail and destroying the post-install wizard's ability to reconstruct what the base installer did. +- `archinstall/lib/installer.py` — core `pacstrap` and `chroot` logic. Also responsible for exporting the `mddos_config.json` handoff file to the newly installed filesystem. +- `archinstall/lib/models/` — data classes that hold TUI selections, enforcing strict typing before execution. **When modifying configuration exports like `mddos_config.json`, strictly adhere to the schemas defined in `docs/obsidian/schema.md` or validate against `models/config_schema.py`. Do not guess or hallucinate JSON schemas.** +- `archinstall/default_profiles/` — profile configurations. Aggressively pruned to Hyprland only, to minimize attack surface and maintenance burden. + +## TUI Patterns + +Avoid writing raw `curses` code. Build all UI on the `archinstall.tui` abstraction layer, using classes like `Selection` and `Confirmation` handlers. + +For a concrete example, see `archinstall/lib/general/system_menu.py` → `select_kernel()`: it shows how to initialize `Selection[str]` with `multi=True` for a checkbox list and how `MenuItemGroup` captures user selections. + +We value code that explains itself through clear class, method, and variable names. Comments should be used only when necessary to explain tricky logic. + +## Agent Behavior + +- Default behavior is analysis, not implementation. Never write code unless explicitly requested. +- If unsure, ask for clarification before proceeding. +- Act as a senior pair programmer: explain reasoning before proposing solutions, challenge assumptions, and suggest minimal changes first. + +## Git + +Agents operate read-only. Do not create commits, push, merge, or modify branches unless given explicit authorization. No git authentication is available in this environment — do not run any command that could prompt for credentials. + +The full branching strategy and contribution workflow for human developers is documented in `CONTRIBUTING.md`. + +### What Agents Must Never Do + +- Force-push to `main` or `dev`. +- Commit directly to `main`. +- Run `git merge upstream/main` on `dev` or `main` without a dedicated sync branch. +- Leave merge conflict markers (`<<<<<<<`) in any committed file. +- Perform write operations on any git remote. diff --git a/docs/obsidian/.obsidian/app.json b/docs/obsidian/.obsidian/app.json new file mode 100644 index 00000000..6abe4c13 --- /dev/null +++ b/docs/obsidian/.obsidian/app.json @@ -0,0 +1,3 @@ +{ + "alwaysUpdateLinks": true +} \ No newline at end of file diff --git a/docs/obsidian/.obsidian/appearance.json b/docs/obsidian/.obsidian/appearance.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/docs/obsidian/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/docs/obsidian/.obsidian/core-plugins.json b/docs/obsidian/.obsidian/core-plugins.json new file mode 100644 index 00000000..639b90da --- /dev/null +++ b/docs/obsidian/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/docs/obsidian/.obsidian/graph.json b/docs/obsidian/.obsidian/graph.json new file mode 100644 index 00000000..f428fa5e --- /dev/null +++ b/docs/obsidian/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 1.5, + "close": true +} \ No newline at end of file diff --git a/docs/obsidian/.obsidian/workspace.json b/docs/obsidian/.obsidian/workspace.json new file mode 100644 index 00000000..aca8d67f --- /dev/null +++ b/docs/obsidian/.obsidian/workspace.json @@ -0,0 +1,210 @@ +{ + "main": { + "id": "ff964cbb24b6a106", + "type": "split", + "children": [ + { + "id": "be28debe6be1b9f9", + "type": "tabs", + "children": [ + { + "id": "8b5aa394785f8060", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "1.1.spec-installer-mvp.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "1.1.spec-installer-mvp" + } + }, + { + "id": "dd0761072c65fe39", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "1.2.wbs-installer-mvp.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "1.2.wbs-installer-mvp" + } + } + ], + "currentTab": 1 + } + ], + "direction": "vertical" + }, + "left": { + "id": "e178b3d2f620a696", + "type": "split", + "children": [ + { + "id": "32ef759a1e75bfd6", + "type": "tabs", + "children": [ + { + "id": "39fa0c0c1d6aa8e0", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Files" + } + }, + { + "id": "9157774ef6f11544", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "Search" + } + }, + { + "id": "855bc9e1ce646f35", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "8e60dc6132c695a0", + "type": "split", + "children": [ + { + "id": "a324f968f11a42ea", + "type": "tabs", + "children": [ + { + "id": "288996fc2726e266", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "Welcome.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "Backlinks for Welcome" + } + }, + { + "id": "47663b42dfe7f193", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "Welcome.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "Outgoing links from Welcome" + } + }, + { + "id": "727458eabbab986b", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Tags" + } + }, + { + "id": "0c3f80ff00a854b9", + "type": "leaf", + "state": { + "type": "all-properties", + "state": { + "sortOrder": "frequency", + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-archive", + "title": "All properties" + } + }, + { + "id": "b4c350951ece0ee4", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "Welcome.md", + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "Outline of Welcome" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Open quick switcher": false, + "graph:Open graph view": false, + "canvas:Create new canvas": false, + "daily-notes:Open today's daily note": false, + "templates:Insert template": false, + "command-palette:Open command palette": false, + "bases:Create new base": false + } + }, + "active": "dd0761072c65fe39", + "lastOpenFiles": [ + "0.0.index.md", + "1.2.wbs-installer-mvp.md", + "1.1.spec-installer-mvp.md", + "CLAUDE.md", + "0.1.archinstall-stack.md", + "Welcome.md" + ] +} \ No newline at end of file diff --git a/docs/obsidian/0.0.index.md b/docs/obsidian/0.0.index.md new file mode 100644 index 00000000..5058e4a5 --- /dev/null +++ b/docs/obsidian/0.0.index.md @@ -0,0 +1,17 @@ +# MDDOS Installer Documentation + +Welcome to the documentation for the `mddosinstall` project, a secure, barebones fork of `archinstall` tailored for a Hyprland + Quickshell experience. + +## Index + +### 0. Architecture & System Design +* [[0.1.archinstall-stack]] - Analysis of the original `archinstall` codebase, detailing what to keep, modify, or delete to achieve the MVP goals. + +### 1. MVP Planning & Requirements +* [[1.1.spec-installer-mvp]] - Product Requirements Document (PRD) detailing the strict menu hierarchy, default configurations, and security constraints for the MVP. +* [[1.2.wbs-installer-mvp]] - Work Breakdown Structure (WBS) dividing the PRD into actionable, chronological development phases. + + + +--- +*Note: This documentation uses Obsidian-flavored Markdown with wikilinks for easy navigation between files.* diff --git a/docs/obsidian/0.1.archinstall-stack.md b/docs/obsidian/0.1.archinstall-stack.md new file mode 100644 index 00000000..a5795cc7 --- /dev/null +++ b/docs/obsidian/0.1.archinstall-stack.md @@ -0,0 +1,68 @@ +# System Design: Archinstall Stack Analysis + +This document evaluates the existing `archinstall` codebase architecture in the context of the new `mddosinstall` MVP goals (a stripped-down, secure, barebones Hyprland + quickshell installer). + +## 1. Requirements & Constraints +* **Functional:** The system must install Arch Linux, specifically configuring zram, systemd-boot (quiet+plymouth), NetworkManager, greetd, and a Hyprland profile. +* **Non-functional:** The codebase must be maintainable, minimizing technical debt by aggressively pruning unused profiles, applications, and legacy TUI menus. +* **Constraints:** The system is an offline/live-environment installer script, built entirely in Python using curses/TUI for user interaction. + +## 2. High-Level Architectural Flow +1. **Entry Point (`main.py`):** Parses arguments, initializes logging, and invokes the TUI. +2. **TUI/UI Layer (`archinstall/tui/` and `archinstall/lib/menu/`):** Manages the curses-based menus where the user configures the system. +3. **Data Models (`archinstall/lib/models/`):** Holds the state of the user's choices (Disk, Network, Profile, etc.). +4. **Hardware/System Abstraction (`archinstall/lib/`):** Executes shell commands via `archinstall.lib.command.SysCommand` to interact with Pacstrap, systemd, and disk utilities. +5. **Execution (`archinstall/lib/installer.py`):** Consumes the configuration models to mount disks, pacstrap base packages, chroot in, configure the bootloader, and export the logs/handoff data. + +## 3. Deep Dive: Component Stack Analysis + +Below is an analysis of each major module/directory in the `archinstall` stack, its original intent, and the architectural decision (Keep, Modify, or Delete) for the MVP. + +### 3.1. Core Engine & Entry Points +| Component | Original Intent | Decision | Notes | +| :--- | :--- | :--- | :--- | +| `archinstall/main.py` | Primary entry point, argument parsing, main execution loop. | **Modify** | Simplify the CLI arguments if necessary, wire it to the new 7-step hierarchical global menu. | +| `archinstall/lib/installer.py` | The main `Installer` class that handles the `pacstrap` and `chroot` logic. | **Modify** | Needs modifications for Phase 5 (Post-Install Handoff) to ensure `mddos_config.json` and logs are safely copied to `/etc/mddos/`. | +| `archinstall/lib/command.py` | Wrapper for executing and logging shell commands (`SysCommand`). | **Keep** | Essential for our `cmd_history.txt` and `install.log` requirements. | +| `archinstall/lib/hardware.py` | Hardware detection (CPU microcode, Graphics cards). | **Keep** | Required for the automatic ucode injection and the NVIDIA driver warning fallback. | + +### 3.2. User Interface (TUI & Menus) +| Component | Original Intent | Decision | Notes | +| :--- | :--- | :--- | :--- | +| `archinstall/tui/` | The curses framework building blocks (checkboxes, inputs, lists). | **Keep** | Core UI library. We will heavily reuse the checkbox list components. | +| `archinstall/lib/menu/global_menu.py` | The main menu the user sees. | **Modify** | Complete rewrite required (Phase 1) to implement the 7-step hierarchy (Locales, Disk, System, Auth, Profile, Advanced, Install). | +| `archinstall/lib/general/system_menu.py` | Handles kernel, audio, etc. | **Modify** | Strip old options, implement `systemd-boot` defaults, zram swap, and pacman checkboxes. | + +### 3.3. Profiles & Applications (The "Bloat") +| Component | Original Intent | Decision | Notes | +| :--- | :--- | :--- | :--- | +| `archinstall/default_profiles/desktops/` | JSON configs for GNOME, KDE, XFCE, Sway, etc. | **Delete** | Nuke everything except a customized `hyprland.json` to enforce the Secure Barebones MVP. | +| `archinstall/default_profiles/servers/` | JSON configs for web servers, database servers. | **Delete** | Not relevant to a Hyprland desktop installer. | +| `archinstall/lib/profile/` | Logic for parsing and installing desktop profiles. | **Modify** | Hardcode the Hyprland lock and display the "More desktop environments will be given support later" tooltip. | +| `archinstall/applications/` | Helper scripts to install generic apps (like tailscale, docker, etc.). | **Delete** | The PRD explicitly defers "Additional packages" to the post-install wizard. This folder can be purged. | + +### 3.4. System Configuration Modules +| Component | Original Intent | Decision | Notes | +| :--- | :--- | :--- | :--- | +| `archinstall/lib/disk/` | Disk partitioning, BTRFS, LUKS, formatting logic. | **Keep** | The PRD states disk configuration will be kept the same. Excellent, battle-tested code. | +| `archinstall/lib/bootloader/` | GRUB, systemd-boot, Limine logic. | **Modify** | Enforce `systemd-boot (quiet + plymouth)` as the default. Strip GRUB if deemed unnecessary for modern UEFI systems (optional, but recommended for simplicity). | +| `archinstall/lib/network/` | NetworkManager, iwd, systemd-networkd configurators. | **Keep / Modify** | Keep NetworkManager logic, ensure it defaults to NM instead of systemd-networkd as per PRD. | +| `archinstall/lib/authentication/` | Users, passwords, sudo, polkit setups. | **Modify** | Implement the `Lock root account` logic and dynamic UI disabling (Phase 3). | + +### 3.5. Auxiliaries +| Component | Original Intent | Decision | Notes | +| :--- | :--- | :--- | :--- | +| `archinstall/locales/` | Language translations. | **Keep** | Internationalization is good, even if the default is English. | +| `archinstall/scripts/` | Standalone example scripts or test harnesses. | **Delete** | Mostly clutter for an opinionated fork. | + +## 4. Scale and Reliability +* **Scale:** Does not apply to a local installer script. +* **Reliability:** By strictly limiting the Desktop Environments (Hyprland only) and Display Managers (greetd only), we drastically reduce the state-space of potential failures. The system is inherently more reliable than upstream `archinstall`. + +## 5. Trade-off Analysis +* **Trade-off 1 (Flexibility vs. Maintenance):** Deleting 90% of the `default_profiles/` and `applications/` severely limits user choice during the install phase. However, it guarantees a predictable baseline system for the post-install wizard, reducing developer maintenance burden by orders of magnitude. +* **Trade-off 2 (Root Account Locking):** Defaulting to locking the root account prevents users from relying on legacy root logins. The trade-off is they *must* ensure their primary user has correct sudo/polkit permissions, which `archinstall` currently handles reasonably well but must be thoroughly tested. + +## 6. Output & Revisit Strategy +* As the system grows, we will need to revisit `archinstall/lib/profile/` to re-introduce other environments (Sway, KDE) once the base architecture proves stable. +* The immediate next step is to begin systematically deleting the `Delete` components to clean the workspace, followed by refactoring the `global_menu.py`. diff --git a/docs/obsidian/1.1.spec-installer-mvp.md b/docs/obsidian/1.1.spec-installer-mvp.md new file mode 100644 index 00000000..1fa1e304 --- /dev/null +++ b/docs/obsidian/1.1.spec-installer-mvp.md @@ -0,0 +1,102 @@ +# Goal + +Fork `archinstall` into a secure bare-bones `hyprland` + `quickshell` installer. The identity of the project will be designed later on. + +# System + +## Menu order + +The installer will be shown as an hierarchical menu with the following design: + - Locales + - Disk + - System + - Authentication + - Profile + - Advanced + - Install/Cancel + +The general idea is to keep it simple and intuitive, leaving each task grouped with what's relevant. Every application or setting that may break low-level dependencies will be left in the advanced tab, such as boot loaders, network application, sound, and desktop environment. It is important to mention that any customization such as applications, shell, plugins, and dot-files will have a guided user interface out-of-the-box wizard for the post install designed after the conclusion of this installer. The section "Additional packages" purpose will be fulfilled in the post install wizard, but in a more opinionated way and integrated with hyprland, and a log with the configuration will be passed to it also, so there will be the possibility of automated installs. + +## Locales + +This section will have 7 topics: +- Installer language - _English_ +- Keyboard layout - _us_ +- Locale language - _en_US.UTF-8_ +- Locale encoding - _UTF-8_ +- Mirrors + - Select regions + - Add custom servers +- Timezone - _UTC_ +- Automatic time sync (NTP) - _Yes_ + +All topics regarding geographic specific configuration + NTP (partially related) was kept in this section + +## Disk + +The disk configuration will be kept the same way, since the `archinstall` default is already good. + +## System + +This section will have 6 options: +- Kernels - _linux_ +- Bootloader + - Bootloader - _systemd-boot (quiet + plymouth)_ ¹ + - Unified kernel images (UKI) - _Yes_ +- Swap - _zram: Yes_; _zstd_ +- Pacman² - _ParallelDownloads, ILoveCandy, and Colors _ +- Optional repositories +- Add custom repositories + +Modifications: + ¹ extra options: systemd-boot (quiet) and systemd-boot (quiet + plymouth). + ² extra options and refactored into check-boxes: ParallelDownloads and ILoveCandy + +All topics regarding package manager + kernel + swap have been unified in this section. + +## Authentication + +This section will have 5 options: + - Hostname + - Lock root account - _Yes_ ¹ + - Root password - (If "Lock root account" is Yes, then this option will be disabled, which is the default) + - User accounts + - U2F login setup + +Modifications: + ¹ For security purposes, the Lock root password section has been added and defaulted to Yes. + +## Profile + +This section will have 3 options: +- Desktop enviroment - _Hyprland (polkit + quickshell)_ ¹ +- Graphics drivers - _All open-source (NVIDIA users are prompted to change)_ +- Greeter - _greetd_ ² + +Modifications: + ¹ All desktop enviroments will be removed or debloated. For now, only hyprland will be mantained, With a minimal quickshell and polkit configuration. Later on the project more DEs and shells might be added. The user will see the option disabled, with the list of dependencies, and a message: "More desktop environments will be given support later" + ² Greeter will be also locked, so themes can be supported and officially mantained. The user will see the option disabled, with the list of dependencies, and a message: "More greeters will be given support later" + +The section has been simplified, to allow only supported DEs. + +## Advanced + +A header will be displayed on top of the TUI: This section contains only dependency sensitive options. + +This section will have 5 options: +- Bluetooth - _Yes_ +- Audio - _pipewire_ +- Print service - _No_ +- Firewall - _ufw_ +- Network - _Network Manager (default backend)_ + +All services that hyprland/quickshell rely on will be placed here. + +## Logging + +To ensure that the installation can be debugged and that the post-install wizard can operate smoothly, the installer will generate three specific logs: +1. **User Configuration (`user_configuration.json`):** A JSON file containing all the options chosen by the user during the TUI prompts. +2. **Command History (`cmd_history.txt`):** A sequential log of the exact shell commands executed by the installer (input only). +3. **Terminal Output (`install.log` / `cmd_output.txt`):** A comprehensive log capturing both the commands run and their corresponding terminal output/errors. + +*(Note: `archinstall` already implements all three natively via `cmd_history.txt`, `cmd_output.txt`/`install.log`, and `user_configuration.json` inside `/var/log/archinstall/`)*. \ No newline at end of file diff --git a/docs/obsidian/1.2.wbs-installer-mvp.md b/docs/obsidian/1.2.wbs-installer-mvp.md new file mode 100644 index 00000000..56e47584 --- /dev/null +++ b/docs/obsidian/1.2.wbs-installer-mvp.md @@ -0,0 +1,75 @@ +# Work Breakdown Structure (WBS): Installer MVP + +This document breaks down the implementation of the [[1.1.spec-installer-mvp]] into actionable development tasks. It is structured chronologically to guide the modification of the `archinstall` codebase. + +## Phase 1: Project Initialization & Core TUI Restructuring +**Goal:** Establish the new hierarchical menu foundation without altering backend logic yet. + +- [ ] **1.1 Main Menu Redesign:** Refactor `archinstall/lib/global_menu.py` (or equivalent entry point) to replace the flat menu with the 7-step hierarchy: + - Locales + - Disk + - System + - Authentication + - Profile + - Advanced + - Install/Cancel +- [ ] **1.2 Category Relocation:** Map existing `archinstall` menus into the new structure. + - Move Timezone, NTP, and Mirrors into `Locales`. + - Move Bootloader, Kernels, and Swap into `System`. + - Move Network, Audio, and Bluetooth into `Advanced`. +- [ ] **1.3 TUI Headers:** Add the descriptive header to the Advanced menu: *"This section contains only dependency sensitive options."* + +## Phase 2: System & Pacman Enhancements +**Goal:** Implement the new system defaults and UI checkboxes. + +- [ ] **2.1 Bootloader Options:** + - Add `systemd-boot (quiet)` and `systemd-boot (quiet + plymouth)` to the bootloader selection. + - Set `systemd-boot (quiet + plymouth)` as the default. +- [ ] **2.2 Swap Configuration:** + - Change the default swap implementation to `zram`. + - Set the default compression algorithm for zram to `zstd`. +- [ ] **2.3 Pacman Checkboxes:** + - Refactor the Pacman configuration menu to use `archinstall`'s existing CLI checkbox list helper. + - Include options: `ParallelDownloads`, `ILoveCandy`, and `Colors`. + - Enable all three by default. + +## Phase 3: Authentication & Security Lockdown +**Goal:** Implement the secure-by-default user configuration. + +- [ ] **3.1 Lock Root Account UI:** + - Add a "Lock root account" boolean toggle (Default: `Yes`). + - Implement UI state logic: If "Lock root account" is `Yes`, dynamically gray out/disable the "Root password" input field. +- [ ] **3.2 Lock Root Backend:** Ensure the installer runs `arch-chroot /mnt passwd -l root` (or equivalent lock command) in the chroot if the toggle is enabled. +- [ ] **3.3 U2F Menu:** Ensure "U2F login setup" is clearly labeled and accessible in the Authentication menu. + +## Phase 4: Profile & Advanced Pruning +**Goal:** Enforce the "Secure Barebones" constraints, locking the system to Hyprland and Greetd. + +- [ ] **4.1 Desktop Environment Lock:** + - Hardcode the DE option to `Hyprland (polkit + quickshell)`. + - Disable user interaction for this field. + - Display the tooltip/message: *"More desktop environments will be given support later"*. + - Strip/Delete other profile configs (GNOME, KDE, etc.) from `archinstall/default_profiles/` to reduce bloat. +- [ ] **4.2 Greeter Lock:** + - Hardcode the Greeter option to `greetd`. + - Disable user interaction for this field. + - Display the tooltip/message: *"More greeters will be given support later"*. +- [ ] **4.3 Graphics Drivers:** + - Set default to `All open-source`. + - Verify that the existing `archinstall` NVIDIA prompt logic remains intact so NVIDIA users are warned to switch to proprietary drivers. +- [ ] **4.4 Advanced Defaults:** Hardcode the following default selections: + - Bluetooth: `Yes` + - Audio: `pipewire` + - Print service: `No` + - Firewall: `ufw` + - Network: `Network Manager` (default backend) + +## Phase 5: Post-Install Handoff Integration +**Goal:** Cleanly pass installation metadata to the future post-install wizard. + +- [ ] **5.1 Remove "Additional Packages":** Strip the generic extra packages prompt from the base installer to prevent user-induced dependency conflicts. +- [ ] **5.2 Export Configuration & Command Logs:** + - Modify the final installation hook in `archinstall/lib/installer.py`. + - Ensure the user's configuration choices (`user_configuration.json`), the command history (`cmd_history.txt`), and the full terminal output (`install.log` / `cmd_output.txt`) are dumped into a persistent directory in the newly installed system (e.g., `/etc/mddos/installer-handoff/`). + - Verify that all three native `archinstall` logging mechanisms correctly output to this handoff directory. +- [ ] **5.3 Automated Install Hook (Optional/Prep):** Ensure the exported log is structured in a way that allows the post-install wizard to run headlessly for automated setups.