getch 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80a9841959ac12d1fccf5a4dc5834001e802b36dd1798e297db0cd85f772be03
4
- data.tar.gz: 4bcdc9927577f8de4ba1d992e055d00cc11fe42f8aa8a66b52fff06f2c93ca95
3
+ metadata.gz: 476822c82abc15e37ab19b3e111b4b4109beb127fb775a9075757948c9e202a4
4
+ data.tar.gz: 1a2290c23d28c9fb0fa45ac47882698ad4f61dfe10f699804ab53162ea337e00
5
5
  SHA512:
6
- metadata.gz: 837136b17e66962df98d4e982a4fc10bcd3aefd58fdcf72014079d639d605c1f41b7e9663e1d8e95dba8e78705e448b06a86c36158b8b2590d34febbfdfcd541
7
- data.tar.gz: cb9b794f65827c4c7facc6441bd17ebb01409c3d07fc1fc68ca9e7ee6f741b4571cc19e62634069e3eeb4c45ca055c4eb0c2babc58cad033d1e32996c53e0b76
6
+ metadata.gz: 6b299fd1b7b9daa4be76a482ed768e85c2372c847a7f18e4ffaebf173d8d80fddbfe9b4fccc42f3037e51d53751acaf7d12f26e87b7e68fad385d280223c8471
7
+ data.tar.gz: 2e97a961aaa0e8a5380fa61f1dafaa958d8941287d2c16e6d493038e6bb52f94153aeb35d5762f1b8347eef8f85f0be496ca372fac6ff070caaf03b94c237b0e
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.1.2, release 2021-05-12
2
+ * DOCS update.
3
+ * Keep Nano for those who need :)
4
+ * ZFS use the last version >=2.0 with kernel stable =5.10
5
+ * ZFS create a Log device and Cache device if getch is used with `--separate-cache`.
6
+ * GRUB or Systemd-boot can now be installed on separate disk with `--separate-boot`.
7
+ * Adding flag for ZFS `-o autotrim=on` (used with `zpool create`).
8
+ * Encrypted swap use: `cipher=aes-xts-plain64:sha256,size=512` by default.
9
+ * In the make.conf: add `-fomit-frame-pointer`, designed to reduce generated code size.
10
+
11
+ ## 0.1.1, release 2020-11-01
1
12
  * Change mountpoint for the esp at /efi rather than /boot/efi
2
13
  * Replace Garden by Bask https://github.com/szorfein/bask
3
14
  * Correct option --username USERNAME, do not create a new partition.
data/README.md CHANGED
@@ -3,7 +3,6 @@ A CLI tool to install Gentoo.
3
3
 
4
4
  ## Description
5
5
  Actually, Getch support only the [AMD64 handbook](https://wiki.gentoo.org/wiki/Handbook:AMD64) and only with the last `stage3-amd64-systemd`.
6
- It also require a disk (only one for now) with a minimum of 20G.
7
6
 
8
7
  BIOS system will use `Grub2` and `systemd-boot` for UEFI. Filesystem supported by Getch are for now:
9
8
  + Ext4
@@ -29,6 +28,12 @@ When you boot from an `iso`, you can install `ruby`, `getch` and correct your `P
29
28
  # sh <(curl -L https://raw.githubusercontent.com/szorfein/getch/master/bin/setup.sh)
30
29
  # source ~/.zshrc # or ~/.bashrc
31
30
 
31
+ If you want to try the master branch:
32
+
33
+ # git clone https://github.com/szorfein/getch
34
+ # cd getch
35
+ # ruby -I lib bin/getch -h
36
+
32
37
  ## Usage
33
38
  Just ensure than the script is run with a root account.
34
39
 
@@ -60,19 +65,30 @@ With ZFS:
60
65
  ## Troubleshooting
61
66
 
62
67
  #### LVM
63
- Unless your old LVM volume group is also named `vg0`, `getch` may fail to partition your disk. You have to clean up your device before proceed with `vgremove` and `pvremove`.
68
+ Unless your old LVM volume group is also named `vg0`, `getch` may fail to partition your disk. You have to clean up your device before proceed with `vgremove` and `pvremove`. An short example how doing this with a volume group named `vg0`:
69
+
70
+ # vgdisplay | grep vg0
71
+ # vgremove -f vg0
72
+ # pvremove -f /dev/sdb
64
73
 
65
74
  #### Encryption enable on BIOS with ext4
66
75
  To decrypt your disk on BIOS system, you have to enter your password two times. One time for Grub and another time for the initramfs (Genkernel). [post](https://wiki.archlinux.org/index.php/GRUB#Encrypted_/boot).
67
76
  Also with GRUB, only a `us` keymap is working.
68
77
 
69
78
  #### With ZFS
70
- When you boot, the pool may fail to start, it's happen when the pool has not been `export` to the ISO. So just reboot on your ISO:
79
+ When Gentoo boot, the pool may fail to start, it's happen when the pool has not been `export` to the ISO. So just reboot on your ISO:
80
+
81
+ You need the partuuid, pool are create with the first 5 characters, just replace `sdX` by your real device:
82
+
83
+ # ls -l /dev/disk/by-partuuid/ | grep sdX4
84
+ -> 150ed969...
85
+ # zpool import -N -R /mnt rpool-150ed
86
+
87
+ And export them correctly:
71
88
 
72
- # zpool import -N -R /mnt zpool
73
89
  # zpool export -a
74
90
 
75
- And it's all.
91
+ It's all.
76
92
 
77
93
  ## Issues
78
94
  If need more support for your hardware (network, sound card, ...), you can submit a [new issue](https://github.com/szorfein/getch/issues/new) and post the output of the following command:
@@ -19,14 +19,22 @@ module Getch
19
19
 
20
20
  private
21
21
  def search_boot
22
- if @boot_disk
23
- @dev_gpt = @efi ? nil : "/dev/#{@boot_disk}1"
24
- @dev_esp = @efi ? "/dev/#{@boot_disk}1" : nil
22
+ if @efi
23
+ if @boot_disk
24
+ @dev_esp = "/dev/#{@boot_disk}#{@root_part}"
25
+ else
26
+ @dev_esp = "/dev/#{@disk}#{@root_part}"
27
+ @root_part += 1
28
+ end
25
29
  else
26
- @dev_gpt = @efi ? nil : "/dev/#{@disk}#{@root_part}"
27
- @dev_esp = @efi ? "/dev/#{@disk}#{@root_part}" : nil
28
- @boot_disk = @disk # used by grub
29
- @root_part += 1
30
+ if @boot_disk
31
+ @dev_gpt = "/dev/#{@boot_disk}#{@root_part}"
32
+ @dev_grub = "/dev/#{@boot_disk}"
33
+ else
34
+ @dev_gpt = "/dev/#{@disk}#{@root_part}"
35
+ @dev_grub = "/dev/#{@disk}"
36
+ @root_part += 1
37
+ end
30
38
  end
31
39
  end
32
40
 
@@ -46,8 +54,6 @@ module Getch
46
54
  def search_home
47
55
  if @home_disk
48
56
  @dev_home = "/dev/#{@home_disk}1"
49
- else
50
- @dev_home = nil
51
57
  end
52
58
  end
53
59
  end
@@ -3,23 +3,14 @@ module Getch
3
3
  module Ext4
4
4
  module Encrypt
5
5
  class Deps
6
- def initialize
7
- if Helpers::efi?
8
- install_efi
9
- else
10
- install_bios
11
- end
12
- install_deps
13
- end
14
-
15
6
  def make
7
+ install_bios unless Helpers::efi?
8
+ install_deps
16
9
  genkernel
17
10
  Getch::Make.new("genkernel --kernel-config=/usr/src/linux/.config all").run!
18
11
  end
19
12
 
20
13
  private
21
- def install_efi
22
- end
23
14
 
24
15
  def genkernel
25
16
  grub = Helpers::efi? ? 'BOOTLOADER="no"' : 'BOOTLOADER="grub2"'
@@ -16,7 +16,7 @@ module Getch
16
16
  end
17
17
 
18
18
  def systemd_boot
19
- return if ! @efi
19
+ return if !@efi
20
20
  esp = '/efi'
21
21
  dir = "#{@root_dir}/#{esp}/loader/entries/"
22
22
  datas_gentoo = [
@@ -29,7 +29,7 @@ module Getch
29
29
  end
30
30
 
31
31
  def grub
32
- return if Helpers::efi?
32
+ return if @efi
33
33
  file = "#{@root_dir}/etc/default/grub"
34
34
  cmdline = [
35
35
  "GRUB_CMDLINE_LINUX=\"resume=UUID=#{@uuid_swap} root=UUID=#{@uuid_root} init=#{@init} dolvm rw\""
@@ -2,16 +2,9 @@ module Getch
2
2
  module FileSystem
3
3
  module Lvm
4
4
  class Deps
5
- def initialize
6
- if Helpers::efi?
7
- install_efi
8
- else
9
- install_bios
10
- end
11
- install_deps
12
- end
13
-
14
5
  def make
6
+ install_bios unless Helpers::efi?
7
+ install_deps
15
8
  options_make
16
9
  Getch::Make.new("genkernel --kernel-config=/usr/src/linux/.config all").run!
17
10
  end
@@ -34,9 +27,6 @@ module Getch
34
27
  File.write(file, datas.join("\n"), mode: 'a')
35
28
  end
36
29
 
37
- def install_efi
38
- end
39
-
40
30
  def install_bios
41
31
  exec("euse -p sys-boot/grub -E device-mapper")
42
32
  end
@@ -13,16 +13,24 @@ module Getch
13
13
  private
14
14
 
15
15
  def search_boot
16
- if @boot_disk
17
- @dev_gpt = @efi ? nil : "/dev/#{@boot_disk}1"
18
- @dev_boot = @efi ? nil : "/dev/#{@boot_disk}2"
19
- @dev_esp = @efi ? "/dev/#{@boot_disk}1" : nil
16
+ if @efi
17
+ if @boot_disk
18
+ @dev_esp = "/dev/#{@boot_disk}1"
19
+ else
20
+ @dev_esp = "/dev/#{@disk}1"
21
+ @root_part += 1
22
+ end
20
23
  else
21
- @dev_gpt = @efi ? nil : "/dev/#{@disk}1"
22
- @dev_boot = @efi ? nil : "/dev/#{@disk}2"
23
- @dev_esp = @efi ? "/dev/#{@disk}1" : nil
24
- @root_part += 1
25
- @root_part += 1 if ! @efi
24
+ if @boot_disk
25
+ @dev_gpt = "/dev/#{@boot_disk}1"
26
+ @dev_boot = "/dev/#{@boot_disk}2"
27
+ @dev_grub = "/dev/#{@boot_disk}"
28
+ else
29
+ @dev_gpt = "/dev/#{@disk}1"
30
+ @dev_boot = "/dev/#{@disk}2"
31
+ @dev_grub = "/dev/#{@disk}"
32
+ @root_part += 2
33
+ end
26
34
  end
27
35
  end
28
36
 
@@ -32,7 +32,7 @@ module Getch
32
32
 
33
33
  def crypttab
34
34
  datas = [
35
- "cryptswap #{@lv_swap} /dev/urandom swap,cipher=aes-xts-plain64:sha256,size=256"
35
+ "cryptswap #{@lv_swap} /dev/urandom swap,cipher=aes-xts-plain64:sha256,size=512"
36
36
  ]
37
37
  File.write("#{@root_dir}/etc/crypttab", datas.join("\n"))
38
38
  end
@@ -3,16 +3,9 @@ module Getch
3
3
  module Lvm
4
4
  module Encrypt
5
5
  class Deps
6
- def initialize
7
- if Helpers::efi?
8
- install_efi
9
- else
10
- install_bios
11
- end
12
- install_deps
13
- end
14
-
15
6
  def make
7
+ install_bios unless Helpers::efi?
8
+ install_deps
16
9
  options_make
17
10
  Getch::Make.new("genkernel --kernel-config=/usr/src/linux/.config all").run!
18
11
  end
@@ -37,9 +30,6 @@ module Getch
37
30
  File.write(file, datas.join("\n"), mode: 'a')
38
31
  end
39
32
 
40
- def install_efi
41
- end
42
-
43
33
  def install_bios
44
34
  exec("euse -p sys-boot/grub -E device-mapper")
45
35
  end
@@ -16,16 +16,24 @@ module Getch
16
16
  private
17
17
 
18
18
  def search_boot
19
- if @boot_disk
20
- @dev_gpt = @efi ? nil : "/dev/#{@boot_disk}1"
21
- @dev_boot = @efi ? nil : "/dev/#{@boot_disk}2"
22
- @dev_esp = @efi ? "/dev/#{@boot_disk}1" : nil
19
+ if @efi
20
+ if @boot_disk
21
+ @dev_esp = "/dev/#{@boot_disk}1"
22
+ else
23
+ @dev_esp = "/dev/#{@disk}1"
24
+ @root_part += 1
25
+ end
23
26
  else
24
- @dev_gpt = @efi ? nil : "/dev/#{@disk}1"
25
- @dev_boot = @efi ? nil : "/dev/#{@disk}2"
26
- @dev_esp = @efi ? "/dev/#{@disk}1" : nil
27
- @root_part += 1
28
- @root_part += 1 if ! @efi
27
+ if @boot_disk
28
+ @dev_gpt = "/dev/#{@boot_disk}1"
29
+ @dev_boot = "/dev/#{@boot_disk}2"
30
+ @dev_grub = "/dev/#{@boot_disk}"
31
+ else
32
+ @dev_gpt = "/dev/#{@disk}1"
33
+ @dev_boot = "/dev/#{@disk}2"
34
+ @dev_grub = "/dev/#{@disk}"
35
+ @root_part += 2
36
+ end
29
37
  end
30
38
  end
31
39
 
@@ -3,6 +3,7 @@ module Getch
3
3
  module Zfs
4
4
  class Deps < Getch::FileSystem::Zfs::Device
5
5
  def make
6
+ unstable_zfs
6
7
  install_deps
7
8
  zfs_mountpoint
8
9
  auto_module_rebuild
@@ -13,6 +14,15 @@ module Getch
13
14
 
14
15
  private
15
16
 
17
+ def unstable_zfs
18
+ conf = "#{MOUNTPOINT}/etc/portage/package.accept_keywords/zfs"
19
+ data = [
20
+ "sys-fs/zfs-kmod",
21
+ "sys-fs/zfs"
22
+ ]
23
+ File.write(conf, data.join("\n"), mode: "w")
24
+ end
25
+
16
26
  def install_deps
17
27
  exec("euse -E libzfs") if ! Helpers::grep?("#{MOUNTPOINT}/etc/portage/make.conf", /libzfs/)
18
28
  exec("euse -E rootfs") if ! Helpers::grep?("#{MOUNTPOINT}/etc/portage/make.conf", /rootfs/)
@@ -13,17 +13,35 @@ module Getch
13
13
  private
14
14
 
15
15
  def search_boot
16
- if @boot_disk
17
- @dev_gpt = @efi ? nil : "/dev/#{@boot_disk}1"
18
- @dev_boot = @efi ? nil : "/dev/#{@boot_disk}2"
19
- @dev_esp = @efi ? "/dev/#{@boot_disk}1" : nil
16
+ if @efi
17
+ if @boot_disk
18
+ @dev_esp = "/dev/#{@boot_disk}1"
19
+ else
20
+ @dev_esp = "/dev/#{@disk}1"
21
+ @root_part += 1
22
+ end
20
23
  else
21
- @dev_gpt = @efi ? nil : "/dev/#{@disk}#{@root_part}"
22
- @dev_esp = @efi ? "/dev/#{@disk}#{@root_part}" : nil
23
- @boot_disk = @disk # used by grub
24
+ if @boot_disk
25
+ @dev_gpt = "/dev/#{@boot_disk}1"
26
+ @dev_boot = "/dev/#{@boot_disk}2"
27
+ @dev_grub = "/dev/#{@boot_disk}"
28
+ else
29
+ @dev_gpt = "/dev/#{@disk}1"
30
+ @dev_boot = "/dev/#{@disk}2"
31
+ @dev_grub = "/dev/#{@disk}"
32
+ @root_part += 2
33
+ end
34
+ end
35
+ end
36
+
37
+ def search_swap
38
+ if @cache_disk
39
+ @dev_swap = "/dev/#{@cache_disk}1"
40
+ @dev_log = "/dev/#{@cache_disk}2"
41
+ @dev_cache = "/dev/#{@cache_disk}3"
42
+ else
43
+ @dev_swap = "/dev/#{@disk}#{@root_part}"
24
44
  @root_part += 1
25
- @dev_boot = @efi ? nil : "/dev/#{@disk}#{@root_part}"
26
- @root_part += 1 if ! @efi
27
45
  end
28
46
  end
29
47
 
@@ -32,7 +32,7 @@ module Getch
32
32
 
33
33
  def crypttab
34
34
  datas = [
35
- "cryptswap PARTUUID=#{@partuuid_swap} /dev/urandom swap,cipher=aes-xts-plain64:sha256,size=256"
35
+ "cryptswap PARTUUID=#{@partuuid_swap} /dev/urandom swap,cipher=aes-xts-plain64:sha256,size=512"
36
36
  ]
37
37
  File.write("#{@root_dir}/etc/crypttab", datas.join("\n"))
38
38
  end
@@ -4,6 +4,7 @@ module Getch
4
4
  module Encrypt
5
5
  class Deps < Getch::FileSystem::Zfs::Encrypt::Device
6
6
  def make
7
+ unstable_zfs
7
8
  install_deps
8
9
  zfs_mountpoint
9
10
  auto_module_rebuild
@@ -13,6 +14,15 @@ module Getch
13
14
  end
14
15
 
15
16
  private
17
+ def unstable_zfs
18
+ conf = "#{MOUNTPOINT}/etc/portage/package.accept_keywords/zfs"
19
+ data = [
20
+ "sys-fs/zfs-kmod",
21
+ "sys-fs/zfs"
22
+ ]
23
+ File.write(conf, data.join("\n"), mode: "w")
24
+ end
25
+
16
26
  def install_deps
17
27
  exec("euse -E libzfs") if ! Helpers::grep?("#{MOUNTPOINT}/etc/portage/make.conf", /libzfs/)
18
28
  exec("euse -E rootfs") if ! Helpers::grep?("#{MOUNTPOINT}/etc/portage/make.conf", /rootfs/)
@@ -14,17 +14,35 @@ module Getch
14
14
  private
15
15
 
16
16
  def search_boot
17
- if @boot_disk
18
- @dev_gpt = @efi ? nil : "/dev/#{@boot_disk}1"
19
- @dev_boot = @efi ? nil : "/dev/#{@boot_disk}2"
20
- @dev_esp = @efi ? "/dev/#{@boot_disk}1" : nil
17
+ if @efi
18
+ if @boot_disk
19
+ @dev_esp = "/dev/#{@boot_disk}1"
20
+ else
21
+ @dev_esp = "/dev/#{@disk}1"
22
+ @root_part += 1
23
+ end
21
24
  else
22
- @dev_gpt = @efi ? nil : "/dev/#{@disk}#{@root_part}"
23
- @dev_esp = @efi ? "/dev/#{@disk}#{@root_part}" : nil
24
- @boot_disk = @disk # used by grub
25
+ if @boot_disk
26
+ @dev_gpt = "/dev/#{@boot_disk}1"
27
+ @dev_boot = "/dev/#{@boot_disk}2"
28
+ @dev_grub = "/dev/#{@boot_disk}"
29
+ else
30
+ @dev_gpt = "/dev/#{@disk}1"
31
+ @dev_boot = "/dev/#{@disk}2"
32
+ @dev_grub = "/dev/#{@disk}"
33
+ @root_part += 2
34
+ end
35
+ end
36
+ end
37
+
38
+ def search_swap
39
+ if @cache_disk
40
+ @dev_swap = "/dev/#{@cache_disk}1"
41
+ @dev_log = "/dev/#{@cache_disk}2"
42
+ @dev_cache = "/dev/#{@cache_disk}3"
43
+ else
44
+ @dev_swap = "/dev/#{@disk}#{@root_part}"
25
45
  @root_part += 1
26
- @dev_boot = @efi ? nil : "/dev/#{@disk}#{@root_part}"
27
- @root_part += 1 if ! @efi
28
46
  end
29
47
  end
30
48
 
@@ -47,7 +47,7 @@ module Getch
47
47
  # https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html
48
48
  @log.info("Creating boot pool on #{@pool_name}")
49
49
  exec("zpool create -f \\
50
- -o ashift=#{ashift} -d \\
50
+ -o ashift=#{ashift} -o autotrim=on -d \\
51
51
  -o feature@async_destroy=enabled \\
52
52
  -o feature@bookmarks=enabled \\
53
53
  -o feature@embedded_data=enabled \\
@@ -66,7 +66,7 @@ module Getch
66
66
  ")
67
67
  end
68
68
 
69
- exec("zpool create -f -o ashift=#{ashift} \\
69
+ exec("zpool create -f -o ashift=#{ashift} -o autotrim=on \\
70
70
  -O encryption=aes-256-gcm \\
71
71
  -O keylocation=prompt -O keyformat=passphrase \\
72
72
  -O acltype=posixacl -O canmount=off -O compression=lz4 \\
@@ -18,6 +18,7 @@ module Getch
18
18
  @clean.struct(@disk, @cache_disk, @home_disk)
19
19
  @clean.hdd(@disk, @cache_disk, @home_disk)
20
20
  partition
21
+ cache
21
22
  @state.partition
22
23
  end
23
24
 
@@ -36,6 +37,15 @@ module Getch
36
37
  end
37
38
  end
38
39
 
40
+ def cache
41
+ if @dev_log
42
+ exec("sgdisk -n2:0:+4G -t2:BF07 #{cache_disk}")
43
+ end
44
+ if @dev_cache
45
+ exec("sgdisk -n3:0:0 -t3:BF08 #{cache_disk}")
46
+ end
47
+ end
48
+
39
49
  # Partition_efi
40
50
  # /efi - EFI system partition - 260MB
41
51
  # / - Root
@@ -23,8 +23,8 @@ module Getch
23
23
  raise "Error, no id found for #{@dev_root}." if ! @id
24
24
  @log.info "Create #{@id} for #{@pool_name}"
25
25
  system("mkfs.fat -F32 #{@dev_esp}") if @dev_esp
26
- system("mkswap -f #{@dev_swap}")
27
26
  zfs
27
+ cache
28
28
  datasets
29
29
  @state.format
30
30
  end
@@ -47,7 +47,7 @@ module Getch
47
47
  # https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html
48
48
  @log.info("Creating boot pool on #{@pool_name}")
49
49
  exec("zpool create -f \\
50
- -o ashift=#{ashift} -d \\
50
+ -o ashift=#{ashift} -o autotrim=on -d \\
51
51
  -o feature@async_destroy=enabled \\
52
52
  -o feature@bookmarks=enabled \\
53
53
  -o feature@embedded_data=enabled \\
@@ -66,7 +66,7 @@ module Getch
66
66
  ")
67
67
  end
68
68
 
69
- exec("zpool create -f -o ashift=#{ashift} \\
69
+ exec("zpool create -f -o ashift=#{ashift} -o autotrim=on \\
70
70
  -O acltype=posixacl -O canmount=off -O compression=lz4 \\
71
71
  -O dnodesize=auto -O normalization=formD -O atime=off \\
72
72
  -O xattr=sa -O mountpoint=/ -R #{MOUNTPOINT} \\
@@ -74,6 +74,16 @@ module Getch
74
74
  ")
75
75
  end
76
76
 
77
+ def cache
78
+ system("mkswap -f #{@dev_swap}")
79
+ if @dev_log
80
+ exec("zpool add #{@pool_name} log #{@dev_log}")
81
+ end
82
+ if @dev_cache
83
+ exec("zpool add #{@pool_name} cache #{@dev_cache}")
84
+ end
85
+ end
86
+
77
87
  def datasets
78
88
  exec("zfs create -o canmount=off -o mountpoint=none #{@pool_name}/ROOT")
79
89
  exec("zfs create -o canmount=off -o mountpoint=none #{@boot_pool_name}/BOOT") if @dev_boot
@@ -90,7 +100,9 @@ module Getch
90
100
 
91
101
  exec("zfs create -o canmount=off -o mountpoint=/ #{@pool_name}/USERDATA")
92
102
  exec("zfs create -o canmount=on -o mountpoint=/root #{@pool_name}/USERDATA/root")
93
- exec("zfs create -o canmount=on -o mountpoint=/home/#{@user} #{@pool_name}/USERDATA/#{@user}") if @user
103
+ if @user
104
+ exec("zfs create -o canmount=on -o mountpoint=/home/#{@user} #{@pool_name}/USERDATA/#{@user}")
105
+ end
94
106
  end
95
107
 
96
108
  def exec(cmd)
@@ -17,6 +17,7 @@ module Getch
17
17
  @clean.struct(@disk, @cache_disk, @home_disk)
18
18
  @clean.hdd(@disk, @cache_disk, @home_disk)
19
19
  partition
20
+ cache
20
21
  @state.partition
21
22
  end
22
23
 
@@ -36,6 +37,15 @@ module Getch
36
37
  end
37
38
  end
38
39
 
40
+ def cache
41
+ if @dev_log
42
+ exec("sgdisk -n2:0:+4G -t2:BF07 #{cache_disk}")
43
+ end
44
+ if @dev_cache
45
+ exec("sgdisk -n3:0:0 -t3:BF08 #{cache_disk}")
46
+ end
47
+ end
48
+
39
49
  # Partition_efi
40
50
  # /efi - EFI system partition - 260MB
41
51
  # / - Root
data/lib/getch/gentoo.rb CHANGED
@@ -54,7 +54,6 @@ module Getch
54
54
  new
55
55
  source.build_kspp
56
56
  source.build_others
57
- source.localmodconfig
58
57
  source.make
59
58
  @state.kernel
60
59
  end
@@ -4,7 +4,7 @@ module Getch
4
4
  module Gentoo
5
5
  class Boot
6
6
  def initialize(opts)
7
- @disk = opts.disk
7
+ @disk = opts.boot_disk ? opts.boot_disk : opts.disk
8
8
  @user = opts.username
9
9
  @config = Getch.class_fs::Config.new()
10
10
  end
@@ -13,7 +13,6 @@ module Getch
13
13
  @config.fstab
14
14
  bootloader
15
15
  password
16
- cleanup
17
16
  the_end
18
17
  end
19
18
 
@@ -77,10 +76,6 @@ module Getch
77
76
 
78
77
  private
79
78
 
80
- def cleanup
81
- Getch::Emerge.new("emerge --depclean").run!
82
- end
83
-
84
79
  def the_end
85
80
  #Helpers::exec_or_die("umount -l /mnt/gentoo/dev{/shm,/pts,}")
86
81
  #Helpers::exec_or_die("umount -R #{MOUNTPOINT}")
@@ -51,6 +51,7 @@ module Getch
51
51
  def install_pkgs
52
52
  @pkgs << "app-admin/sudo"
53
53
  @pkgs << "app-editors/vim"
54
+ @pkgs << "sys-kernel/linux-firmware"
54
55
  all_pkgs = @pkgs.join(" ")
55
56
  puts "Installing #{all_pkgs}..."
56
57
  Getch::Emerge.new(all_pkgs).pkg!
@@ -11,9 +11,8 @@ module Getch
11
11
  end
12
12
 
13
13
  def portage
14
- nproc = `nproc`.chomp()
15
14
  grub_pc = Helpers::efi? ? '' : 'GRUB_PLATFORMS="pc"'
16
- quiet = DEFAULT_OPTIONS[:verbose] ? '' : "EMERGE_DEFAULT_OPTS=\"--jobs=#{nproc} --load-average=#{nproc}\""
15
+ nproc = `nproc`.chomp()
17
16
 
18
17
  # Add cpu name
19
18
  cpu=`chroot #{MOUNTPOINT} /bin/bash -c \"source /etc/profile ; gcc -c -Q -march=native --help=target | grep march\" | awk '{print $2}' | head -1`.chomp
@@ -24,7 +23,7 @@ module Getch
24
23
 
25
24
  File.open(@make).each { |l|
26
25
  if l.match(/^COMMON_FLAGS/)
27
- File.write(tmp, "COMMON_FLAGS=\"-march=#{cpu} -O2 -pipe\"\n", mode: 'a')
26
+ File.write(tmp, "COMMON_FLAGS=\"-march=#{cpu} -O2 -pipe -fomit-frame-pointer\"\n", mode: 'a')
28
27
  else
29
28
  File.write(tmp, l, mode: 'a')
30
29
  end
@@ -35,9 +34,8 @@ module Getch
35
34
  # Add the rest
36
35
  data = [
37
36
  '',
37
+ "MAKEOPTS=\"-j#{nproc}\"",
38
38
  'ACCEPT_KEYWORDS="amd64"',
39
- "MAKEOPTS=\"-j#{nproc} -l#{nproc}\"",
40
- quiet,
41
39
  'INPUT_DEVICES="libinput"',
42
40
  grub_pc
43
41
  ]
@@ -113,7 +111,7 @@ module Getch
113
111
  end
114
112
 
115
113
  def search_zone(zone)
116
- if ! File.exist?("#{MOUNTPOINT}/usr/share/zoneinfo/#{zone}")
114
+ if !File.exist?("#{MOUNTPOINT}/usr/share/zoneinfo/#{zone}")
117
115
  raise ArgumentError, "Zoneinfo #{zone} doesn\'t exist."
118
116
  end
119
117
  end
@@ -26,10 +26,6 @@ module Getch
26
26
  end
27
27
  end
28
28
 
29
- def localmodconfig
30
- Getch::Make.new("make localmodconfig").run!
31
- end
32
-
33
29
  private
34
30
 
35
31
  def make_kernel
data/lib/getch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Getch
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1zem9y
14
- ZmVpbi9EQz1wcm90b25tYWlsL0RDPWNvbTAeFw0yMDA0MzAxNzAxNDBaFw0yMTA0
15
- MzAxNzAxNDBaMCgxJjAkBgNVBAMMHXN6b3JmZWluL0RDPXByb3Rvbm1haWwvREM9
14
+ ZmVpbi9EQz1wcm90b25tYWlsL0RDPWNvbTAeFw0yMTA1MTEyMTAzNDZaFw0yMjA1
15
+ MTEyMTAzNDZaMCgxJjAkBgNVBAMMHXN6b3JmZWluL0RDPXByb3Rvbm1haWwvREM9
16
16
  Y29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAxCTYZRndCTRy18rE
17
17
  exr2wig/staa0G5kt99xqaBYD0dnIRBr/GO5dFntlBVwmefQlTrNbygVUIYTb8Vg
18
18
  B1oX3v/LLW9SRQcWaZwou0tARqanm5WhgV1ZYQTs22endTazsDHw0uhM3V+FgDh+
@@ -25,19 +25,19 @@ cert_chain:
25
25
  BgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUc8XWveAjxS5fVEOZeeZe
26
26
  uUQmbhMwIgYDVR0RBBswGYEXc3pvcmZlaW5AcHJvdG9ubWFpbC5jb20wIgYDVR0S
27
27
  BBswGYEXc3pvcmZlaW5AcHJvdG9ubWFpbC5jb20wDQYJKoZIhvcNAQELBQADggGB
28
- AG4K1ZJdzcVABSnVuD83z5ne9eBlrYscHHSXev5FX32jFdKxl19FQ+eorjSOTsNq
29
- SIgKneQOKdsWIlv8M6NDiUDcc1s504fOpIVtMbP+6n47hBGz4bzGlAdtvTO1PewK
30
- tW6ii8TOCOJ3Pv6bTzQlsaQrADi2MHuVHTb14H7uoSFJNzfU4sYJn1C3PRMC3G7n
31
- Qe/zVOdMf0bkwBnfQNojbwx3Vy1jr2JSQWjK25NYimpuKV0skanU0iBiqru6VCbK
32
- zhDNufCgCnWLwXXET3onVQMZsiLTUFf30BXX7PY1O0Km15MQn1HzOecJ3ZIDBWtS
33
- d/lg1MHB7+/FQAY5FujZqvVv5i2M9wLx+7N4ONRA7MsWD86hLiYN68QeRsHI+LNf
34
- AnVdw7i28f3GhZldcdllblGeTOjSfwl9wL4yBb1UwVjvcwMR5SDed0yPmHPXBiAC
35
- J/zT/q2Ac7BWpSLbv6p9lChBiEnD9j24x463LR5QQjDNS5SsjzRQfFuprsa9Nqf2
36
- Tw==
28
+ AHuRqWvtAx1PSIEcvq1uzgBclzP+Lhp6J1f7McvbfzHAZuLo5Nv9iFHkLl2ad9gx
29
+ p/X2/p8PmgiUNFSXDdB12Pn/VbX4DdoQujwXvmZbQo2KmooklHIhM6AJMafOHW1N
30
+ qjHIwGvMY5bJfn+3qEQNV+yip6KnCUQVklw132IFvdusoBOPfEP48p41deXbIhNP
31
+ GNJQ4qkZfXWdLumikb2Y432kIIeugIIAL57VD+wwDUJ3MciiLufYT7v9WNSFRenV
32
+ JDNGIh3AYiCnNO2DWIArrW6/jaof3A0OnjRQ64vS+EKhZFp8+y6rfC3Clrfjdjse
33
+ a4zH3TI57bnzfkx5xhjhIu6LJnBpk0x8Y/N2kVmwB+GonFiRcVzZpIfOLvy03tn5
34
+ dAHfUn//hrBJAT9EXRHNUoLyEmFsCPabTCXjQH6EM2uBcsrjQN4SlgBNzsKc8bS4
35
+ F9Dl4EPzjBJOgQWf+NxzxNuNKI46Lp5Q8AI+xtDUHAPbSswHa40BA6ChFehP+j0L
36
+ fg==
37
37
  -----END CERTIFICATE-----
38
- date: 2020-11-01 00:00:00.000000000 Z
38
+ date: 2021-05-12 00:00:00.000000000 Z
39
39
  dependencies: []
40
- description:
40
+ description:
41
41
  email:
42
42
  - szorfein@protonmail.com
43
43
  executables:
@@ -119,7 +119,7 @@ metadata:
119
119
  changelog_uri: https://github.com/szorfein/getch/blob/master/CHANGELOG.md
120
120
  bug_tracker_uri: https://github.com/szorfein/getch/issues
121
121
  wiki_uri: https://github.com/szorfein/getch
122
- post_install_message:
122
+ post_install_message:
123
123
  rdoc_options: []
124
124
  require_paths:
125
125
  - lib
@@ -134,8 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.0.3
138
- signing_key:
137
+ rubygems_version: 3.0.9
138
+ signing_key:
139
139
  specification_version: 4
140
140
  summary: A CLI tool to install Gentoo
141
141
  test_files: []
metadata.gz.sig CHANGED
Binary file