Fix pxe loading, using ntfs and using new video install

master3.3
Mike Hiretsky 12 years ago
parent e2b72b54c0
commit 19534728ec

@ -41,6 +41,14 @@ install_pkg()
FEATURES="-getbinpkg" FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles emerge $pkg &>/dev/null
}
new_install_pkg()
{
local pkg=$1
ebegin "Installing $pkg"
FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles /usr/local/sbin/cl-video-install $pkg &>/dev/null
eend $?
}
variable_value()
{
local varname=$1
@ -68,7 +76,12 @@ install_video_driver()
then
if ! is_already_install $drv
then
check_install_ability $drv && install_pkg $drv
if [[ -x /usr/local/sbin/cl-video-install ]]
then
new_install_pkg $drv
else
check_install_ability $drv && install_pkg $drv
fi
fi
eend $?
else
@ -124,7 +137,11 @@ start() {
# reinit net.* services
local roottype=`variable_value os_root_type`
[[ $roottype == "livecd" ]] && udevadm trigger --action="add" --subsystem-match=net
if [[ $roottype == "livecd" ]]
then
touch /* /bin/* /sbin/*
udevadm trigger --action="add" --subsystem-match=net
fi
/sbin/rc-update --update
return 0
@ -137,5 +154,6 @@ stop() {
rc-update del calculate boot
local distdir="/usr/portage/distfiles"
[[ -d "${distdir}" ]] && [[ -n "`ls ${distdir}`" ]] && rm ${distdir}/*
[[ -f /usr/local/sbin/cl-video-install ]] && rm /usr/local/sbin/cl-video-install
fi
}

@ -24,6 +24,7 @@ from calculate.core.server.api_types import ReturnedMessage
from calculate.core.server.api_types import ChoiceValue, Table, Option, Field, \
GroupField, ViewInfo, ViewParams
from calculate.lib.datavars import VariableError,DataVarsError
from calculate.install.cl_install import InstallError
#from cl_install import Install,DataVarsInstall
import cl_install
@ -107,7 +108,7 @@ class catchExcept:
default = 'color:red;',
element = "error"))
view.groups.append(group)
if not isinstance(VariableError,DataVarsError,InstallError):
if not type(e) in (InstallError,DataVarsError,VariableError):
for i in apply(traceback.format_exception, sys.exc_info()):
print i,

@ -100,14 +100,14 @@ class FileSystemManager:
'msdos': '0b',
'type':['flash']},
'ntfs': {'defaultopt': defaultOpt,
'format': '/sbin/mkfs.ntfs',
'format': '/usr/sbin/mkfs.ntfs',
'formatparam': '{labelparam} -FQ {device}',
'gpt': '0700',
'label': '-L {labelname}',
'msdos': '7',
'compatible':['ntfs-3g']},
'ntfs-3g': {'defaultopt': defaultOpt,
'format': '/sbin/mkfs.ntfs',
'format': '/usr/sbin/mkfs.ntfs',
'formatparam': '{labelparam} -FQ {device}',
'gpt': '0700',
'label': '-L {labelname}',

@ -998,6 +998,8 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
return map(self.defaultPerformFormat(),
zip(source,mount,fs,value))
fixNtfs = lambda self,x:{'ntfs-3g':'ntfs'}.get(x,x)
def check(self,value):
"""Check perform format
@ -1016,9 +1018,11 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
unavailFS = set(self.Select('os_format_type',
where='os_format_use',
eq="off"))
fixNtfs = self.fixNtfs
for dev,mp,fs,isformat in info:
# should format if change fs or partition is root, but non flash
partitionMustFormat = diskFormat.get(dev,fs) != fs or \
partitionMustFormat = \
fixNtfs(diskFormat.get(dev,fs)) != fixNtfs(fs) or \
(mp == '/' and \
self.Get('os_install_root_type') != 'flash')
# if entry has mount point AND
@ -1060,10 +1064,11 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
(self.Get('os_disk_format'))))
def wrap(info):
source,dest,fs,isformat = info
fixNtfs = self.fixNtfs
if not isformat and source.startswith('/dev/'):
if dest == '/':
return "on"
if dest and diskFormat.get(source,fs) != fs:
if dest and fixNtfs(diskFormat.get(source,fs)) != fixNtfs(fs):
return "on"
return isformat or ("off" if source.startswith('/dev/') else "")
return wrap
@ -1591,7 +1596,7 @@ class VariableOsInstallFstabMountConf(ReadonlyVariable,DeviceHelper):
devicesForFstab = filter(lambda x:x[1] != "/", devicesForFstab)
# rootLine one string, but it correct work if devicesForFstab is empty
rootLine = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 2" %
rootLine = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 1" %
(self._commentFstab(x[0],x[1],x[4]),x[1],x[2],x[3]),
devicesForFstab[:1]))
otherLines = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 0" %

Loading…
Cancel
Save