getch 0.1.0 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +95 -22
- data/assets/network-stack.conf +63 -0
- data/bin/getch +12 -4
- data/lib/getch.rb +116 -66
- data/lib/getch/command.rb +19 -5
- data/lib/getch/config.rb +42 -0
- data/lib/getch/config/gentoo.rb +59 -0
- data/lib/getch/config/void.rb +49 -0
- data/lib/getch/filesystem.rb +5 -0
- data/lib/getch/filesystem/.mount.rb.swp +0 -0
- data/lib/getch/filesystem/clean.rb +58 -0
- data/lib/getch/filesystem/device.rb +61 -0
- data/lib/getch/filesystem/ext4.rb +1 -0
- data/lib/getch/filesystem/ext4/config.rb +8 -9
- data/lib/getch/filesystem/ext4/device.rb +2 -7
- data/lib/getch/filesystem/ext4/encrypt.rb +1 -0
- data/lib/getch/filesystem/ext4/encrypt/config.rb +8 -9
- data/lib/getch/filesystem/ext4/encrypt/deps.rb +3 -19
- data/lib/getch/filesystem/ext4/encrypt/device.rb +3 -8
- data/lib/getch/filesystem/ext4/encrypt/format.rb +3 -6
- data/lib/getch/filesystem/ext4/encrypt/mount.rb +5 -43
- data/lib/getch/filesystem/ext4/encrypt/partition.rb +29 -54
- data/lib/getch/filesystem/ext4/encrypt/void.rb +100 -0
- data/lib/getch/filesystem/ext4/format.rb +4 -6
- data/lib/getch/filesystem/ext4/mount.rb +7 -46
- data/lib/getch/filesystem/ext4/partition.rb +16 -39
- data/lib/getch/filesystem/ext4/void.rb +43 -0
- data/lib/getch/filesystem/lvm.rb +1 -0
- data/lib/getch/filesystem/lvm/config.rb +11 -15
- data/lib/getch/filesystem/lvm/deps.rb +4 -19
- data/lib/getch/filesystem/lvm/device.rb +33 -9
- data/lib/getch/filesystem/lvm/encrypt.rb +1 -0
- data/lib/getch/filesystem/lvm/encrypt/config.rb +9 -12
- data/lib/getch/filesystem/lvm/encrypt/deps.rb +4 -21
- data/lib/getch/filesystem/lvm/encrypt/device.rb +33 -9
- data/lib/getch/filesystem/lvm/encrypt/format.rb +3 -4
- data/lib/getch/filesystem/lvm/encrypt/mount.rb +7 -47
- data/lib/getch/filesystem/lvm/encrypt/partition.rb +30 -38
- data/lib/getch/filesystem/lvm/encrypt/void.rb +100 -0
- data/lib/getch/filesystem/lvm/format.rb +12 -8
- data/lib/getch/filesystem/lvm/mount.rb +7 -46
- data/lib/getch/filesystem/lvm/partition.rb +19 -31
- data/lib/getch/filesystem/lvm/void.rb +45 -0
- data/lib/getch/filesystem/mount.rb +56 -0
- data/lib/getch/filesystem/partition.rb +77 -0
- data/lib/getch/filesystem/zfs.rb +1 -0
- data/lib/getch/filesystem/zfs/config.rb +7 -8
- data/lib/getch/filesystem/zfs/deps.rb +24 -12
- data/lib/getch/filesystem/zfs/device.rb +54 -9
- 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 +11 -11
- data/lib/getch/filesystem/zfs/encrypt/deps.rb +24 -14
- data/lib/getch/filesystem/zfs/encrypt/device.rb +54 -9
- data/lib/getch/filesystem/zfs/encrypt/format.rb +84 -3
- data/lib/getch/filesystem/zfs/encrypt/mount.rb +8 -28
- data/lib/getch/filesystem/zfs/encrypt/partition.rb +26 -109
- data/lib/getch/filesystem/zfs/encrypt/void.rb +96 -0
- data/lib/getch/filesystem/zfs/format.rb +97 -4
- data/lib/getch/filesystem/zfs/mount.rb +10 -32
- data/lib/getch/filesystem/zfs/partition.rb +25 -106
- data/lib/getch/filesystem/zfs/void.rb +81 -0
- data/lib/getch/gentoo.rb +20 -16
- data/lib/getch/gentoo/boot.rb +24 -16
- data/lib/getch/gentoo/chroot.rb +16 -25
- data/lib/getch/gentoo/config.rb +67 -15
- data/lib/getch/gentoo/sources.rb +55 -13
- data/lib/getch/gentoo/stage.rb +0 -1
- data/lib/getch/gentoo/use.rb +43 -0
- data/lib/getch/gentoo/use_flag.rb +63 -0
- data/lib/getch/guard.rb +64 -0
- data/lib/getch/helpers.rb +133 -0
- data/lib/getch/log.rb +3 -2
- data/lib/getch/options.rb +46 -24
- 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 +46 -25
- metadata.gz.sig +0 -0
- data/.gitignore +0 -2
- data/CHANGELOG.md +0 -60
- 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,53 @@
|
|
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
|
6
|
-
|
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/).
|
7
19
|
|
8
|
-
|
9
|
-
+
|
10
|
-
+
|
20
|
+
Filesystem supported (with or without encryption)
|
21
|
+
+ Ext4
|
22
|
+
+ Lvm
|
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/)
|
31
|
+
+ [Archaeidae](https://github.com/szorfein/archaeidae): Custom Archiso that includes ZFS support.
|
32
|
+
|
33
|
+
## Dependencies
|
34
|
+
Getch is build without external libs, so it only require `ruby >= 2.5`.
|
16
35
|
|
17
36
|
## Install
|
18
37
|
Getch is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
|
19
38
|
With `gem` installed:
|
20
39
|
|
21
40
|
$ gem cert --add <(curl -Ls https://raw.githubusercontent.com/szorfein/getch/master/certs/szorfein.pem)
|
22
|
-
|
23
41
|
$ gem install getch -P HighSecurity
|
24
42
|
|
25
|
-
|
43
|
+
If you want to try the master branch (can be unstable):
|
26
44
|
|
27
|
-
#
|
28
|
-
#
|
45
|
+
# git clone https://github.com/szorfein/getch
|
46
|
+
# cd getch
|
47
|
+
# ruby -I lib bin/getch -h
|
29
48
|
|
30
49
|
## Usage
|
31
|
-
Just ensure than the script is run with a root account
|
50
|
+
Just ensure than the script is run with a root account.
|
32
51
|
|
33
52
|
# getch -h
|
34
53
|
|
@@ -39,28 +58,82 @@ For a french user:
|
|
39
58
|
|
40
59
|
# getch --zoneinfo "Europe/Paris" --language fr_FR --keymap fr
|
41
60
|
|
42
|
-
Install Gentoo on LVM
|
61
|
+
Install Gentoo on LVM and use a different root disk `/dev/sdc`
|
43
62
|
|
44
|
-
# getch --format lvm --disk
|
63
|
+
# getch --format lvm --disk sdc
|
45
64
|
|
46
65
|
Encrypt your disk with LVM with a french keymap
|
47
66
|
|
48
67
|
# getch --format lvm --encrypt --keymap fr
|
49
68
|
|
50
|
-
Encrypt with ext4 and create a
|
69
|
+
Encrypt with ext4 and create a new user `ninja`:
|
51
70
|
|
52
71
|
# getch --format ext4 --encrypt --username ninja
|
53
72
|
|
73
|
+
With ZFS, if used with `--encrypt`, it use the native ZFS encryption:
|
74
|
+
|
75
|
+
# getch --format zfs
|
76
|
+
|
77
|
+
With `Void Linux`:
|
78
|
+
|
79
|
+
# getch --os void --encrypt -k fr
|
80
|
+
|
54
81
|
## Troubleshooting
|
55
82
|
|
56
|
-
#### LVM
|
57
|
-
|
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`:
|
85
|
+
|
86
|
+
# vgdisplay | grep vg0
|
87
|
+
# vgremove -f vg0
|
88
|
+
# pvremove -f /dev/sdb
|
58
89
|
|
59
90
|
#### Encryption enable on BIOS with ext4
|
60
|
-
To decrypt your disk on BIOS system, you have to enter your password
|
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).
|
61
92
|
Also with GRUB, only a `us` keymap is working.
|
62
93
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
94
|
+
#### ZFS for Gentoo
|
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:
|
96
|
+
|
97
|
+
The zpool name should be visible (rpool-150ed here), so enter in the Genkernel shell:
|
98
|
+
|
99
|
+
> shell
|
100
|
+
zpool import -f -N -R /tmp rpool-150ed
|
101
|
+
zpool export -a
|
102
|
+
|
103
|
+
Then, just reboot now, it's all.
|
104
|
+
|
105
|
+
*INFO*: To create the zpool, getch use the 5 fist characters from the `partuuid`, just replace `sdX` by your real device:
|
106
|
+
|
107
|
+
# ls -l /dev/disk/by-partuuid/ | grep sdX4
|
108
|
+
-> 150ed969...
|
109
|
+
|
110
|
+
The pool will be called `rpool-150ed`.
|
111
|
+
|
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,22 +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'
|
9
|
+
require_relative 'getch/config'
|
10
|
+
require_relative 'getch/guard'
|
11
|
+
require_relative 'getch/version'
|
8
12
|
|
9
13
|
module Getch
|
10
14
|
|
11
|
-
|
12
|
-
language
|
13
|
-
zoneinfo
|
14
|
-
keymap
|
15
|
-
disk
|
16
|
-
fs
|
17
|
-
username
|
18
|
-
|
19
|
-
|
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
|
20
28
|
}
|
21
29
|
|
22
30
|
STATES = {
|
@@ -29,76 +37,118 @@ module Getch
|
|
29
37
|
:gentoo_kernel => false
|
30
38
|
}
|
31
39
|
|
32
|
-
MOUNTPOINT = "/mnt/gentoo"
|
40
|
+
MOUNTPOINT = "/mnt/gentoo"
|
41
|
+
|
33
42
|
DEFAULT_FS = {
|
34
43
|
true => {
|
35
|
-
ext4:
|
36
|
-
lvm:
|
37
|
-
zfs:
|
44
|
+
ext4: FileSystem::Ext4::Encrypt,
|
45
|
+
lvm: FileSystem::Lvm::Encrypt,
|
46
|
+
zfs: FileSystem::Zfs::Encrypt
|
38
47
|
},
|
39
48
|
false => {
|
40
|
-
ext4:
|
41
|
-
lvm:
|
42
|
-
zfs:
|
49
|
+
ext4: FileSystem::Ext4,
|
50
|
+
lvm: FileSystem::Lvm,
|
51
|
+
zfs: FileSystem::Zfs,
|
43
52
|
}
|
44
53
|
}.freeze
|
45
54
|
|
46
|
-
def self.
|
47
|
-
encrypt =
|
48
|
-
|
49
|
-
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]
|
50
59
|
end
|
51
60
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
puts "fs: #{DEFAULT_OPTIONS[:fs]}"
|
59
|
-
puts "username: #{DEFAULT_OPTIONS[:username]}"
|
60
|
-
puts "encrypt: #{DEFAULT_OPTIONS[:encrypt]}"
|
61
|
-
puts
|
62
|
-
print "Continue? (n,y) "
|
63
|
-
case gets.chomp
|
64
|
-
when /^y|^Y/
|
65
|
-
return
|
66
|
-
else
|
67
|
-
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
|
68
67
|
end
|
69
|
-
end
|
70
68
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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
|
83
92
|
end
|
84
|
-
end
|
85
93
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
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
|
106
|
+
|
107
|
+
def format
|
108
|
+
return if STATES[:format]
|
109
|
+
@class_fs::Format.new
|
110
|
+
end
|
94
111
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
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
|
103
153
|
end
|
104
154
|
end
|