diff --git a/src/modules/grub/main.py b/src/modules/grub/main.py index 2fd22eddd..8327f43dc 100644 --- a/src/modules/grub/main.py +++ b/src/modules/grub/main.py @@ -17,24 +17,17 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . -import os -import subprocess import libcalamares -def chroot_call(root_mount_point, cmd): - subprocess.check_call(["chroot", root_mount_point] + cmd) - - -def install_grub(root_mount_point, boot_loader): +def install_grub(boot_loader): install_path = boot_loader["installPath"] - chroot_call(root_mount_point, ["grub-install", install_path]) - chroot_call(root_mount_point, ["grub-mkconfig", "-o", "/boot/grub/grub.cfg"]) + libcalamares.utils.chroot_call(["grub-install", install_path]) + libcalamares.utils.chroot_call(["grub-mkconfig", "-o", "/boot/grub/grub.cfg"]) def run(): - root_mount_point = libcalamares.globalstorage.value("rootMountPoint") boot_loader = libcalamares.globalstorage.value("bootLoader") - install_grub(root_mount_point, boot_loader) + install_grub(boot_loader) return None