[webmin-devel] [RFC] patches for fdisk modules

Jean-Christophe Dubois <[email protected]>
Newsgroups gmane.comp.web.webmin.devel
Message-ID <[email protected]>
Hi,

I proposed this patch on the forum but there was not much attention there. So 
maybe this list is more appropriate.

In my system I have a bunch of SATA disks that are handled as SCSI devices by 
the Linux kernel. As a consequence, in the fdisk module these disks don't get 
the "IDE parameter" or "SMART" links.

The patch below allows these links to be enabled for these disks. I guess 
the "IDE parameter" link is more questionable as not all IDE options are 
available on SATA. However this is working well enough for me.

I may have missed some implication with RAID devices and such but I don't have 
any to test with.

Comments are welcome.

JC

--- fdisk/index.cgi.org	2007-10-10 12:16:50.000000000 +0200
+++ fdisk/index.cgi	2007-10-10 12:21:57.000000000 +0200
@@ -44,12 +44,12 @@
 
 	# Show links to other modules
 	@links = ( );
-	if ($d->{'type'} eq 'ide' && $ed) {
+	if ($ed && ($d->{'type'} eq 'ide' || ($d->{'type'} eq 'scsi' && 
$d->{'model'} =~ /ATA /))) {
 		# Display link to IDE params form
 		push(@links, "<a href='edit_hdparm.cgi?".
 			     "disk=$d->{'index'}'>$text{'index_hdparm'}</a>");
 		}
-	if ($smart && $d->{'type'} eq 'ide') {
+	if ($smart) {
 		# Display link to smart module
 		push(@links, "<a href='../smart-status/index.cgi?".
 			     "drive=$d->{'device'}'>$text{'index_smart'}</a>");



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
-
Forwarded by the Webmin development list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.