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

Diff of /trunk/src/GLIArchitectureTemplate.py

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

Revision 360 Revision 361
1""" 1"""
2Gentoo Linux Installer 2Gentoo Linux Installer
3 3
4$Id: GLIArchitectureTemplate.py,v 1.54 2005/03/14 22:19:45 codeman Exp $ 4$Id: GLIArchitectureTemplate.py,v 1.55 2005/03/16 06:17:35 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
57 (self.install_filesystem_tools, "Installing filesystem tools"), 57 (self.install_filesystem_tools, "Installing filesystem tools"),
58 (self.setup_network_post, "Configuring post-install networking"), 58 (self.setup_network_post, "Configuring post-install networking"),
59 (self.install_bootloader, "Configuring and installing bootloader"), 59 (self.install_bootloader, "Configuring and installing bootloader"),
60 (self.update_config_files, "Updating config files"), 60 (self.update_config_files, "Updating config files"),
61 (self.configure_rc_conf, "Updating /etc/rc.conf"), 61 (self.configure_rc_conf, "Updating /etc/rc.conf"),
62 (self.set_services, "Setting up services for startup"),
62 (self.set_users, "Add additional users.") 63 (self.set_users, "Add additional users.")
63 ] 64 ]
64 65
65 66
66 def get_install_steps(self): 67 def get_install_steps(self):
74 75
75 def _add_to_runlevel(self, script_name, runlevel="default"): 76 def _add_to_runlevel(self, script_name, runlevel="default"):
76 "Adds the script named 'script_name' to the runlevel 'runlevel' in the chroot environement" 77 "Adds the script named 'script_name' to the runlevel 'runlevel' in the chroot environement"
77 78
78 # Do it 79 # Do it
79 status = GLIUtility.spawn("rc-update add " + script_name + " " + runlevel, chroot=self._chroot_dir) 80 status = GLIUtility.spawn("rc-update add " + script_name + " " + runlevel, display_on_tty8=True, chroot=self._chroot_dir)
80 if not GLIUtility.exitsuccess(status): 81 if not GLIUtility.exitsuccess(status):
81 raise GLIException("RunlevelAddError", 'fatal', '_add_to_runlevel', "Failure adding " + script_name + " to runlevel " + runlevel + "!") 82 raise GLIException("RunlevelAddError", 'fatal', '_add_to_runlevel', "Failure adding " + script_name + " to runlevel " + runlevel + "!")
82 self._logger.log("Added "+script_name+" to runlevel "+runlevel) 83 self._logger.log("Added "+script_name+" to runlevel "+runlevel)
83 84
84 def _quickpkg_deps(self, package): 85 def _quickpkg_deps(self, package):
190 if not GLIUtility.exitsuccess(status): 191 if not GLIUtility.exitsuccess(status):
191 self._logger.log("Could not emerge " + package + "!") 192 self._logger.log("Could not emerge " + package + "!")
192 # raise GLIException("InstallPackagesError", 'warning', 'install_packages', "Could not emerge " + package + "!") 193 # raise GLIException("InstallPackagesError", 'warning', 'install_packages', "Could not emerge " + package + "!")
193 else: 194 else:
194 self._logger.log("Emerged package: "+package) 195 self._logger.log("Emerged package: "+package)
195# ************************************************************************************** 196
197 def set_services(self):
198 "Will set the list of services to runlevel default. This is a temporary solution!"
199
200 services = self._install_profile.get_services()
201 for service in services:
202 status = self._add_to_runlevel(service)
203 if not GLIUtility.exitsuccess(status):
204 self._logger.log("Could not add " + package + "to startup!")
205 # raise GLIException("InstallPackagesError", 'warning', 'install_packages', "Could not emerge " + package + "!")
196 206
197 207
198 def mount_local_partitions(self): 208 def mount_local_partitions(self):
199 "Mounts all partitions that are on the local machine" 209 "Mounts all partitions that are on the local machine"
200 #{ 1: { 'end': 1999871, 'format': False, 'mb': 0, 210 #{ 1: { 'end': 1999871, 'format': False, 'mb': 0,
429 # Run genkernel in chroot 439 # Run genkernel in chroot
430 print "genkernel all " + genkernel_options 440 print "genkernel all " + genkernel_options
431 exitstatus = GLIUtility.spawn("genkernel all " + genkernel_options, chroot=self._chroot_dir, display_on_tty8=True) 441 exitstatus = GLIUtility.spawn("genkernel all " + genkernel_options, chroot=self._chroot_dir, display_on_tty8=True)
432 if exitstatus != 0: 442 if exitstatus != 0:
433 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not build kernel!") 443 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not build kernel!")
444 self._add_to_runlevel("hotplug")
445 self._add_to_runlevel("coldplug", runlevel="boot")
434 self._logger.log("Genkernel complete.") 446 self._logger.log("Genkernel complete.")
435 else: #CUSTOM CONFIG 447 else: #CUSTOM CONFIG
436 #Copy the kernel .config to the proper location in /usr/src/linux 448 #Copy the kernel .config to the proper location in /usr/src/linux
437 try: 449 try:
438 GLIUtility.get_uri(kernel_config_uri, self._chroot_dir + "/root/kernel_config") 450 GLIUtility.get_uri(kernel_config_uri, self._chroot_dir + "/root/kernel_config")

Legend:
Removed from v.360  
changed lines
  Added in v.361

  ViewVC Help
Powered by ViewVC 1.1.20