Class: Dracut::Zfs

Inherits:
Root
  • Object
show all
Defined in:
lib/dracut/zfs.rb

Instance Method Summary collapse

Methods inherited from Root

#generate

Methods included from NiTo

cp, echo, echo_a, grep?, mkdir, mount, mount?, mv, rm, search_proc_swaps, sed, sh, swapoff, swapoff_dm, touch, umount

Constructor Details

#initialize(devs, options) ⇒ Zfs

Returns a new instance of Zfs.



5
6
7
8
9
10
# File 'lib/dracut/zfs.rb', line 5

def initialize(devs, options)
  super
  @zfs = options[:zfs_name] ||= 'pool'
  @encrypt = options[:encrypt]
  @os = options[:os]
end

Instance Method Details

#get_lineObject



20
21
22
23
24
# File 'lib/dracut/zfs.rb', line 20

def get_line
  @encrypt ?
    without :
    with_swap
end

#othersObject



12
13
14
15
16
# File 'lib/dracut/zfs.rb', line 12

def others
  file = "#{@mountpoint}/etc/dracut.conf.d/zfs.conf"
  echo file, 'nofsck="yes"'
  echo_a file, 'omit_dracutmodules+=" btrfs "'
end

#with_swapObject



30
31
32
33
# File 'lib/dracut/zfs.rb', line 30

def with_swap
  swap = Getch::Helpers.uuid @swap
  "resume=UUID=#{swap} root=zfs:r#{@zfs}/ROOT/#{@os} zfs.force=1 zfs.zfs_arc_max=536870912"
end

#withoutObject



26
27
28
# File 'lib/dracut/zfs.rb', line 26

def without
  "root=zfs:r#{@zfs}/ROOT/#{@os} zfs.force=1 zfs.zfs_arc_max=536870912"
end