class Getch::FileSystem::Zfs::Partition
Public Class Methods
new()
click to toggle source
Calls superclass method
Getch::FileSystem::Zfs::Device::new
# File lib/getch/filesystem/zfs/partition.rb, line 5 def initialize super @clean = Getch::FileSystem::Clean @partition = Getch::FileSystem::Partition.new @state = Getch::States.new() @log = Getch::Log.new() run_partition end
Public Instance Methods
run_partition()
click to toggle source
# File lib/getch/filesystem/zfs/partition.rb, line 14 def run_partition return if STATES[:partition ] @clean.old_zpool @clean.hdd(@disk) @clean.external_disk(@disk, @boot_disk, @cache_disk, @home_disk) partition cache @state.partition end
Private Instance Methods
cache()
click to toggle source
# File lib/getch/filesystem/zfs/partition.rb, line 42 def cache if @cache_disk mem=`awk '/MemTotal/ {print $2}' /proc/meminfo`.chomp + 'K' exec("sgdisk -n1:0:+#{mem} -t1:8200 /dev/#{@cache_disk}") exec("sgdisk -n2:0:+4G -t2:BF07 /dev/#{@cache_disk}") exec("sgdisk -n3:0:0 -t3:BF00 /dev/#{@cache_disk}") end end
exec(cmd)
click to toggle source
Partition_bios None - Bios Boot Partition
- 1MiB /boot - Boot - 8300 / - Root
# File lib/getch/filesystem/zfs/partition.rb, line 60 def exec(cmd) Getch::Command.new(cmd).run! end
partition()
click to toggle source
# File lib/getch/filesystem/zfs/partition.rb, line 27 def partition if @efi @partition.efi(@dev_esp) @partition.boot(@dev_boot) if Getch::OPTIONS[:os] == 'void' @partition.swap(@dev_swap) if !@cache_disk @partition.root(@dev_root, "BF00") if @root_part != 1 else @partition.gpt(@dev_gpt) # Boot pool for GRUB2 @partition.boot(@dev_boot) @partition.swap(@dev_swap) if !@cache_disk @partition.root(@dev_root, "BF00") if @root_part != 1 end end