Class: Getch::Gentoo::Bootloader
- Inherits:
-
Object
- Object
- Getch::Gentoo::Bootloader
- Defined in:
- lib/getch/gentoo/bootloader.rb
Overview
install grub or bootctl
Instance Method Summary collapse
- #bootctl ⇒ Object
-
#dependencies ⇒ Object
Dracut is used by sys-kernel/gentoo-kernel.
-
#initialize ⇒ Bootloader
constructor
A new instance of Bootloader.
- #install ⇒ Object
-
#with_boot ⇒ Object
We need to umount the encrypted /boot first github.com/systemd/systemd/issues/16151.
Constructor Details
#initialize ⇒ Bootloader
Returns a new instance of Bootloader.
7 8 9 10 11 |
# File 'lib/getch/gentoo/bootloader.rb', line 7 def initialize @esp = '/efi' @boot = DEVS[:boot] ||= nil @encrypt = OPTIONS[:encrypt] ||= false end |
Instance Method Details
#bootctl ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/getch/gentoo/bootloader.rb', line 33 def bootctl if @boot with_boot else Chroot.new("bootctl --esp-path=#{@esp} install") end end |
#dependencies ⇒ Object
Dracut is used by sys-kernel/gentoo-kernel
14 15 16 17 18 19 20 |
# File 'lib/getch/gentoo/bootloader.rb', line 14 def dependencies if Helpers.systemd_minimal? Log.new.info "Systemd-boot alrealy installed...\n" else ChrootOutput.new('emerge --update --newuse sys-boot/grub') end end |
#install ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/getch/gentoo/bootloader.rb', line 22 def install if Helpers.grub? Config::Grub.new else bootctl end # ChrootOutput.new('emerge --config sys-kernel/gentoo-kernel') ChrootOutput.new('emerge --config sys-kernel/gentoo-kernel-bin') # should also reload grub-mkconfig end |
#with_boot ⇒ Object
We need to umount the encrypted /boot first github.com/systemd/systemd/issues/16151
43 44 45 46 47 48 |
# File 'lib/getch/gentoo/bootloader.rb', line 43 def with_boot boot = @encrypt ? '/dev/mapper/boot-luks' : "/dev/#{DEVS[:boot]}" NiTo.umount "#{OPTIONS[:mountpoint]}/boot" Chroot.new("bootctl --esp-path=#{@esp} install") NiTo.mount boot, "#{OPTIONS[:mountpoint]}/boot" end |