[bootloader] use '--force' argument

- Note (Kevin Kofler): Grub will fall back to a LILO-style installation,
  using blocklists to reference the blocks inside a larger partition,
  with the same caveats LILO had (need to reinstall whenever you do
  anything to the partition that will move those blocks around).
- Setting flags (EF00, EF02) or creating grub boot partition should be
  handled within 'partition' module.
This commit is contained in:
Philip 2015-02-23 02:35:50 +01:00
parent 9ac0fc37b1
commit 0dadd19e51

View File

@ -159,7 +159,7 @@ def install_grub(efi_directory, fw_type):
boot_loader = libcalamares.globalstorage.value("bootLoader")
check_chroot_call(
[libcalamares.job.configuration["grubInstall"], "--target=i386-pc",
"--recheck", boot_loader["installPath"]])
"--recheck", "--force", boot_loader["installPath"]])
check_chroot_call([libcalamares.job.configuration["grubMkconfig"], "-o",
libcalamares.job.configuration["grubCfg"]])
@ -187,36 +187,6 @@ def prepare_bootloader(fw_type):
print("Boot device: \"{!s}\"".format(device))
print("Set 'EF00' flag")
subprocess.call(["sgdisk", "--typecode={!s}:EF00".format(boot_p), "{!s}".format(device)])
if fw_type != "efi":
partitions = libcalamares.globalstorage.value("partitions")
boot_p = ""
device = ""
use_boot = ""
for partition in partitions:
if partition["mountPoint"] == "/boot":
boot_device = partition["device"]
boot_p = boot_device[-1:]
device = boot_device[:-1]
use_boot = True
print("Partition (/boot): \"{!s}\"".format(boot_p))
print("Device: \"{!s}\"".format(device))
if (not use_boot and partition["mountPoint"] == "/"):
boot_device = partition["device"]
boot_p = boot_device[-1:]
device = boot_device[:-1]
print("Partition (/): \"{!s}\"".format(boot_p))
print("Device: \"{!s}\"".format(device))
if (not boot_p or not device):
return ("Boot partition not found!",
"Partition: \"{!s}\"",
"Device: \"{!s}\"".format(boot_p,device))
process = subprocess.Popen(["parted", "{!s}".format(device),
"--list"], stdout=subprocess.PIPE)
for line in process.stdout:
if b"gpt" in line:
print("Set 'bios_grub' flag")
subprocess.call(["parted", "{!s}".format(device),
"set {!s} bios_grub on".format(boot_p)])
if (efi_boot_loader == "gummiboot" and fw_type == "efi"):
install_gummiboot(efi_directory)
else: