getch 0.1.5 → 0.1.6
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.tar.gz.sig +0 -0
- data/README.md +64 -24
- data/assets/network-stack.conf +63 -0
- data/bin/getch +12 -4
- data/lib/getch.rb +113 -78
- data/lib/getch/command.rb +1 -1
- data/lib/getch/config.rb +33 -49
- data/lib/getch/config/gentoo.rb +59 -0
- data/lib/getch/config/void.rb +49 -0
- data/lib/getch/filesystem/.mount.rb.swp +0 -0
- data/lib/getch/filesystem/device.rb +5 -5
- data/lib/getch/filesystem/ext4.rb +1 -0
- data/lib/getch/filesystem/ext4/encrypt.rb +1 -0
- data/lib/getch/filesystem/ext4/encrypt/config.rb +2 -2
- data/lib/getch/filesystem/ext4/encrypt/format.rb +0 -1
- data/lib/getch/filesystem/ext4/encrypt/mount.rb +0 -1
- data/lib/getch/filesystem/ext4/encrypt/partition.rb +10 -16
- data/lib/getch/filesystem/ext4/encrypt/void.rb +100 -0
- data/lib/getch/filesystem/ext4/format.rb +1 -1
- data/lib/getch/filesystem/ext4/void.rb +43 -0
- data/lib/getch/filesystem/lvm.rb +1 -0
- data/lib/getch/filesystem/lvm/encrypt.rb +1 -0
- data/lib/getch/filesystem/lvm/encrypt/config.rb +2 -2
- data/lib/getch/filesystem/lvm/encrypt/format.rb +1 -2
- data/lib/getch/filesystem/lvm/encrypt/mount.rb +1 -2
- data/lib/getch/filesystem/lvm/encrypt/partition.rb +10 -7
- data/lib/getch/filesystem/lvm/encrypt/void.rb +100 -0
- data/lib/getch/filesystem/lvm/format.rb +1 -1
- data/lib/getch/filesystem/lvm/void.rb +45 -0
- data/lib/getch/filesystem/partition.rb +4 -4
- data/lib/getch/filesystem/zfs.rb +1 -0
- data/lib/getch/filesystem/zfs/config.rb +3 -3
- data/lib/getch/filesystem/zfs/deps.rb +11 -4
- data/lib/getch/filesystem/zfs/device.rb +6 -0
- data/lib/getch/filesystem/zfs/encrypt.rb +1 -0
- data/lib/getch/filesystem/zfs/encrypt/.mount.rb.swp +0 -0
- data/lib/getch/filesystem/zfs/encrypt/config.rb +5 -5
- data/lib/getch/filesystem/zfs/encrypt/deps.rb +11 -4
- data/lib/getch/filesystem/zfs/encrypt/device.rb +6 -0
- data/lib/getch/filesystem/zfs/encrypt/format.rb +9 -10
- data/lib/getch/filesystem/zfs/encrypt/mount.rb +5 -9
- data/lib/getch/filesystem/zfs/encrypt/partition.rb +3 -1
- data/lib/getch/filesystem/zfs/encrypt/void.rb +96 -0
- data/lib/getch/filesystem/zfs/format.rb +9 -9
- data/lib/getch/filesystem/zfs/mount.rb +5 -8
- data/lib/getch/filesystem/zfs/partition.rb +2 -1
- data/lib/getch/filesystem/zfs/void.rb +81 -0
- data/lib/getch/gentoo.rb +12 -15
- data/lib/getch/gentoo/boot.rb +7 -4
- data/lib/getch/gentoo/config.rb +8 -8
- data/lib/getch/gentoo/sources.rb +6 -3
- data/lib/getch/gentoo/stage.rb +0 -1
- data/lib/getch/gentoo/use_flag.rb +6 -7
- data/lib/getch/guard.rb +3 -1
- data/lib/getch/helpers.rb +107 -1
- data/lib/getch/log.rb +3 -2
- data/lib/getch/options.rb +41 -34
- data/lib/getch/version.rb +1 -1
- data/lib/getch/void.rb +59 -0
- data/lib/getch/void/boot.rb +80 -0
- data/lib/getch/void/chroot.rb +55 -0
- data/lib/getch/void/config.rb +87 -0
- data/lib/getch/void/stage.rb +70 -0
- metadata +22 -9
- metadata.gz.sig +0 -0
- data/.gitignore +0 -2
- data/CHANGELOG.md +0 -99
- data/Rakefile +0 -21
- data/bin/setup.sh +0 -90
- data/getch.gemspec +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9291f8df276b462cd310f6dc759d6c0526a9d8fdc7c47116f4c22e53d1aec6e6
|
4
|
+
data.tar.gz: c7c325c4fbc228110630b98f9d52d110bdc7d5654566efb0a136bbcfedbe5331
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7634afba44f36e31c1ab56bc373afbf1b20cce50d97445410ffc496d4c803b3c5d978c98d1a0949dc41de725db25236185df5492a0c9115425a4dc08d1c73e8
|
7
|
+
data.tar.gz: d807dbcdf3fc769473c5c14200ad91c3e8c878f6f6627a0a242481601be05e57ffe58d623c1e0431b510546f896e7fdb0f0c98bd719298977cef15ad50a76c65
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -1,34 +1,46 @@
|
|
1
1
|
# Getch
|
2
|
-
A CLI tool to install Gentoo
|
2
|
+
A CLI tool to install Gentoo or Void Linux with default:
|
3
|
+
+ DNS over HTTPS (with [Quad9](https://www.quad9.net/)).
|
4
|
+
+ Vim | Nano installed.
|
5
|
+
+ Iptables installed (not configured).
|
6
|
+
+ Sudo installed (not configured).
|
7
|
+
+ [iwd](https://iwd.wiki.kernel.org/) installed if wifi is detected.
|
8
|
+
+ No GUI installed.
|
9
|
+
|
10
|
+
Hardened System:
|
11
|
+
+ sysctl.conf with TCP/IP stack hardening and more [Arch](https://wiki.archlinux.org/title/Sysctl)
|
12
|
+
+ Kernel parameters enforced (dmesg restricted, kexec disabled, etc)
|
13
|
+
+ Kernel source (Gentoo) patched with [bask](https://github.com/szorfein/bask).
|
3
14
|
|
4
15
|
## Description
|
5
|
-
Actually, Getch support only the
|
16
|
+
Actually, Getch support only the `x86_64` architecture and only with the following archives:
|
17
|
+
+ **Gentoo**: `stage3-amd64-systemd` [Gentoo](https://www.gentoo.org/downloads/).
|
18
|
+
+ **Void**: `rootfs glibc` [Void](https://voidlinux.org/download/).
|
6
19
|
|
7
|
-
|
20
|
+
Filesystem supported (with or without encryption)
|
8
21
|
+ Ext4
|
9
|
-
+
|
22
|
+
+ Lvm
|
10
23
|
+ ZFS
|
11
24
|
|
12
|
-
|
25
|
+
Boot Manager:
|
26
|
+
+ **Gentoo**: `BIOS` will use `Grub2` and `systemd-boot` for `UEFI`.
|
27
|
+
+ **Void**: use only Grub2, encryption for the root fs use luks1.
|
13
28
|
|
14
29
|
The ISO images i was able to test and that works:
|
15
30
|
+ [Archlinux](https://www.archlinux.org/download/)
|
16
31
|
+ [Archaeidae](https://github.com/szorfein/archaeidae): Custom Archiso that includes ZFS support.
|
17
32
|
|
33
|
+
## Dependencies
|
34
|
+
Getch is build without external libs, so it only require `ruby >= 2.5`.
|
35
|
+
|
18
36
|
## Install
|
19
37
|
Getch is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
|
20
38
|
With `gem` installed:
|
21
39
|
|
22
40
|
$ gem cert --add <(curl -Ls https://raw.githubusercontent.com/szorfein/getch/master/certs/szorfein.pem)
|
23
|
-
|
24
41
|
$ gem install getch -P HighSecurity
|
25
42
|
|
26
|
-
|
27
|
-
|
28
|
-
# sh <(curl -L https://raw.githubusercontent.com/szorfein/getch/master/bin/setup.sh)
|
29
|
-
# source ~/.zshrc # or ~/.bashrc
|
30
|
-
|
31
|
-
If you want to try the master branch:
|
43
|
+
If you want to try the master branch (can be unstable):
|
32
44
|
|
33
45
|
# git clone https://github.com/szorfein/getch
|
34
46
|
# cd getch
|
@@ -46,26 +58,30 @@ For a french user:
|
|
46
58
|
|
47
59
|
# getch --zoneinfo "Europe/Paris" --language fr_FR --keymap fr
|
48
60
|
|
49
|
-
Install Gentoo on LVM
|
61
|
+
Install Gentoo on LVM and use a different root disk `/dev/sdc`
|
50
62
|
|
51
|
-
# getch --format lvm --disk
|
63
|
+
# getch --format lvm --disk sdc
|
52
64
|
|
53
65
|
Encrypt your disk with LVM with a french keymap
|
54
66
|
|
55
67
|
# getch --format lvm --encrypt --keymap fr
|
56
68
|
|
57
|
-
Encrypt with ext4 and create a
|
69
|
+
Encrypt with ext4 and create a new user `ninja`:
|
58
70
|
|
59
71
|
# getch --format ext4 --encrypt --username ninja
|
60
72
|
|
61
|
-
With ZFS:
|
73
|
+
With ZFS, if used with `--encrypt`, it use the native ZFS encryption:
|
62
74
|
|
63
75
|
# getch --format zfs
|
64
76
|
|
77
|
+
With `Void Linux`:
|
78
|
+
|
79
|
+
# getch --os void --encrypt -k fr
|
80
|
+
|
65
81
|
## Troubleshooting
|
66
82
|
|
67
|
-
#### LVM
|
68
|
-
|
83
|
+
#### Old VG for LVM
|
84
|
+
If a old volume group exist, `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
85
|
|
70
86
|
# vgdisplay | grep vg0
|
71
87
|
# vgremove -f vg0
|
@@ -75,13 +91,13 @@ Unless your old LVM volume group is also named `vg0`, `getch` may fail to partit
|
|
75
91
|
To decrypt your disk on BIOS system, you have to enter your password twice. One time for Grub and another time for Genkernel. [post](https://wiki.archlinux.org/index.php/GRUB#Encrypted_/boot).
|
76
92
|
Also with GRUB, only a `us` keymap is working.
|
77
93
|
|
78
|
-
#### ZFS
|
94
|
+
#### ZFS for Gentoo
|
79
95
|
When Gentoo boot the first time, the pool may fail to start, it's happen when the pool has not been `export` to the ISO. So just `export` your pool from the genkernel shell:
|
80
96
|
|
81
97
|
The zpool name should be visible (rpool-150ed here), so enter in the Genkernel shell:
|
82
98
|
|
83
99
|
> shell
|
84
|
-
zpool import -f -N -R /
|
100
|
+
zpool import -f -N -R /tmp rpool-150ed
|
85
101
|
zpool export -a
|
86
102
|
|
87
103
|
Then, just reboot now, it's all.
|
@@ -93,7 +109,31 @@ Then, just reboot now, it's all.
|
|
93
109
|
|
94
110
|
The pool will be called `rpool-150ed`.
|
95
111
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
112
|
+
#### ZFS for Void Linux - Enable the boot pool
|
113
|
+
You have some extras step to do after booting to enable the boot pool, you need this pool when you update your system. It's used mainly by Grub and Dracut.
|
114
|
+
By default, your /boot is empty because your boot pool is not imported...
|
115
|
+
|
116
|
+
# zpool import -N bpool150ed
|
117
|
+
# zfs mount bpool150ed/BOOT/void
|
118
|
+
# ls /boot
|
119
|
+
|
120
|
+
You should see something in the boot (initramfs, vmlinuz).. Recreate the initramfs.
|
121
|
+
|
122
|
+
# xbps-reconfigure -fa
|
123
|
+
|
124
|
+
Transform the boot pool in legacy mode and add this to the fstab:
|
125
|
+
|
126
|
+
# zfs set mountpoint=legacy bpool150ed/BOOT/void
|
127
|
+
# echo "bpool150ed/BOOT/void /boot zfs defaults 0 0" >> /etc/fstab
|
128
|
+
# mount /boot
|
129
|
+
|
130
|
+
The /boot should not be empty again and then, reboot. `fstab` should do this automatically now.
|
131
|
+
|
132
|
+
#### ZFS Encrypted with Void
|
133
|
+
Well, another weird issue, the first time you boot on your encrypted pool, nothing append. Dracut try to mount inexistent device. Just wait for enter in the shell:
|
134
|
+
|
135
|
+
# ls /lib/dracut/hooks/initqueue/finished/*
|
136
|
+
# rm /lib/dracut/hooks/initqueue/finished/dev*
|
137
|
+
# exit
|
138
|
+
|
139
|
+
Dracut should finally start `mount-zfs.sh` and ask for your password. After you first login, follow instructions above for recompile the initramfs and mount the boot pool and your good.
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# https://wiki.archlinux.org/title/Sysctl#TCP/IP_stack_hardening
|
2
|
+
# https://github.com/trimstray/the-practical-linux-hardening-guide/wiki/Network-stack
|
3
|
+
|
4
|
+
# TCP SYN cookie protection
|
5
|
+
net.ipv4.tcp_syncookies = 1
|
6
|
+
|
7
|
+
# TCP rfc1337
|
8
|
+
net.ipv4.tcp_rfc1337 = 1
|
9
|
+
|
10
|
+
# Reverse path filtering
|
11
|
+
net.ipv4.conf.default.rp_filter = 1
|
12
|
+
net.ipv4.conf.all.rp_filter = 1
|
13
|
+
|
14
|
+
# Log martian packets
|
15
|
+
net.ipv4.conf.default.log_martians = 1
|
16
|
+
net.ipv4.conf.all.log_martians = 1
|
17
|
+
|
18
|
+
# Disable ICMP redirects
|
19
|
+
net.ipv6.conf.all.accept_redirects = 0
|
20
|
+
net.ipv6.conf.default.accept_redirects = 0
|
21
|
+
|
22
|
+
# Disable IP source routing
|
23
|
+
net.ipv4.conf.default.accept_source_route = 0
|
24
|
+
net.ipv4.conf.all.accept_source_route = 0
|
25
|
+
|
26
|
+
# Ignore ICMP echo requests
|
27
|
+
net.ipv4.icmp_echo_ignore_all = 1
|
28
|
+
net.ipv6.icmp.echo_ignore_all = 1
|
29
|
+
|
30
|
+
# Ignoring broadcasts request
|
31
|
+
net.ipv4.icmp_echo_ignore_broadcasts = 1
|
32
|
+
|
33
|
+
# An illicit router advertisement message could result in a man-in-the-middle attack.
|
34
|
+
net.ipv6.conf.default.accept_ra = 0
|
35
|
+
net.ipv6.conf.all.accept_ra = 0
|
36
|
+
|
37
|
+
# Ignore bogus ICMP error responses
|
38
|
+
net.ipv4.icmp_ignore_bogus_error_responses = 1
|
39
|
+
|
40
|
+
# ICMP redirects
|
41
|
+
net.ipv4.conf.default.accept_redirects = 0
|
42
|
+
net.ipv4.conf.all.accept_redirects = 0
|
43
|
+
|
44
|
+
# Accepting secure redirects
|
45
|
+
net.ipv4.conf.default.secure_redirects = 0
|
46
|
+
net.ipv4.conf.all.secure_redirects = 0
|
47
|
+
|
48
|
+
# IP forwarding
|
49
|
+
net.ipv4.ip_forward = 0
|
50
|
+
|
51
|
+
# Sending ICMP redirects
|
52
|
+
net.ipv4.conf.default.send_redirects = 0
|
53
|
+
net.ipv4.conf.all.send_redirects = 0
|
54
|
+
|
55
|
+
# Keep sockets in FIN-WAIT-2 state
|
56
|
+
net.ipv4.tcp_fin_timeout = 30
|
57
|
+
|
58
|
+
# Keepalive packets to keep an connection alive
|
59
|
+
net.ipv4.tcp_keepalive_time = 180
|
60
|
+
net.ipv4.tcp_keepalive_intvl = 10
|
61
|
+
net.ipv4.tcp_keepalive_probes = 3
|
62
|
+
|
63
|
+
|
data/bin/getch
CHANGED
@@ -2,8 +2,16 @@
|
|
2
2
|
|
3
3
|
require 'getch'
|
4
4
|
|
5
|
-
|
6
|
-
Getch::
|
7
|
-
|
5
|
+
getch = Getch::Main.new(
|
6
|
+
:cli => Getch::Options.new(ARGV)
|
7
|
+
)
|
8
8
|
|
9
|
-
|
9
|
+
getch.resume
|
10
|
+
|
11
|
+
getch.partition
|
12
|
+
getch.format
|
13
|
+
getch.mount
|
14
|
+
|
15
|
+
getch.install
|
16
|
+
|
17
|
+
getch.configure
|
data/lib/getch.rb
CHANGED
@@ -1,27 +1,30 @@
|
|
1
1
|
require_relative 'getch/options'
|
2
2
|
require_relative 'getch/states'
|
3
3
|
require_relative 'getch/gentoo'
|
4
|
+
require_relative 'getch/void'
|
4
5
|
require_relative 'getch/filesystem'
|
5
6
|
require_relative 'getch/command'
|
6
7
|
require_relative 'getch/helpers'
|
7
8
|
require_relative 'getch/log'
|
8
9
|
require_relative 'getch/config'
|
9
10
|
require_relative 'getch/guard'
|
11
|
+
require_relative 'getch/version'
|
10
12
|
|
11
13
|
module Getch
|
12
14
|
|
13
|
-
|
14
|
-
language
|
15
|
-
zoneinfo
|
16
|
-
keymap
|
17
|
-
disk
|
18
|
-
fs
|
19
|
-
username
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
OPTIONS = {
|
16
|
+
:language => 'en_US',
|
17
|
+
:zoneinfo => 'US/Eastern',
|
18
|
+
:keymap => 'us',
|
19
|
+
:disk => false,
|
20
|
+
:fs => 'ext4',
|
21
|
+
:username => false,
|
22
|
+
:os => 'gentoo',
|
23
|
+
:boot_disk => false,
|
24
|
+
:cache_disk => false,
|
25
|
+
:home_disk => false,
|
26
|
+
:encrypt => false,
|
27
|
+
:verbose => false
|
25
28
|
}
|
26
29
|
|
27
30
|
STATES = {
|
@@ -34,86 +37,118 @@ module Getch
|
|
34
37
|
:gentoo_kernel => false
|
35
38
|
}
|
36
39
|
|
37
|
-
MOUNTPOINT = "/mnt/gentoo"
|
40
|
+
MOUNTPOINT = "/mnt/gentoo"
|
41
|
+
|
38
42
|
DEFAULT_FS = {
|
39
43
|
true => {
|
40
|
-
ext4:
|
41
|
-
lvm:
|
42
|
-
zfs:
|
44
|
+
ext4: FileSystem::Ext4::Encrypt,
|
45
|
+
lvm: FileSystem::Lvm::Encrypt,
|
46
|
+
zfs: FileSystem::Zfs::Encrypt
|
43
47
|
},
|
44
48
|
false => {
|
45
|
-
ext4:
|
46
|
-
lvm:
|
47
|
-
zfs:
|
49
|
+
ext4: FileSystem::Ext4,
|
50
|
+
lvm: FileSystem::Lvm,
|
51
|
+
zfs: FileSystem::Zfs,
|
48
52
|
}
|
49
53
|
}.freeze
|
50
54
|
|
51
|
-
def self.
|
52
|
-
encrypt =
|
53
|
-
|
54
|
-
DEFAULT_FS[encrypt][
|
55
|
+
def self.select_fs
|
56
|
+
encrypt = OPTIONS[:encrypt]
|
57
|
+
fs_sym = OPTIONS[:fs].to_sym
|
58
|
+
DEFAULT_FS[encrypt][fs_sym]
|
55
59
|
end
|
56
60
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
puts "Filesystem: #{DEFAULT_OPTIONS[:fs]}"
|
64
|
-
puts "Username: #{DEFAULT_OPTIONS[:username]}"
|
65
|
-
puts "Encrypt: #{DEFAULT_OPTIONS[:encrypt]}"
|
66
|
-
puts
|
67
|
-
puts "separate-boot disk: #{DEFAULT_OPTIONS[:boot_disk]}"
|
68
|
-
puts "separate-cache disk: #{DEFAULT_OPTIONS[:cache_disk]}"
|
69
|
-
puts "separate-home disk: #{DEFAULT_OPTIONS[:home_disk]}"
|
70
|
-
puts
|
71
|
-
print "Continue? (n,y) "
|
72
|
-
case gets.chomp
|
73
|
-
when /^y|^Y/
|
74
|
-
return
|
75
|
-
else
|
76
|
-
exit 1
|
61
|
+
class Main
|
62
|
+
def initialize(argv)
|
63
|
+
argv[:cli]
|
64
|
+
@class_fs = Getch::select_fs
|
65
|
+
@log = Log.new
|
66
|
+
Getch::States.new # Update States
|
77
67
|
end
|
78
|
-
end
|
79
68
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
69
|
+
def resume
|
70
|
+
raise "No disk, use at least getch with -d DISK" if !OPTIONS[:disk]
|
71
|
+
puts "\nBuild " + OPTIONS[:os].capitalize + " Linux with the following args:\n"
|
72
|
+
puts
|
73
|
+
puts "\tLang: #{OPTIONS[:language]}"
|
74
|
+
puts "\tZoneinfo: #{OPTIONS[:zoneinfo]}"
|
75
|
+
puts "\tKeymap: #{OPTIONS[:keymap]}"
|
76
|
+
puts "\tDisk: #{OPTIONS[:disk]}"
|
77
|
+
puts "\tFilesystem: #{OPTIONS[:fs]}"
|
78
|
+
puts "\tUsername: #{OPTIONS[:username]}"
|
79
|
+
puts "\tEncrypt: #{OPTIONS[:encrypt]}"
|
80
|
+
puts
|
81
|
+
puts "\tseparate-boot disk: #{OPTIONS[:boot_disk]}"
|
82
|
+
puts "\tseparate-cache disk: #{OPTIONS[:cache_disk]}"
|
83
|
+
puts "\tseparate-home disk: #{OPTIONS[:home_disk]}"
|
84
|
+
puts
|
85
|
+
print "Continue? (y,N) "
|
86
|
+
case gets.chomp
|
87
|
+
when /^y|^Y/
|
88
|
+
return
|
89
|
+
else
|
90
|
+
exit
|
91
|
+
end
|
92
92
|
end
|
93
|
-
end
|
94
93
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
94
|
+
def partition
|
95
|
+
return if STATES[:partition]
|
96
|
+
puts
|
97
|
+
print "Partition and format disk #{OPTIONS[:disk]}, this will erase all data, continue? (y,N) "
|
98
|
+
case gets.chomp
|
99
|
+
when /^y|^Y/
|
100
|
+
@log.info("Partition start")
|
101
|
+
@class_fs::Partition.new
|
102
|
+
else
|
103
|
+
exit
|
104
|
+
end
|
105
|
+
end
|
103
106
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
107
|
+
def format
|
108
|
+
return if STATES[:format]
|
109
|
+
@class_fs::Format.new
|
110
|
+
end
|
108
111
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
112
|
+
def mount
|
113
|
+
return if STATES[:mount]
|
114
|
+
@class_fs::Mount.new.run
|
115
|
+
end
|
116
|
+
|
117
|
+
def install
|
118
|
+
if OPTIONS[:os] == 'gentoo'
|
119
|
+
install_gentoo
|
120
|
+
elsif OPTIONS[:os] == 'void'
|
121
|
+
install_void
|
122
|
+
else
|
123
|
+
puts "Options #{OPTIONS[:os]} not supported...."
|
124
|
+
exit 1
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def install_gentoo
|
129
|
+
gentoo = Getch::Gentoo::Main.new
|
130
|
+
gentoo.stage3
|
131
|
+
gentoo.config
|
132
|
+
gentoo.chroot
|
133
|
+
gentoo.kernel
|
134
|
+
gentoo.boot
|
135
|
+
end
|
136
|
+
|
137
|
+
def install_void
|
138
|
+
void = Getch::Void::Main.new
|
139
|
+
void.root_fs
|
140
|
+
void.config
|
141
|
+
void.chroot
|
142
|
+
void.boot
|
143
|
+
end
|
144
|
+
|
145
|
+
def configure
|
146
|
+
config = Getch::Config::Main.new
|
147
|
+
config.ethernet
|
148
|
+
config.wifi
|
149
|
+
config.dns
|
150
|
+
config.sysctl
|
151
|
+
config.shell
|
152
|
+
end
|
118
153
|
end
|
119
154
|
end
|