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

Diff of /trunk/src/GLIArchitectureTemplate.py

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

Revision 281 Revision 282
1""" 1"""
2Gentoo Linux Installer 2Gentoo Linux Installer
3 3
4$Id: GLIArchitectureTemplate.py,v 1.38 2005/01/19 17:38:14 agaffney Exp $ 4$Id: GLIArchitectureTemplate.py,v 1.39 2005/01/22 08:58:05 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
249 if exitstatus != 0: 249 if exitstatus != 0:
250 raise GLIException("PortageError", 'fatal','install_portage_tree',"Failed to copy the distfiles to the new system") 250 raise GLIException("PortageError", 'fatal','install_portage_tree',"Failed to copy the distfiles to the new system")
251 251
252 def fetch_grp_from_cd(self): 252 def fetch_grp_from_cd(self):
253 "Gets grp binary packages from CD (required for non-network binary installation)" 253 "Gets grp binary packages from CD (required for non-network binary installation)"
254 # This will not work until we find out how the new GRP format will function.
254 pass 255 pass
255 256
256 def configure_make_conf(self): 257 def configure_make_conf(self):
257 "Configures make.conf" 258 "Configures make.conf"
258 259
376 else: 377 else:
377 counter = counter + 1 378 counter = counter + 1
378 379
379 def build_kernel(self): 380 def build_kernel(self):
380 "Builds kernel" 381 "Builds kernel"
381 exitstatus = self._emerge("genkernel")
382 if exitstatus != 0:
383 raise GLIException("EmergeGenKernelError", 'warning','build_kernel', "Could not emerge genkernel!")
384
385 # Null the genkernel_options
386 genkernel_options = ""
387
388 # Get the uri to the kernel config 382 # Get the uri to the kernel config
389 kernel_config_uri = self._install_profile.get_kernel_config_uri() 383 kernel_config_uri = self._install_profile.get_kernel_config_uri()
384 if kernel_config_uri == "": #use genkernel if no specific config
385
386 exitstatus = self._emerge("genkernel")
387 if exitstatus != 0:
388 raise GLIException("EmergeGenKernelError", 'warning','build_kernel', "Could not emerge genkernel!")
390 389
390 # Null the genkernel_options
391 genkernel_options = ""
392
391 # If the uri for the kernel config is not null, then 393 # If the uri for the kernel config is not null, then
392 if kernel_config_uri != "": 394 if kernel_config_uri != "":
393 GLIUtility.get_uri(kernel_config_uri, self._chroot_dir + "/root/kernel_config") 395 GLIUtility.get_uri(kernel_config_uri, self._chroot_dir + "/root/kernel_config")
394 genkernel_options = genkernel_options + " --kernel-config=/root/kernel_config" 396 genkernel_options = genkernel_options + " --kernel-config=/root/kernel_config"
395 397
396 # Decide whether to use bootsplash or not 398 # Decide whether to use bootsplash or not
397 if self._install_profile.get_kernel_bootsplash(): 399 if self._install_profile.get_kernel_bootsplash():
398 genkernel_options = genkernel_options + " --bootsplash" 400 genkernel_options = genkernel_options + " --bootsplash"
399 else: 401 else:
400 genkernel_options = genkernel_options + " --no-bootsplash" 402 genkernel_options = genkernel_options + " --no-bootsplash"
401
402 # This is code to choose whether or not genekernel will build an initrd or not
403 # Genkernel currently does not support this
404 #if self._install_profile.get_kernel_initrd():
405 # pass
406 #else:
407 # pass
408
409 # Run genkernel in chroot 403 # Run genkernel in chroot
410 print "genkernel all " + genkernel_options 404 print "genkernel all " + genkernel_options
411 exitstatus = GLIUtility.spawn("genkernel all " + genkernel_options, chroot=self._chroot_dir) 405 exitstatus = GLIUtility.spawn("genkernel all " + genkernel_options, chroot=self._chroot_dir)
412 if exitstatus != 0: 406 if exitstatus != 0:
413 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not build kernel!") 407 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not build kernel!")
408 else: #CUSTOM CONFIG
409 #Copy the kernel .config to the proper location in /usr/src/linux
410 try:
411 shutil.copy(kernel_config_uri, self._chroot_dir + "/usr/src/linux/.config")
412 except:
413 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not copy kernel config!")
414
415 #Build the kernel
416 exitstatus = GLIUtility.spawn("cd "+self._chroot_dir + "/usr/src/linux/ && make && make modules_install")
417 if exitstatus != 0:
418 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not build custom kernel!")
419
420 #Ok now that it's built, copy it to /boot/kernel-* for bootloader code to find it
421 try:
422 shutil.copy(self._chroot_dir+"/usr/src/linux/"+self._kernel_bzimage, self._chroot_dir+"/boot/kernel-custom")
423 except:
424 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not copy kernel!")
425
426 #i'm sure i'm forgetting something here.
414 427
415 def install_logging_daemon(self): 428 def install_logging_daemon(self):
416 "Installs and sets up logger" 429 "Installs and sets up logger"
417 # Get loggin daemon info 430 # Get loggin daemon info
418 logging_daemon_pkg = self._install_profile.get_logging_daemon_pkg() 431 logging_daemon_pkg = self._install_profile.get_logging_daemon_pkg()

Legend:
Removed from v.281  
changed lines
  Added in v.282

  ViewVC Help
Powered by ViewVC 1.1.20