|
|
|
@ -31,6 +31,7 @@ from cl_utils import runOsCommand,appendProgramToEnvFile, \
|
|
|
|
|
getSupportArch, refreshLVM, refreshUdev, \
|
|
|
|
|
isPkgInstalled, checkUtils, countPartitions
|
|
|
|
|
from cl_vars_share import varsShare
|
|
|
|
|
from subprocess import Popen,PIPE,STDOUT
|
|
|
|
|
|
|
|
|
|
from cl_kernel_utils import KernelConfig,InitRamFs
|
|
|
|
|
|
|
|
|
@ -1794,6 +1795,9 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
return True
|
|
|
|
|
fdiskProg, gdiskProg, partedProg = checkUtils('/sbin/fdisk',
|
|
|
|
|
'/usr/sbin/gdisk','/usr/sbin/parted')
|
|
|
|
|
|
|
|
|
|
parttable = self.varSelect("os_disk_table",where="os_disk_dev",
|
|
|
|
|
eq=partition)
|
|
|
|
|
partitionNumber = \
|
|
|
|
|
getUdevDeviceInfo(name=partition).get('ID_PART_ENTRY_NUMBER','')
|
|
|
|
|
devicePartitionCount = countPartitions(deviceName)
|
|
|
|
@ -1819,7 +1823,7 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
if changeActive:
|
|
|
|
|
if devicePartitionCount > 1:
|
|
|
|
|
for partnum in changeActive:
|
|
|
|
|
pipe.stdin.write("a\n%s\n",partnum)
|
|
|
|
|
pipe.stdin.write("a\n%s\n"%partnum)
|
|
|
|
|
pipe.stdin.write("w\n")
|
|
|
|
|
else:
|
|
|
|
|
pipe.stdin.write("a\nw\n")
|
|
|
|
@ -1833,19 +1837,20 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
if devicePartitionCount > 1:
|
|
|
|
|
pipe.stdin.write("x\n")
|
|
|
|
|
for partnum in changeActive:
|
|
|
|
|
pipe.stdin.write("a\n%s\n2\n\n",partnum)
|
|
|
|
|
pipe.stdin.write("w\n")
|
|
|
|
|
pipe.stdin.write("a\n%s\n2\n\n"%partnum)
|
|
|
|
|
pipe.stdin.write("w\nY\n")
|
|
|
|
|
else:
|
|
|
|
|
pipe.stdin.write("x\na\n2\n\nw\n")
|
|
|
|
|
pipe.stdin.write("x\na\n2\n\nw\nY\n")
|
|
|
|
|
pipe.stdin.close()
|
|
|
|
|
pipe.wait()
|
|
|
|
|
for waittime in (0.1,0.2,0.5,1,2,4):
|
|
|
|
|
if path.exists(dev):
|
|
|
|
|
if path.exists(partition):
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
sleep(waittime)
|
|
|
|
|
raise InstallError(
|
|
|
|
|
_("Failed to found partition %s after changing the activity")%dev)
|
|
|
|
|
_("Failed to found partition %s after changing the activity")%
|
|
|
|
|
partition)
|
|
|
|
|
|
|
|
|
|
def installSyslinuxBootloader(self,target):
|
|
|
|
|
"""Install boot loader by syslinux
|
|
|
|
|