/[gli]/trunk/src/templates/x86ArchitectureTemplate.py
Gentoo

Diff of /trunk/src/templates/x86ArchitectureTemplate.py

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

Revision 647 Revision 648
1""" 1"""
2Gentoo Linux Installer 2Gentoo Linux Installer
3 3
4$Id: x86ArchitectureTemplate.py,v 1.43 2005/06/10 02:31:57 agaffney Exp $ 4$Id: x86ArchitectureTemplate.py,v 1.44 2005/06/11 07:51:55 robbat2 Exp $
5Copyright 2004 Gentoo Technologies Inc. 5Copyright 2004 Gentoo Technologies Inc.
6 6
7 7
8This fills in x86 specific functions. 8This fills in x86 specific functions.
9""" 9"""
303 if parted_disk.get_partition(part).is_flag_available(flag): 303 if parted_disk.get_partition(part).is_flag_available(flag):
304 parted_disk.get_partition(part).set_flag(flag) 304 parted_disk.get_partition(part).set_flag(flag)
305 # write to disk 305 # write to disk
306 parted_disk.commit() 306 parted_disk.commit()
307 # now format the partition 307 # now format the partition
308 if newpart['format']: 308 # extended partitions should never be formatted
309 if newpart['format'] and newpart['type'] != 'extended':
310 devnode = device + str(part)
311 errormsg = "could't create %s filesystem on %s" % (newpart['type'],devnode)
312 # if you need a special command and
313 # some base options, place it here. -f
314 # is here for filesystems that asks for
315 # confirmation.
309 if newpart['type'] == "ext2": 316 if newpart['type'] == "linux-swap":
310 if GLIUtility.spawn("mkfs.ext2 " + newpart['mkfsopts'] + " " + device + str(part)): 317 cmdname = "mkswap"
311 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create ext2 filesystem on " + device + str(part))
312 elif newpart['type'] == "ext3": 318 elif newpart['type'] == "fat32":
313 if GLIUtility.spawn("mkfs.ext3 " + newpart['mkfsopts'] + " " + device + str(part)): 319 cmdname = "mkfs.vfat -F 32"
314 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create ext3 filesystem on " + device + str(part)) 320 elif newpart['type'] == "ntfs":
321 cmdname = "mkntfs"
322 elif newpart['type'] == "reiserfs":
323 cmdname = "mkfs.reiserfs -f"
315 elif newpart['type'] == "jfs": 324 elif newpart['type'] == "jfs":
316 if GLIUtility.spawn("mkfs.jfs " + newpart['mkfsopts'] + " " + device + str(part)): 325 cmdname = "mkfs.jfs -f"
317 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create jfs filesystem on " + device + str(part))
318 elif newpart['type'] == "xfs": 326 elif newpart['type'] == "xfs":
319 if GLIUtility.spawn("mkfs.xfs " + newpart['mkfsopts'] + " " + device + str(part)): 327 cmdname = "mkfs.xfs -f"
320 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create xfs filesystem on " + device + str(part)) 328 else: # this should catch everything else
321 elif newpart['type'] == "reiserfs": 329 cmdname = "mkfs."+newpart['type']
322 if GLIUtility.spawn("mkfs.reiserfs " + newpart['mkfsopts'] + " " + device + str(part)): 330 # now the actual command
323 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create reiserfs filesystem on " + device + str(part)) 331 cmd = "%s %s %s" % (cmdname,newpart['mkfsopts'],devnode)
324 elif newpart['type'] == "linux-swap": 332 self._logger.log(" Formatting partition %s as %s with: %s" % (str(part),newpart['type'],cmd))
325 if GLIUtility.spawn("mkswap " + newpart['mkfsopts'] + " " + device + str(part)): 333 # If logging is not done, then you get errors:
334 # PartitionFormatError :FATAL: partition: could't create ext2 filesystem on /dev/hda1
335 #if GLIUtility.spawn(cmd):
336 #if GLIUtility.spawn(cmd,append_log=True,logfile='/var/log/install-mkfs.log'):
337 if GLIUtility.spawn(cmd,logfile='/dev/null'):
326 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create swap on " + device + str(part)) 338 raise GLIException("PartitionFormatError", 'fatal', 'partition', errormsg)
327 elif newpart['type'] == "fat32":
328 if GLIUtility.spawn("mkfs.vfat -F 32 " + newpart['mkfsopts'] + " " + device + str(part)):
329 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create fat32 filesystem on " + device + str(part))
330 elif newpart['type'] == "ntfs":
331 if GLIUtility.spawn("mkntfs " + newpart['mkfsopts'] + " " + device + str(part)):
332 raise GLIException("PartitionFormatError", 'fatal', 'partition', "could't create ntfs filesystem on " + device + str(part))
333 start = end + 1 339 start = end + 1
334 340
335 def _install_grub(self): 341 def _install_grub(self):
336 boot_device = "" 342 boot_device = ""
337 boot_minor = "" 343 boot_minor = ""

Legend:
Removed from v.647  
changed lines
  Added in v.648

  ViewVC Help
Powered by ViewVC 1.1.20