aboutsummaryrefslogtreecommitdiff
path: root/custom/lib/disk.sh
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 /custom/lib/disk.sh
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 'custom/lib/disk.sh')
-rw-r--r--custom/lib/disk.sh11
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