class Getch::Gentoo::UseFlag

Public Class Methods

new() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 5
def initialize
  @efi = Helpers::efi?
end

Public Instance Methods

apply() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 9
def apply
  systemd
  kmod
  grub
  zfs
  lvm
  cryptsetup
end

Private Instance Methods

cryptsetup() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 57
def cryptsetup
  return unless Getch::OPTIONS[:encrypt]
  use = Getch::Gentoo::Use.new
  use.add_global('cryptsetup')
end
grub() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 33
def grub
  return if @efi
  flags = []
  use = Getch::Gentoo::Use.new('sys-boot/grub')
  flags << '-grub_platforms_efi-64'
  flags << 'libzfs' if Getch::OPTIONS[:fs] == 'zfs'
  flags << 'device-mapper' if Getch::OPTIONS[:fs] == 'lvm'
  use.add(flags)
end
kmod() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 28
def kmod
  use = Getch::Gentoo::Use.new('sys-apps/kmod')
  use.add('zstd', 'lzma')
end
lvm() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 51
def lvm
  return unless Getch::OPTIONS[:fs] == 'lvm'
  use = Getch::Gentoo::Use.new
  use.add_global('lvm', 'device-mapper')
end
systemd() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 20
def systemd
  flags = []
  use = Getch::Gentoo::Use.new('sys-apps/systemd')
  flags << 'dns-over-tls'
  flags << 'gnuefi' if @efi
  use.add(flags)
end
zfs() click to toggle source
# File lib/getch/gentoo/use_flag.rb, line 43
def zfs
  return unless Getch::OPTIONS[:fs] == 'zfs'
  use = Getch::Gentoo::Use.new('sys-fs/zfs-kmod')
  use.add('rootfs')
  use = Getch::Gentoo::Use.new('sys-fs/zfs')
  use.add('rootfs')
end