/[gli]/branches/overhaul/src/GLIArchitectureTemplate.py
Gentoo

Diff of /branches/overhaul/src/GLIArchitectureTemplate.py

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

Revision 1673 Revision 1674
38 self._chroot_dir = self._install_profile.get_root_mount_point() 38 self._chroot_dir = self._install_profile.get_root_mount_point()
39 self._logger = GLILogger.Logger(LOGFILE) 39 self._logger = GLILogger.Logger(LOGFILE)
40 self._compile_logfile = COMPILE_LOGFILE 40 self._compile_logfile = COMPILE_LOGFILE
41 self._debug = self._install_profile.get_verbose() 41 self._debug = self._install_profile.get_verbose()
42 42
43 self._portage = GLIPortage.GLIPortage(self._chroot_dir, self._install_profile.get_grp_install(), self._logger, self._debug, self._cc, self._compile_logfile) 43 self._portage = GLIPortage.GLIPortage(self._chroot_dir, self._logger, self._debug, self._cc, self._compile_logfile)
44 44
45 # This will cleanup the logfile if it's a dead link (pointing 45 # This will cleanup the logfile if it's a dead link (pointing
46 # to the chroot logfile when partitions aren't mounted, else 46 # to the chroot logfile when partitions aren't mounted, else
47 # no action needs to be taken 47 # no action needs to be taken
48 48
637 if self._debug: self._logger.log("DEBUG: starting livecd-kernel setup") 637 if self._debug: self._logger.log("DEBUG: starting livecd-kernel setup")
638 self.notify_frontend("progress", (0, "Copying livecd-kernel to chroot")) 638 self.notify_frontend("progress", (0, "Copying livecd-kernel to chroot"))
639 self._portage.copy_pkg_to_chroot(self._portage.get_best_version_vdb("livecd-kernel")) 639 self._portage.copy_pkg_to_chroot(self._portage.get_best_version_vdb("livecd-kernel"))
640 self.notify_frontend("progress", (1, "Done copying livecd-kernel to chroot")) 640 self.notify_frontend("progress", (1, "Done copying livecd-kernel to chroot"))
641 641
642 exitstatus = self._portage.emerge("coldplug") 642 exitstatus = self._portage.emerge("coldplug", self._install_profile.get_grp_install())
643 self._logger.log("Coldplug emerged. Now they should be added to the boot runlevel.") 643 self._logger.log("Coldplug emerged. Now they should be added to the boot runlevel.")
644 self._add_to_runlevel("coldplug", runlevel="boot") 644 self._add_to_runlevel("coldplug", runlevel="boot")
645 645
646 if self._install_profile.get_kernel_bootsplash(): 646 if self._install_profile.get_kernel_bootsplash():
647 self._logger.log("Bootsplash enabled for livecd-kernel...this is currently broken, so we're skipping the package install") 647 self._logger.log("Bootsplash enabled for livecd-kernel...this is currently broken, so we're skipping the package install")
662# raise GLIException("EmergeExtraKernelModulesError", 'fatal','build_kernel', "Could not emerge extra kernel packages") 662# raise GLIException("EmergeExtraKernelModulesError", 'fatal','build_kernel', "Could not emerge extra kernel packages")
663# self._logger.log("Extra kernel packages emerged.") 663# self._logger.log("Extra kernel packages emerged.")
664 664
665 # normal case 665 # normal case
666 else: 666 else:
667 exitstatus = self._portage.emerge(kernel_pkg) 667 exitstatus = self._portage.emerge(kernel_pkg, self._install_profile.get_grp_install())
668# if not GLIUtility.exitsuccess(exitstatus): 668# if not GLIUtility.exitsuccess(exitstatus):
669# raise GLIException("EmergeKernelSourcesError", 'fatal','emerge_kernel_sources',"Could not retrieve kernel sources!") 669# raise GLIException("EmergeKernelSourcesError", 'fatal','emerge_kernel_sources',"Could not retrieve kernel sources!")
670 try: 670 try:
671 os.stat(self._chroot_dir + "/usr/src/linux") 671 os.stat(self._chroot_dir + "/usr/src/linux")
672 except: 672 except:
753 #it's not important if this fails. 753 #it's not important if this fails.
754 self._logger.log("prepare-only build complete") 754 self._logger.log("prepare-only build complete")
755 # Genkernel mode, including custom kernel_config. Initrd always on. 755 # Genkernel mode, including custom kernel_config. Initrd always on.
756 elif build_mode == "genkernel": 756 elif build_mode == "genkernel":
757 if self._debug: self._logger.log("DEBUG: build_kernel(): starting emerge genkernel") 757 if self._debug: self._logger.log("DEBUG: build_kernel(): starting emerge genkernel")
758 exitstatus = self._portage.emerge("genkernel") 758 exitstatus = self._portage.emerge("genkernel", self._install_profile.get_grp_install())
759# if not GLIUtility.exitsuccess(exitstatus): 759# if not GLIUtility.exitsuccess(exitstatus):
760# raise GLIException("EmergeGenKernelError", 'fatal','build_kernel', "Could not emerge genkernel!") 760# raise GLIException("EmergeGenKernelError", 'fatal','build_kernel', "Could not emerge genkernel!")
761 self._logger.log("Genkernel emerged. Beginning kernel compile.") 761 self._logger.log("Genkernel emerged. Beginning kernel compile.")
762 # Null the genkernel_options 762 # Null the genkernel_options
763 genkernel_options = "" 763 genkernel_options = ""
782 782
783# exitstatus = self._emerge("hotplug") 783# exitstatus = self._emerge("hotplug")
784# if not GLIUtility.exitsuccess(exitstatus): 784# if not GLIUtility.exitsuccess(exitstatus):
785# raise GLIException("EmergeHotplugError", 'fatal','build_kernel', "Could not emerge hotplug!") 785# raise GLIException("EmergeHotplugError", 'fatal','build_kernel', "Could not emerge hotplug!")
786# self._logger.log("Hotplug emerged.") 786# self._logger.log("Hotplug emerged.")
787 exitstatus = self._portage.emerge("coldplug") 787 exitstatus = self._portage.emerge("coldplug", self._install_profile.get_grp_install())
788# if not GLIUtility.exitsuccess(exitstatus): 788# if not GLIUtility.exitsuccess(exitstatus):
789# raise GLIException("EmergeColdplugError", 'fatal','build_kernel', "Could not emerge coldplug!") 789# raise GLIException("EmergeColdplugError", 'fatal','build_kernel', "Could not emerge coldplug!")
790 self._logger.log("Coldplug emerged. Now they should be added to the default runlevel.") 790 self._logger.log("Coldplug emerged. Now they should be added to the default runlevel.")
791 791
792# self._add_to_runlevel("hotplug") 792# self._add_to_runlevel("hotplug")
793 self._add_to_runlevel("coldplug", runlevel="boot") 793 self._add_to_runlevel("coldplug", runlevel="boot")
794 794
795 if self._install_profile.get_kernel_bootsplash(): 795 if self._install_profile.get_kernel_bootsplash():
796 self._logger.log("Bootsplash enabled...emerging necessary packages") 796 self._logger.log("Bootsplash enabled...emerging necessary packages")
797 self._portage.emerge(["splashutils", "splash-themes-livecd"]) 797 self._portage.emerge(["splashutils", "splash-themes-livecd"], self._install_profile.get_grp_install())
798 798
799 self._logger.log("Genkernel complete.") 799 self._logger.log("Genkernel complete.")
800 elif build_mode == "custom": #CUSTOM CONFIG 800 elif build_mode == "custom": #CUSTOM CONFIG
801 801
802 kernel_compile_script += " && make && make modules && make modules_install" 802 kernel_compile_script += " && make && make modules && make modules_install"
827 exitstatus = GLIUtility.spawn("rm -f "+self._chroot_dir+"/var/tmp/kernel_script "+self._chroot_dir+"/var/tmp/kernel_config") 827 exitstatus = GLIUtility.spawn("rm -f "+self._chroot_dir+"/var/tmp/kernel_script "+self._chroot_dir+"/var/tmp/kernel_config")
828 #it's not important if this fails. 828 #it's not important if this fails.
829 829
830 if self._install_profile.get_kernel_bootsplash(): 830 if self._install_profile.get_kernel_bootsplash():
831 self._logger.log("Bootsplash enabled...emerging necessary packages") 831 self._logger.log("Bootsplash enabled...emerging necessary packages")
832 self._portage.emerge(["splashutils", "splash-themes-livecd"]) 832 self._portage.emerge(["splashutils", "splash-themes-livecd"], self._install_profile.get_grp_install())
833 833
834 self._logger.log("Custom kernel complete") 834 self._logger.log("Custom kernel complete")
835 835
836 ## 836 ##
837 # Installs and starts up distccd if the user has it set, so that it will get used for the rest of the install 837 # Installs and starts up distccd if the user has it set, so that it will get used for the rest of the install
851 # Get MTA info 851 # Get MTA info
852 mta_pkg = self._install_profile.get_mta_pkg() 852 mta_pkg = self._install_profile.get_mta_pkg()
853 if mta_pkg: 853 if mta_pkg:
854 # Emerge MTA 854 # Emerge MTA
855 if self._debug: self._logger.log("DEBUG: install_mta(): installing mta: "+mta_pkg) 855 if self._debug: self._logger.log("DEBUG: install_mta(): installing mta: "+mta_pkg)
856 exitstatus = self._portage.emerge(mta_pkg) 856 exitstatus = self._portage.emerge(mta_pkg, self._install_profile.get_grp_install())
857# if not GLIUtility.exitsuccess(exitstatus): 857# if not GLIUtility.exitsuccess(exitstatus):
858# raise GLIException("MTAError", 'fatal','install_mta', "Could not emerge " + mta_pkg + "!") 858# raise GLIException("MTAError", 'fatal','install_mta', "Could not emerge " + mta_pkg + "!")
859 self._logger.log("MTA installed: "+mta_pkg) 859 self._logger.log("MTA installed: "+mta_pkg)
860 else: 860 else:
861 installpackages = self._install_profile.get_install_packages() 861 installpackages = self._install_profile.get_install_packages()
862 if installpackages: 862 if installpackages:
863 for pkg in installpackages: 863 for pkg in installpackages:
864 if pkg in ['esmtp', 'exim', 'msmtp', 'nbsmtp', 'nullmailer', 'sendmail', 'ssmtp', 'xmail']: 864 if pkg in ['esmtp', 'exim', 'msmtp', 'nbsmtp', 'nullmailer', 'sendmail', 'ssmtp', 'xmail']:
865 self._logger.log("Found an mta in the package list: "+pkg+". Installing early.") 865 self._logger.log("Found an mta in the package list: "+pkg+". Installing early.")
866 exitstatus = self._portage.emerge(pkg) 866 exitstatus = self._portage.emerge(pkg, self._install_profile.get_grp_install())
867 self._logger.log("MTA installed.") 867 self._logger.log("MTA installed.")
868 break # We only want to install one 868 break # We only want to install one
869 869
870 ## 870 ##
871 # Installs and sets up logging daemon on the new system. adds to runlevel too. 871 # Installs and sets up logging daemon on the new system. adds to runlevel too.
873 # Get loggin daemon info 873 # Get loggin daemon info
874 logging_daemon_pkg = self._install_profile.get_logging_daemon_pkg() 874 logging_daemon_pkg = self._install_profile.get_logging_daemon_pkg()
875 if logging_daemon_pkg: 875 if logging_daemon_pkg:
876 # Emerge Logging Daemon 876 # Emerge Logging Daemon
877 if self._debug: self._logger.log("DEBUG: install_logging_daemon: emerging "+logging_daemon_pkg) 877 if self._debug: self._logger.log("DEBUG: install_logging_daemon: emerging "+logging_daemon_pkg)
878 exitstatus = self._portage.emerge(logging_daemon_pkg) 878 exitstatus = self._portage.emerge(logging_daemon_pkg, self._install_profile.get_grp_install())
879# if not GLIUtility.exitsuccess(exitstatus): 879# if not GLIUtility.exitsuccess(exitstatus):
880# raise GLIException("LoggingDaemonError", 'fatal','install_logging_daemon', "Could not emerge " + logging_daemon_pkg + "!") 880# raise GLIException("LoggingDaemonError", 'fatal','install_logging_daemon', "Could not emerge " + logging_daemon_pkg + "!")
881 881
882 # Add Logging Daemon to default runlevel 882 # Add Logging Daemon to default runlevel
883 # After we find the name of it's initscript 883 # After we find the name of it's initscript
895 if cron_daemon_pkg == "none": 895 if cron_daemon_pkg == "none":
896 self._logger.log("Skipping installation of cron daemon") 896 self._logger.log("Skipping installation of cron daemon")
897 else: 897 else:
898 # Emerge Cron Daemon 898 # Emerge Cron Daemon
899 if self._debug: self._logger.log("DEBUG: install_cron_daemon: emerging "+cron_daemon_pkg) 899 if self._debug: self._logger.log("DEBUG: install_cron_daemon: emerging "+cron_daemon_pkg)
900 exitstatus = self._portage.emerge(cron_daemon_pkg) 900 exitstatus = self._portage.emerge(cron_daemon_pkg, self._install_profile.get_grp_install())
901# if not GLIUtility.exitsuccess(exitstatus): 901# if not GLIUtility.exitsuccess(exitstatus):
902# raise GLIException("CronDaemonError", 'fatal', 'install_cron_daemon', "Could not emerge " + cron_daemon_pkg + "!") 902# raise GLIException("CronDaemonError", 'fatal', 'install_cron_daemon', "Could not emerge " + cron_daemon_pkg + "!")
903 903
904 # Add Cron Daemon to default runlevel 904 # Add Cron Daemon to default runlevel
905 # After we find the name of it's initscript 905 # After we find the name of it's initscript
948 #else: 948 #else:
949 # should be code here for every FS type! 949 # should be code here for every FS type!
950 failed_list = [] 950 failed_list = []
951 for package in package_list: 951 for package in package_list:
952 if self._debug: self._logger.log("DEBUG: install_filesystem_tools(): emerging "+package) 952 if self._debug: self._logger.log("DEBUG: install_filesystem_tools(): emerging "+package)
953 exitstatus = self._portage.emerge(package) 953 exitstatus = self._portage.emerge(package, self._install_profile.get_grp_install())
954# if not GLIUtility.exitsuccess(exitstatus): 954# if not GLIUtility.exitsuccess(exitstatus):
955# self._logger.log("ERROR! : Could not emerge "+package+"!") 955# self._logger.log("ERROR! : Could not emerge "+package+"!")
956# failed_list.append(package) 956# failed_list.append(package)
957# else: 957# else:
958 self._logger.log("FileSystemTool "+package+" was emerged successfully.") 958 self._logger.log("FileSystemTool "+package+" was emerged successfully.")
963 963
964 ## 964 ##
965 # Installs and sets up pcmcia-cs if selected in the profile IS THIS USED AT ALL???? 965 # Installs and sets up pcmcia-cs if selected in the profile IS THIS USED AT ALL????
966 def install_pcmcia_cs(self): 966 def install_pcmcia_cs(self):
967 if self._debug: self._logger.log("DEBUG: install_pcmcia_cs(): emerging pcmcia-cs") 967 if self._debug: self._logger.log("DEBUG: install_pcmcia_cs(): emerging pcmcia-cs")
968 exitstatus = self._portage.emerge("pcmcia-cs") 968 exitstatus = self._portage.emerge("pcmcia-cs", self._install_profile.get_grp_install())
969# if not GLIUtility.exitsuccess(exitstatus): 969# if not GLIUtility.exitsuccess(exitstatus):
970# self._logger.log("ERROR! : Could not emerge pcmcia-cs!") 970# self._logger.log("ERROR! : Could not emerge pcmcia-cs!")
971 971
972 # Add pcmcia-cs to the default runlevel 972 # Add pcmcia-cs to the default runlevel
973# else: 973# else:
1141 dhcpcd_options = "" 1141 dhcpcd_options = ""
1142 self._edit_config(self._chroot_dir + "/etc/conf.d/net", {"iface_" + interface: "dhcp", "dhcpcd_" + interface: dhcpcd_options}) 1142 self._edit_config(self._chroot_dir + "/etc/conf.d/net", {"iface_" + interface: "dhcp", "dhcpcd_" + interface: dhcpcd_options})
1143 emerge_dhcp = True 1143 emerge_dhcp = True
1144 if emerge_dhcp: 1144 if emerge_dhcp:
1145 if self._debug: self._logger.log("DEBUG: setup_network_post(): emerging dhcpcd.") 1145 if self._debug: self._logger.log("DEBUG: setup_network_post(): emerging dhcpcd.")
1146 exitstatus = self._portage.emerge("dhcpcd") 1146 exitstatus = self._portage.emerge("dhcpcd", self._install_profile.get_grp_install())
1147# if not GLIUtility.exitsuccess(exitstatus): 1147# if not GLIUtility.exitsuccess(exitstatus):
1148# self._logger.log("ERROR! : Could not emerge dhcpcd!") 1148# self._logger.log("ERROR! : Could not emerge dhcpcd!")
1149# else: 1149# else:
1150 self._logger.log("dhcpcd emerged.") 1150 self._logger.log("dhcpcd emerged.")
1151 1151
1242# else: 1242# else:
1243# try: 1243# try:
1244# self._portage.copy_pkg_to_chroot(pkg) 1244# self._portage.copy_pkg_to_chroot(pkg)
1245# except: 1245# except:
1246# raise GLIException("ExtraPackagesError", "fatal", "install_packages", "Could not emerge " + pkg + "!") 1246# raise GLIException("ExtraPackagesError", "fatal", "install_packages", "Could not emerge " + pkg + "!")
1247 self._portage.emerge(installpackages) 1247 self._portage.emerge(installpackages, self._install_profile.get_grp_install())
1248 1248
1249 if GLIUtility.is_file(self._chroot_dir + "/etc/X11"): 1249 if GLIUtility.is_file(self._chroot_dir + "/etc/X11"):
1250 # Copy the xorg.conf from the LiveCD if they installed xorg-x11 1250 # Copy the xorg.conf from the LiveCD if they installed xorg-x11
1251 exitstatus = GLIUtility.spawn("cp /etc/X11/xorg.conf " + self._chroot_dir + "/etc/X11/xorg.conf") 1251 exitstatus = GLIUtility.spawn("cp /etc/X11/xorg.conf " + self._chroot_dir + "/etc/X11/xorg.conf")
1252 if not GLIUtility.exitsuccess(exitstatus): 1252 if not GLIUtility.exitsuccess(exitstatus):

Legend:
Removed from v.1673  
changed lines
  Added in v.1674

  ViewVC Help
Powered by ViewVC 1.1.20