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

Diff of /trunk/src/GLIArchitectureTemplate.py

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

Revision 286 Revision 287
1""" 1"""
2Gentoo Linux Installer 2Gentoo Linux Installer
3 3
4$Id: GLIArchitectureTemplate.py,v 1.39 2005/01/22 08:58:05 codeman Exp $ 4$Id: GLIArchitectureTemplate.py,v 1.40 2005/01/26 05:52:43 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
406 if exitstatus != 0: 406 if exitstatus != 0:
407 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 408 else: #CUSTOM CONFIG
409 #Copy the kernel .config to the proper location in /usr/src/linux 409 #Copy the kernel .config to the proper location in /usr/src/linux
410 try: 410 try:
411 shutil.copy(kernel_config_uri, self._chroot_dir + "/usr/src/linux/.config") 411 GLIUtility.get_uri(kernel_config_uri, self._chroot_dir + "/root/kernel_config")
412 except: 412 except:
413 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not copy kernel config!") 413 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not copy kernel config!")
414 414
415 kernel_compile_script = "#!/bin/bash\n"
416 kernel_compile_script += "cp /root/kernel_config /usr/src/linux/.config\n"
417 kernel_compile_script += "cd /usr/src/linux\n"
418 kernel_compile_script += "make \nmake modules_install \n"
419
420 #Ok now that it's built, copy it to /boot/kernel-* for bootloader code to find it
421 if self._client_configuration.get_architecture_template() == "x86":
422 kernel_compile_script += "cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel-custom\n"
423 f = open(self._chroot_dir+"/root/kernel_script", 'w')
424 f.writelines(kernel_compile_script)
425 f.close()
415 #Build the kernel 426 #Build the kernel
416 exitstatus = GLIUtility.spawn("cd "+self._chroot_dir + "/usr/src/linux/ && make && make modules_install") 427 exitstatus = GLIUtility.spawn("chmod u+x "+self._chroot_dir+"/root/kernel_script")
428 exitstatus = GLIUtility.spawn("/root/kernel_script", chroot=self._chroot_dir)
417 if exitstatus != 0: 429 if exitstatus != 0:
418 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not build custom kernel!") 430 raise GLIException("KernelBuildError", 'fatal', 'build_kernel', "Could not build custom kernel!")
419 431
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. 432 #i'm sure i'm forgetting something here.
427 433
428 def install_logging_daemon(self): 434 def install_logging_daemon(self):
429 "Installs and sets up logger" 435 "Installs and sets up logger"
430 # Get loggin daemon info 436 # Get loggin daemon info

Legend:
Removed from v.286  
changed lines
  Added in v.287

  ViewVC Help
Powered by ViewVC 1.1.20