my $proxmox_cddir = $iso_env->{locations}->{iso};
my $proxmox_pkgdir = "${proxmox_cddir}/proxmox/packages/";
-my $boot_type = -d '/sys/firmware/efi' ? 'efi' : 'bios';
-
my $step_number = 0; # Init number for global function list
my @steps = (
eval {
my $rc = syscmd("chroot $targetdir /usr/sbin/grub-install --target x86_64-efi --no-floppy --bootloader-id='proxmox' $dev");
if ($rc != 0) {
- if ($boot_type eq 'efi') {
+ if ($run_env->{boot_type} eq 'efi') {
die "unable to install the EFI boot loader on '$dev'\n";
} else {
warn "unable to install the EFI boot loader on '$dev', ignoring (not booted using UEFI)\n";
|| die "unable to bind-mount packages on $targetdir/tmp/pkg\n";
syscmd("mount -n -t proc proc $targetdir/proc") == 0 || die "unable to mount proc on $targetdir/proc\n";
syscmd("mount -n -t sysfs sysfs $targetdir/sys") == 0 || die "unable to mount sysfs on $targetdir/sys\n";
- if ($boot_type eq 'efi') {
+ if ($run_env->{boot_type} eq 'efi') {
syscmd("mount -n -t efivarfs efivarfs $targetdir/sys/firmware/efi/efivars") == 0 ||
die "unable to mount efivarfs on $targetdir/sys/firmware/efi/efivars: $!\n";
}
# Note: this is required by current grub, but really dangerous, because
# vfat does not have journaling, so it triggers manual fsck after each crash
# so we only mount /boot/efi if really required (efi systems).
- if ($boot_type eq 'efi' && !$use_zfs) {
+ if ($run_env->{boot_type} eq 'efi' && !$use_zfs) {
if (scalar(@$bootdevinfo)) {
my $di = @$bootdevinfo[0]; # simply use first disk
sub legacy_bios_4k_check {
my ($lbs) = @_;
die "Booting from 4kn drive in legacy BIOS mode is not supported.\n"
- if $boot_type ne 'efi' && $lbs == 4096;
+ if $run_env->{boot_type} ne 'efi' && $lbs == 4096;
}
sub get_zfs_raid_setup {