getch 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +75 -35
- data/assets/network-stack.conf +63 -0
- data/assets/system.conf +38 -0
- data/bin/getch +14 -4
- data/lib/clean.rb +149 -0
- data/lib/cmdline.rb +128 -0
- data/lib/cryptsetup.rb +132 -0
- data/lib/devs.rb +199 -0
- data/lib/dracut/encrypt.rb +36 -0
- data/lib/dracut/hybrid.rb +15 -0
- data/lib/dracut/lvm.rb +14 -0
- data/lib/dracut/minimal.rb +11 -0
- data/lib/dracut/root.rb +45 -0
- data/lib/dracut/zfs.rb +35 -0
- data/lib/dracut.rb +11 -0
- data/lib/fstab/encrypt.rb +44 -0
- data/lib/fstab/hybrid.rb +34 -0
- data/lib/fstab/lvm.rb +25 -0
- data/lib/fstab/minimal.rb +6 -0
- data/lib/fstab/root.rb +93 -0
- data/lib/fstab/zfs.rb +23 -0
- data/lib/fstab.rb +11 -0
- data/lib/getch/assembly.rb +150 -0
- data/lib/getch/command.rb +94 -124
- data/lib/getch/config/account.rb +39 -0
- data/lib/getch/config/dhcp.rb +104 -0
- data/lib/getch/config/grub.rb +42 -0
- data/lib/getch/config/iwd.rb +60 -0
- data/lib/getch/config/keymap.rb +78 -0
- data/lib/getch/config/locale.rb +96 -0
- data/lib/getch/config/portage.rb +90 -0
- data/lib/getch/config/pre_network.rb +37 -0
- data/lib/getch/config/timezone.rb +52 -0
- data/lib/getch/config/void.rb +11 -0
- data/lib/getch/config.rb +19 -53
- data/lib/getch/device.rb +67 -0
- data/lib/getch/filesystem/ext4/encrypt/config.rb +11 -68
- data/lib/getch/filesystem/ext4/encrypt/deps.rb +17 -25
- data/lib/getch/filesystem/ext4/encrypt/device.rb +13 -5
- data/lib/getch/filesystem/ext4/encrypt/format.rb +8 -15
- data/lib/getch/filesystem/ext4/encrypt/mount.rb +9 -13
- data/lib/getch/filesystem/ext4/encrypt/partition.rb +10 -82
- data/lib/getch/filesystem/ext4/encrypt/void.rb +63 -0
- data/lib/getch/filesystem/ext4/encrypt.rb +4 -0
- data/lib/getch/filesystem/ext4/hybrid/config.rb +27 -0
- data/lib/getch/filesystem/ext4/hybrid/deps.rb +55 -0
- data/lib/getch/filesystem/ext4/hybrid/device.rb +24 -0
- data/lib/getch/filesystem/ext4/hybrid/format.rb +23 -0
- data/lib/getch/filesystem/ext4/hybrid/mount.rb +21 -0
- data/lib/getch/filesystem/ext4/hybrid/partition.rb +27 -0
- data/lib/getch/filesystem/ext4/hybrid/void.rb +62 -0
- data/lib/getch/filesystem/ext4/hybrid.rb +19 -0
- data/lib/getch/filesystem/ext4/lvm/config.rb +25 -0
- data/lib/getch/filesystem/ext4/lvm/deps.rb +56 -0
- data/lib/getch/filesystem/ext4/lvm/device.rb +28 -0
- data/lib/getch/filesystem/ext4/lvm/format.rb +21 -0
- data/lib/getch/filesystem/ext4/lvm/mount.rb +21 -0
- data/lib/getch/filesystem/ext4/lvm/partition.rb +28 -0
- data/lib/getch/filesystem/{lvm.rb → ext4/lvm.rb} +8 -3
- data/lib/getch/filesystem/ext4/minimal/config.rb +25 -0
- data/lib/getch/filesystem/ext4/{device.rb → minimal/deps.rb} +4 -3
- data/lib/getch/filesystem/ext4/minimal/device.rb +22 -0
- data/lib/getch/filesystem/ext4/minimal/format.rb +23 -0
- data/lib/getch/filesystem/ext4/minimal/mount.rb +21 -0
- data/lib/getch/filesystem/ext4/minimal/partition.rb +28 -0
- data/lib/getch/filesystem/ext4/minimal.rb +19 -0
- data/lib/getch/filesystem/ext4.rb +9 -6
- data/lib/getch/filesystem/zfs/encrypt/config.rb +12 -57
- data/lib/getch/filesystem/zfs/encrypt/deps.rb +7 -86
- data/lib/getch/filesystem/zfs/encrypt/device.rb +9 -45
- data/lib/getch/filesystem/zfs/encrypt/format.rb +8 -90
- data/lib/getch/filesystem/zfs/encrypt/mount.rb +16 -34
- data/lib/getch/filesystem/zfs/encrypt/partition.rb +8 -50
- data/lib/getch/filesystem/zfs/encrypt.rb +4 -0
- data/lib/getch/filesystem/zfs/minimal/config.rb +37 -0
- data/lib/getch/filesystem/zfs/minimal/deps.rb +126 -0
- data/lib/getch/filesystem/zfs/minimal/device.rb +24 -0
- data/lib/getch/filesystem/zfs/minimal/format.rb +23 -0
- data/lib/getch/filesystem/zfs/minimal/mount.rb +23 -0
- data/lib/getch/filesystem/zfs/minimal/partition.rb +23 -0
- data/lib/getch/filesystem/zfs/minimal.rb +19 -0
- data/lib/getch/filesystem/zfs.rb +3 -6
- data/lib/getch/filesystem.rb +2 -6
- data/lib/getch/gentoo/bootloader.rb +47 -0
- data/lib/getch/gentoo/finalize.rb +25 -0
- data/lib/getch/gentoo/post_config.rb +75 -0
- data/lib/getch/gentoo/pre_config.rb +37 -0
- data/lib/getch/gentoo/services.rb +18 -0
- data/lib/getch/gentoo/sources.rb +82 -52
- data/lib/getch/gentoo/tarball.rb +91 -0
- data/lib/getch/gentoo/terraform.rb +34 -0
- data/lib/getch/gentoo/update.rb +54 -0
- data/lib/getch/gentoo/use.rb +11 -12
- data/lib/getch/gentoo/use_flag.rb +74 -52
- data/lib/getch/gentoo.rb +11 -63
- data/lib/getch/guard.rb +71 -0
- data/lib/getch/helpers.rb +128 -48
- data/lib/getch/log.rb +91 -26
- data/lib/getch/options.rb +79 -40
- data/lib/getch/states.rb +37 -10
- data/lib/getch/tree.rb +56 -0
- data/lib/getch/version.rb +1 -1
- data/lib/getch/void/bootloader.rb +18 -0
- data/lib/getch/void/finalize.rb +31 -0
- data/lib/getch/void/post_config.rb +19 -0
- data/lib/getch/void/pre_config.rb +18 -0
- data/lib/getch/void/services.rb +18 -0
- data/lib/getch/void/tarball.rb +89 -0
- data/lib/getch/void/terraform.rb +28 -0
- data/lib/getch/void/update.rb +33 -0
- data/lib/getch/void.rb +15 -0
- data/lib/getch.rb +104 -92
- data/lib/luks.rb +239 -0
- data/lib/lvm2.rb +112 -0
- data/lib/mkfs/zfs.rb +167 -0
- data/lib/mkfs.rb +140 -0
- data/lib/mountfs.rb +154 -0
- data/lib/nito.rb +131 -0
- data/lib/sgdisk.rb +160 -0
- data.tar.gz.sig +0 -0
- metadata +96 -45
- metadata.gz.sig +0 -0
- data/.gitignore +0 -2
- data/CHANGELOG.md +0 -90
- data/Rakefile +0 -21
- data/bin/setup.sh +0 -90
- data/getch.gemspec +0 -25
- data/lib/getch/filesystem/clean.rb +0 -51
- data/lib/getch/filesystem/device.rb +0 -61
- data/lib/getch/filesystem/ext4/config.rb +0 -58
- data/lib/getch/filesystem/ext4/deps.rb +0 -22
- data/lib/getch/filesystem/ext4/format.rb +0 -28
- data/lib/getch/filesystem/ext4/mount.rb +0 -23
- data/lib/getch/filesystem/ext4/partition.rb +0 -52
- data/lib/getch/filesystem/lvm/config.rb +0 -59
- data/lib/getch/filesystem/lvm/deps.rb +0 -42
- data/lib/getch/filesystem/lvm/device.rb +0 -43
- data/lib/getch/filesystem/lvm/encrypt/config.rb +0 -71
- data/lib/getch/filesystem/lvm/encrypt/deps.rb +0 -46
- data/lib/getch/filesystem/lvm/encrypt/device.rb +0 -46
- data/lib/getch/filesystem/lvm/encrypt/format.rb +0 -32
- data/lib/getch/filesystem/lvm/encrypt/mount.rb +0 -25
- data/lib/getch/filesystem/lvm/encrypt/partition.rb +0 -80
- data/lib/getch/filesystem/lvm/encrypt.rb +0 -15
- data/lib/getch/filesystem/lvm/format.rb +0 -29
- data/lib/getch/filesystem/lvm/mount.rb +0 -23
- data/lib/getch/filesystem/lvm/partition.rb +0 -69
- data/lib/getch/filesystem/mount.rb +0 -56
- data/lib/getch/filesystem/partition.rb +0 -77
- data/lib/getch/filesystem/zfs/config.rb +0 -57
- data/lib/getch/filesystem/zfs/deps.rb +0 -95
- data/lib/getch/filesystem/zfs/device.rb +0 -58
- data/lib/getch/filesystem/zfs/format.rb +0 -114
- data/lib/getch/filesystem/zfs/mount.rb +0 -48
- data/lib/getch/filesystem/zfs/partition.rb +0 -64
- data/lib/getch/gentoo/boot.rb +0 -109
- data/lib/getch/gentoo/chroot.rb +0 -77
- data/lib/getch/gentoo/config.rb +0 -129
- data/lib/getch/gentoo/stage.rb +0 -74
data/lib/sgdisk.rb
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'getch/command'
|
|
4
|
+
require 'getch/helpers'
|
|
5
|
+
|
|
6
|
+
module Sgdisk
|
|
7
|
+
class Root
|
|
8
|
+
def initialize(devs)
|
|
9
|
+
@gpt = devs[:gpt] ||= nil
|
|
10
|
+
@efi = devs[:efi] ||= nil
|
|
11
|
+
@boot = devs[:boot] ||= nil
|
|
12
|
+
@swap = devs[:swap] ||= nil
|
|
13
|
+
@root = devs[:root] ||= nil
|
|
14
|
+
@home = devs[:home] ||= nil
|
|
15
|
+
load_codes
|
|
16
|
+
x
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
protected
|
|
20
|
+
|
|
21
|
+
def x
|
|
22
|
+
make_gpt
|
|
23
|
+
make_efi
|
|
24
|
+
make_boot
|
|
25
|
+
make_swap
|
|
26
|
+
make_root
|
|
27
|
+
make_home
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def make_gpt
|
|
31
|
+
@gpt || return
|
|
32
|
+
|
|
33
|
+
partition @gpt, @gpt_code, '1MiB:+1MiB'
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def make_efi
|
|
37
|
+
@efi || return
|
|
38
|
+
|
|
39
|
+
partition @efi, @efi_code, '1M:+260M'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def make_boot
|
|
43
|
+
@boot || return
|
|
44
|
+
|
|
45
|
+
partition @boot, @boot_code, '0:+256MiB'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def make_swap
|
|
49
|
+
@swap || return
|
|
50
|
+
|
|
51
|
+
mem = Getch::Helpers.get_memory
|
|
52
|
+
partition @swap, @swap_code, "0:+#{mem}"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Align the end
|
|
56
|
+
# https://unix.stackexchange.com/questions/588930/sgdisk-force-alignment-of-end-sector
|
|
57
|
+
# https://gitlab.com/cryptsetup/cryptsetup/-/issues/585
|
|
58
|
+
def make_root
|
|
59
|
+
@root || return
|
|
60
|
+
|
|
61
|
+
return unless @root =~ /[0-9]/
|
|
62
|
+
|
|
63
|
+
finish = end_sector @root
|
|
64
|
+
partition @root, @root_code, "0:#{finish}"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def make_home
|
|
68
|
+
@home || return
|
|
69
|
+
|
|
70
|
+
return unless @home =~ /[0-9]/
|
|
71
|
+
|
|
72
|
+
finish = end_sector @home
|
|
73
|
+
partition @home, @home_code, "0:#{finish}"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
private
|
|
77
|
+
|
|
78
|
+
# sgdisk -L
|
|
79
|
+
def load_codes
|
|
80
|
+
@gpt_code = 'ef02'
|
|
81
|
+
@efi_code = 'ef00'
|
|
82
|
+
@boot_code = '8300'
|
|
83
|
+
@swap_code = '8200'
|
|
84
|
+
@root_code = '8304'
|
|
85
|
+
@home_code = '8302'
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# e.g: partition sda1, 'ef02', '1Mib:+1MiB'
|
|
89
|
+
def partition(disk, code, sectors)
|
|
90
|
+
d = disk[/^[a-z]+/]
|
|
91
|
+
p = disk[/[0-9]{1}$/]
|
|
92
|
+
args = "-n#{p}:#{sectors} -t#{p}:#{code} /dev/#{d}"
|
|
93
|
+
|
|
94
|
+
Getch::Command.new('sgdisk', args)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def end_sector(dev)
|
|
98
|
+
disk = dev[/^[a-z]+/]
|
|
99
|
+
cmd = Getch::Command.new("sgdisk -E /dev/#{disk}")
|
|
100
|
+
end_position = cmd.res.to_i
|
|
101
|
+
( end_position - ( end_position + 1 ) % 2048 )
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
class Ext4 < Root
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
class Lvm < Root
|
|
109
|
+
def load_codes
|
|
110
|
+
super
|
|
111
|
+
@root_code = '8e00'
|
|
112
|
+
@home_code = '8e00'
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
class Encrypt < Root
|
|
117
|
+
def load_codes
|
|
118
|
+
super
|
|
119
|
+
@boot_code = '8309'
|
|
120
|
+
@root_code = '8309'
|
|
121
|
+
@home_code = '8309'
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
class Zfs < Root
|
|
126
|
+
def load_codes
|
|
127
|
+
super
|
|
128
|
+
@boot_code = 'be00'
|
|
129
|
+
@root_code = 'bf00'
|
|
130
|
+
@home_code = 'bf05'
|
|
131
|
+
@zlog_code = 'bf07'
|
|
132
|
+
@zcache_code = 'bf08'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def make_boot
|
|
136
|
+
@boot || return
|
|
137
|
+
|
|
138
|
+
partition @boot, @boot_code, '0:+2G'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def make_swap
|
|
142
|
+
mem = Getch::Helpers.get_memory
|
|
143
|
+
partition @swap, @swap_code, "0:+#{mem}"
|
|
144
|
+
add_zlog
|
|
145
|
+
add_zcache
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def add_zlog
|
|
149
|
+
@zlog || return
|
|
150
|
+
|
|
151
|
+
partition @zlog, @zlog_code, '0:+4G'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def add_zcache
|
|
155
|
+
@zcache || return
|
|
156
|
+
|
|
157
|
+
partition @zcache, @zcache_code, '0:0'
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: getch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- szorfein
|
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
|
35
35
|
F9Dl4EPzjBJOgQWf+NxzxNuNKI46Lp5Q8AI+xtDUHAPbSswHa40BA6ChFehP+j0L
|
|
36
36
|
fg==
|
|
37
37
|
-----END CERTIFICATE-----
|
|
38
|
-
date:
|
|
38
|
+
date: 2022-02-17 00:00:00.000000000 Z
|
|
39
39
|
dependencies: []
|
|
40
40
|
description:
|
|
41
41
|
email:
|
|
@@ -43,25 +43,48 @@ email:
|
|
|
43
43
|
executables:
|
|
44
44
|
- getch
|
|
45
45
|
extensions: []
|
|
46
|
-
extra_rdoc_files:
|
|
46
|
+
extra_rdoc_files:
|
|
47
|
+
- README.md
|
|
47
48
|
files:
|
|
48
|
-
- ".gitignore"
|
|
49
|
-
- CHANGELOG.md
|
|
50
49
|
- README.md
|
|
51
|
-
-
|
|
50
|
+
- assets/network-stack.conf
|
|
51
|
+
- assets/system.conf
|
|
52
52
|
- bin/getch
|
|
53
|
-
-
|
|
54
|
-
-
|
|
53
|
+
- lib/clean.rb
|
|
54
|
+
- lib/cmdline.rb
|
|
55
|
+
- lib/cryptsetup.rb
|
|
56
|
+
- lib/devs.rb
|
|
57
|
+
- lib/dracut.rb
|
|
58
|
+
- lib/dracut/encrypt.rb
|
|
59
|
+
- lib/dracut/hybrid.rb
|
|
60
|
+
- lib/dracut/lvm.rb
|
|
61
|
+
- lib/dracut/minimal.rb
|
|
62
|
+
- lib/dracut/root.rb
|
|
63
|
+
- lib/dracut/zfs.rb
|
|
64
|
+
- lib/fstab.rb
|
|
65
|
+
- lib/fstab/encrypt.rb
|
|
66
|
+
- lib/fstab/hybrid.rb
|
|
67
|
+
- lib/fstab/lvm.rb
|
|
68
|
+
- lib/fstab/minimal.rb
|
|
69
|
+
- lib/fstab/root.rb
|
|
70
|
+
- lib/fstab/zfs.rb
|
|
55
71
|
- lib/getch.rb
|
|
72
|
+
- lib/getch/assembly.rb
|
|
56
73
|
- lib/getch/command.rb
|
|
57
74
|
- lib/getch/config.rb
|
|
75
|
+
- lib/getch/config/account.rb
|
|
76
|
+
- lib/getch/config/dhcp.rb
|
|
77
|
+
- lib/getch/config/grub.rb
|
|
78
|
+
- lib/getch/config/iwd.rb
|
|
79
|
+
- lib/getch/config/keymap.rb
|
|
80
|
+
- lib/getch/config/locale.rb
|
|
81
|
+
- lib/getch/config/portage.rb
|
|
82
|
+
- lib/getch/config/pre_network.rb
|
|
83
|
+
- lib/getch/config/timezone.rb
|
|
84
|
+
- lib/getch/config/void.rb
|
|
85
|
+
- lib/getch/device.rb
|
|
58
86
|
- lib/getch/filesystem.rb
|
|
59
|
-
- lib/getch/filesystem/clean.rb
|
|
60
|
-
- lib/getch/filesystem/device.rb
|
|
61
87
|
- lib/getch/filesystem/ext4.rb
|
|
62
|
-
- lib/getch/filesystem/ext4/config.rb
|
|
63
|
-
- lib/getch/filesystem/ext4/deps.rb
|
|
64
|
-
- lib/getch/filesystem/ext4/device.rb
|
|
65
88
|
- lib/getch/filesystem/ext4/encrypt.rb
|
|
66
89
|
- lib/getch/filesystem/ext4/encrypt/config.rb
|
|
67
90
|
- lib/getch/filesystem/ext4/encrypt/deps.rb
|
|
@@ -69,29 +92,30 @@ files:
|
|
|
69
92
|
- lib/getch/filesystem/ext4/encrypt/format.rb
|
|
70
93
|
- lib/getch/filesystem/ext4/encrypt/mount.rb
|
|
71
94
|
- lib/getch/filesystem/ext4/encrypt/partition.rb
|
|
72
|
-
- lib/getch/filesystem/ext4/
|
|
73
|
-
- lib/getch/filesystem/ext4/
|
|
74
|
-
- lib/getch/filesystem/ext4/
|
|
75
|
-
- lib/getch/filesystem/
|
|
76
|
-
- lib/getch/filesystem/
|
|
77
|
-
- lib/getch/filesystem/
|
|
78
|
-
- lib/getch/filesystem/
|
|
79
|
-
- lib/getch/filesystem/
|
|
80
|
-
- lib/getch/filesystem/
|
|
81
|
-
- lib/getch/filesystem/lvm
|
|
82
|
-
- lib/getch/filesystem/lvm/
|
|
83
|
-
- lib/getch/filesystem/lvm/
|
|
84
|
-
- lib/getch/filesystem/lvm/
|
|
85
|
-
- lib/getch/filesystem/lvm/
|
|
86
|
-
- lib/getch/filesystem/lvm/
|
|
87
|
-
- lib/getch/filesystem/lvm/
|
|
88
|
-
- lib/getch/filesystem/
|
|
89
|
-
- lib/getch/filesystem/
|
|
90
|
-
- lib/getch/filesystem/
|
|
95
|
+
- lib/getch/filesystem/ext4/encrypt/void.rb
|
|
96
|
+
- lib/getch/filesystem/ext4/hybrid.rb
|
|
97
|
+
- lib/getch/filesystem/ext4/hybrid/config.rb
|
|
98
|
+
- lib/getch/filesystem/ext4/hybrid/deps.rb
|
|
99
|
+
- lib/getch/filesystem/ext4/hybrid/device.rb
|
|
100
|
+
- lib/getch/filesystem/ext4/hybrid/format.rb
|
|
101
|
+
- lib/getch/filesystem/ext4/hybrid/mount.rb
|
|
102
|
+
- lib/getch/filesystem/ext4/hybrid/partition.rb
|
|
103
|
+
- lib/getch/filesystem/ext4/hybrid/void.rb
|
|
104
|
+
- lib/getch/filesystem/ext4/lvm.rb
|
|
105
|
+
- lib/getch/filesystem/ext4/lvm/config.rb
|
|
106
|
+
- lib/getch/filesystem/ext4/lvm/deps.rb
|
|
107
|
+
- lib/getch/filesystem/ext4/lvm/device.rb
|
|
108
|
+
- lib/getch/filesystem/ext4/lvm/format.rb
|
|
109
|
+
- lib/getch/filesystem/ext4/lvm/mount.rb
|
|
110
|
+
- lib/getch/filesystem/ext4/lvm/partition.rb
|
|
111
|
+
- lib/getch/filesystem/ext4/minimal.rb
|
|
112
|
+
- lib/getch/filesystem/ext4/minimal/config.rb
|
|
113
|
+
- lib/getch/filesystem/ext4/minimal/deps.rb
|
|
114
|
+
- lib/getch/filesystem/ext4/minimal/device.rb
|
|
115
|
+
- lib/getch/filesystem/ext4/minimal/format.rb
|
|
116
|
+
- lib/getch/filesystem/ext4/minimal/mount.rb
|
|
117
|
+
- lib/getch/filesystem/ext4/minimal/partition.rb
|
|
91
118
|
- lib/getch/filesystem/zfs.rb
|
|
92
|
-
- lib/getch/filesystem/zfs/config.rb
|
|
93
|
-
- lib/getch/filesystem/zfs/deps.rb
|
|
94
|
-
- lib/getch/filesystem/zfs/device.rb
|
|
95
119
|
- lib/getch/filesystem/zfs/encrypt.rb
|
|
96
120
|
- lib/getch/filesystem/zfs/encrypt/config.rb
|
|
97
121
|
- lib/getch/filesystem/zfs/encrypt/deps.rb
|
|
@@ -99,26 +123,53 @@ files:
|
|
|
99
123
|
- lib/getch/filesystem/zfs/encrypt/format.rb
|
|
100
124
|
- lib/getch/filesystem/zfs/encrypt/mount.rb
|
|
101
125
|
- lib/getch/filesystem/zfs/encrypt/partition.rb
|
|
102
|
-
- lib/getch/filesystem/zfs/
|
|
103
|
-
- lib/getch/filesystem/zfs/
|
|
104
|
-
- lib/getch/filesystem/zfs/
|
|
126
|
+
- lib/getch/filesystem/zfs/minimal.rb
|
|
127
|
+
- lib/getch/filesystem/zfs/minimal/config.rb
|
|
128
|
+
- lib/getch/filesystem/zfs/minimal/deps.rb
|
|
129
|
+
- lib/getch/filesystem/zfs/minimal/device.rb
|
|
130
|
+
- lib/getch/filesystem/zfs/minimal/format.rb
|
|
131
|
+
- lib/getch/filesystem/zfs/minimal/mount.rb
|
|
132
|
+
- lib/getch/filesystem/zfs/minimal/partition.rb
|
|
105
133
|
- lib/getch/gentoo.rb
|
|
106
|
-
- lib/getch/gentoo/
|
|
107
|
-
- lib/getch/gentoo/
|
|
108
|
-
- lib/getch/gentoo/
|
|
134
|
+
- lib/getch/gentoo/bootloader.rb
|
|
135
|
+
- lib/getch/gentoo/finalize.rb
|
|
136
|
+
- lib/getch/gentoo/post_config.rb
|
|
137
|
+
- lib/getch/gentoo/pre_config.rb
|
|
138
|
+
- lib/getch/gentoo/services.rb
|
|
109
139
|
- lib/getch/gentoo/sources.rb
|
|
110
|
-
- lib/getch/gentoo/
|
|
140
|
+
- lib/getch/gentoo/tarball.rb
|
|
141
|
+
- lib/getch/gentoo/terraform.rb
|
|
142
|
+
- lib/getch/gentoo/update.rb
|
|
111
143
|
- lib/getch/gentoo/use.rb
|
|
112
144
|
- lib/getch/gentoo/use_flag.rb
|
|
145
|
+
- lib/getch/guard.rb
|
|
113
146
|
- lib/getch/helpers.rb
|
|
114
147
|
- lib/getch/log.rb
|
|
115
148
|
- lib/getch/options.rb
|
|
116
149
|
- lib/getch/states.rb
|
|
150
|
+
- lib/getch/tree.rb
|
|
117
151
|
- lib/getch/version.rb
|
|
152
|
+
- lib/getch/void.rb
|
|
153
|
+
- lib/getch/void/bootloader.rb
|
|
154
|
+
- lib/getch/void/finalize.rb
|
|
155
|
+
- lib/getch/void/post_config.rb
|
|
156
|
+
- lib/getch/void/pre_config.rb
|
|
157
|
+
- lib/getch/void/services.rb
|
|
158
|
+
- lib/getch/void/tarball.rb
|
|
159
|
+
- lib/getch/void/terraform.rb
|
|
160
|
+
- lib/getch/void/update.rb
|
|
161
|
+
- lib/luks.rb
|
|
162
|
+
- lib/lvm2.rb
|
|
163
|
+
- lib/mkfs.rb
|
|
164
|
+
- lib/mkfs/zfs.rb
|
|
165
|
+
- lib/mountfs.rb
|
|
166
|
+
- lib/nito.rb
|
|
167
|
+
- lib/sgdisk.rb
|
|
118
168
|
homepage: https://github.com/szorfein/getch
|
|
119
169
|
licenses:
|
|
120
170
|
- MIT
|
|
121
171
|
metadata:
|
|
172
|
+
source_code_uri: https://github.com/szorfein/getch
|
|
122
173
|
changelog_uri: https://github.com/szorfein/getch/blob/master/CHANGELOG.md
|
|
123
174
|
bug_tracker_uri: https://github.com/szorfein/getch/issues
|
|
124
175
|
wiki_uri: https://github.com/szorfein/getch
|
|
@@ -130,15 +181,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
130
181
|
requirements:
|
|
131
182
|
- - ">="
|
|
132
183
|
- !ruby/object:Gem::Version
|
|
133
|
-
version:
|
|
184
|
+
version: 2.5.0
|
|
134
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
186
|
requirements:
|
|
136
187
|
- - ">="
|
|
137
188
|
- !ruby/object:Gem::Version
|
|
138
189
|
version: '0'
|
|
139
190
|
requirements: []
|
|
140
|
-
rubygems_version: 3.
|
|
191
|
+
rubygems_version: 3.2.32
|
|
141
192
|
signing_key:
|
|
142
193
|
specification_version: 4
|
|
143
|
-
summary: A CLI tool to install Gentoo
|
|
194
|
+
summary: A CLI tool to install Gentoo or VoidLinux.
|
|
144
195
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|
data/.gitignore
DELETED
data/CHANGELOG.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
## 0.1.3, release 2021-05-17
|
|
2
|
-
* LVM use the format /dev/vg_name/lv_name for mount/format/fstab.
|
|
3
|
-
* Stop using `euse` from `gentoolkit`, use native Ruby code here.
|
|
4
|
-
* Optimization on package installation, they shouln't be installed more than once.
|
|
5
|
-
* Regroup use flags under Getch::Gentoo::UseFlag.
|
|
6
|
-
* Upd Bask v0.5 (zstd compression, better support for wifi...)
|
|
7
|
-
* Config for systemd-resolved, enable DNS over TLS with Quad9 (9.9.9.9)
|
|
8
|
-
* Add configs for systemd-network with DHCP for wifi and ethernet.
|
|
9
|
-
* Correct permissions (/home/[user] and /etc/portage)
|
|
10
|
-
|
|
11
|
-
## 0.1.2, release 2021-05-12
|
|
12
|
-
* DOCS update.
|
|
13
|
-
* Keep Nano for those who need :)
|
|
14
|
-
* ZFS use the last version >=2.0 with kernel stable =5.10
|
|
15
|
-
* ZFS create a Log device and Cache device if getch is used with `--separate-cache`.
|
|
16
|
-
* GRUB or Systemd-boot can now be installed on separate disk with `--separate-boot`.
|
|
17
|
-
* Adding flag for ZFS `-o autotrim=on` (used with `zpool create`).
|
|
18
|
-
* Encrypted swap use: `cipher=aes-xts-plain64:sha256,size=512` by default.
|
|
19
|
-
* In the make.conf: add `-fomit-frame-pointer`, designed to reduce generated code size.
|
|
20
|
-
|
|
21
|
-
## 0.1.1, release 2020-11-01
|
|
22
|
-
* Change mountpoint for the esp at /efi rather than /boot/efi
|
|
23
|
-
* Replace Garden by Bask https://github.com/szorfein/bask
|
|
24
|
-
* Correct option --username USERNAME, do not create a new partition.
|
|
25
|
-
* New set of options --separate-{boot,cache,home} to install them on another disk
|
|
26
|
-
* Refactor codes
|
|
27
|
-
* Add cpu name to COMMON_FLAGS
|
|
28
|
-
* Add cpuflags with app-portage/cpuid2cpuflags
|
|
29
|
-
+ Use the whole disk space available for / when option --username is unset
|
|
30
|
-
|
|
31
|
-
## 0.1.0, release 2020-10-15
|
|
32
|
-
* Add the (Zeta) filesystem ZFS
|
|
33
|
-
* `emerge --depclean` to save space.
|
|
34
|
-
* Add a message when getch have finish, keep /mnt/gentoo if you need to add something.
|
|
35
|
-
* Use systemd-detect-virt to detect a Virtual Guest.
|
|
36
|
-
|
|
37
|
-
## 0.0.9, release 2020-10-03
|
|
38
|
-
* Add encryption on ext4 and lvm (BIOS,UEFI)
|
|
39
|
-
* Correct KEYMAP="yes" with genkernel
|
|
40
|
-
* Renaming option keyboard with keymap
|
|
41
|
-
* GPG verification for ebuild
|
|
42
|
-
|
|
43
|
-
## 0.0.8, release 2020-09-30
|
|
44
|
-
* Adding LVM via the option fs, `--fs lvm`.
|
|
45
|
-
* Systemd-boot use the value of PARTUUID without initramfs.
|
|
46
|
-
* Include lib logger.
|
|
47
|
-
* Enhance functions to call program system Emerge, Make, ...
|
|
48
|
-
|
|
49
|
-
## 0.0.7, release 2020-09-22
|
|
50
|
-
* Correct fstab.
|
|
51
|
-
* Repair GRUB/fstab for BIOS system, add secure cmdline.
|
|
52
|
-
* Create a swap volume equal to the memory installed.
|
|
53
|
-
* Add vim and sudo
|
|
54
|
-
|
|
55
|
-
## 0.0.6, release 2020-09-19
|
|
56
|
-
* Add support for QEMU guest with KVM and Virtio driver
|
|
57
|
-
* Kernel compilation, initialize a config file with `make localyesconfig`.
|
|
58
|
-
* More modular codes to start with encryption and other filesystems.
|
|
59
|
-
* Add the new option --verbose to display output of compilation, etc...
|
|
60
|
-
|
|
61
|
-
## 0.0.5, release 2020-09-17
|
|
62
|
-
* Generate a hostname
|
|
63
|
-
* Configure systemd-boot for UEFI system
|
|
64
|
-
|
|
65
|
-
## 0.0.4, release 2020-09-16
|
|
66
|
-
* Boot on a BIOS system with VirtualBox
|
|
67
|
-
* Install Grub
|
|
68
|
-
* Create user
|
|
69
|
-
* Create passwd for root and user
|
|
70
|
-
* Check lsmod to install deps (like wpa_supplicant) and patch the kernel
|
|
71
|
-
|
|
72
|
-
## 0.0.3, release 2020-09-14
|
|
73
|
-
* Add dhcpcd, gentoo-sources, linux-firmware
|
|
74
|
-
* Kernel build by using https://github.com/szorfein/garden
|
|
75
|
-
* Populate /etc/portage (/etc/portage/package.{use,unmask,accept_keywords}/zzz_via_autounmask)
|
|
76
|
-
* Download all the lastest ebuild via emerge-webrsync
|
|
77
|
-
* Update gentoo via emerge -uDN @world
|
|
78
|
-
|
|
79
|
-
## 0.0.2, release 2020-09-12
|
|
80
|
-
* Getch genere a file /tmp/install_gentoo to avoid to remake same task over and over
|
|
81
|
-
* Support for ext4
|
|
82
|
-
* Mount partition on /mnt/gentoo during the install
|
|
83
|
-
* Download, verify the checksum and decompress the last stage3-amd64-systemd
|
|
84
|
-
|
|
85
|
-
## 0.0.1, release 2020-09-10
|
|
86
|
-
* Partition disk (at least 15G required) with sgdisk (create /boot, /, /home, and swap)
|
|
87
|
-
* Support for one disk with -d|--disk
|
|
88
|
-
* Add few options for the CLI
|
|
89
|
-
* Add bin/setup.sh to install ruby when boot on a ISO file
|
|
90
|
-
* Init project
|
data/Rakefile
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# https://github.com/seattlerb/minitest#running-your-tests-
|
|
2
|
-
require "rake/testtask"
|
|
3
|
-
require File.dirname(__FILE__) + "/lib/getch/version"
|
|
4
|
-
|
|
5
|
-
Rake::TestTask.new(:test) do |t|
|
|
6
|
-
t.libs << "test"
|
|
7
|
-
t.libs << "lib"
|
|
8
|
-
t.test_files = FileList["test/test_*.rb"]
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# Usage: rake gem:build
|
|
12
|
-
namespace :gem do
|
|
13
|
-
desc "build the gem"
|
|
14
|
-
task :build do
|
|
15
|
-
Dir["getch*.gem"].each {|f| File.unlink(f) }
|
|
16
|
-
system("gem build getch.gemspec")
|
|
17
|
-
system("gem install getch-#{Getch::VERSION}.gem -P HighSecurity")
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
task :default => :test
|
data/bin/setup.sh
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
set -o errexit -o nounset
|
|
4
|
-
|
|
5
|
-
DIR=/tmp/getch-master
|
|
6
|
-
PATH=${PATH}:/tmp/ruby/bin
|
|
7
|
-
|
|
8
|
-
# last snapshot https://www.ruby-lang.org/en/downloads/
|
|
9
|
-
compile_ruby() {
|
|
10
|
-
PN=ruby
|
|
11
|
-
PV=2.7
|
|
12
|
-
[ -f /tmp/$PN_$PV.tar.gz ] || curl -s -L -o /tmp/$PN_$PV.tar.gz https://cache.ruby-lang.org/pub/ruby/snapshot/snapshot-$PN_$PV.tar.gz
|
|
13
|
-
[ -d /tmp/snapshot-$PN_$PV ] || {
|
|
14
|
-
cd /tmp
|
|
15
|
-
tar xvf $PN_$PV.tar.gz
|
|
16
|
-
}
|
|
17
|
-
cd snapshot-$PN_$PV
|
|
18
|
-
./configure --prefix=/tmp/$PN
|
|
19
|
-
make
|
|
20
|
-
make install
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
search_ruby() {
|
|
24
|
-
if hash ruby 2>/dev/null ; then
|
|
25
|
-
echo "Ruby $(ruby -v | awk '{print $2}') found"
|
|
26
|
-
else
|
|
27
|
-
echo "Install ruby"
|
|
28
|
-
if hash pacman 2>/dev/null ; then
|
|
29
|
-
pacman -Syy --noconfirm libyaml ruby ruby-irb ruby-reline rubygems
|
|
30
|
-
elif hash emerge 2>/dev/null ; then
|
|
31
|
-
emerge -av dev-lang/ruby
|
|
32
|
-
elif hash apt-get 2>/dev/null ; then
|
|
33
|
-
apt-get install ruby
|
|
34
|
-
else
|
|
35
|
-
compile_ruby
|
|
36
|
-
fi
|
|
37
|
-
fi
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
install_with_gem() {
|
|
41
|
-
gem install getch
|
|
42
|
-
getch -h
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
dll_test_version() {
|
|
46
|
-
echo "Downloading the test version..."
|
|
47
|
-
cd /tmp
|
|
48
|
-
[ -f ./getch.tar.gz ] && rm ./getch.tar.gz
|
|
49
|
-
[ -d ./getch-master ] && rm -rf ./getch-master
|
|
50
|
-
|
|
51
|
-
curl -s -L -o getch.tar.gz https://github.com/szorfein/getch/archive/master.tar.gz
|
|
52
|
-
tar xzf getch.tar.gz \
|
|
53
|
-
&& cd $DIR \
|
|
54
|
-
&& ruby -I lib bin/getch -h
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
get_getch() {
|
|
58
|
-
if hash gem 2>/dev/null ; then
|
|
59
|
-
printf "Which version? [1] stable , [2] test (no recommended) " ; read -r
|
|
60
|
-
if echo "$REPLY" | grep -qP "2" ; then
|
|
61
|
-
dll_test_version
|
|
62
|
-
else
|
|
63
|
-
install_with_gem
|
|
64
|
-
fi
|
|
65
|
-
else
|
|
66
|
-
dll_test_version
|
|
67
|
-
fi
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
set_shell() {
|
|
71
|
-
your_shell=~/.bashrc
|
|
72
|
-
[ -f ~/.zshrc ] && your_shell=~/.zshrc
|
|
73
|
-
|
|
74
|
-
[ -f "$your_shell" ] && {
|
|
75
|
-
if ! grep -q "ruby" "$your_shell" ; then
|
|
76
|
-
echo "export PATH=\$PATH:$(ruby -e 'puts Gem.user_dir')/bin" >> "$your_shell"
|
|
77
|
-
fi
|
|
78
|
-
if $(. "$your_shell") ; then
|
|
79
|
-
echo "Shell loaded"
|
|
80
|
-
fi
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
main() {
|
|
85
|
-
search_ruby
|
|
86
|
-
set_shell
|
|
87
|
-
get_getch
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
main "$@"
|
data/getch.gemspec
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + "/lib/getch/version"
|
|
2
|
-
|
|
3
|
-
Gem::Specification.new do |s|
|
|
4
|
-
s.name = "getch"
|
|
5
|
-
s.version = Getch::VERSION
|
|
6
|
-
s.summary = "A CLI tool to install Gentoo"
|
|
7
|
-
s.authors = ["szorfein"]
|
|
8
|
-
s.email = ["szorfein@protonmail.com"]
|
|
9
|
-
s.homepage = 'https://github.com/szorfein/getch'
|
|
10
|
-
s.metadata = {
|
|
11
|
-
"changelog_uri" => "https://github.com/szorfein/getch/blob/master/CHANGELOG.md",
|
|
12
|
-
"bug_tracker_uri" => "https://github.com/szorfein/getch/issues",
|
|
13
|
-
"wiki_uri" => "https://github.com/szorfein/getch"
|
|
14
|
-
}
|
|
15
|
-
s.license = "MIT"
|
|
16
|
-
s.required_ruby_version = '>=2.5'
|
|
17
|
-
|
|
18
|
-
s.files = `git ls-files`.split(" ")
|
|
19
|
-
s.files.reject! { |fn| fn.include? "certs" }
|
|
20
|
-
|
|
21
|
-
s.executables = [ 'getch' ]
|
|
22
|
-
|
|
23
|
-
s.cert_chain = ['certs/szorfein.pem']
|
|
24
|
-
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
|
|
25
|
-
end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
module Getch
|
|
2
|
-
module FileSystem
|
|
3
|
-
module Clean
|
|
4
|
-
def self.clean_hdd(disk)
|
|
5
|
-
return if ! disk
|
|
6
|
-
raise ArgumentError, "Disk #{disk} is no found." if ! File.exist? "/dev/#{disk}"
|
|
7
|
-
puts
|
|
8
|
-
print "Cleaning data on #{disk}, can be long, avoid this on Flash Memory (SSD,USB,...) ? [y,N] "
|
|
9
|
-
case gets.chomp
|
|
10
|
-
when /^y|^Y/
|
|
11
|
-
bloc=`blockdev --getbsz /dev/#{disk}`.chomp
|
|
12
|
-
Helpers::sys("dd if=/dev/urandom of=/dev/#{disk} bs=#{bloc} status=progress")
|
|
13
|
-
else
|
|
14
|
-
return
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def self.clean_struct(disk)
|
|
19
|
-
return if ! disk
|
|
20
|
-
raise ArgumentError, "Disk #{disk} is no found." if ! File.exist? "/dev/#{disk}"
|
|
21
|
-
Helpers::sys("sgdisk -Z /dev/#{disk}")
|
|
22
|
-
Helpers::sys("wipefs -a /dev/#{disk}")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def self.hdd(*disks)
|
|
26
|
-
disks.each { |d| clean_hdd(d) }
|
|
27
|
-
end
|
|
28
|
-
# See https://wiki.archlinux.org/index.php/Solid_state_drive/Memory_cell_clearing
|
|
29
|
-
# for SSD
|
|
30
|
-
def self.sdd
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def self.struct(*disks)
|
|
34
|
-
disks.each { |d| clean_struct(d) }
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def self.old_vg(disk, vg)
|
|
38
|
-
oldvg = `vgdisplay | grep #{vg}`.chomp
|
|
39
|
-
Helpers::sys("vgremove -f #{vg}") if oldvg != ''
|
|
40
|
-
Helpers::sys("pvremove -f #{disk}") if oldvg != '' and File.exist? disk
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def self.old_zpool
|
|
44
|
-
oldzpool = `zpool status | grep pool:`.gsub(/pool: /, '').delete(' ').split("\n")
|
|
45
|
-
if oldzpool[0] != "" and $?.success?
|
|
46
|
-
oldzpool.each { |p| Helpers::sys("zpool destroy #{p}") if p }
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|