getch 0.1.9 → 0.3.3
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/CHANGELOG.md +132 -0
- data/LICENSE +10 -0
- data/README.md +35 -29
- data/bin/getch +8 -6
- data/getch.gemspec +31 -0
- data/lib/clean.rb +149 -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 +88 -128
- 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 +0 -36
- data/lib/getch/config.rb +16 -37
- data/lib/getch/device.rb +67 -0
- data/lib/getch/filesystem/ext4/encrypt/config.rb +9 -71
- data/lib/getch/filesystem/ext4/encrypt/deps.rb +15 -25
- data/lib/getch/filesystem/ext4/encrypt/device.rb +11 -5
- data/lib/getch/filesystem/ext4/encrypt/format.rb +6 -15
- data/lib/getch/filesystem/ext4/encrypt/mount.rb +7 -11
- data/lib/getch/filesystem/ext4/encrypt/partition.rb +10 -76
- data/lib/getch/filesystem/ext4/encrypt/void.rb +0 -38
- data/lib/getch/filesystem/ext4/encrypt.rb +2 -1
- 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/{lvm/encrypt → ext4/hybrid}/void.rb +0 -39
- 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} +6 -4
- data/lib/getch/filesystem/ext4/minimal/config.rb +25 -0
- data/lib/getch/filesystem/ext4/{device.rb → minimal/deps.rb} +3 -1
- 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 +7 -7
- data/lib/getch/filesystem/zfs/encrypt/config.rb +10 -39
- data/lib/getch/filesystem/zfs/encrypt/deps.rb +4 -55
- data/lib/getch/filesystem/zfs/encrypt/device.rb +7 -51
- data/lib/getch/filesystem/zfs/encrypt/format.rb +6 -90
- data/lib/getch/filesystem/zfs/encrypt/mount.rb +16 -35
- data/lib/getch/filesystem/zfs/encrypt/partition.rb +6 -54
- data/lib/getch/filesystem/zfs/encrypt.rb +2 -1
- 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 +1 -7
- data/lib/getch/filesystem.rb +0 -6
- data/lib/getch/gentoo/bootloader.rb +23 -44
- 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 +39 -33
- 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 +9 -6
- data/lib/getch/gentoo/use_flag.rb +17 -20
- data/lib/getch/gentoo.rb +9 -75
- data/lib/getch/guard.rb +3 -3
- data/lib/getch/helpers.rb +63 -115
- data/lib/getch/log.rb +87 -25
- data/lib/getch/options.rb +41 -11
- data/lib/getch/states.rb +28 -8
- 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/{stage.rb → tarball.rb} +34 -14
- data/lib/getch/void/terraform.rb +28 -0
- data/lib/getch/void/update.rb +33 -0
- data/lib/getch/void.rb +9 -59
- data/lib/getch.rb +58 -90
- data/lib/luks.rb +239 -0
- data/lib/lvm2.rb +112 -0
- data/lib/mkfs/zfs.rb +167 -0
- data/lib/mkfs.rb +144 -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 +113 -74
- metadata.gz.sig +0 -0
- data/lib/getch/config/gentoo.rb +0 -58
- data/lib/getch/filesystem/clean.rb +0 -58
- data/lib/getch/filesystem/device.rb +0 -63
- data/lib/getch/filesystem/ext4/config.rb +0 -62
- data/lib/getch/filesystem/ext4/deps.rb +0 -24
- data/lib/getch/filesystem/ext4/format.rb +0 -31
- data/lib/getch/filesystem/ext4/mount.rb +0 -26
- data/lib/getch/filesystem/ext4/partition.rb +0 -55
- data/lib/getch/filesystem/ext4/void.rb +0 -44
- data/lib/getch/filesystem/lvm/config.rb +0 -44
- data/lib/getch/filesystem/lvm/deps.rb +0 -44
- data/lib/getch/filesystem/lvm/device.rb +0 -45
- data/lib/getch/filesystem/lvm/encrypt/config.rb +0 -74
- data/lib/getch/filesystem/lvm/encrypt/deps.rb +0 -49
- data/lib/getch/filesystem/lvm/encrypt/device.rb +0 -48
- data/lib/getch/filesystem/lvm/encrypt/format.rb +0 -35
- data/lib/getch/filesystem/lvm/encrypt/mount.rb +0 -27
- data/lib/getch/filesystem/lvm/encrypt/partition.rb +0 -84
- data/lib/getch/filesystem/lvm/encrypt.rb +0 -18
- data/lib/getch/filesystem/lvm/format.rb +0 -32
- data/lib/getch/filesystem/lvm/mount.rb +0 -26
- data/lib/getch/filesystem/lvm/partition.rb +0 -72
- data/lib/getch/filesystem/lvm/void.rb +0 -46
- data/lib/getch/filesystem/mount.rb +0 -63
- data/lib/getch/filesystem/partition.rb +0 -85
- data/lib/getch/filesystem/zfs/config.rb +0 -43
- data/lib/getch/filesystem/zfs/deps.rb +0 -67
- data/lib/getch/filesystem/zfs/device.rb +0 -66
- data/lib/getch/filesystem/zfs/encrypt/void.rb +0 -97
- data/lib/getch/filesystem/zfs/format.rb +0 -117
- data/lib/getch/filesystem/zfs/mount.rb +0 -47
- data/lib/getch/filesystem/zfs/partition.rb +0 -69
- data/lib/getch/filesystem/zfs/void.rb +0 -81
- data/lib/getch/gentoo/boot.rb +0 -64
- data/lib/getch/gentoo/chroot.rb +0 -75
- data/lib/getch/gentoo/config.rb +0 -167
- data/lib/getch/gentoo/stage.rb +0 -73
- data/lib/getch/void/boot.rb +0 -84
- data/lib/getch/void/chroot.rb +0 -56
- data/lib/getch/void/config.rb +0 -90
@@ -5,59 +5,79 @@ require 'open3'
|
|
5
5
|
|
6
6
|
module Getch
|
7
7
|
module Void
|
8
|
-
class
|
8
|
+
class Tarball
|
9
9
|
def initialize
|
10
|
+
@log = Log.new
|
10
11
|
@url = 'https://alpha.de.repo.voidlinux.org/live/current'
|
11
12
|
@file = 'sha256sum.txt'
|
12
13
|
@xbps = false
|
13
|
-
Dir.chdir
|
14
|
+
Dir.chdir OPTIONS[:mountpoint]
|
15
|
+
end
|
16
|
+
|
17
|
+
def x
|
18
|
+
search_archive
|
19
|
+
download
|
20
|
+
checksum
|
21
|
+
install
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
|
26
|
+
def tarball
|
27
|
+
OPTIONS[:musl] ?
|
28
|
+
/void-x86_64-musl-ROOTFS-[\d._]+.tar.xz/ :
|
29
|
+
/void-x86_64-ROOTFS-[\d._]+.tar.xz/
|
14
30
|
end
|
15
31
|
|
16
32
|
# Search only the glibc x86_64 for now
|
17
33
|
def search_archive
|
18
34
|
yurl = "#{@url}/#{@file}"
|
19
|
-
|
35
|
+
@log.info "Opening #{yurl}...\n"
|
20
36
|
Helpers.get_file_online(yurl, @file)
|
21
37
|
File.open(@file).each do |l|
|
22
|
-
@xbps = l.tr('()', '').split(' ') if l.match(
|
38
|
+
@xbps = l.tr('()', '').split(' ') if l.match(tarball)
|
23
39
|
end
|
24
40
|
end
|
25
41
|
|
26
42
|
def download
|
27
|
-
|
43
|
+
@log.fatal 'No file found, retry later.' unless @xbps
|
28
44
|
return if File.exist? @xbps[1]
|
29
45
|
|
30
|
-
|
46
|
+
@log.info "Downloading #{@xbps[1]}..."
|
31
47
|
Helpers.get_file_online("#{@url}/#{@xbps[1]}", @xbps[1])
|
48
|
+
@log.result_ok
|
32
49
|
end
|
33
50
|
|
34
51
|
def checksum
|
35
|
-
|
52
|
+
@log.info 'Checking SHA256 checksum...'
|
36
53
|
# Should contain 2 spaces...
|
37
54
|
command = "echo #{@xbps[3]} #{@xbps[1]} | sha256sum --check"
|
38
55
|
_, stderr, status = Open3.capture3(command)
|
39
56
|
if status.success? then
|
40
|
-
|
41
|
-
decompress
|
42
|
-
cleaning
|
57
|
+
@log.result_ok
|
43
58
|
return
|
44
59
|
end
|
45
60
|
cleaning
|
46
|
-
|
61
|
+
@log.fatal "Problem with the checksum, stderr\n#{stderr}"
|
62
|
+
end
|
63
|
+
|
64
|
+
def install
|
65
|
+
decompress
|
66
|
+
cleaning
|
47
67
|
end
|
48
68
|
|
49
69
|
private
|
50
70
|
|
51
71
|
def decompress
|
52
|
-
|
72
|
+
@log.info "Decompressing #{@xbps[1]}..."
|
53
73
|
cmd = "tar xpf #{@xbps[1]} --xattrs-include=\'*.*\' --numeric-owner"
|
54
74
|
_, stderr, status = Open3.capture3(cmd)
|
55
75
|
if status.success? then
|
56
|
-
|
76
|
+
@log.result_ok
|
57
77
|
return
|
58
78
|
end
|
59
79
|
cleaning
|
60
|
-
|
80
|
+
@log.fatal "Fail to decompressing #{@xbps[1]} - #{stderr}."
|
61
81
|
end
|
62
82
|
|
63
83
|
def cleaning
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Getch
|
2
|
+
module Void
|
3
|
+
class Terraform
|
4
|
+
def initialize
|
5
|
+
x
|
6
|
+
end
|
7
|
+
|
8
|
+
protected
|
9
|
+
|
10
|
+
def x
|
11
|
+
install_pkgs
|
12
|
+
end
|
13
|
+
|
14
|
+
def install_pkgs
|
15
|
+
@pkgs = 'sudo'
|
16
|
+
@pkgs << ' vim'
|
17
|
+
@pkgs << ' iptables'
|
18
|
+
@pkgs << ' runit-iptables'
|
19
|
+
@pkgs << ' iwd'
|
20
|
+
@pkgs << ' dhcpcd'
|
21
|
+
@pkgs << ' lvm2' if OPTIONS[:fs] == 'lvm'
|
22
|
+
@pkgs << ' zfs' if OPTIONS[:fs] == 'zfs'
|
23
|
+
@pkgs << ' cryptsetup' if OPTIONS[:encrypt]
|
24
|
+
Install.new(@pkgs)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Getch
|
4
|
+
module Void
|
5
|
+
class Update
|
6
|
+
def initialize
|
7
|
+
@log = Log.new
|
8
|
+
x
|
9
|
+
end
|
10
|
+
|
11
|
+
protected
|
12
|
+
|
13
|
+
# https://docs.voidlinux.org/installation/guides/chroot.html#install-base-system-rootfs-method-only
|
14
|
+
def x
|
15
|
+
sync
|
16
|
+
update
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def sync
|
22
|
+
@log.info "Synchronize index...\n"
|
23
|
+
ChrootOutput.new '/usr/bin/xbps-install', '-Suy', 'xbps'
|
24
|
+
end
|
25
|
+
|
26
|
+
def update
|
27
|
+
ChrootOutput.new '/usr/bin/xbps-install -uy'
|
28
|
+
ChrootOutput.new '/usr/bin/xbps-install -y base-system'
|
29
|
+
ChrootOutput.new '/usr/bin/xbps-remove -y base-voidstrap'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/getch/void.rb
CHANGED
@@ -1,65 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative 'void/stage'
|
4
|
-
require_relative 'void/config'
|
5
|
-
require_relative 'void/chroot'
|
6
|
-
#require_relative 'void/sources'
|
7
|
-
require_relative 'void/boot'
|
8
|
-
|
9
3
|
module Getch
|
10
4
|
module Void
|
11
|
-
class Main
|
12
|
-
def initialize
|
13
|
-
@state = Getch::States.new
|
14
|
-
end
|
15
|
-
|
16
|
-
def root_fs
|
17
|
-
return if STATES[:gentoo_base]
|
18
|
-
|
19
|
-
xbps = Getch::Void::RootFS.new
|
20
|
-
xbps.search_archive
|
21
|
-
xbps.download
|
22
|
-
xbps.checksum
|
23
|
-
@state.stage3
|
24
|
-
end
|
25
|
-
|
26
|
-
def config
|
27
|
-
return if STATES[:gentoo_config]
|
28
|
-
|
29
|
-
config = Getch::Void::Config.new
|
30
|
-
config.host
|
31
|
-
config.network
|
32
|
-
config.system
|
33
|
-
config.locale
|
34
|
-
@state.config
|
35
|
-
end
|
36
|
-
|
37
|
-
def chroot
|
38
|
-
return if STATES[:gentoo_kernel]
|
39
|
-
|
40
|
-
chroot = Getch::Void::Chroot.new
|
41
|
-
chroot.update
|
42
|
-
chroot.fs
|
43
|
-
chroot.extras
|
44
|
-
chroot.install_pkgs
|
45
|
-
end
|
46
|
-
|
47
|
-
def kernel
|
48
|
-
return if STATES[:gentoo_kernel]
|
49
|
-
|
50
|
-
Getch::Void::Sources.new
|
51
|
-
@state.kernel
|
52
|
-
end
|
53
|
-
|
54
|
-
def boot
|
55
|
-
boot = Getch::Void::Boot.new
|
56
|
-
boot.new_user
|
57
|
-
boot.fstab
|
58
|
-
boot.dracut
|
59
|
-
boot.grub
|
60
|
-
boot.initramfs
|
61
|
-
boot.finish
|
62
|
-
end
|
63
|
-
end
|
64
5
|
end
|
65
6
|
end
|
7
|
+
|
8
|
+
require_relative 'void/tarball'
|
9
|
+
require_relative 'void/pre_config'
|
10
|
+
require_relative 'void/update'
|
11
|
+
require_relative 'void/post_config'
|
12
|
+
require_relative 'void/terraform'
|
13
|
+
require_relative 'void/services'
|
14
|
+
require_relative 'void/bootloader'
|
15
|
+
require_relative 'void/finalize'
|
data/lib/getch.rb
CHANGED
@@ -5,7 +5,10 @@ require_relative 'getch/options'
|
|
5
5
|
require_relative 'getch/states'
|
6
6
|
require_relative 'getch/gentoo'
|
7
7
|
require_relative 'getch/void'
|
8
|
+
require_relative 'getch/device'
|
8
9
|
require_relative 'getch/filesystem'
|
10
|
+
require_relative 'getch/tree'
|
11
|
+
require_relative 'getch/assembly'
|
9
12
|
require_relative 'getch/command'
|
10
13
|
require_relative 'getch/log'
|
11
14
|
require_relative 'getch/config'
|
@@ -15,72 +18,65 @@ require_relative 'getch/version'
|
|
15
18
|
module Getch
|
16
19
|
|
17
20
|
OPTIONS = {
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
21
|
+
boot_disk: false,
|
22
|
+
disk: false,
|
23
|
+
cache_disk: false,
|
24
|
+
encrypt: false,
|
25
|
+
fs: 'ext4',
|
26
|
+
home_disk: false,
|
27
|
+
keymap: 'us',
|
28
|
+
language: 'en_US',
|
29
|
+
luks_name: 'luks',
|
30
|
+
lvm: false,
|
31
|
+
mountpoint: '/mnt/getch',
|
32
|
+
musl: false,
|
33
|
+
os: 'gentoo',
|
34
|
+
timezone: 'UTC',
|
35
|
+
username: false,
|
36
|
+
verbose: false,
|
37
|
+
vg_name: 'vg4',
|
38
|
+
zfs_name: 'pool'
|
30
39
|
}
|
31
40
|
|
32
41
|
STATES = {
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
42
|
+
partition: false,
|
43
|
+
format: false,
|
44
|
+
mount: false,
|
45
|
+
tarball: false,
|
46
|
+
pre_config: false,
|
47
|
+
update: false,
|
48
|
+
post_config: false,
|
49
|
+
terraform: false,
|
50
|
+
bootloader: false,
|
51
|
+
services: false,
|
52
|
+
finalize: false,
|
41
53
|
}
|
42
54
|
|
43
|
-
MOUNTPOINT = '/mnt/
|
44
|
-
|
45
|
-
DEFAULT_FS = {
|
46
|
-
true => {
|
47
|
-
ext4: FileSystem::Ext4::Encrypt,
|
48
|
-
lvm: FileSystem::Lvm::Encrypt,
|
49
|
-
zfs: FileSystem::Zfs::Encrypt
|
50
|
-
},
|
51
|
-
false => {
|
52
|
-
ext4: FileSystem::Ext4,
|
53
|
-
lvm: FileSystem::Lvm,
|
54
|
-
zfs: FileSystem::Zfs,
|
55
|
-
}
|
56
|
-
}.freeze
|
57
|
-
|
58
|
-
def self.select_fs
|
59
|
-
encrypt = OPTIONS[:encrypt]
|
60
|
-
fs_sym = OPTIONS[:fs].to_sym
|
61
|
-
DEFAULT_FS[encrypt][fs_sym]
|
62
|
-
end
|
55
|
+
MOUNTPOINT = '/mnt/getch'
|
56
|
+
DEVS = {}
|
63
57
|
|
64
58
|
class Main
|
65
59
|
def initialize(argv)
|
66
60
|
argv[:cli]
|
67
|
-
@class_fs = Getch::select_fs
|
68
61
|
@log = Log.new
|
69
|
-
|
62
|
+
@assembly = Assembly.new
|
70
63
|
end
|
71
64
|
|
72
65
|
def resume
|
73
|
-
|
66
|
+
STATES[:partition] && return
|
67
|
+
|
68
|
+
@log.fatal 'No disk, use at least getch with -d DISK' unless OPTIONS[:disk]
|
74
69
|
|
75
70
|
puts "\nBuild " + OPTIONS[:os].capitalize + " Linux with the following args:\n"
|
76
71
|
puts
|
77
72
|
puts "\tLang: #{OPTIONS[:language]}"
|
78
|
-
puts "\
|
73
|
+
puts "\tTimezone: #{OPTIONS[:timezone]}"
|
79
74
|
puts "\tKeymap: #{OPTIONS[:keymap]}"
|
80
75
|
puts "\tDisk: #{OPTIONS[:disk]}"
|
81
76
|
puts "\tFilesystem: #{OPTIONS[:fs]}"
|
82
77
|
puts "\tUsername: #{OPTIONS[:username]}"
|
83
78
|
puts "\tEncrypt: #{OPTIONS[:encrypt]}"
|
79
|
+
puts "\tMusl: #{OPTIONS[:musl]}"
|
84
80
|
puts
|
85
81
|
puts "\tseparate-boot disk: #{OPTIONS[:boot_disk]}"
|
86
82
|
puts "\tseparate-cache disk: #{OPTIONS[:cache_disk]}"
|
@@ -89,67 +85,39 @@ module Getch
|
|
89
85
|
print 'Continue? (y,N) '
|
90
86
|
case gets.chomp
|
91
87
|
when /^y|^Y/
|
92
|
-
return
|
93
88
|
else
|
94
89
|
exit
|
95
90
|
end
|
96
91
|
end
|
97
92
|
|
98
|
-
def
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
case gets.chomp
|
104
|
-
when /^y|^Y/
|
105
|
-
@log.info('Partition start')
|
106
|
-
@class_fs::Partition.new
|
107
|
-
else
|
108
|
-
exit
|
109
|
-
end
|
93
|
+
def prepare_disk
|
94
|
+
@assembly.clean
|
95
|
+
@assembly.partition
|
96
|
+
@assembly.format
|
97
|
+
@assembly.mount
|
110
98
|
end
|
111
99
|
|
112
|
-
def
|
113
|
-
|
114
|
-
|
115
|
-
@
|
100
|
+
def install_system
|
101
|
+
@assembly.tarball
|
102
|
+
@assembly.pre_config
|
103
|
+
@assembly.update
|
104
|
+
@assembly.post_config
|
116
105
|
end
|
117
106
|
|
118
|
-
def
|
119
|
-
|
120
|
-
|
121
|
-
@class_fs::Mount.new.run
|
107
|
+
def terraform
|
108
|
+
@assembly.terraform
|
109
|
+
@assembly.services
|
122
110
|
end
|
123
111
|
|
124
|
-
def
|
125
|
-
|
126
|
-
|
127
|
-
elsif OPTIONS[:os] == 'void'
|
128
|
-
install_void
|
129
|
-
else
|
130
|
-
puts "Options #{OPTIONS[:os]} not supported...."
|
131
|
-
exit 1
|
132
|
-
end
|
112
|
+
def bootloader
|
113
|
+
@assembly.luks_keys
|
114
|
+
@assembly.bootloader
|
133
115
|
end
|
134
116
|
|
135
|
-
def
|
136
|
-
|
137
|
-
gentoo.stage3
|
138
|
-
gentoo.config
|
139
|
-
gentoo.chroot
|
140
|
-
gentoo.bootloader
|
141
|
-
gentoo.kernel
|
142
|
-
gentoo.boot
|
117
|
+
def finalize
|
118
|
+
@assembly.finalize
|
143
119
|
end
|
144
120
|
|
145
|
-
def install_void
|
146
|
-
void = Getch::Void::Main.new
|
147
|
-
void.root_fs
|
148
|
-
void.config
|
149
|
-
void.chroot
|
150
|
-
void.boot
|
151
|
-
end
|
152
|
-
|
153
121
|
def configure
|
154
122
|
config = Getch::Config::Main.new
|
155
123
|
config.ethernet
|