Use libcalamares.utils.chroot_call in grub jobmodule.

This commit is contained in:
Teo Mrnjavac 2014-08-01 13:37:28 +02:00
parent cc2e49c6ae
commit a311770e2f

View File

@ -17,24 +17,17 @@
# You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
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