Class: Fstab::Hybrid
Overview
Hybrid for Lvm + Encryption
Instance Method Summary collapse
-
#initialize(devs, options) ⇒ Hybrid
constructor
A new instance of Hybrid.
- #write_home ⇒ Object
- #write_root ⇒ Object
-
#write_swap ⇒ Object
The swap UUID based on the lvm volume /dev/vg/swap.
Methods inherited from Encrypt
Methods inherited from Root
Methods included from NiTo
cp, echo, echo_a, grep?, mkdir, mount, mount?, rm, search_proc_swaps, sed, sh, swapoff, swapoff_dm, touch, umount
Constructor Details
#initialize(devs, options) ⇒ Hybrid
Returns a new instance of Hybrid.
5 6 7 8 9 |
# File 'lib/fstab/hybrid.rb', line 5 def initialize(devs, ) super @vg = [:vg_name] ||= 'vg0' @luks = [:luks_name] end |
Instance Method Details
#write_home ⇒ Object
29 30 31 32 |
# File 'lib/fstab/hybrid.rb', line 29 def write_home line = "/dev/#{@vg}/home /home #{@fs} rw,relatime 0 2" echo_a @conf, line end |
#write_root ⇒ Object
24 25 26 27 |
# File 'lib/fstab/hybrid.rb', line 24 def write_root line = "/dev/#{@vg}/root / #{@fs} rw,relatime 0 1" echo_a @conf, line end |
#write_swap ⇒ Object
The swap UUID based on the lvm volume /dev/vg/swap
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fstab/hybrid.rb', line 12 def write_swap # The both use /etc/crypttab if Getch::Helpers.runit? || Getch::Helpers.systemd? echo_a @conf, "/dev/mapper/swap-#{@luks} none swap sw 0 0" else dm = Getch::Helpers.get_dm "#{@vg}-swap" uuid = Getch::Helpers.uuid dm line = "UUID=#{uuid} none swap sw 0 0" echo_a @conf, line end end |