Skip to content
Snippets Groups Projects
Commit a311770e authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

Use libcalamares.utils.chroot_call in grub jobmodule.

parent cc2e49c6
No related branches found
No related tags found
No related merge requests found
...@@ -17,24 +17,17 @@ ...@@ -17,24 +17,17 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>. # along with Calamares. If not, see <http://www.gnu.org/licenses/>.
import os
import subprocess
import libcalamares import libcalamares
def chroot_call(root_mount_point, cmd): def install_grub(boot_loader):
subprocess.check_call(["chroot", root_mount_point] + cmd)
def install_grub(root_mount_point, boot_loader):
install_path = boot_loader["installPath"] install_path = boot_loader["installPath"]
chroot_call(root_mount_point, ["grub-install", install_path]) libcalamares.utils.chroot_call(["grub-install", install_path])
chroot_call(root_mount_point, ["grub-mkconfig", "-o", "/boot/grub/grub.cfg"]) libcalamares.utils.chroot_call(["grub-mkconfig", "-o", "/boot/grub/grub.cfg"])
def run(): def run():
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
boot_loader = libcalamares.globalstorage.value("bootLoader") boot_loader = libcalamares.globalstorage.value("bootLoader")
install_grub(root_mount_point, boot_loader) install_grub(boot_loader)
return None return None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment