From e6b958f97ecee9d7cd18c6c295e34c34bcdb8bba Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 23 Jan 2026 22:57:21 -0600 Subject: 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) --- custom/lib/disk.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'custom/lib/disk.sh') 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 -- cgit v1.2.3