Class: Getch::Gentoo::Chroot

Inherits:
Object
  • Object
show all
Defined in:
lib/getch/gentoo/chroot.rb

Instance Method Summary collapse

Constructor Details

#initializeChroot

Returns a new instance of Chroot.



4
5
6
7
# File 'lib/getch/gentoo/chroot.rb', line 4

def initialize
  @state = Getch::States.new()
  mount
end

Instance Method Details

#kernelObject



30
31
32
33
34
35
36
# File 'lib/getch/gentoo/chroot.rb', line 30

def kernel
  puts "Installing kernel gentoo-sources..."
  cmd = "emerge sys-kernel/gentoo-sources sys-kernel/linux-firmware"
  license = "#{MOUNTPOINT}/etc/portage/package.license"
  File.write(license, "sys-kernel/linux-firmware linux-fw-redistributable no-source-code\n")
  exec_chroot(cmd)
end

#systemdObject



24
25
26
27
28
# File 'lib/getch/gentoo/chroot.rb', line 24

def systemd
  puts "Updating locale, keymap..."
  cmd = "locale-gen; emerge --config sys-libs/timezone-data"
  exec_chroot(cmd)
end

#updateObject



9
10
11
12
13
14
# File 'lib/getch/gentoo/chroot.rb', line 9

def update
  return if STATES[:gentoo_update]
  puts "Downloading the last ebuilds for Gentoo..."
  cmd = "emerge-webrsync"
  exec_chroot(cmd)
end

#worldObject



16
17
18
19
20
21
22
# File 'lib/getch/gentoo/chroot.rb', line 16

def world
  return if STATES[:gentoo_update]
  puts "Update Gentoo"
  cmd = "emerge --update --deep --newuse @world"
  exec_chroot(cmd)
  @state.update
end