parent
9252edfb1a
commit
3539561860
@ -0,0 +1,44 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI="3"
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
PYTHON_DEPEND="2:2.7"
|
||||
RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*"
|
||||
|
||||
inherit distutils eutils
|
||||
|
||||
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2"
|
||||
|
||||
DESCRIPTION="The program of installation Calculate Linux"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="pxe minimal"
|
||||
|
||||
DEPEND="~sys-apps/calculate-core-3.1.9
|
||||
!<sys-apps/calculate-install-2.2.29
|
||||
app-portage/layman
|
||||
>=virtual/udev-197
|
||||
!app-misc/livecd-tools
|
||||
sys-apps/iproute2[-minimal]
|
||||
!minimal? ( sys-boot/grub
|
||||
sys-apps/gptfdisk
|
||||
>=sys-apps/util-linux-2.19.1
|
||||
sys-fs/dosfstools
|
||||
sys-fs/squashfs-tools
|
||||
sys-block/parted )
|
||||
pxe? ( sys-apps/calculate-server
|
||||
net-ftp/tftp-hpa
|
||||
net-misc/dhcp
|
||||
net-fs/nfs-utils )"
|
||||
|
||||
src_unpack() {
|
||||
unpack "${A}"
|
||||
cd "${S}"
|
||||
|
||||
# apply revision changes
|
||||
epatch "${FILESDIR}/calculate-install-3.1.9-r15.patch"
|
||||
}
|
@ -0,0 +1,354 @@
|
||||
diff --git data/calculate data/calculate
|
||||
index c7f60b9..60a24b0 100644
|
||||
--- data/calculate
|
||||
+++ data/calculate
|
||||
@@ -134,10 +134,6 @@ start() {
|
||||
touch /* /bin/* /sbin/*
|
||||
udevadm trigger --action="add" --subsystem-match=net
|
||||
fi
|
||||
- if [[ $roottype != "livecd" ]]
|
||||
- then
|
||||
- /usr/bin/eix-checkout &>/dev/null &
|
||||
- fi
|
||||
|
||||
/sbin/rc-update --update
|
||||
return 0
|
||||
diff --git install/distr.py install/distr.py
|
||||
index 88de47f..e6202e8 100644
|
||||
--- install/distr.py
|
||||
+++ install/distr.py
|
||||
@@ -31,7 +31,8 @@ from functools import partial
|
||||
from calculate.lib.utils.files import (runOsCommand,isMount,removeDir,
|
||||
processProgress,countFiles,STDOUT,
|
||||
typeFile,pathJoin,process,getRunCommands,
|
||||
- readLinesFile,getProgPath,listDirectory,checkUtils)
|
||||
+ readLinesFile,getProgPath,listDirectory,checkUtils,
|
||||
+ MAGIC_COMPRESS,MAGIC_SYMLINK,MAGIC_CONTINUE)
|
||||
from calculate.lib.utils.common import getTupleVersion,cmpVersion
|
||||
from calculate.lib.utils.device import (detectDeviceForPartition,
|
||||
getUdevDeviceInfo, countPartitions,
|
||||
@@ -114,7 +115,7 @@ class Distributive(object):
|
||||
def fromFile(cls,filename):
|
||||
"""Get Distributive object by filename"""
|
||||
# MAGIC_COMPRESS 0x000004 Check inside compressed files
|
||||
- tf = typeFile(magic=0x6)
|
||||
+ tf = typeFile(magic=MAGIC_COMPRESS|MAGIC_SYMLINK|MAGIC_CONTINUE)
|
||||
ftype = tf.getMType(filename)
|
||||
if ftype:
|
||||
if "block special" in ftype:
|
||||
@@ -753,7 +754,7 @@ class PartitionDistributive(Distributive):
|
||||
mulipartDataNotBind = filter(lambda x: x[2]!="bind",
|
||||
self.getMultipartData())
|
||||
for dev, mountPoint, fileSystem, isFormat, partTable\
|
||||
- in mulipartDataNotBind:
|
||||
+ in sorted(mulipartDataNotBind, key=lambda x:x[1]):
|
||||
if fileSystem!="swap":
|
||||
realMountPoint = pathJoin(mdirectory, mountPoint)
|
||||
self._mountPartition(dev,realMountPoint,"-t %s"%fileSystem)
|
||||
@@ -1095,7 +1096,7 @@ class IsoDistributive(Distributive):
|
||||
self.compress = compress
|
||||
|
||||
def getType(self):
|
||||
- tf = typeFile(magic=0x6)
|
||||
+ tf = typeFile(magic=MAGIC_COMPRESS|MAGIC_SYMLINK|MAGIC_CONTINUE)
|
||||
ftype = tf.getMType(self.file)
|
||||
if "block special" in ftype:
|
||||
return _("live image %s")%self.file
|
||||
@@ -1116,7 +1117,7 @@ class IsoDistributive(Distributive):
|
||||
def _mountIso(self,file,directory):
|
||||
if self.file != self.mdirectory:
|
||||
self._makeDirectory(directory)
|
||||
- tf = typeFile(magic=0x6)
|
||||
+ tf = typeFile(magic=MAGIC_COMPRESS|MAGIC_SYMLINK|MAGIC_CONTINUE)
|
||||
ftype = tf.getMType(file)
|
||||
if "block special" in ftype:
|
||||
mopts = "-o ro"
|
||||
diff --git install/install.py install/install.py
|
||||
index fdd6b04..c3e0c7e 100644
|
||||
--- install/install.py
|
||||
+++ install/install.py
|
||||
@@ -28,7 +28,8 @@ from shutil import copy2
|
||||
from calculate.core.server.func import safetyWrapper
|
||||
from calculate.lib.utils.files import (runOsCommand,pathJoin,
|
||||
isMount,process,listDirectory,STDOUT,
|
||||
- checkUtils,readFile,find,copyWithPath)
|
||||
+ checkUtils,readFile,find,copyWithPath,
|
||||
+ readLinesFile)
|
||||
from calculate.lib.utils.common import (appendProgramToEnvFile,
|
||||
removeProgramToEnvFile, getTupleVersion,
|
||||
cmpVersion,getUserPassword,
|
||||
@@ -350,7 +351,7 @@ class Install:
|
||||
newModuleName = defaultGL
|
||||
curModuleName = map(lambda x:x.strip().rpartition('=')[-1].strip('"\''),
|
||||
filter(lambda x: x.startswith("OPENGL_PROFILE="),
|
||||
- readFile(openGLenv)))
|
||||
+ readLinesFile(openGLenv)))
|
||||
curModuleName = curModuleName[-1] if curModuleName else ""
|
||||
if curModuleName == newModuleName:
|
||||
return True
|
||||
diff --git install/variables/audio.py install/variables/audio.py
|
||||
index 0243ec3..5dc7a1c 100644
|
||||
--- install/variables/audio.py
|
||||
+++ install/variables/audio.py
|
||||
@@ -33,13 +33,12 @@ class VariableOsAudioData(ReadonlyTableVariable):
|
||||
'os_audio_name']
|
||||
|
||||
def get(self,hr=False):
|
||||
- alsaInfo = getProgPath('/usr/bin/alsa-info')
|
||||
- if not alsaInfo:
|
||||
+ data = readFile('/proc/asound/cards')
|
||||
+ cards = re.findall('^\s*(\d+).*\n\s+(\S.*) at .*$',data,re.M)
|
||||
+ if cards:
|
||||
+ return map(list, cards)
|
||||
+ else:
|
||||
return [[]]
|
||||
- entry = re.compile('^Card hw:(\d+)\s*[^/]+/\'(.*?) at .*$')
|
||||
- return tuple(map(lambda x:x.groups(),
|
||||
- filter(None,map(entry.search,
|
||||
- process(alsaInfo,'--stdout',envdict=os.environ)))))
|
||||
|
||||
setValue = Variable.setValue
|
||||
|
||||
diff --git install/variables/disk.py install/variables/disk.py
|
||||
index ef0f9e2..c950ec3 100644
|
||||
--- install/variables/disk.py
|
||||
+++ install/variables/disk.py
|
||||
@@ -31,7 +31,7 @@ from calculate.lib.utils.device import (getUdevDeviceInfo,getDeviceType,
|
||||
getUUIDDict,getCommonDeviceName)
|
||||
from calculate.install.variables.autopartition import Sizes
|
||||
from calculate.lib.utils.files import (listDirectory,pathJoin,readFile,FStab,
|
||||
- isMount)
|
||||
+ isMount,getProgPath)
|
||||
from calculate.install.distr import PartitionDistributive
|
||||
from calculate.install.fs_manager import FileSystemManager
|
||||
|
||||
@@ -110,7 +110,8 @@ class VariableOsDeviceDev(ReadonlyVariable,DeviceHelper):
|
||||
"""Get device /dev name"""
|
||||
if self.master is None:
|
||||
self.master,slave = pty.openpty()
|
||||
- self.monitor = Popen(["/sbin/udevadm","monitor","--kernel",
|
||||
+ udevAdm = getProgPath('/sbin/udevadm')
|
||||
+ self.monitor = Popen([udevAdm,"monitor","--kernel",
|
||||
"--subsystem-match=block"],stdout=slave,
|
||||
close_fds=True)
|
||||
os.close(slave)
|
||||
@@ -213,7 +214,12 @@ class VariableOsDeviceTable(ReadonlyVariable):
|
||||
listDirectory(syspath))
|
||||
if childs:
|
||||
child = pathJoin(syspath,childs[0])
|
||||
- return getUdevDeviceInfo(path=child).get('ID_PART_ENTRY_SCHEME','')
|
||||
+ udevinfo = getUdevDeviceInfo(path=child)
|
||||
+ map_names = {'mbr':'dos',
|
||||
+ 'msdos':'dos'}
|
||||
+ table = (udevinfo.get('ID_PART_ENTRY_SCHEME','') or
|
||||
+ udevinfo.get('UDISKS_PARTITION_SCHEME',''))
|
||||
+ return map_names.get(table,table)
|
||||
return ""
|
||||
|
||||
def get(self):
|
||||
@@ -1834,7 +1840,7 @@ class VariableOsInstallFstabMountConf(ReadonlyVariable,DeviceHelper):
|
||||
'os_install_disk_mount',
|
||||
'os_install_disk_format',
|
||||
'os_install_disk_options',
|
||||
- 'os_disk_dev'],
|
||||
+ 'os_install_disk_dev'],
|
||||
where='os_install_disk_mount',
|
||||
func=lambda x:x[0] != "" and x[0] != "swap"),
|
||||
lambda x,y: cmp(self.separateDevice(x[1]),
|
||||
diff --git install/variables/kernel.py install/variables/kernel.py
|
||||
index 2e844ac..6fa1bd7 100644
|
||||
--- install/variables/kernel.py
|
||||
+++ install/variables/kernel.py
|
||||
@@ -19,7 +19,8 @@ import sys
|
||||
import re
|
||||
from os import path
|
||||
from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable
|
||||
-from calculate.lib.utils.files import typeFile,process,listDirectory
|
||||
+from calculate.lib.utils.files import (
|
||||
+ typeFile,process,listDirectory,MAGIC_SYMLINK,MAGIC_COMPRESS)
|
||||
|
||||
from calculate.lib.cl_lang import setLocalTranslate
|
||||
setLocalTranslate('cl_install3',sys.modules[__name__])
|
||||
@@ -137,8 +138,10 @@ class KernelHelper:
|
||||
def getFilesByType(self,pathname,descr):
|
||||
"""Get files from "pathname" has "descr" in descriptions"""
|
||||
filelist = map(lambda x:path.join(pathname,x),os.listdir(pathname))
|
||||
- ftype = typeFile(magic=0x4).getMType
|
||||
- filesWithType = map(lambda x:(x,ftype(x)), filelist)
|
||||
+ ftype = typeFile(magic=MAGIC_COMPRESS|MAGIC_SYMLINK).getMType
|
||||
+ filesWithType = map(lambda x:(x,ftype(x)),
|
||||
+ filter(path.exists,
|
||||
+ filelist))
|
||||
return filter(lambda x:descr in x[1],filesWithType)
|
||||
|
||||
def getInitrd(self,arch,shortname,chroot,kernel,suffix="",notsuffix=""):
|
||||
@@ -150,7 +153,7 @@ class KernelHelper:
|
||||
return resInitrdVer.groups()[1]
|
||||
return ""
|
||||
|
||||
- ftype = typeFile(magic=0x4).getMType
|
||||
+ ftype = typeFile(magic=MAGIC_COMPRESS|MAGIC_SYMLINK).getMType
|
||||
kernelfile = path.join(chroot,'boot',kernel)
|
||||
typeKernelFile = ftype(kernelfile)
|
||||
if typeKernelFile == None:
|
||||
diff --git install/variables/net.py install/variables/net.py
|
||||
index d8d22f6..a07cfe3 100644
|
||||
--- install/variables/net.py
|
||||
+++ install/variables/net.py
|
||||
@@ -34,6 +34,7 @@ from calculate.lib.utils import ip
|
||||
from calculate.lib.utils.portage import isPkgInstalled
|
||||
from operator import itemgetter
|
||||
from itertools import *
|
||||
+from functools import partial
|
||||
import hashlib
|
||||
from calculate.install.distr import DistributiveError
|
||||
|
||||
@@ -92,26 +93,39 @@ class VariableOsInstallNetInterfacesOrig(NetHelper,ReadonlyVariable):
|
||||
"""
|
||||
type = "list"
|
||||
|
||||
+ def is_classic_interface_name(self):
|
||||
+ hashsum = lambda x: hashlib.md5(readFile(x)).digest()
|
||||
+ chroot_path = self.Get('cl_chroot_path')
|
||||
+ etc_path_join = partial(path.join,
|
||||
+ chroot_path, 'etc/udev/rules.d')
|
||||
+ lib_path_join = partial(path.join,
|
||||
+ chroot_path, 'lib/udev/rules.d')
|
||||
+ udev_files = ('70-persistent-net.rules',
|
||||
+ '80-net-name-slot.rules',
|
||||
+ '80-net-setup-link.rules')
|
||||
+ for etc_file, lib_file in izip(map(etc_path_join,udev_files),
|
||||
+ map(lib_path_join,udev_files)):
|
||||
+ if path.exists(etc_file) and hashsum(etc_file) != hashsum(lib_file):
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
def get(self):
|
||||
- chrootPath = self.Get('cl_chroot_path')
|
||||
- pathOldUdevNet = path.join(chrootPath,
|
||||
- 'etc/udev/rules.d/70-persistent-net.rules')
|
||||
- pathNewUdevNet = path.join(chrootPath,
|
||||
- 'etc/udev/rules.d/80-net-name-slot.rules')
|
||||
- pathOrigUdevNet = path.join(chrootPath,
|
||||
- 'lib/udev/rules.d/80-net-name-slot.rules')
|
||||
- if path.exists(pathOldUdevNet) or \
|
||||
- (path.exists(pathNewUdevNet) and
|
||||
- hashlib.md5(readFile(pathNewUdevNet)).digest() != \
|
||||
- hashlib.md5(readFile(pathOrigUdevNet)).digest()):
|
||||
+ if self.is_classic_interface_name():
|
||||
return self.Get('os_install_net_interfaces')
|
||||
def getOrig(x):
|
||||
try:
|
||||
- nameParam = filter(lambda x:x.startswith("ID_NET_NAME_PATH="),
|
||||
- process("udevadm","test-builtin","net_id",
|
||||
- "/sys/class/net/%s"%x))
|
||||
+ nameParam = \
|
||||
+ map(lambda x:x.partition('=')[::2],
|
||||
+ filter(lambda x:x.startswith("ID_NET_NAME_PATH=") or
|
||||
+ x.startswith("ID_NET_NAME_ONBOARD="),
|
||||
+ process("udevadm","test-builtin","net_id",
|
||||
+ "/sys/class/net/%s"%x)))
|
||||
if nameParam:
|
||||
- return nameParam[0].partition('=')[2].strip() or x
|
||||
+ sortOrder = {'ID_NET_NAME_PATH':0,
|
||||
+ 'ID_NET_NAME_ONBOARD':1}
|
||||
+ nameParam = sorted(nameParam,
|
||||
+ key=lambda x:sortOrder.get(x[0],-1))
|
||||
+ return nameParam[-1][1].strip() or x
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
return x
|
||||
@@ -783,3 +797,24 @@ class VariableOsInstallNetSettings(NetHelper,Variable):
|
||||
|
||||
def choice(self):
|
||||
return [("","")]+self.Get('os_install_net_conf_available')
|
||||
+
|
||||
+class VariableOsInstallPxeIp(Variable):
|
||||
+ """
|
||||
+ IP адрес PXE сервера
|
||||
+ """
|
||||
+ type = "choice"
|
||||
+ opt = ["--ip"]
|
||||
+ metavalue = "IP"
|
||||
+
|
||||
+ def init(self):
|
||||
+ self.label = _("PXE server IP")
|
||||
+ self.help = "set IP address for PXE server"
|
||||
+
|
||||
+ def get(self):
|
||||
+ for ipaddr in ifilter(None, self.Get('os_install_net_ip')):
|
||||
+ return ipaddr
|
||||
+ else:
|
||||
+ return ""
|
||||
+
|
||||
+ def choice(self):
|
||||
+ return filter(None, self.Get('os_install_net_ip'))
|
||||
diff --git install/variables/system.py install/variables/system.py
|
||||
index a9193b6..69e800e 100644
|
||||
--- install/variables/system.py
|
||||
+++ install/variables/system.py
|
||||
@@ -86,8 +86,6 @@ class VariableOsFormatUse(ReadonlyVariable):
|
||||
'value': "off"}
|
||||
|
||||
def checkFunc(self,fs):
|
||||
- if fs == "btrfs" and self.Get('os_root_type') == 'livecd':
|
||||
- return "no"
|
||||
if "format" in FileSystemManager.supportFS[fs] and \
|
||||
path.exists(FileSystemManager.supportFS[fs]["format"]):
|
||||
return "yes"
|
||||
@@ -656,6 +654,10 @@ class VariableOsInstallGrubTerminal(Variable):
|
||||
'etc/default/grub')
|
||||
if getValueFromConfig(grubDefault,'GRUB_TERMINAL') == 'console':
|
||||
return 'console'
|
||||
+ grubCfg = '/boot/grub/grub.cfg'
|
||||
+ if re.search('^terminal_output\s*console',readFile(grubCfg),re.M):
|
||||
+ return 'console'
|
||||
+
|
||||
return 'gfxterm'
|
||||
|
||||
def choice(self):
|
||||
diff --git install/wsdl_install.py install/wsdl_install.py
|
||||
index 511e16c..c9cab5b 100644
|
||||
--- install/wsdl_install.py
|
||||
+++ install/wsdl_install.py
|
||||
@@ -94,8 +94,6 @@ class Wsdl(WsdlBase):
|
||||
expert=('cl_install_home_crypt_set',),
|
||||
hide=('cl_migrate_data',),
|
||||
brief=('cl_migrate_user',)),
|
||||
- lambda group:group(_("Audio"),
|
||||
- normal=('os_audio_default',)),
|
||||
lambda group:group(_("Video"),
|
||||
normal=('os_install_x11_video_drv','os_install_x11_composite',
|
||||
'os_install_x11_resolution','os_install_fb_resolution',
|
||||
@@ -150,29 +148,9 @@ class Wsdl(WsdlBase):
|
||||
'groups':[
|
||||
lambda group:group(_("PXE install"),
|
||||
normal=('cl_image_filename',),
|
||||
- expert=('os_install_pxe_path',),
|
||||
+ expert=('os_install_pxe_path',
|
||||
+ 'os_install_pxe_ip'),
|
||||
next_label=_("Install"))]},
|
||||
- # настройка аудио
|
||||
- {
|
||||
- 'method_name':"setup_audio",
|
||||
- 'category':__("Configuration"),
|
||||
- 'title':__("Audio"),
|
||||
- 'image':'audio-card',
|
||||
- 'command':'cl-setup-audio',
|
||||
- 'gui':True,
|
||||
- 'rights':['setupaudio'],
|
||||
- 'logic':{'Install':install.Install},
|
||||
- 'action':ClSetupAudioAction,
|
||||
- 'datavars':"install",
|
||||
- 'native_error':(VariableError,DataVarsError,install.InstallError),
|
||||
- 'setvars':{'cl_action!':'merge','cl_merge_pkg!':[None],
|
||||
- 'cl_merge_set!':"on",'cl_setup':'audio'},
|
||||
- 'groups':[
|
||||
- lambda group:group(_("Audio"),
|
||||
- normal=('os_audio_default',),
|
||||
- expert=('cl_templates_locate',"cl_dispatch_conf","cl_verbose_set"),
|
||||
- next_label=_("Save"))]},
|
||||
- {
|
||||
# настройка загрузки системы
|
||||
'method_name':"setup_boot",
|
||||
'category':__("Configuration"),
|
@ -0,0 +1,26 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI=4
|
||||
|
||||
DESCRIPTION="Calculate Utilities meta package"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="cl_consolegui cl_client cl_desktop cl_console"
|
||||
|
||||
RDEPEND="${RDEPEND}
|
||||
=sys-apps/calculate-install-3.1.9-r15
|
||||
=sys-apps/calculate-i18n-3.1.9
|
||||
=sys-apps/calculate-lib-3.1.9-r14
|
||||
=sys-apps/calculate-core-3.1.9-r4
|
||||
=sys-apps/calculate-update-3.1.9
|
||||
cl_client? ( =sys-apps/calculate-client-3.1.9-r3 )
|
||||
cl_desktop? ( =sys-apps/calculate-desktop-3.1.9-r4 )
|
||||
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.9-r1 )
|
||||
cl_console? ( =sys-apps/calculate-console-3.1.9-r1 )
|
||||
"
|
Loading…
Reference in new issue