getch 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 880096b36b35951139edcd47f4e5668543030fe47b12eeb7057b7b968277dae4
4
- data.tar.gz: 589f41662372b0539468498154ae9c62652dda8e3ef98acdf9f3846ed4a24b74
3
+ metadata.gz: fd3d032249ccce67db0756a7bfb3d272ed3ddd526eddc87718858f7b946dcfdb
4
+ data.tar.gz: d177972f815b9e3f3881120a311710347539530630e3a5f8de616d7455d6c3c2
5
5
  SHA512:
6
- metadata.gz: 0dc24a2f84c83cabe29307bd22d039ee409f77ceb02ed72f486b8499b91ebd6e534a163b315e6b9c5c0f3b27f259240fa1108a1a5b7b3faaba435632f1274731
7
- data.tar.gz: 74569f9b52ff8cec49df4a9f77c70a2cc90b1b3c2a7a8f11dbc411ebdd8ff1ee927a5a0cb35b247e49ac7cd39ec8c0e3d57b78fc7dc22b97108fc326a146e71a
6
+ metadata.gz: b795b119532c054f28105273141cd747b7dc573c657804134233832fa824314c93b119bd9965970695b073f2ff67009f192310ef0089304e8754fede7cb38075
7
+ data.tar.gz: 1755beabb76c3a8bbaa9fc574c412593ab64ab726eff58f49caba5ca8e96de1cfec8337fc3e1be327f7d6da3d20c49a37a6ee771d6b45c5c3f7a0d23a704d81d
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.3.5, release 2022-11-21
2
+ * Tested on a live Ubuntu 22.10.
3
+ * Ensure `dracut.conf.d` exist before writing to it.
4
+ * Display the version with `-v`, `--version`.
5
+
1
6
  ## 0.3.4, release 2022-10-10
2
7
  * Can work on a Live image of Voidlinux
3
8
 
data/README.md CHANGED
@@ -41,6 +41,7 @@ Boot Manager:
41
41
  The ISO images i was able to test and that works:
42
42
  + [Archlinux](https://www.archlinux.org/download/)
43
43
  + [Portia](https://github.com/szorfein/portia/releases): Custom Archiso that includes ZFS support and Ruby.
44
+ * [Ubuntu 22.10](https://cdimage.ubuntu.com/releases/22.10/release/)
44
45
  * [Voidlinux](https://voidlinux.org/download/)
45
46
 
46
47
  You can also use your current `linux` host, just pay attention to the disk that will be used.
data/lib/dracut/root.rb CHANGED
@@ -24,6 +24,7 @@ module Dracut
24
24
  protected
25
25
 
26
26
  def host_only
27
+ mkdir "#{@mountpoint}/etc/dracut.conf.d"
27
28
  file = "#{@mountpoint}/etc/dracut.conf.d/host.conf"
28
29
  echo file, 'hostonly="yes"'
29
30
  echo_a file, 'use_fstab="yes"'
data/lib/fstab/hybrid.rb CHANGED
@@ -11,7 +11,7 @@ module Fstab
11
11
  # The swap UUID based on the lvm volume /dev/vg/swap
12
12
  def write_swap
13
13
  # The both use /etc/crypttab
14
- if Helpers.runit? or Helpers.systemd?
14
+ if Getch::Helpers.runit? || Getch::Helpers.systemd?
15
15
  echo_a @conf, "/dev/mapper/swap-#{@luks} none swap sw 0 0"
16
16
  else
17
17
  dm = Getch::Helpers.get_dm "#{@vg}-swap"
@@ -31,7 +31,7 @@ module Getch
31
31
  def bootctl
32
32
  @boot ?
33
33
  with_boot :
34
- Chroot.new("bootctl --path #{@esp} install")
34
+ Chroot.new("bootctl --esp-path=#{@esp} install")
35
35
  end
36
36
 
37
37
  # We need to umount the encrypted /boot first
@@ -39,7 +39,7 @@ module Getch
39
39
  def with_boot
40
40
  boot = @encrypt ? '/dev/mapper/boot-luks' : "/dev/#{DEVS[:boot]}"
41
41
  NiTo.umount "#{OPTIONS[:mountpoint]}/boot"
42
- Chroot.new("bootctl --path #{@esp} install")
42
+ Chroot.new("bootctl --esp-path=#{@esp} install")
43
43
  NiTo.mount boot, "#{OPTIONS[:mountpoint]}/boot"
44
44
  end
45
45
  end
data/lib/getch/options.rb CHANGED
@@ -84,6 +84,11 @@ module Getch
84
84
  OPTIONS[:verbose] = true
85
85
  end
86
86
 
87
+ opts.on('-v', '--version', 'Display the version.') do
88
+ puts "Getch v#{VERSION}"
89
+ exit
90
+ end
91
+
87
92
  opts.on('-h', '--help', 'Display this') do
88
93
  puts opts
89
94
  exit
data/lib/getch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Getch
2
- VERSION = '0.3.4'.freeze
2
+ VERSION = '0.3.6'.freeze
3
3
  end
data/lib/luks.rb CHANGED
@@ -110,7 +110,7 @@ module Luks
110
110
  # https://wiki.archlinux.org/title/Advanced_Format#File_systems
111
111
  def format_ext4
112
112
  @log.info "Formating disk with #{@format}...\n"
113
- sh 'mkfs.ext4', '-F', '-b', @bs, "/dev/mapper/#{@luks_name}"
113
+ Mkfs.ext4 "/dev/mapper/#{@luks_name}"
114
114
  end
115
115
 
116
116
  # https://wiki.archlinux.org/title/Advanced_Format#File_systems
data/lib/mkfs.rb CHANGED
@@ -4,6 +4,19 @@ require 'getch/command'
4
4
  require 'getch/helpers'
5
5
 
6
6
  module Mkfs
7
+
8
+ # Format a path using mkfs.ext4.
9
+ # @param [string] path, full path e.g /dev/sda1
10
+ #
11
+ def self.ext4(path)
12
+ bs = Getch::Helpers.get_bs(path)
13
+ if bs == '512'
14
+ Getch::Command.new('mkfs.ext4', '-F', path)
15
+ else
16
+ Getch::Command.new('mkfs.ext4', '-F', '-b', bs, path)
17
+ end
18
+ end
19
+
7
20
  class Root
8
21
  def initialize(devs, options)
9
22
  @efi = devs[:efi] ||= nil
@@ -59,7 +72,7 @@ module Mkfs
59
72
 
60
73
  def mkfs(path)
61
74
  case @fs
62
- when 'ext4' then mkfs_ext4 path
75
+ when 'ext4' then Mkfs.ext4 path
63
76
  when 'xfs' then mkfs_xfs path
64
77
  end
65
78
  end
@@ -72,15 +85,6 @@ module Mkfs
72
85
  Getch::Command.new('mkswap', '-f', path)
73
86
  end
74
87
 
75
- def mkfs_ext4(path)
76
- bs = Getch::Helpers.get_bs(path)
77
- if bs == '512'
78
- Getch::Command.new('mkfs.ext4', '-F', path)
79
- else
80
- Getch::Command.new('mkfs.ext4', '-F', '-b', bs, path)
81
- end
82
- end
83
-
84
88
  def mkfs_xfs(path)
85
89
  bs = Getch::Helpers.get_bs(path)
86
90
  Getch::Command.new('mkfs.xfs', '-f', '-s', "size=#{bs}", path)
data/lib/nito.rb CHANGED
@@ -55,12 +55,12 @@ module NiTo
55
55
 
56
56
  # Like echo 'content' > to_file
57
57
  def echo(file, content)
58
- File.write file, "#{content}\n", mode: 'w'
58
+ File.write(file, "#{content}\n")
59
59
  end
60
60
 
61
61
  # Like echo 'content' >> to_file
62
62
  def echo_a(file, content)
63
- File.write file, "#{content}\n", mode: 'a' unless grep? file, content
63
+ File.write(file, "#{content}\n", mode: 'a') unless grep? file, content
64
64
  end
65
65
 
66
66
  def cp(src, dest)
@@ -69,7 +69,7 @@ module NiTo
69
69
 
70
70
  # create a void file
71
71
  def touch(file)
72
- File.write file, '' unless File.exist? file
72
+ File.write(file, '') unless File.exist? file
73
73
  end
74
74
 
75
75
  # Like sed -i /old:new/ file
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.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
@@ -36,7 +36,7 @@ cert_chain:
36
36
  aEJeKq4/BlIwMlXPe+W5C8zp2i8hgG1/OYbwbGE1p2iRi1NIK7G/HyRqQjOqJxzE
37
37
  LLknX69FN7/G
38
38
  -----END CERTIFICATE-----
39
- date: 2022-10-10 00:00:00.000000000 Z
39
+ date: 2022-12-25 00:00:00.000000000 Z
40
40
  dependencies: []
41
41
  description:
42
42
  email:
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubygems_version: 3.3.21
194
+ rubygems_version: 3.3.23
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: A CLI tool to install Gentoo or VoidLinux.
metadata.gz.sig CHANGED
Binary file