lib/getch/gentoo/bootloader.rb in getch-0.5.0 vs lib/getch/gentoo/bootloader.rb in getch-0.7.0
- old
+ new
@@ -1,38 +1,42 @@
# frozen_string_literal: true
module Getch
module Gentoo
+ # install grub or bootctl
class Bootloader
def initialize
@esp = '/efi'
@boot = DEVS[:boot] ||= nil
@encrypt = OPTIONS[:encrypt] ||= false
end
# Dracut is used by sys-kernel/gentoo-kernel
def dependencies
- Install.new('app-shells/dash')
- if Helpers.systemd? and Helpers.efi?
+ if Helpers.systemd_minimal?
Log.new.info "Systemd-boot alrealy installed...\n"
else
ChrootOutput.new('emerge --update --newuse sys-boot/grub')
end
end
def install
- Helpers.grub? ?
- Config::Grub.new :
+ 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')
+ # ChrootOutput.new('emerge --config sys-kernel/gentoo-kernel')
+ ChrootOutput.new('emerge --config sys-kernel/gentoo-kernel-bin') # should also reload grub-mkconfig
end
def bootctl
- @boot ?
- with_boot :
+ if @boot
+ with_boot
+ else
Chroot.new("bootctl --esp-path=#{@esp} install")
+ end
end
# We need to umount the encrypted /boot first
# https://github.com/systemd/systemd/issues/16151
def with_boot