Class: Devs::MatZfs

Inherits:
Matrice show all
Defined in:
lib/devs.rb

Instance Method Summary collapse

Methods inherited from Matrice

#x

Constructor Details

#initialize(disk, args) ⇒ MatZfs

Returns a new instance of MatZfs.



164
165
166
167
168
# File 'lib/devs.rb', line 164

def initialize(disk, args)
  @zfs_cache = args[:zfs_cache] ||= nil
  @systemd_boot = args[:systemd_boot] ||= false
  super
end

Instance Method Details

#bootObject



170
171
172
173
174
175
176
177
# File 'lib/devs.rb', line 170

def boot
  @boot || return

  @systemd_boot && return

  @device.boot "#{@disk}#{@@part}"
  @@part += 1
end

#swapObject



179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/devs.rb', line 179

def swap
  @swap || return

  if @zfs_cache
    @device.swap "#{@disk}#{@@part}"
    @@part += 1
    @device.zlog "#{@disk}#{@@part}"
    @@part += 1
    @device.zcache "#{@disk}#{@@part}"
  else
    @device.swap "#{@disk}#{@@part}"
    @@part += 1
  end
end