/[gli]/trunk/src/GLIArchitectureTemplate.py
Gentoo

Diff of /trunk/src/GLIArchitectureTemplate.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 216 Revision 217
1""" 1"""
2Gentoo Linux Installer 2Gentoo Linux Installer
3 3
4$Id: GLIArchitectureTemplate.py,v 1.25 2005/01/06 07:29:43 codeman Exp $ 4$Id: GLIArchitectureTemplate.py,v 1.26 2005/01/06 09:16:23 codeman Exp $
5Copyright 2004 Gentoo Technologies Inc. 5Copyright 2004 Gentoo Technologies Inc.
6 6
7 7
8The ArchitectureTemplate is largely meant to be an abstract class and an 8The ArchitectureTemplate is largely meant to be an abstract class and an
9interface (yes, it is both at the same time!). The purpose of this is to create 9interface (yes, it is both at the same time!). The purpose of this is to create
289 minor = str(parts[device][partition]['minor']) 289 minor = str(parts[device][partition]['minor'])
290 partition_type = parts[device][partition]['type'] 290 partition_type = parts[device][partition]['type']
291 mountopts = parts[device][partition]['mountopts'] 291 mountopts = parts[device][partition]['mountopts']
292 if mountpoint: 292 if mountpoint:
293 if not GLIUtility.is_file(self._chroot_dir+mountpoint): 293 if not GLIUtility.is_file(self._chroot_dir+mountpoint):
294 exitstatus = GLIUtility.spawn("mkdir -p " + self._chroot_dir + mountpoint) 294 exitstatus = GLIUtility.spawn("mkdir -p " + self._chroot_dir + mountpoint)
295 if exitstatus != 0: 295 if exitstatus != 0:
296 raise GLIException("MkdirError", 'fatal','configure_fstab', "Making the mount point failed!") 296 raise GLIException("MkdirError", 'fatal','configure_fstab', "Making the mount point failed!")
297 newfstab += device+minor+"\t "+mountpoint+"\t "+partition_type+"\t "+mountopts+"\t\t " 297 newfstab += device+minor+"\t "+mountpoint+"\t "+partition_type+"\t "+mountopts+"\t\t "
298 if mountpoint == "/boot": 298 if mountpoint == "/boot":
299 newfstab += "1 2\n" 299 newfstab += "1 2\n"
300 elif mountpoint == "/": 300 elif mountpoint == "/":
301 newfstab += "0 1\n" 301 newfstab += "0 1\n"
519 hosts_line = hostname + "." + domainname + "\t" + hostname + "\tlocalhost" 519 hosts_line = hostname + "." + domainname + "\t" + hostname + "\tlocalhost"
520 else: 520 else:
521 hosts_line = "localhost\t" + hostname 521 hosts_line = "localhost\t" + hostname
522 522
523 # Write to file 523 # Write to file
524 self._edit_config(self._chroot_dir + "/etc/hosts", hosts_ip, hosts_line, True, '\t', False) 524 self._edit_config(self._chroot_dir + "/etc/hosts", {hosts_ip: hosts_line}, delimiter='\t', quotes_around_value=False)
525 525
526 # 526 #
527 # SET DEFAULT GATEWAY 527 # SET DEFAULT GATEWAY
528 # 528 #
529 529
530 # Get default gateway 530 # Get default gateway
531 default_gateway = self._install_profile.get_default_gateway() 531 default_gateway = self._install_profile.get_default_gateway()
532 532
533 # If the default gateway exists, add it 533 # If the default gateway exists, add it
534 if default_gateway: 534 if default_gateway:
535 self._edit_config(self._chroot_dir + "/etc/conf.d/net", "gateway", default_gateway) 535 self._edit_config(self._chroot_dir + "/etc/conf.d/net", {"gateway": default_gateway})
536 536
537 # 537 #
538 # SET RESOLV INFO 538 # SET RESOLV INFO
539 # 539 #
540 540
604 # alias_ips = [] 604 # alias_ips = []
605 # alias_broadcasts = [] 605 # alias_broadcasts = []
606 # alias_netmasks = [] 606 # alias_netmasks = []
607 607
608 # Write the static ip config to /etc/conf.d/net 608 # Write the static ip config to /etc/conf.d/net
609 self._edit_config(self._chroot_dir + "/etc/conf.d/net", "iface_" + interface, ip + " broadcast " + broadcast + " netmask " + netmask) 609 self._edit_config(self._chroot_dir + "/etc/conf.d/net", {"iface_" + interface: ip + " broadcast " + broadcast + " netmask " + netmask})
610 610
611 # If aliases are set 611 # If aliases are set
612 # if aliases: 612 # if aliases:
613 613
614 # Parse aliases to format alias info 614 # Parse aliases to format alias info
627 627
628 # 628 #
629 # DHCP IP 629 # DHCP IP
630 # 630 #
631 else: 631 else:
632 self._edit_config(self._chroot_dir + "/etc/conf.d/net", "iface_" + interface, "dhcp") 632 self._edit_config(self._chroot_dir + "/etc/conf.d/net", {"iface_" + interface: "dhcp"})
633 633
634 def set_root_password(self): 634 def set_root_password(self):
635 "Sets the root password" 635 "Sets the root password"
636 status = GLIUtility.spawn('echo "root:' + self._install_profile.get_root_pass_hash() + '" | chpasswd -e', chroot=self._chroot_dir) 636 status = GLIUtility.spawn('echo "root:' + self._install_profile.get_root_pass_hash() + '" | chpasswd -e', chroot=self._chroot_dir)
637 if not GLIUtility.exit_success(status): 637 if not GLIUtility.exit_success(status):

Legend:
Removed from v.216  
changed lines
  Added in v.217

  ViewVC Help
Powered by ViewVC 1.1.20