diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-23 22:57:21 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-23 22:57:21 -0600 |
| commit | e6b958f97ecee9d7cd18c6c295e34c34bcdb8bba (patch) | |
| tree | a2211a056012377d62f85d199b2f28f4315e5b24 /custom/lib/disk.sh | |
| parent | 79f829f25255a06ca44e1860d9ed60837cd40582 (diff) | |
| download | archangel-e6b958f97ecee9d7cd18c6c295e34c34bcdb8bba.tar.gz archangel-e6b958f97ecee9d7cd18c6c295e34c34bcdb8bba.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 'custom/lib/disk.sh')
| -rw-r--r-- | custom/lib/disk.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/custom/lib/disk.sh b/custom/lib/disk.sh index fa3dbd2..38c6dd9 100644 --- a/custom/lib/disk.sh +++ b/custom/lib/disk.sh @@ -8,10 +8,17 @@ # Partition a single disk for ZFS/Btrfs installation # Creates: EFI partition (512M) + root partition (rest) +# Uses global FILESYSTEM variable to determine partition type partition_disk() { local disk="$1" local efi_size="${2:-512M}" + # Determine root partition type based on filesystem + local root_type="BF00" # ZFS (Solaris root) + if [[ "$FILESYSTEM" == "btrfs" ]]; then + root_type="8300" # Linux filesystem + fi + info "Partitioning $disk..." # Wipe existing partition table @@ -20,8 +27,8 @@ partition_disk() { # Create EFI partition (512M, type EF00) sgdisk -n 1:0:+${efi_size} -t 1:EF00 -c 1:"EFI" "$disk" || error "Failed to create EFI partition on $disk" - # Create root partition (rest of disk, type BF00 for ZFS or 8300 for Linux) - sgdisk -n 2:0:0 -t 2:BF00 -c 2:"ROOT" "$disk" || error "Failed to create root partition on $disk" + # Create root partition (rest of disk) + sgdisk -n 2:0:0 -t 2:$root_type -c 2:"ROOT" "$disk" || error "Failed to create root partition on $disk" # Notify kernel of partition changes partprobe "$disk" 2>/dev/null || true |
