getch 0.0.4 → 0.0.5

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: cee5eb8b60c64dd64bd0416ae0306f725b1fd58f58baec8288e6358c9ff79a8a
4
- data.tar.gz: 315db3e29828388088d8cda3c38e5bd7ed5c57d3b9ecb324150c06e47ebd1eba
3
+ metadata.gz: d947133437b5880e6880404a19c59e272ab01cf3c7acca7f4775d646c9a99597
4
+ data.tar.gz: a910853539cd82f577ede94eab669ce323fc71a5986990f060dc54e96338f9b6
5
5
  SHA512:
6
- metadata.gz: 622547ffd01a03d7a957f489014ae0c27255e868c9135326b4bd8a3e0671dca6319f9f593f3fc33f54f657089cfa5e65a8917a2e6c7201ade89682a5767a3e96
7
- data.tar.gz: bed494285e0ec32397e37aaed1d3836fe700fe11b4c0661f1e7b68039393a2356b1ec6f16207c29988e7ff9656d573833cd5e74ecf91ee1f143639e798cea442
6
+ metadata.gz: c0e4a3c3ade0f4acc7793de34419248168bcce5211deaf48befbb85cf357519262157850b8c7524e178d9447e28b28c2bf5a89dcde0a1c887d46fd324656e96a
7
+ data.tar.gz: cb41112758289ca2bf43fe433cb69177608b859c02a61cfa0af724a874a94f812d1231ee09e8ababc884c270160976be18c52b735ceca3d74ad694ee2eb11d50
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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 commands in the chroot
13
+ * Add dhcpcd, gentoo-sources, linux-firmware
3
14
  * Kernel build by using https://github.com/szorfein/garden
4
- * Add portage fs (like /etc/portage/package.use/zzz_via_autounmask)
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 fs ext4
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
- * Format disk with sgdisk (should be installed)
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
@@ -32,6 +32,7 @@ module Getch
32
32
  config.repo
33
33
  config.network
34
34
  config.systemd(options)
35
+ config.hostname
35
36
  @state.config
36
37
  end
37
38
 
@@ -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
- grub
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 #{MOUNTPONT}")
83
+ Helpers::exec_or_die("umount -R #{MOUNTPOINT}")
40
84
  puts "Reboot when you have done"
41
85
  end
42
86
 
@@ -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")
@@ -1,3 +1,3 @@
1
1
  module Getch
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
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
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-16 00:00:00.000000000 Z
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�#�ƛ�������)ԾUxU)'�\����+���^�9*C����}E��mI��EP��eG&�:����?��.i��trdF^5�t���0,k�T�F�V��;7̮���
2
- ��:�Ae6y�x�Δ�9rFA��q��At���q��Z(��E�T�H��q3x)y��L�U������R ����g��{⚁h�aN?e��L�GX�H�(4����?�6�'8���[U�do�\�
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�+Dmi�9��Y�<��S�&f��$O�0�V
2
+ a;��#�b��z���eb [ `�VLw;uF�ީ�T������������n���=���k��7 �K.B pe�hcNno��� ������vu��D�i���V�|Î�R��2P:{qp&���\���S��U�X��T��ߧp��pU4i2��'�g��_��b:L��[�ށ9��an�͚�� R\6f�H���5�ʮB��V1����S��E�����8 �e�����|