Class: Getch::Assembly
Overview
define steps/order for getch
Instance Method Summary collapse
-
#bootloader ⇒ Object
bootloader Install and configure Grub2 or Systemd-boot with Dracut Adding keys for Luks.
- #clean ⇒ Object
-
#finalize ⇒ Object
finalize Password for root, etc.
- #format ⇒ Object
- #init_devs ⇒ Object
-
#initialize ⇒ Assembly
constructor
A new instance of Assembly.
-
#luks_keys ⇒ Object
Luks_keys Install external keys to avoid enter password multiple times.
- #mount ⇒ Object
- #partition ⇒ Object
- #post_config ⇒ Object
-
#pre_config ⇒ Object
pre_config Pre configuration before updates and install packages Can contain config for a repository, CPU compilation flags, etc…
- #services ⇒ Object
- #tarball ⇒ Object
-
#terraform ⇒ Object
terraform Install all the required packages Also add services.
-
#update ⇒ Object
update Synchronise and Update the new system.
Methods included from NiTo
cp, echo, echo_a, grep?, mkdir, mount, mount?, mv, rm, search_proc_swaps, sed, sh, swapoff, swapoff_dm, touch, umount
Constructor Details
Instance Method Details
#bootloader ⇒ Object
bootloader Install and configure Grub2 or Systemd-boot with Dracut Adding keys for Luks
128 129 130 131 132 133 134 135 136 |
# File 'lib/getch/assembly.rb', line 128 def bootloader return if STATES[:bootloader] bootloader = @os::Bootloader.new bootloader.dependencies @fs::Config.new bootloader.install @state.bootloader end |
#clean ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/getch/assembly.rb', line 27 def clean return if STATES[:partition] print "\nPartition and format disk #{OPTIONS[:disk]}, this will erase all data, continue? (y,N) " case gets.chomp when /^y|^Y/ else exit end Clean.new(OPTIONS).x end |
#finalize ⇒ Object
finalize Password for root, etc
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/getch/assembly.rb', line 140 def finalize return if STATES[:finalize] @os::Finalize.new puts puts '[*!*] Installation finished [*!*]' puts @fs.end @state.finalize end |
#format ⇒ Object
47 48 49 50 51 52 |
# File 'lib/getch/assembly.rb', line 47 def format return if STATES[:format] @fs::Format.new @state.format end |
#init_devs ⇒ Object
20 21 22 23 24 25 |
# File 'lib/getch/assembly.rb', line 20 def init_devs DEVS[:root] && return @fs::Device.new DEVS[:root] || Log.new.fatal('No root, device prob !') end |
#luks_keys ⇒ Object
Luks_keys Install external keys to avoid enter password multiple times
97 98 99 100 101 102 103 104 |
# File 'lib/getch/assembly.rb', line 97 def luks_keys return unless OPTIONS[:encrypt] && OPTIONS[:fs] != 'zfs' return if STATES[:luks_keys] CryptSetup.new(DEVS, OPTIONS).keys @state.luks_keys end |
#mount ⇒ Object
54 55 56 57 58 59 |
# File 'lib/getch/assembly.rb', line 54 def mount return if STATES[:mount] @fs::Mount.new @state.mount end |
#partition ⇒ Object
40 41 42 43 44 45 |
# File 'lib/getch/assembly.rb', line 40 def partition return if STATES[:partition] @fs::Partition.new @state.partition end |
#post_config ⇒ Object
88 89 90 91 92 93 |
# File 'lib/getch/assembly.rb', line 88 def post_config return if STATES[:post_config] @os::PostConfig.new @state.post_config end |
#pre_config ⇒ Object
pre_config Pre configuration before updates and install packages Can contain config for a repository, CPU compilation flags, etc…
71 72 73 74 75 76 |
# File 'lib/getch/assembly.rb', line 71 def pre_config return if STATES[:pre_config] @os::PreConfig.new @state.pre_config end |
#services ⇒ Object
118 119 120 121 122 123 |
# File 'lib/getch/assembly.rb', line 118 def services return if STATES[:services] @os::Services.new @state.services end |
#tarball ⇒ Object
61 62 63 64 65 66 |
# File 'lib/getch/assembly.rb', line 61 def tarball return if STATES[:tarball] @os::Tarball.new.x @state.tarball end |
#terraform ⇒ Object
terraform Install all the required packages Also add services
109 110 111 112 113 114 115 116 |
# File 'lib/getch/assembly.rb', line 109 def terraform return if STATES[:terraform] # @fs::PreDeps.new @os::Terraform.new @fs::Deps.new @state.terraform end |