getch 0.0.4 → 0.0.5
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/CHANGELOG.md +16 -5
- data/README.md +17 -0
- data/lib/getch/gentoo.rb +1 -0
- data/lib/getch/gentoo/boot.rb +47 -3
- data/lib/getch/gentoo/config.rb +6 -0
- data/lib/getch/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +2 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d947133437b5880e6880404a19c59e272ab01cf3c7acca7f4775d646c9a99597
|
4
|
+
data.tar.gz: a910853539cd82f577ede94eab669ce323fc71a5986990f060dc54e96338f9b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0e4a3c3ade0f4acc7793de34419248168bcce5211deaf48befbb85cf357519262157850b8c7524e178d9447e28b28c2bf5a89dcde0a1c887d46fd324656e96a
|
7
|
+
data.tar.gz: cb41112758289ca2bf43fe433cb69177608b859c02a61cfa0af724a874a94f812d1231ee09e8ababc884c270160976be18c52b735ceca3d74ad694ee2eb11d50
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,18 +1,29 @@
|
|
1
|
+
## 0.0.5, release 2020-09-17
|
2
|
+
* Generate a hostname
|
3
|
+
* Configure systemd-boot for UEFI system
|
4
|
+
|
5
|
+
## 0.0.4, release 2020-09-16
|
6
|
+
* Boot on a BIOS system with VirtualBox
|
7
|
+
* Install Grub
|
8
|
+
* Create user
|
9
|
+
* Create passwd for root and user
|
10
|
+
* Check lsmod to install deps (like wpa_supplicant) and patch the kernel
|
11
|
+
|
1
12
|
## 0.0.3, release 2020-09-14
|
2
|
-
* Add
|
13
|
+
* Add dhcpcd, gentoo-sources, linux-firmware
|
3
14
|
* Kernel build by using https://github.com/szorfein/garden
|
4
|
-
*
|
5
|
-
* Download all the lastest ebuild
|
15
|
+
* Populate /etc/portage (/etc/portage/package.{use,unmask,accept_keywords}/zzz_via_autounmask)
|
16
|
+
* Download all the lastest ebuild via emerge-webrsync
|
6
17
|
* Update gentoo via emerge -uDN @world
|
7
18
|
|
8
19
|
## 0.0.2, release 2020-09-12
|
9
20
|
* Getch genere a file /tmp/install_gentoo to avoid to remake same task over and over
|
10
|
-
* Support for
|
21
|
+
* Support for ext4
|
11
22
|
* Mount partition on /mnt/gentoo during the install
|
12
23
|
* Download, verify the checksum and decompress the last stage3-amd64-systemd
|
13
24
|
|
14
25
|
## 0.0.1, release 2020-09-10
|
15
|
-
*
|
26
|
+
* Partition disk (at least 15G required) with sgdisk (create /boot, /, /home, and swap)
|
16
27
|
* Support for one disk with -d|--disk
|
17
28
|
* Add few options for the CLI
|
18
29
|
* Add bin/setup.sh to install ruby when boot on a ISO file
|
data/README.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
# Getch
|
2
2
|
A CLI tool to install Gentoo.
|
3
3
|
|
4
|
+
## Description
|
5
|
+
Actually, Getch support only the [AMD64 handbook](https://wiki.gentoo.org/wiki/Handbook:AMD64) and only with the last `stage3-amd64-systemd`.
|
6
|
+
It also require a disk (only one for now) with a minimum of 20G.
|
7
|
+
|
8
|
+
Filesystem supported by Getch are: (the list will evolve...)
|
9
|
+
+ ext4 with GRUB2 for BIOS based system and systemd-boot for UEFI systems.
|
10
|
+
|
11
|
+
I would also add disk encryption soon.
|
12
|
+
|
13
|
+
The ISO images i was able to test and that works:
|
14
|
+
+ [Archlinux](https://www.archlinux.org/download/)
|
15
|
+
|
4
16
|
## Install
|
5
17
|
Getch is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
|
6
18
|
With `gem` installed:
|
@@ -22,3 +34,8 @@ When you boot from an `iso`, you can install `ruby`, `getch` and correct your `P
|
|
22
34
|
For a french user:
|
23
35
|
|
24
36
|
# getch --username ninja --zoneinfo "Europe/Paris" --language fr_FR --keyboard fr
|
37
|
+
|
38
|
+
## Issues
|
39
|
+
If need more support for your hardware (network, sound card, ...), you can submit a [new issue](https://github.com/szorfein/getch/issues/new) and post the output of the following command:
|
40
|
+
+ lspci
|
41
|
+
+ lsmod
|
data/lib/getch/gentoo.rb
CHANGED
data/lib/getch/gentoo/boot.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
module Getch
|
2
4
|
module Gentoo
|
3
5
|
class Boot
|
@@ -8,13 +10,55 @@ module Getch
|
|
8
10
|
|
9
11
|
def start
|
10
12
|
gen_fstab
|
11
|
-
|
13
|
+
bootloader
|
12
14
|
password
|
13
15
|
umount
|
14
16
|
end
|
15
17
|
|
18
|
+
def bootloader
|
19
|
+
if Helpers::efi?
|
20
|
+
bootctl
|
21
|
+
else
|
22
|
+
grub
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# bootctl is alrealy installed with the stage3-amd64-systemd
|
27
|
+
def bootctl
|
28
|
+
bootctl_dep
|
29
|
+
puts "Configuring systemd-boot."
|
30
|
+
# ref: https://forums.gentoo.org/viewtopic-p-8118822.html
|
31
|
+
esp = '/boot/efi'
|
32
|
+
#systemd = "#{MOUNTPOINT}/usr/lib/systemd"
|
33
|
+
#FileUtils.mkdir_p "#{systemd}#{esp}", mode: 0700 if ! Dir.exist?("#{systemd}#{esp}")
|
34
|
+
exec_chroot("bootctl --path #{esp} install")
|
35
|
+
|
36
|
+
root = `lsblk -o "PARTUUID" /dev/#{@disk}3 | tail -1`.chomp()
|
37
|
+
init = '/usr/lib/systemd/systemd'
|
38
|
+
datas_gentoo = [
|
39
|
+
'title Gentoo Linux',
|
40
|
+
'linux /vmlinuz',
|
41
|
+
"options root=PARTUUID=#{root} init=#{init} rw"
|
42
|
+
]
|
43
|
+
datas_loader = [
|
44
|
+
'default gentoo',
|
45
|
+
'timeout 3',
|
46
|
+
'editor 0'
|
47
|
+
]
|
48
|
+
File.write("#{MOUNTPOINT}/#{esp}/loader/entries/gentoo.conf", datas_gentoo.join("\n"))
|
49
|
+
File.write("#{MOUNTPOINT}/#{esp}/loader/loader.conf", datas_loader.join("\n"))
|
50
|
+
|
51
|
+
FileUtils.cp("#{MOUNTPOINT}/usr/src/linux/arch/x86/boot/bzImage", "#{MOUNTPOINT}/#{esp}/vmlinuz", preserve: true)
|
52
|
+
exec_chroot("bootctl --path #{esp} update")
|
53
|
+
end
|
54
|
+
|
55
|
+
def bootctl_dep
|
56
|
+
puts 'Installing systemd-boot...'
|
57
|
+
exec_chroot("euse -p sys-apps/systemd -E gnuefi")
|
58
|
+
Helpers::emerge("sys-apps/systemd efivar", MOUNTPOINT)
|
59
|
+
end
|
60
|
+
|
16
61
|
def grub
|
17
|
-
return if Helpers::efi?
|
18
62
|
puts 'Installing GRUB...'
|
19
63
|
Helpers::emerge("sys-boot/grub:2", MOUNTPOINT)
|
20
64
|
exec_chroot("grub-install /dev/#{@disk}")
|
@@ -36,7 +80,7 @@ module Getch
|
|
36
80
|
|
37
81
|
def umount
|
38
82
|
Helpers::exec_or_die("umount -l /mnt/gentoo/dev{/shm,/pts,}")
|
39
|
-
Helpers::exec_or_die("umount -R #{
|
83
|
+
Helpers::exec_or_die("umount -R #{MOUNTPOINT}")
|
40
84
|
puts "Reboot when you have done"
|
41
85
|
end
|
42
86
|
|
data/lib/getch/gentoo/config.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'tempfile'
|
3
|
+
require 'securerandom'
|
3
4
|
|
4
5
|
module Getch
|
5
6
|
module Gentoo
|
@@ -50,6 +51,11 @@ module Getch
|
|
50
51
|
File.write("#{MOUNTPOINT}/etc/vconsole.conf", "KEYMAP=#{options.keyboard}")
|
51
52
|
end
|
52
53
|
|
54
|
+
def hostname
|
55
|
+
id = SecureRandom.hex(2)
|
56
|
+
File.write("#{MOUNTPOINT}/etc/hostname", "gentoo-hatch-#{id}")
|
57
|
+
end
|
58
|
+
|
53
59
|
def portage_fs
|
54
60
|
portage = "#{MOUNTPOINT}/etc/portage"
|
55
61
|
Helpers::create_dir("#{portage}/package.use")
|
data/lib/getch/version.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- szorfein
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
J/zT/q2Ac7BWpSLbv6p9lChBiEnD9j24x463LR5QQjDNS5SsjzRQfFuprsa9Nqf2
|
36
36
|
Tw==
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-09-
|
38
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
39
39
|
dependencies: []
|
40
40
|
description:
|
41
41
|
email:
|
metadata.gz.sig
CHANGED
@@ -1,4 +1,2 @@
|
|
1
|
-
w
|
2
|
-
|
3
|
-
L���m~Сb�����S
|
4
|
-
��x��}�d��-�|>�N�C��Z���h��"w4GS�q�Cg��]=/�V,�"B9�`w�3�����C9r&��&��E(�z�|L�]�;�����l�W��{��͓ɛ;y��=oswǢ�J��-��߈b�
|
1
|
+
w�*j�&'�cDYΡ�\U�`��YR��㴼,�F�+D�mi�9��Y�<��S�&f��$O�0�V
|
2
|
+
a;��#�b��z���eb [�`�VL�w;uF�ީ�T������������n���=���k��7�K.B pe�hcNno��� ������vu��D�i���V�|Î�R��2P:{q�p&���\���S��U�X��T��ߧp��pU4i2��'�g��_��b:L��[�ށ9��an�͚��R\6f�H���5�ʮB��V1����S��E�����8�e�����|
|