getch 0.1.0 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +95 -22
  5. data/assets/network-stack.conf +63 -0
  6. data/bin/getch +12 -4
  7. data/lib/getch.rb +116 -66
  8. data/lib/getch/command.rb +19 -5
  9. data/lib/getch/config.rb +42 -0
  10. data/lib/getch/config/gentoo.rb +59 -0
  11. data/lib/getch/config/void.rb +49 -0
  12. data/lib/getch/filesystem.rb +5 -0
  13. data/lib/getch/filesystem/.mount.rb.swp +0 -0
  14. data/lib/getch/filesystem/clean.rb +58 -0
  15. data/lib/getch/filesystem/device.rb +61 -0
  16. data/lib/getch/filesystem/ext4.rb +1 -0
  17. data/lib/getch/filesystem/ext4/config.rb +8 -9
  18. data/lib/getch/filesystem/ext4/device.rb +2 -7
  19. data/lib/getch/filesystem/ext4/encrypt.rb +1 -0
  20. data/lib/getch/filesystem/ext4/encrypt/config.rb +8 -9
  21. data/lib/getch/filesystem/ext4/encrypt/deps.rb +3 -19
  22. data/lib/getch/filesystem/ext4/encrypt/device.rb +3 -8
  23. data/lib/getch/filesystem/ext4/encrypt/format.rb +3 -6
  24. data/lib/getch/filesystem/ext4/encrypt/mount.rb +5 -43
  25. data/lib/getch/filesystem/ext4/encrypt/partition.rb +29 -54
  26. data/lib/getch/filesystem/ext4/encrypt/void.rb +100 -0
  27. data/lib/getch/filesystem/ext4/format.rb +4 -6
  28. data/lib/getch/filesystem/ext4/mount.rb +7 -46
  29. data/lib/getch/filesystem/ext4/partition.rb +16 -39
  30. data/lib/getch/filesystem/ext4/void.rb +43 -0
  31. data/lib/getch/filesystem/lvm.rb +1 -0
  32. data/lib/getch/filesystem/lvm/config.rb +11 -15
  33. data/lib/getch/filesystem/lvm/deps.rb +4 -19
  34. data/lib/getch/filesystem/lvm/device.rb +33 -9
  35. data/lib/getch/filesystem/lvm/encrypt.rb +1 -0
  36. data/lib/getch/filesystem/lvm/encrypt/config.rb +9 -12
  37. data/lib/getch/filesystem/lvm/encrypt/deps.rb +4 -21
  38. data/lib/getch/filesystem/lvm/encrypt/device.rb +33 -9
  39. data/lib/getch/filesystem/lvm/encrypt/format.rb +3 -4
  40. data/lib/getch/filesystem/lvm/encrypt/mount.rb +7 -47
  41. data/lib/getch/filesystem/lvm/encrypt/partition.rb +30 -38
  42. data/lib/getch/filesystem/lvm/encrypt/void.rb +100 -0
  43. data/lib/getch/filesystem/lvm/format.rb +12 -8
  44. data/lib/getch/filesystem/lvm/mount.rb +7 -46
  45. data/lib/getch/filesystem/lvm/partition.rb +19 -31
  46. data/lib/getch/filesystem/lvm/void.rb +45 -0
  47. data/lib/getch/filesystem/mount.rb +56 -0
  48. data/lib/getch/filesystem/partition.rb +77 -0
  49. data/lib/getch/filesystem/zfs.rb +1 -0
  50. data/lib/getch/filesystem/zfs/config.rb +7 -8
  51. data/lib/getch/filesystem/zfs/deps.rb +24 -12
  52. data/lib/getch/filesystem/zfs/device.rb +54 -9
  53. data/lib/getch/filesystem/zfs/encrypt.rb +1 -0
  54. data/lib/getch/filesystem/zfs/encrypt/.mount.rb.swp +0 -0
  55. data/lib/getch/filesystem/zfs/encrypt/config.rb +11 -11
  56. data/lib/getch/filesystem/zfs/encrypt/deps.rb +24 -14
  57. data/lib/getch/filesystem/zfs/encrypt/device.rb +54 -9
  58. data/lib/getch/filesystem/zfs/encrypt/format.rb +84 -3
  59. data/lib/getch/filesystem/zfs/encrypt/mount.rb +8 -28
  60. data/lib/getch/filesystem/zfs/encrypt/partition.rb +26 -109
  61. data/lib/getch/filesystem/zfs/encrypt/void.rb +96 -0
  62. data/lib/getch/filesystem/zfs/format.rb +97 -4
  63. data/lib/getch/filesystem/zfs/mount.rb +10 -32
  64. data/lib/getch/filesystem/zfs/partition.rb +25 -106
  65. data/lib/getch/filesystem/zfs/void.rb +81 -0
  66. data/lib/getch/gentoo.rb +20 -16
  67. data/lib/getch/gentoo/boot.rb +24 -16
  68. data/lib/getch/gentoo/chroot.rb +16 -25
  69. data/lib/getch/gentoo/config.rb +67 -15
  70. data/lib/getch/gentoo/sources.rb +55 -13
  71. data/lib/getch/gentoo/stage.rb +0 -1
  72. data/lib/getch/gentoo/use.rb +43 -0
  73. data/lib/getch/gentoo/use_flag.rb +63 -0
  74. data/lib/getch/guard.rb +64 -0
  75. data/lib/getch/helpers.rb +133 -0
  76. data/lib/getch/log.rb +3 -2
  77. data/lib/getch/options.rb +46 -24
  78. data/lib/getch/version.rb +1 -1
  79. data/lib/getch/void.rb +59 -0
  80. data/lib/getch/void/boot.rb +80 -0
  81. data/lib/getch/void/chroot.rb +55 -0
  82. data/lib/getch/void/config.rb +87 -0
  83. data/lib/getch/void/stage.rb +70 -0
  84. metadata +46 -25
  85. metadata.gz.sig +0 -0
  86. data/.gitignore +0 -2
  87. data/CHANGELOG.md +0 -60
  88. data/Rakefile +0 -21
  89. data/bin/setup.sh +0 -90
  90. data/getch.gemspec +0 -25
@@ -1,60 +1,20 @@
1
- require 'fileutils'
2
-
3
1
  module Getch
4
2
  module FileSystem
5
3
  module Lvm
6
4
  module Encrypt
7
- class Mount < Getch::FileSystem::Lvm::Encrypt::Device
5
+ class Mount < Device
8
6
  def initialize
9
7
  super
10
- @root_dir = MOUNTPOINT
11
- @boot_dir = "#{@root_dir}/boot"
12
- @boot_efi_dir = "#{@root_dir}/boot/efi"
13
- @home_dir = @user ? "#{@root_dir}/home/#{@user}" : nil
14
- @state = Getch::States.new()
8
+ @mount = Getch::FileSystem::Mount.new
9
+ @state = Getch::States.new
15
10
  end
16
11
 
17
12
  def run
18
13
  return if STATES[:mount]
19
- mount_swap
20
- mount_root
21
- mount_boot
22
- mount_home
23
- mount_boot_efi
24
- @state.mount
25
- end
26
-
27
- private
28
-
29
- def mount_swap
30
- return if ! @lv_swap
31
- system("swapon #{@lv_swap}")
32
- end
33
-
34
- def mount_root
35
- return if ! @lv_root
36
- Dir.mkdir(@root_dir, 0700) if ! Dir.exist?(@root_dir)
37
- system("mount #{@lv_root} #{@root_dir}")
38
- end
39
-
40
- def mount_boot_efi
41
- return if ! @dev_boot_efi
42
- FileUtils.mkdir_p @boot_efi_dir, mode: 0700 if ! Dir.exist?(@boot_efi_dir)
43
- system("mount #{@dev_boot_efi} #{@boot_efi_dir}")
44
- end
45
-
46
- def mount_boot
47
- return if ! @dev_boot
48
- FileUtils.mkdir_p @boot_dir, mode: 0700 if ! Dir.exist?(@boot_dir)
49
- system("mount #{@dev_boot} #{@boot_dir}")
50
- end
51
-
52
- def mount_home
53
- return if ! @lv_home
54
- if @user != nil then
55
- FileUtils.mkdir_p @home_dir, mode: 0700 if ! Dir.exist?(@home_dir)
56
- system("mount #{@lv_home} #{@home_dir}")
57
- end
14
+ @mount.root(@lv_root)
15
+ @mount.boot(@dev_boot)
16
+ @mount.esp(@dev_esp)
17
+ @mount.home(@lv_home)
58
18
  @state.mount
59
19
  end
60
20
  end
@@ -1,64 +1,50 @@
1
+ require_relative '../../../helpers'
2
+
1
3
  module Getch
2
4
  module FileSystem
3
5
  module Lvm
4
6
  module Encrypt
5
- class Partition < Getch::FileSystem::Lvm::Encrypt::Device
7
+ class Partition < Device
8
+ include Helpers::Cryptsetup
9
+
6
10
  def initialize
7
11
  super
8
12
  @state = Getch::States.new()
13
+ @clean = Getch::FileSystem::Clean
14
+ @partition = Getch::FileSystem::Partition.new
9
15
  @log = Log.new
10
16
  run_partition
11
17
  end
12
18
 
13
19
  def run_partition
14
20
  return if STATES[:partition ]
15
- clear_struct
16
- cleaning
21
+ @clean.old_vg(@dev_root, @vg)
22
+ @clean.hdd(@disk)
23
+ @clean.external_disk(@disk, @boot_disk, @cache_disk, @home_disk)
24
+
17
25
  partition
18
- encrypt
26
+ encrypting
19
27
  lvm
20
28
  @state.partition
21
29
  end
22
30
 
23
31
  private
24
32
 
25
- def clear_struct
26
- oldvg = `vgdisplay | grep #{@vg}`.chomp
27
- exec("vgremove -f #{@vg}") if oldvg != '' # remove older volume group
28
- exec("pvremove -f #{@dev_root}") if oldvg != '' and File.exist? @dev_root # remove older volume group
29
-
30
- exec("sgdisk -Z /dev/#{@disk}")
31
- exec("wipefs -a /dev/#{@disk}")
32
- end
33
-
34
- def cleaning
35
- puts
36
- print "Cleaning data on #{@disk}, can be long, avoid this on Flash Memory (SSD,USB,...) ? (n,y) "
37
- case gets.chomp
38
- when /^y|^Y/
39
- bloc=`blockdev --getbsz /dev/#{@disk}`.chomp
40
- exec("dd if=/dev/urandom of=/dev/#{@disk} bs=#{bloc} status=progress")
41
- else
42
- return
43
- end
44
- end
45
-
46
33
  def partition
47
34
  if Helpers::efi?
48
- exec("sgdisk -n1:1M:+260M -t1:EF00 /dev/#{@disk}")
49
- exec("sgdisk -n2:0:+0 -t2:8e00 /dev/#{@disk}")
35
+ @partition.efi(@dev_esp)
36
+ @partition.root(@dev_root, "8e00")
50
37
  else
51
- exec("sgdisk -n1:1MiB:+1MiB -t1:EF02 /dev/#{@disk}")
52
- exec("sgdisk -n2:0:+128MiB -t2:8300 /dev/#{@disk}")
53
- exec("sgdisk -n3:0:+0 -t3:8e00 /dev/#{@disk}")
38
+ @partition.gpt(@dev_gpt)
39
+ @partition.boot(@dev_boot)
40
+ @partition.root(@dev_root, "8e00")
54
41
  end
55
42
  end
56
43
 
57
- def encrypt
58
- @log.info("Format root")
59
- Helpers::sys("cryptsetup luksFormat #{@dev_root}")
60
- @log.debug("Opening root")
61
- Helpers::sys("cryptsetup open --type luks #{@dev_root} cryptroot")
44
+ def encrypting
45
+ @log.info("Cryptsetup")
46
+ encrypt(@dev_root)
47
+ open_crypt(@dev_root, "cryptroot")
62
48
  end
63
49
 
64
50
  def lvm
@@ -66,15 +52,21 @@ module Getch
66
52
  exec("pvcreate -f #{@luks_root}")
67
53
  exec("vgcreate -f #{@vg} #{@luks_root}")
68
54
  # Wipe old signature: https://github.com/chef-cookbooks/lvm/issues/45
69
- exec("lvcreate -y -Wy -Zy -L 15G -n root #{@vg}")
70
55
  exec("lvcreate -y -Wy -Zy -L #{mem} -n swap #{@vg}")
71
- exec("lvcreate -y -Wy -Zy -l 100%FREE -n home #{@vg}") if @user
56
+
57
+ if @user
58
+ exec("lvcreate -y -Wy -Zy -L 18G -n root #{@vg}")
59
+ exec("lvcreate -y -Wy -Zy -l 100%FREE -n home #{@vg}")
60
+ else
61
+ exec("lvcreate -y -Wy -Zy -l 100%FREE -n root #{@vg}")
62
+ end
63
+
72
64
  exec("vgchange --available y")
73
65
  end
74
66
 
75
67
  # Follow https://wiki.archlinux.org/index.php/Partitioning
76
68
  # Partition_efi
77
- # /boot/efi - EFI system partition - 260MB
69
+ # /efi - EFI system partition - 260MB
78
70
  # / - Root
79
71
 
80
72
  # Partition_bios
@@ -0,0 +1,100 @@
1
+ require_relative '../../../helpers'
2
+
3
+ module Getch
4
+ module FileSystem
5
+ module Lvm
6
+ module Encrypt
7
+ class Void < Device
8
+ include Helpers::Void
9
+ attr_reader :boot_disk
10
+
11
+ # Create key to avoid enter password twice
12
+ def create_key
13
+ add_key("volume.key", @dev_root)
14
+ add_key("home.key", @dev_home) if @home_disk
15
+ end
16
+
17
+ # Key need to be added in dracut.conf.d and crypttab
18
+ def add_key(name, dev)
19
+ command "dd bs=1 count=64 if=/dev/urandom of=/boot/#{name}"
20
+ puts " => Creating a key for #{dev}, password required:"
21
+ chroot "cryptsetup luksAddKey #{dev} /boot/#{name}"
22
+ command "chmod 000 /boot/#{name}"
23
+ #command "chmod -R g-rwx,o-rwx /boot"
24
+ end
25
+
26
+ def fstab
27
+ conf = "#{MOUNTPOINT}/etc/fstab"
28
+ File.write(conf, "\n", mode: 'w', chmod: 0644)
29
+ line_fstab(@dev_esp, "/efi vfat noauto,rw,relatime 0 0") if @dev_esp
30
+ line_fstab(@dev_boot, "/boot ext4 noauto,rw,relatime 0 0") if @dev_boot
31
+ add_line(conf, "/dev/mapper/cryptswap none swap sw 0 0")
32
+ add_line(conf, "#{@lv_home} /home ext4 rw,discard 0 0") if @home_disk
33
+ add_line(conf, "#{@lv_root} / ext4 rw,relatime 0 1")
34
+ add_line(conf, "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0")
35
+ end
36
+
37
+ def crypttab
38
+ conf = "#{MOUNTPOINT}/etc/crypttab"
39
+ File.write(conf, "\n", mode: 'w', chmod: 0644)
40
+ add_line(conf, "cryptswap #{@lv_swap} /dev/urandom swap,discard,cipher=aes-xts-plain64:sha256,size=512")
41
+ line_crypttab(@vg, @dev_root, "/boot/volume.key", "luks")
42
+ line_crypttab("crypthome", @dev_home, "/boot/home.key", "luks") if @home_disk
43
+ end
44
+
45
+ def config_grub
46
+ conf = "#{MOUNTPOINT}/etc/default/grub"
47
+ content = "GRUB_ENABLE_CRYPTODISK=y"
48
+ unless search(conf, content)
49
+ File.write(conf, "#{content}\n", mode: 'a')
50
+ end
51
+ end
52
+
53
+ def config_dracut
54
+ conf = "#{MOUNTPOINT}/etc/dracut.conf.d/lvm.conf"
55
+ content = [
56
+ "hostonly=\"yes\"",
57
+ "omit_dracutmodules+=\" btrfs \"",
58
+ "install_items+=\" /boot/volume.key /etc/crypttab \"",
59
+ ""
60
+ ]
61
+ File.write(conf, content.join("\n"), mode: 'w', chmod: 0644)
62
+ #add_line(conf, "install_items+=\" /boot/home.key \"") if @home_disk
63
+ end
64
+
65
+ def kernel_cmdline_dracut
66
+ conf = "#{MOUNTPOINT}/etc/dracut.conf.d/cmdline.conf"
67
+ root_uuid = b_uuid(@dev_root)
68
+ args = "rd.lvm.vg=#{@vg} rd.luks.uuid=#{root_uuid} rootflags=rw,relatime"
69
+ line = "kernel_cmdline=\"#{args}\""
70
+ File.write(conf, "#{line}\n", mode: 'w', chmod: 0644)
71
+ end
72
+
73
+ def finish
74
+ puts "+ Enter in your system: chroot /mnt /bin/bash"
75
+ puts "+ Reboot with: shutdown -r now"
76
+ end
77
+
78
+ private
79
+
80
+ def b_uuid(dev)
81
+ device = dev.delete_prefix("/dev/")
82
+ Dir.glob("/dev/disk/by-uuid/*").each { |f|
83
+ link = File.readlink(f)
84
+ return f.delete_prefix("/dev/disk/by-uuid/") if link.match(/#{device}$/)
85
+ }
86
+ end
87
+
88
+ # line_crypttab("cryptswap", "sda2", "/dev/urandom", "luks")
89
+ def line_crypttab(mapname, dev, point, rest)
90
+ conf = "#{MOUNTPOINT}/etc/crypttab"
91
+ device = s_uuid(dev)
92
+ raise "No partuuid for #{dev} #{device}" if !device
93
+ raise "Bad partuuid for #{dev} #{device}" if device.kind_of? Array
94
+ add_line(conf, "#{mapname} PARTUUID=#{device} #{point} #{rest}")
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
@@ -4,21 +4,25 @@ module Getch
4
4
  class Format < Getch::FileSystem::Lvm::Device
5
5
  def initialize
6
6
  super
7
- @fs = 'ext4'
8
- @state = Getch::States.new()
7
+ @state = Getch::States.new
9
8
  format
10
9
  end
11
10
 
12
11
  def format
13
12
  return if STATES[:format]
14
- puts "Format #{@disk} with #{@fs}"
15
- system("mkfs.fat -F32 #{@dev_boot_efi}") if @dev_boot_efi
16
- system("mkfs.#{@fs} -F #{@dev_boot}") if @dev_boot
17
- system("mkswap -f #{@lv_swap}")
18
- system("mkfs.#{@fs} -F #{@lv_root}")
19
- system("mkfs.#{@fs} -F #{@lv_home}") if @lv_home
13
+ exec("mkfs.fat -F32 #{@dev_esp}") if @dev_esp
14
+ exec("mkfs.ext4 -F #{@dev_boot}") if @dev_boot
15
+ exec("mkswap -f #{@lv_swap}")
16
+ exec("mkfs.ext4 -F #{@lv_root}")
17
+ exec("mkfs.ext4 -F #{@lv_home}") if @lv_home
20
18
  @state.format
21
19
  end
20
+
21
+ private
22
+
23
+ def exec(cmd)
24
+ Getch::Command.new(cmd).run!
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -1,59 +1,20 @@
1
- require 'fileutils'
2
-
3
1
  module Getch
4
2
  module FileSystem
5
3
  module Lvm
6
4
  class Mount < Getch::FileSystem::Lvm::Device
7
5
  def initialize
8
6
  super
9
- @root_dir = MOUNTPOINT
10
- @boot_dir = "#{@root_dir}/boot"
11
- @boot_efi_dir = "#{@root_dir}/boot/efi"
12
- @home_dir = @user ? "#{@root_dir}/home/#{@user}" : nil
13
- @state = Getch::States.new()
7
+ @mount = Getch::FileSystem::Mount.new
8
+ @state = Getch::States.new
14
9
  end
15
10
 
16
11
  def run
17
12
  return if STATES[:mount]
18
- mount_swap
19
- mount_root
20
- mount_boot
21
- mount_home
22
- mount_boot_efi
23
- @state.mount
24
- end
25
-
26
- private
27
-
28
- def mount_swap
29
- return if ! @lv_swap
30
- system("swapon #{@lv_swap}")
31
- end
32
-
33
- def mount_root
34
- return if ! @lv_root
35
- Dir.mkdir(@root_dir, 0700) if ! Dir.exist?(@root_dir)
36
- system("mount #{@lv_root} #{@root_dir}")
37
- end
38
-
39
- def mount_boot_efi
40
- return if ! @dev_boot_efi
41
- FileUtils.mkdir_p @boot_efi_dir, mode: 0700 if ! Dir.exist?(@boot_efi_dir)
42
- system("mount #{@dev_boot_efi} #{@boot_efi_dir}")
43
- end
44
-
45
- def mount_boot
46
- return if ! @dev_boot
47
- FileUtils.mkdir_p @boot_dir, mode: 0700 if ! Dir.exist?(@boot_dir)
48
- system("mount #{@dev_boot} #{@boot_dir}")
49
- end
50
-
51
- def mount_home
52
- return if ! @lv_home
53
- if @user != nil then
54
- FileUtils.mkdir_p @home_dir, mode: 0700 if ! Dir.exist?(@home_dir)
55
- system("mount #{@lv_home} #{@home_dir}")
56
- end
13
+ @mount.swap(@lv_swap)
14
+ @mount.root(@lv_root)
15
+ @mount.boot(@dev_boot)
16
+ @mount.esp(@dev_esp)
17
+ @mount.home(@lv_home)
57
18
  @state.mount
58
19
  end
59
20
  end
@@ -5,13 +5,16 @@ module Getch
5
5
  def initialize
6
6
  super
7
7
  @state = Getch::States.new()
8
+ @partition = Getch::FileSystem::Partition.new
9
+ @clean = Getch::FileSystem::Clean
8
10
  run_partition
9
11
  end
10
12
 
11
13
  def run_partition
12
14
  return if STATES[:partition ]
13
- clear_struct
14
- cleaning
15
+ @clean.old_vg(@dev_root, @vg)
16
+ @clean.hdd(@disk)
17
+ @clean.external_disk(@disk, @boot_disk, @cache_disk, @home_disk)
15
18
  partition
16
19
  lvm
17
20
  @state.partition
@@ -19,35 +22,14 @@ module Getch
19
22
 
20
23
  private
21
24
 
22
- def clear_struct
23
- oldvg = `vgdisplay | grep #{@vg}`.chomp
24
- exec("vgremove -f #{@vg}") if oldvg != '' # remove older volume group
25
- exec("pvremove -f #{@dev_root}") if oldvg != '' and File.exist? @dev_root # remove older volume group
26
-
27
- exec("sgdisk -Z /dev/#{@disk}")
28
- exec("wipefs -a /dev/#{@disk}")
29
- end
30
-
31
- def cleaning
32
- puts
33
- print "Cleaning data on #{@disk}, can be long, avoid this on Flash Memory (SSD,USB,...) ? (n,y) "
34
- case gets.chomp
35
- when /^y|^Y/
36
- bloc=`blockdev --getbsz /dev/#{@disk}`.chomp
37
- exec("dd if=/dev/urandom of=/dev/#{@disk} bs=#{bloc} status=progress")
38
- else
39
- return
40
- end
41
- end
42
-
43
25
  def partition
44
26
  if Helpers::efi?
45
- exec("sgdisk -n1:1M:+260M -t1:EF00 /dev/#{@disk}")
46
- exec("sgdisk -n2:0:+0 -t2:8e00 /dev/#{@disk}")
27
+ @partition.efi(@dev_esp)
28
+ @partition.root(@dev_root, "8e00")
47
29
  else
48
- exec("sgdisk -n1:1MiB:+1MiB -t1:EF02 /dev/#{@disk}")
49
- exec("sgdisk -n2:0:+128MiB -t2:8300 /dev/#{@disk}")
50
- exec("sgdisk -n3:0:+0 -t3:8e00 /dev/#{@disk}")
30
+ @partition.gpt(@dev_gpt)
31
+ @partition.boot(@dev_boot)
32
+ @partition.root(@dev_root, "8e00")
51
33
  end
52
34
  end
53
35
 
@@ -56,15 +38,21 @@ module Getch
56
38
  exec("pvcreate -f #{@dev_root}")
57
39
  exec("vgcreate -f #{@vg} #{@dev_root}")
58
40
  # Wipe old signature: https://github.com/chef-cookbooks/lvm/issues/45
59
- exec("lvcreate -y -Wy -Zy -L 15G -n root #{@vg}")
60
41
  exec("lvcreate -y -Wy -Zy -L #{mem} -n swap #{@vg}")
61
- exec("lvcreate -y -Wy -Zy -l 100%FREE -n home #{@vg}") if @user
42
+
43
+ if @user
44
+ exec("lvcreate -y -Wy -Zy -L 18G -n root #{@vg}")
45
+ exec("lvcreate -y -Wy -Zy -l 100%FREE -n home #{@vg}")
46
+ else
47
+ exec("lvcreate -y -Wy -Zy -l 100%FREE -n root #{@vg}")
48
+ end
49
+
62
50
  exec("vgchange --available y")
63
51
  end
64
52
 
65
53
  # Follow https://wiki.archlinux.org/index.php/Partitioning
66
54
  # Partition_efi
67
- # /boot/efi - EFI system partition - 260MB
55
+ # /efi - EFI system partition - 260MB
68
56
  # / - Root
69
57
 
70
58
  # Partition_bios