FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-09-2009, 06:05 PM
David Lehman
 
Default Kickstart support for unpartitioned disks.

---
kickstart.py | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index a28eb03..dd7278d 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -23,6 +23,7 @@ from storage.devices import LUKSDevice
from storage.devicelibs.lvm import getPossiblePhysicalExtents
from storage.formats import getFormat
from storage.partitioning import clearPartitions
+from storage.partitioning import shouldClear

from errors import *
import iutil
@@ -239,6 +240,20 @@ class Bootloader(commands.bootloader.F12_Bootloader):
if self.timeout:
anaconda.id.bootloader.timeout = self.timeout

+ # add unpartitioned devices that will get partitioned into
+ # bootloader.drivelist
+ disks = anaconda.id.storage.disks
+ partitioned = anaconda.id.storage.partitioned
+ for disk in [d for d in disks if not d.partitioned]:
+ if shouldClear(disk, anaconda.id.storage.clearPartType,
+ anaconda.id.storage.clearPartDisks):
+ # add newly partitioned disks to the drivelist
+ anaconda.id.bootloader.drivelist.append(disk.name)
+ elif disk.name in anaconda.id.bootloader.drivelist:
+ # remove unpartitioned disks from the drivelist
+ anaconda.id.bootloader.drivelist.remove(disk.name)
+ anaconda.id.bootloader.drivelist.sort(cmp=isys.com pareDrives)
+
# Throw out drives specified that don't exist.
if self.driveorder and len(self.driveorder) > 0:
new = []
@@ -676,9 +691,14 @@ class PartitionData(commands.partition.F12_PartData):
names = [self.disk, "mapper/" + self.disk]
for n in names:
disk = devicetree.getDeviceByName(udev_resolve_devspec(n) )
- if disk:
+ should_clear = shouldClear(disk,
+ storage.clearPartType,
+ storage.clearPartDisks)
+ if disk and (disk.partitioned or should_clear):
kwargs["disks"] = [disk]
break
+ elif disk:
+ raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified unpartitioned disk %s in partition command" % self.disk)

if not kwargs["disks"]:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in partition command" % self.disk)
--
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-09-2009, 08:10 PM
Chris Lumens
 
Default Kickstart support for unpartitioned disks.

> kickstart.py | 22 +++++++++++++++++++++-
> 1 files changed, 21 insertions(+), 1 deletions(-)

Looks okay to me. I worry that there might be other places in
kickstart.py where we need to make these changes, but that's okay for
now.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org