Class: Fstab::Root

Inherits:
Object
  • Object
show all
Includes:
NiTo
Defined in:
lib/fstab/root.rb

Overview

Generating /etc/fstab

Direct Known Subclasses

Encrypt, Lvm, Minimal, Zfs

Instance Method Summary collapse

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) ⇒ Root

Returns a new instance of Root.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fstab/root.rb', line 11

def initialize(devs, options)
  @log = Getch::Log.new
  @efi = devs[:efi]   ||= nil
  @boot = devs[:boot] ||= nil
  @swap = devs[:swap] ||= nil
  @root = devs[:root] ||= nil
  @home = devs[:home] ||= nil
  @fs = options[:fs]  ||= 'ext4'
  @mountpoint = options[:mountpoint] ||= '/mnt/getch'
  @conf = "#{@mountpoint}/etc/fstab"
end

Instance Method Details

#generateObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/fstab/root.rb', line 23

def generate
  @log.info 'Generating fstab...'
  write_efi
  write_boot
  write_swap
  write_root
  write_home
  write_tmp
  @log.result_ok
end