Re: [PATCH] Add support for kickstart's '--initlabel' option to clearpart.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 13, 2009 at 08:52:01AM +0100, Hans de Goede wrote:
> Almost there, see below for my comment.
>
> David Lehman wrote:
>
> <snip, all good so far>
>
>> @@ -1152,18 +1170,38 @@ class DeviceTree(object):
>>                          rs.activate(mknod=True)
>>                           # Create the DMRaidArray
>> +                        if self.zeroMbr:
>> +                            cb = lambda: True
>> +                        else:
>> +                            cb = lambda: questionInitializeDisk(self.intf,
>> +                                                                rs.name)
>> +
>> +                        if not self.clearPartDisks or \
>> +                           rs.name in self.clearPartDisks:
>> +                            # we'll need the array's sysfs path below
>> +                            dm_node = dm.dm_node_from_name(rs.name)
>> +                            _sysfs_path = "/class/block/%s" % dm_node
>> +
>> +                            # if the disk contains protected partitions
>> +                            # we will not wipe the disklabel even if
>> +                            # clearpart --initlabel was specified
>> +                            initlabel = self.reinitializeDisks
>> +                            for protected in self.protectedPartitions:
>> +                                _p = "/sys/%s/%s" % (_sysfs_path, protected)
>> +                                if os.path.exists(os.path.normpath(_p)):
>> +                                    initlabel = False
>> +                                    break
>
> This won't work with dm(raid) partitions as their block sysfs entries are not a subdir
> of the containing "disk", they are a (partial) linear device mapping of their containing
> disk, so they themselves have a sysfs path of /sys/class/block/dm-# too, just like
> their containing disk (but with a higher #)
>
> All I can come up with here, is that you check if the protectedPartition name ends with p#,
> and if so strip p#, and then see if what remains matches the name of the dmraid array.
>
> See udev.py: udev_device_get_dmraid_partition_disk(), but that needs udev info for
> the partition which you do not have, although we could change its argument, as all it really
> needs is the name.

I wonder if its worth it to start handling sysfs paths in
storage/devicelibs/dm.py or pyblock itself.  I'd vote for dm.py.

regards
>
> Regards,
>
> Hans
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux