aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-23 22:57:21 -0600
committerCraig Jennings <c@cjennings.net>2026-01-23 22:57:21 -0600
commite4ee55f9706d5567f45b6b4f6f007c09709fdfea (patch)
tree93b017f7d3b8c76c752e25b2e7c380019bc33355 /docs
parent4560cbdc55e6bd5abe643806e4115d67313db564 (diff)
downloadarchangel-e4ee55f9706d5567f45b6b4f6f007c09709fdfea.tar.gz
archangel-e4ee55f9706d5567f45b6b4f6f007c09709fdfea.zip
Phase 2.1: Implement btrfs support
- Create lib/btrfs.sh with full btrfs installation functions - Subvolume layout matching ZFS datasets (10 subvols) - Snapper configuration with timeline policy - GRUB + grub-btrfs for snapshot boot menu - Update disk.sh for filesystem-aware partition type - Update archangel with install_btrfs() path - Update build.sh to include lib/btrfs.sh - Update plan with Phase 2.7 (test) and 2.8 (LUKS)
Diffstat (limited to 'docs')
-rw-r--r--docs/PLAN-archangel-btrfs.org34
-rw-r--r--docs/session-context.org101
2 files changed, 69 insertions, 66 deletions
diff --git a/docs/PLAN-archangel-btrfs.org b/docs/PLAN-archangel-btrfs.org
index ea39bf6..9d91db7 100644
--- a/docs/PLAN-archangel-btrfs.org
+++ b/docs/PLAN-archangel-btrfs.org
@@ -98,7 +98,14 @@ BTRFS_OPTS="noatime,compress=zstd,space_cache=v2,discard=async"
- [ ] Verify appears in snapper list
- [ ] Verify appears in GRUB menu
-** 2.7 LUKS encryption (optional)
+** 2.7 Test basic btrfs (before encryption)
+- [ ] VM test: single-disk btrfs install
+- [ ] Verify subvolumes created correctly
+- [ ] Verify GRUB boots and shows snapshots
+- [ ] Verify snapper works
+- [ ] Verify genesis snapshot exists
+
+** 2.8 LUKS encryption (after basic btrfs works)
- [ ] Add encryption prompt (yes/no)
- [ ] Create LUKS container on root partition
- [ ] Configure crypttab
@@ -107,20 +114,31 @@ BTRFS_OPTS="noatime,compress=zstd,space_cache=v2,discard=async"
* Phase 3: Multi-disk Btrfs
-Goal: Mirror support for btrfs.
+Goal: Full multi-disk support for btrfs (matching ZFS capabilities).
-** 3.1 Btrfs RAID1 creation
-- [ ] Detect multi-disk selection
-- [ ] Create raid1 volume: mkfs.btrfs -d raid1 -m raid1 /dev/sdX /dev/sdY
-- [ ] Handle 2+ disk configurations
+** 3.1 RAID level support
+- [ ] Stripe (raid0): mkfs.btrfs -d raid0 -m raid0
+- [ ] Mirror (raid1): mkfs.btrfs -d raid1 -m raid1
+- [ ] raid10: mkfs.btrfs -d raid10 -m raid10 (4+ disks)
+- [ ] raid5: mkfs.btrfs -d raid5 -m raid5 (3+ disks, warn: unstable)
+- [ ] raid6: mkfs.btrfs -d raid6 -m raid6 (4+ disks, warn: unstable)
+- [ ] Detect multi-disk selection and offer appropriate levels
+- [ ] Handle mixed disk sizes gracefully
-** 3.2 EFI redundancy
+** 3.2 Encryption + multi-disk
+- [ ] LUKS on each disk before btrfs
+- [ ] crypttab entries for all disks
+- [ ] Test unlock sequence at boot
+- [ ] Single passphrase unlocks all (keyfile approach)
+
+** 3.3 EFI redundancy
- [ ] Create EFI partition on all disks
- [ ] Install GRUB to all EFI partitions
- [ ] Create boot entries for each disk
-** 3.3 Degraded boot support
+** 3.4 Degraded boot support
- [ ] Add degraded mount option for emergency
+- [ ] Kernel param: rootflags=degraded
- [ ] Document recovery procedure
* Phase 4: Testing Infrastructure
diff --git a/docs/session-context.org b/docs/session-context.org
index f441e89..66a1ae0 100644
--- a/docs/session-context.org
+++ b/docs/session-context.org
@@ -11,67 +11,52 @@
- Checked for conflicts: pwnerfly/Archangel is dead (2020, 0 stars, no license)
- Name is clear for use
-** Work Completed
-
-*** 1. Btrfs Implementation Planning
-- Created docs/PLAN-archangel-btrfs.org with 6-phase implementation
-- Expanded testing validation checks in research doc
-- Decided: snapper for snapshots, GRUB for btrfs boot
-
-*** 2. Phase 1: Refactor (COMPLETE)
-**** Phase 1.1: lib/ Structure
-Created modular library structure:
-- [X] custom/lib/common.sh - output, validation, fzf prompts, filesystem selection
-- [X] custom/lib/config.sh - argument parsing, config loading
-- [X] custom/lib/disk.sh - partitioning, disk selection
-- [X] custom/lib/zfs.sh - ZFS pool, datasets, services
-
-**** Phase 1.4: Filesystem Selection
-- [X] Added FILESYSTEM variable (zfs/btrfs)
-- [X] Added select_filesystem() with fzf prompt
-- [X] Btrfs selection shows "not yet implemented"
-- [X] Config file supports FILESYSTEM option
+*** Btrfs Implementation Approach
+- Phase 2: Single-disk btrfs, no encryption (test first)
+- Phase 2.7: Test basic btrfs before adding encryption
+- Phase 2.8: LUKS encryption after basic btrfs works
+- Phase 3: Multi-disk (stripe, mirror, raidX) + encrypted/unencrypted
-**** Phase 1.5: Rename to archangel
-- [X] Renamed install-archzfs → archangel
-- [X] Updated build.sh references
-- [X] Updated config example to archangel.conf.example
-- [X] Updated script headers
+*** Partition Type Handling
+- disk.sh checks global FILESYSTEM variable
+- ZFS: BF00 (Solaris root)
+- Btrfs: 8300 (Linux filesystem)
-*** 3. Bug Fix: set -e compatibility
-Found and fixed critical bug during VM testing:
-- [[ condition ]] && error pattern fails with set -e
-- Fixed by converting to if/then/fi pattern
-
-*** 4. VM Test PASSED
-Full end-to-end test:
-- ISO built with lib/ structure
-- Unattended install completed
-- ZFSBootMenu boots correctly
-- Genesis snapshots created
-- System fully functional
-
-** Commits This Session (11 total)
-- 94c2f15: Add archsetup --chroot task
-- 49a8b2e: Add btrfs implementation plan
-- d8eb81a: Expand testing validation checks
-- 15ac415: Phase 1.1 - Create lib/ directory structure
-- 498ab4d: Fix build.sh to include lib/ in ISO
-- c74b1d7: Fix set -e compatibility in lib functions
-- 0f56f1f: Update session context
-- 7cfdc69: Phase 1.1 complete: VM test passed
-- b8973f3: Phase 1.4 - Add filesystem selection prompt
-- 18c07ee: Phase 1.5 - Rename to archangel
-
-** Phase 1 Status: COMPLETE
+** Work Completed
-** Next Steps (Phase 2: Btrfs Support)
-1. Create lib/btrfs.sh with btrfs functions
-2. Implement subvolume creation
-3. Implement snapper configuration
-4. Implement GRUB + grub-btrfs
-5. Test btrfs installation
+*** 1. Phase 1: Refactor (COMPLETE)
+- [X] lib/common.sh, config.sh, disk.sh, zfs.sh created
+- [X] Filesystem selection prompt
+- [X] Renamed to archangel
+- [X] VM test passed
+
+*** 2. Phase 2: Btrfs Support (IN PROGRESS)
+**** Phase 2.1: lib/btrfs.sh (COMPLETE)
+- [X] Created lib/btrfs.sh with full implementation
+- [X] BTRFS_OPTS: noatime,compress=zstd,space_cache=v2,discard=async
+- [X] 10 subvolumes matching ZFS dataset layout
+- [X] Mount functions with proper options
+- [X] fstab generation (subvol= NOT subvolid!)
+- [X] Snapper configuration (timeline policy)
+- [X] GRUB + grub-btrfs configuration
+- [X] Genesis snapshot via snapper
+
+**** Updated Files
+- [X] disk.sh - filesystem-aware partition type
+- [X] archangel - sources btrfs.sh, install_btrfs() path
+- [X] build.sh - includes lib/btrfs.sh permissions
+- [X] PLAN-archangel-btrfs.org - added Phase 2.7/2.8
+
+**** Syntax Checks
+- [X] All lib/*.sh pass bash -n
+- [X] archangel passes bash -n
+- [X] All btrfs functions defined correctly
+
+** Next Steps
+1. Commit Phase 2.1 implementation
+2. Build ISO
+3. VM test btrfs installation path
** Notes
- Craig on remote console: 30 lines tall, ~145 columns wide
-- Craig stepped away ~17:23, working autonomously
+- Testing approach: syntax first, then full VM test