Use libcalamares.utils.chroot_call in grub jobmodule.
This commit is contained in:
parent
cc2e49c6ae
commit
a311770e2f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user