Re: PATCH: Fix disable dmraid on text and graphical mode

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

 



Peter Jones wrote:
> On Tue, 2007-05-08 at 13:01 +0900, HARA Hiroshi wrote:
>
>   
>> Thank you for your comment.
>> I see.
>> so this disable button(function) is for disabling one specific dmraid
>> (not all dmraid)
>> (The user select one of dmraid device and push disable button,
>> after that only selected dmraid will be breaking apart but not selected
>> dmraid will not be breking apart)
>> I'll reconsider this patch.
>>     
>
> Even more specifically, the right thing to disable is probably that
> particular set of dmraid metadata.
>
>   
I feel so, too.
after "confirminstall" step(start of "install" step) breaking apart device
should be removed dmraid metadata.
and also I made test patch for gui mode.
(if this way is good, I'll make text mode patch)
after applying this patch, I can do the following

>(The user select one of dmraid device and push disable button,
>after that only selected dmraid will be breaking apart but not selected
>dmraid will not be breking apart)


self.anaconda.id.diskset.skippeddmDisks list have breaking
apart devices.
so in my current image, after "confirminstall" step(start of "install"
step),
anaconda do "dmraid -E -r" on each self.anaconda.id.diskset.skippeddmDisks.

but It seems that dmraid command cannot work well or way to use
dmraid is not wrong.(I do not know dmraid so well)
following is my work log on RHEL5 (dmraid -E -r was failed)
------------------------------------------------
# dmraid -r /dev/sda
/dev/sda: ddf1, ".ddf1_disks", GROUP, ok, 976496964 sectors, data@ 0

# dmraid -E -r /dev/sda
Do you really want to erase "ddf1" ondisk metadata on /dev/sda ? [y/n] :y
ERROR: ddf1: seeking device "/dev/sda" to 256000262930432
ERROR: writing metadata to /dev/sda, offset 500000513536 sectors, size 0
bytes returned 0
ERROR: erasing ondisk metadata on /dev/sda

# dmraid -r /dev/sda
/dev/sda: ddf1, ".ddf1_disks", GROUP, ok, 976496964 sectors, data@ 0
--------------------------------------------------

Do you have any ideas and dmraid command informations ?

thank you very much

diff -uNrp anaconda/iw/autopart_type.py anaconda.new/iw/autopart_type.py
--- anaconda/iw/autopart_type.py	2007-05-07 16:07:03.000000000 +0900
+++ anaconda.new/iw/autopart_type.py	2007-05-11 19:14:57.000000000 +0900
@@ -223,6 +223,17 @@ class PartitionTypeWindow(InstallWindow)
         import iscsi
         if not iscsi.has_iscsi():
             dxml.get_widget("iscsiRadio").set_sensitive(False)
+
+        selection = self.drivelist.get_selection()
+        (model, iter) = selection.get_selected()
+        if iter:
+            dev = model.get_value(iter, 1)
+            if dev.startswith("mapper/"):
+                dxml.get_widget("radiobutton1").set_sensitive(True)
+        elif len(self.diskset.driveList()) == 1 and \
+                 self.diskset.driveList()[0].startswith("mapper/"):
+            dev = self.diskset.driveList()[0]
+            dxml.get_widget("radiobutton1").set_sensitive(True)
         
         rc = dialog.run()
         dialog.hide()
@@ -232,6 +243,13 @@ class PartitionTypeWindow(InstallWindow)
             rc = self.addIscsiDrive()
         elif dxml.get_widget("zfcpRadio").get_active():
             rc = self.addZfcpDrive()
+        elif dxml.get_widget("radiobutton1").get_active():
+            for dmraidset in self.diskset.dmList:
+                if dmraidset.name == dev.split("/")[1]:
+                    break
+            for _dev in dmraidset.member_devpaths:
+                self.diskset.skippeddmDisks.append(_dev)
+            self.anaconda.dir = 1
         dialog.destroy()
 
         if rc != gtk.RESPONSE_CANCEL:
diff -uNrp anaconda/partedUtils.py anaconda.new/partedUtils.py
--- anaconda/partedUtils.py	2007-05-07 16:07:03.000000000 +0900
+++ anaconda.new/partedUtils.py	2007-05-11 19:20:00.000000000 +0900
@@ -568,6 +568,7 @@ class DiskSet:
     """The disks in the system."""
 
     skippedDisks = []
+    skippeddmDisks = []
     mdList = []
     dmList = None
     mpList = None
@@ -623,11 +624,17 @@ class DiskSet:
         log.debug("starting dmraids")
         log.debug("self.driveList(): %s" % (self.driveList(),))
         log.debug("DiskSet.skippedDisks: %s" % (DiskSet.skippedDisks,))
+        log.debug("DiskSet.skippeddmDisks: %s" % (DiskSet.skippeddmDisks,))
         driveList = filter(lambda x: x not in DiskSet.skippedDisks,
                 self.driveList())
+        driveList = filter(lambda x: x not in DiskSet.skippeddmDisks,
+                driveList)
         log.debug("DiskSet.skippedDisks: %s" % (DiskSet.skippedDisks,))
 
-        dmList = dmraid.startAllRaid(driveList)
+        if driveList:
+            dmList = dmraid.startAllRaid(driveList)
+        else:
+            dmList = []
         DiskSet.dmList = dmList
         log.debug("done starting dmraids.  Drivelist: %s" % \
             (self.driveList(),))

[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