/[gli]/branches/overhaul/src/templates/x86ArchitectureTemplate.py
Gentoo

Diff of /branches/overhaul/src/templates/x86ArchitectureTemplate.py

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

Revision 1349 Revision 1351
3# This source code is distributed under the terms of version 2 of the GNU 3# This source code is distributed under the terms of version 2 of the GNU
4# General Public License as published by the Free Software Foundation, a copy 4# General Public License as published by the Free Software Foundation, a copy
5# of which can be found in the main directory of this project. 5# of which can be found in the main directory of this project.
6Gentoo Linux Installer 6Gentoo Linux Installer
7 7
8$Id: x86ArchitectureTemplate.py,v 1.112 2006/03/06 22:16:09 agaffney Exp $ 8$Id: x86ArchitectureTemplate.py,v 1.113 2006/03/07 04:26:34 codeman Exp $
9Copyright 2004 Gentoo Technologies Inc. 9Copyright 2004 Gentoo Technologies Inc.
10 10
11 11
12This fills in x86 specific functions. 12This fills in x86 specific functions.
13""" 13"""
479 newgrubconf += "initrd " + grub_initrd_name[5:] + "\n" 479 newgrubconf += "initrd " + grub_initrd_name[5:] + "\n"
480 else: 480 else:
481 newgrubconf += "kernel /boot" + grub_kernel_name[5:] + " root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=" 481 newgrubconf += "kernel /boot" + grub_kernel_name[5:] + " root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root="
482 newgrubconf += self.root_device + self.root_minor + " " + bootloader_kernel_args + "\n" 482 newgrubconf += self.root_device + self.root_minor + " " + bootloader_kernel_args + "\n"
483 newgrubconf += "initrd /boot" + grub_initrd_name[5:] + "\n" 483 newgrubconf += "initrd /boot" + grub_initrd_name[5:] + "\n"
484 484 newgrubconf = self._grub_add_windows(newgrubconf)
485 #now make the grub.conf file 485 #now make the grub.conf file
486 file_name = root + "/boot/grub/grub.conf" 486 file_name = root + "/boot/grub/grub.conf"
487 try: 487 try:
488 shutil.move(file_name, file_name + ".OLDdefault") 488 shutil.move(file_name, file_name + ".OLDdefault")
489 except: 489 except:
536 self.grub_root_drive = self._map_device_to_grub_device(self.root_device) 536 self.grub_root_drive = self._map_device_to_grub_device(self.root_device)
537 self.grub_mbr_drive = self._map_device_to_grub_device(self.mbr_device) 537 self.grub_mbr_drive = self._map_device_to_grub_device(self.mbr_device)
538 538
539 if (not self.grub_root_drive) or (not self.grub_boot_drive): 539 if (not self.grub_root_drive) or (not self.grub_boot_drive):
540 raise GLIException("BootloaderError", 'fatal', '_gather_grub_drive_info',"Couldn't find the drive num in the list from the device.map") 540 raise GLIException("BootloaderError", 'fatal', '_gather_grub_drive_info',"Couldn't find the drive num in the list from the device.map")
541
542 def _grub_add_windows(self, newgrubconf):
543 parts = self._install_profile.get_partition_tables()
544 for device in parts:
545 tmp_partitions = parts[device].get_install_profile_structure()
546 for partition in tmp_partitions:
547 if (tmp_partitions[partition]['type'] == "vfat") or (tmp_partitions[partition]['type'] == "ntfs"):
548 grub_dev = self._map_device_to_grub_device(device)
549 newgrubconf += "\ntitle=Possible Windows P"+str(int(tmp_partitions[partition]['minor']))+"\n"
550 newgrubconf += "rootnoverify ("+grub_dev+","+str(int(tmp_partitions[partition]['minor'] -1))+")\n"
551 newgrubconf += "makeactive\nchainloader +1\n\n"
552 return newgrubconf
541 553
542 def _configure_lilo(self): 554 def _configure_lilo(self):
543 self.build_mode = self._install_profile.get_kernel_build_method() 555 self.build_mode = self._install_profile.get_kernel_build_method()
544 self._gather_lilo_drive_info() 556 self._gather_lilo_drive_info()
545 root = self._chroot_dir 557 root = self._chroot_dir

Legend:
Removed from v.1349  
changed lines
  Added in v.1351

  ViewVC Help
Powered by ViewVC 1.1.20