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 > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-20-2011, 03:39 PM
Chris Lumens
 
Default 'part' command checks if media is present.

> kickstart.py | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/kickstart.py b/kickstart.py
> index 61d00d3..71de65b 100644
> --- a/kickstart.py
> +++ b/kickstart.py
> @@ -811,6 +811,8 @@ class PartitionData(commands.partition.F12_PartData):
> disk = mpath_device
> if not disk:
> raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in partition command" % n)
> + if not disk.mediaPresent:
> + raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified device %s in partition command has no media." % n)

Well, we shouldn't even allow installations onto these sorts of devices
anyway. I'd suggest some sort of check if disk is an OpticalDevice, or
disk.format is read-only, or something along those lines followed by an
error message like "Cannot install to read-only media".

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-21-2011, 07:59 AM
Ales Kozumplik
 
Default 'part' command checks if media is present.

On 06/20/2011 05:39 PM, Chris Lumens wrote:


Well, we shouldn't even allow installations onto these sorts of devices
anyway. I'd suggest some sort of check if disk is an OpticalDevice, or
disk.format is read-only, or something along those lines followed by an
error message like "Cannot install to read-only media".



Thanks for catching this, the current patch will allow sr0 with a media
in it to be used in 'part'. I don't think that device.format is of much
help here --- if no media is present I think the format will be just
'DeviceFormat' which is perfectly OK for partitioning (same as empty
device). I suggest testing the device for both .isDisk and
.mediaPresent, just like storage.disks() (used by clearpart gui for
instance) does.


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-21-2011, 08:01 AM
Ales Kozumplik
 
Default 'part' command checks if media is present.

Otherwise weird tracebacks occur later when an attempt is made to
partition the cdrom.

Resolves: rhbz#679073
---
kickstart.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 61d00d3..a79c64c 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -811,6 +811,8 @@ class PartitionData(commands.partition.F12_PartData):
disk = mpath_device
if not disk:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in partition command" % n)
+ if not (disk.isDisk and disk.mediaPresent):
+ raise KickstartValueError, formatErrorMsg(self.lineno, msg="Cannot install to read-only media %s." % n)

should_clear = shouldClear(disk,
storage.clearPartType,
--
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-21-2011, 07:13 PM
David Lehman
 
Default 'part' command checks if media is present.

On Tue, 2011-06-21 at 09:59 +0200, Ales Kozumplik wrote:
> On 06/20/2011 05:39 PM, Chris Lumens wrote:
>
> > Well, we shouldn't even allow installations onto these sorts of devices
> > anyway. I'd suggest some sort of check if disk is an OpticalDevice, or
> > disk.format is read-only, or something along those lines followed by an
> > error message like "Cannot install to read-only media".
> >
>
> Thanks for catching this, the current patch will allow sr0 with a media
> in it to be used in 'part'. I don't think that device.format is of much
> help here --- if no media is present I think the format will be just
> 'DeviceFormat' which is perfectly OK for partitioning (same as empty
> device). I suggest testing the device for both .isDisk and
> .mediaPresent, just like storage.disks() (used by clearpart gui for
> instance) does.

If the ks commands are trying to create/access partitions on these
devices you probably want to check device.partitionable and perhaps also
device.partitioned, depending on the timing/sequencing.

Dave

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


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-22-2011, 12:05 PM
Ales Kozumplik
 
Default 'part' command checks if media is present.

If the ks commands are trying to create/access partitions on these
devices you probably want to check device.partitionable and perhaps also
device.partitioned, depending on the timing/sequencing.

Dave



Device.partitionable was what I was looking for, thanks.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-22-2011, 12:05 PM
Ales Kozumplik
 
Default 'part' command checks if media is present.

If the ks commands are trying to create/access partitions on these
devices you probably want to check device.partitionable and perhaps also
device.partitioned, depending on the timing/sequencing.

Dave



Device.partitionable was what I was looking for, thanks.

Ales

_______________________________________________
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 12:02 AM.

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