Add copy variables from lib:

os_install_net_allow
os_install_net_domain
os_install_net_hostname
os_install_net_interfaces_info
os_install_net_ip
os_install_root_type

Rename variables:
os_grub_devicemap_info -> os_install_grub_devicemap_info
os_fstab_mount_info -> os_install_fstab_mount_info
os_fstab_swap_info -> os_install_fstab_swap_info

Add cl_pass_action values ('install' for system installation and
'live' for configuration current system)

Fix vars using.
netsetup
Mike Hiretsky 14 years ago
parent 01756640ce
commit 896961b312

@ -263,7 +263,7 @@ class fillVars(object, glob_attr):
"""Map number for grub"""
return self.getAttributeFromHash('os_device_hash','map')
def get_os_grub_devicemap_info(self):
def get_os_install_grub_devicemap_info(self):
"""Content of device.map file for grub"""
return "\n".join(map(lambda x: "(hd%s) /dev/%s" % (x[0],x[1]),
filter(lambda x:x[2] != "flash",
@ -271,7 +271,7 @@ class fillVars(object, glob_attr):
self.Get('os_device_dev'),
self.Get('os_device_type')))))
def get_os_fstab_mount_info(self):
def get_os_install_fstab_mount_info(self):
"""Information about mount points for fstab"""
devicesForFstab = sorted(filter(lambda x:x[1] != "" and x[1] != "swap",
zip(self.Get('os_disk_dev'),
@ -351,7 +351,7 @@ class fillVars(object, glob_attr):
#retList.append('modules_%s=( "!plug" )'%dev)
#return "\n".join(retList)
def get_os_fstab_swap_info(self):
def get_os_install_fstab_swap_info(self):
"""Information about swap for fstab"""
return "\n".join(map(lambda x: "%s\tnone\tswap\tsw\t0 0"%x[0],
filter(lambda x: x[1] == "swap",
@ -638,3 +638,35 @@ class fillVars(object, glob_attr):
if localeXkb:
return localeXkb.split("(")[0]
return ""
def get_os_install_net_hostname(self):
"""Computer hostname"""
return self.Get("os_net_hostname")
def get_os_install_net_allow(self):
"""Allowed network"""
return self.Get("os_net_allow")
def get_os_install_net_ip(self):
"""Ip for all network interfaces"""
return self.Get("os_net_ip")
def get_os_install_net_interfaces(self):
"""Net interfaces"""
return self.Get("os_net_interfaces")
def get_os_install_net_domain(self):
"""Domain"""
return self.Get("os_net_domain")
def get_os_install_root_type(self):
"""Type of device for install"""
rootdev = self.Get('os_install_root_dev')
devicetype = map(lambda x: x[1],
filter(lambda x:x[0] in rootdev,
zip(self.Get('os_device_dev'),
self.Get('os_device_type'))))
if devicetype:
return devicetype[0]
else:
return self.Get('os_root_type')

@ -32,6 +32,9 @@ def installExit(*args,**kwars):
def overprintERROR(s):
globals()["install_errors"] += str(s) +"\n"
def get_install_errors():
return globals()["install_errors"]
cl_overriding.exit = installExit
cl_overriding.printERROR = overprintERROR

@ -13,7 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from cl_install import cl_install, InstallError, __app__, __version__
from cl_install import cl_install, InstallError, __app__, __version__, get_install_errors
from cl_opt import opt
from cl_share_cmd import share_cmd
import re
@ -126,7 +126,7 @@ class install_cmd(cl_install,share_cmd):
else:
if values.d == None:
values.d = self.detectPreviousSystem()
if values.v is None and \
if values.v is False and \
values.d is None:
self.optobj.error(_("need specify disk by '-d' option"))
# check syntax DISK:DIR:FS:'Do I need to format the disk'
@ -190,12 +190,16 @@ class install_cmd(cl_install,share_cmd):
k,o,v = val.partition('=')
if self.clVars.exists(k):
if not self.clVars.SetWriteVar(k,v):
self.printERROR(get_install_errors(),printBR=False)
return False
else:
self.printERROR(_('variable %s not found')%k)
return False
if options.live:
self.clVars.Set('cl_image','',True)
self.clVars.Set('cl_pass_action','live',True)
else:
self.clVars.Set('cl_pass_action','install',True)
self.clVars.Get('cl_image')
if options.s:

@ -90,13 +90,13 @@ class Data:
os_device_map = {}
# content of device.map file for grub
os_grub_devicemap_info = {}
os_install_grub_devicemap_info = {}
# information about mount points for fstab
os_fstab_mount_info = {}
os_install_fstab_mount_info = {}
# information about swap for fstab
os_fstab_swap_info = {}
os_install_fstab_swap_info = {}
# content of /etc/conf.d/net
#os_net_config_info = {}
@ -169,10 +169,10 @@ class Data:
hr_video_id = {'value':""}
# timezone for clock
os_install_clock_timezone = {}
os_install_clock_timezone = {'mode':'w'}
# type of clock (UTC or local)
os_install_clock_type = {}
os_install_clock_type = {'mode':'w'}
# vertical resolution
os_install_x11_height = {'mode':'w'}
@ -212,3 +212,21 @@ class Data:
# keyboard layout name for X server
os_install_locale_xkbname = {}
# computer hostname
os_install_net_hostname = {'mode':"w"}
# allowed network
os_install_net_allow ={}
# ip for all network interfaces
os_install_net_ip ={}
# net interfaces
os_install_net_interfaces={'official':True}
# domain
os_install_net_domain = {'mode':"w"}
# type of device for install
os_install_root_type = {}

@ -1,2 +1,2 @@
# Calculate comment=#
127.0.0.1 #-os_net_hostname-#.#-os_net_domain-# #-os_net_hostname-# localhost
127.0.0.1 #-os_install_net_hostname-#.#-os_install_net_domain-# #-os_install_net_hostname-# localhost

@ -1 +1 @@
#-os_grub_devicemap_info-#
#-os_install_grub_devicemap_info-#

@ -1 +1 @@
HOSTNAME="#-os_net_hostname-#"
HOSTNAME="#-os_install_net_hostname-#"

@ -1,4 +1,4 @@
# Calculate os_root_type==ram
# Calculate os_install_root_type==ram
#переведем системное время на livecd
hwclock --hctosys

@ -1,7 +1,7 @@
# Calculate comment=#
#-os_fstab_mount_info-#
#-os_install_fstab_mount_info-#
#-os_fstab_swap_info-#
#-os_install_fstab_swap_info-#
proc /proc proc defaults 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0

@ -12,46 +12,46 @@ Section "Files"
EndSection
Section "Module"
#?os_x11_video_drv!=nvidia&&os_x11_video_drv!=vesa#
#?os_install_x11_video_drv!=nvidia&&os_install_x11_video_drv!=vesa#
Load "dri"
#os_x11_video_drv#
#?os_x11_video_drv==intel#
#os_install_x11_video_drv#
#?os_install_x11_video_drv==intel#
Load "i2c"
Load "bitmap"
Load "ddc"
Load "int10"
Load "vbe"
#os_x11_video_drv#
#?os_x11_video_drv!=intel#
#os_install_x11_video_drv#
#?os_install_x11_video_drv!=intel#
Load "dbe" # Double buffer extension
#os_x11_video_drv#
#os_install_x11_video_drv#
Load "glx" # OpenGL X protocol interface
Load "extmod" # Misc. required extension
EndSection
Section "Monitor"
Identifier "StandardMonitor"
#?os_x11_video_drv==nvidia||os_x11_video_drv==vesa#
#?os_install_x11_video_drv==nvidia||os_install_x11_video_drv==vesa#
HorizSync 31.5 - 60.0
VertRefresh 60-160
#os_x11_video_drv#
#os_install_x11_video_drv#
Option "DPMS"
EndSection
Section "Device"
Identifier "#-os_x11_video_drv-#VGA"
Identifier "#-os_install_x11_video_drv-#VGA"
#?hr_video_id!=#
BusID "PCI:#-hr_video_id-#"
#hr_video_id#
Driver "#-os_x11_video_drv-#"
#?os_x11_video_drv==nvidia#
Driver "#-os_install_x11_video_drv-#"
#?os_install_x11_video_drv==nvidia#
Option "RenderAccel" "True"
Option "AllowGLXWithComposite" "True"
Option "NoLogo" "True"
Option "NvAgp" "1"
Option "DPI" "96x96"
#os_x11_video_drv#
#?os_x11_video_drv==fglrx#
#os_install_x11_video_drv#
#?os_install_x11_video_drv==fglrx#
Option "XAANoOffscreenPixmaps" "True"
Option "AllowGLXWithComposite" "True"
Option "RenderAccel" "True"
@ -61,47 +61,47 @@ Section "Device"
#http://ru.gentoo-wiki.com/wiki/Fglrx
Option "VideoOverlay" "on" # fix bug with mplayer
Option "TexturedVideo" "on" # fix bug Xv
#os_x11_video_drv#
#?os_x11_video_drv==intel#
#os_install_x11_video_drv#
#?os_install_x11_video_drv==intel#
Option "NoAccel" "False"
Option "DRI" "True"
#os_x11_video_drv#
#os_install_x11_video_drv#
EndSection
Section "Screen"
Identifier "Monitor"
Device "#-os_x11_video_drv-#VGA"
Device "#-os_install_x11_video_drv-#VGA"
Monitor "StandardMonitor"
DefaultDepth 24
Subsection "Display"
Viewport 0 0
Depth 24
#?os_x11_standart!=#
Modes "#-os_x11_standart-#"
#video_resolution#
#?os_install_x11_resolution!=#
Modes "#-os_install_x11_resolution-#"
#os_install_x11_resolution#
EndSubsection
EndSection
#?os_x11_video_drv!=nvidia&&os_x11_video_drv!=vesa&&os_x11_video_drv!=vmware&&os_x11_video_drv!=vboxvideo#
#?os_install_x11_video_drv!=nvidia&&os_install_x11_video_drv!=vesa&&os_install_x11_video_drv!=vmware&&os_install_x11_video_drv!=vboxvideo#
Section "DRI"
Group "video"
Mode 0666
EndSection
#os_x11_video_drv#
#os_install_x11_video_drv#
#?os_x11_video_drv!=vesa&&os_x11_video_drv!=vmware&&os_x11_video_drv!=vboxvideo#
#?os_install_x11_video_drv!=vesa&&os_install_x11_video_drv!=vmware&&os_install_x11_video_drv!=vboxvideo#
Section "Extensions"
#os_x11_video_drv#
#?os_x11_video_drv==fglrx#
#os_install_x11_video_drv#
#?os_install_x11_video_drv==fglrx#
Option "RENDER" "On"
Option "XVideo" "On"
#os_x11_video_drv#
#?os_x11_composite==on&&os_x11_video_drv!=vesa&&os_x11_video_drv!=vmware&&os_x11_video_drv!=vboxvideo#
#os_install_x11_video_drv#
#?os_install_x11_composite==on&&os_install_x11_video_drv!=vesa&&os_install_x11_video_drv!=vmware&&os_install_x11_video_drv!=vboxvideo#
Option "Composite" "On"
#os_x11_composite#
#?os_x11_composite!=on&&os_x11_video_drv!=vesa&&os_x11_video_drv!=vmware&&os_x11_video_drv!=vboxvideo#
#os_install_x11_composite#
#?os_install_x11_composite!=on&&os_install_x11_video_drv!=vesa&&os_install_x11_video_drv!=vmware&&os_install_x11_video_drv!=vboxvideo#
Option "Composite" "Off"
#os_x11_composite#
#?os_x11_video_drv!=vesa&&os_x11_video_drv!=vmware&&os_x11_video_drv!=vboxvideo#
#os_install_x11_composite#
#?os_install_x11_video_drv!=vesa&&os_install_x11_video_drv!=vmware&&os_install_x11_video_drv!=vboxvideo#
EndSection
#os_x11_video_drv#
#os_install_x11_video_drv#

Loading…
Cancel
Save