lib/fstab/root.rb in getch-0.5.0 vs lib/fstab/root.rb in getch-0.7.0
- old
+ new
@@ -1,11 +1,12 @@
-# frozen_string_litteral: true
+# frozen_string_literal: true
require 'nito'
require_relative '../getch/log'
module Fstab
+ # Generating /etc/fstab
class Root
include NiTo
def initialize(devs, options)
@log = Getch::Log.new
@@ -34,19 +35,19 @@
def write_efi
@efi || return
uuid = gen_uuid @efi
- line = "UUID=#{uuid} /efi vfat noauto,rw,relatime 0 0"
+ line = "UUID=#{uuid} /efi vfat defaults,nosuid,nodev 0 0"
echo_a @conf, line
end
def write_boot
@boot || return
uuid = gen_uuid @boot
- line = "UUID=#{uuid} /boot #{@fs} noauto,rw,relatime 0 0"
+ line = "UUID=#{uuid} /boot #{@fs} defaults,nosuid,noexec,nodev 0 2"
echo_a @conf, line
end
def write_swap
@swap || return
@@ -58,25 +59,25 @@
def write_root
@root || return
uuid = gen_uuid @root
- line = "UUID=#{uuid} / #{@fs} rw,relatime 0 1"
+ line = "UUID=#{uuid} / #{@fs} defaults 1 1"
echo_a @conf, line
end
def write_home
@home || return
uuid = gen_uuid @home
- line = "UUID=#{uuid} /home #{@fs} rw,relatime 0 2"
+ line = "UUID=#{uuid} /home #{@fs} defaults,nosuid,nodev 0 2"
echo_a @conf, line
end
def write_tmp
Getch::Helpers.systemd? && return
- line = 'tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0'
+ line = 'tmpfs /tmp tmpfs defaults,nosuid,noexec,nodev 0 0'
echo_a @conf, line
end
private