Make sure the hwinfo executable exists before calling it
This commit is contained in:
parent
eed387f7a4
commit
f9bd0dfcfc
@ -20,19 +20,22 @@
|
|||||||
import libcalamares
|
import libcalamares
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import shutil
|
||||||
from libcalamares.utils import check_chroot_call
|
from libcalamares.utils import check_chroot_call
|
||||||
|
|
||||||
|
|
||||||
def get_cpu():
|
def get_cpu():
|
||||||
""" Check if system is an intel system. """
|
""" Check if system is an intel system. """
|
||||||
|
|
||||||
process1 = subprocess.Popen(["hwinfo", "--cpu"], stdout=subprocess.PIPE)
|
if shutil.which("hwinfo") != None:
|
||||||
process2 = subprocess.Popen(["grep", "Model:[[:space:]]"],
|
process1 = subprocess.Popen(["hwinfo", "--cpu"], stdout=subprocess.PIPE)
|
||||||
stdin=process1.stdout, stdout=subprocess.PIPE)
|
process2 = subprocess.Popen(["grep", "Model:[[:space:]]"],
|
||||||
process1.stdout.close()
|
stdin=process1.stdout, stdout=subprocess.PIPE)
|
||||||
out, err = process2.communicate()
|
process1.stdout.close()
|
||||||
return out.decode().lower()
|
out, err = process2.communicate()
|
||||||
|
return out.decode().lower()
|
||||||
|
|
||||||
|
return ""
|
||||||
|
|
||||||
def set_mkinitcpio_hooks_and_modules(hooks, modules, root_mount_point):
|
def set_mkinitcpio_hooks_and_modules(hooks, modules, root_mount_point):
|
||||||
""" Set up mkinitcpio.conf """
|
""" Set up mkinitcpio.conf """
|
||||||
|
Loading…
Reference in New Issue
Block a user