[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: kwikdisk and udev-created symlinks
From: Kevin Gilbert <kev.gilbert () cdu ! edu ! au>
Date: 2006-07-03 4:35:36
Message-ID: 200607031353.48764.kev.gilbert () cdu ! edu ! au
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/alternative)]
Hi,
The is an annoying "feature" in kwikdisk. If you use udev to create a symlink to a \
device and the path name of the symlink is longer than that of the raw device path, \
kwikdisk replaces any configured mount command with the default command.
What I propose is that the "length" be redefined as the number of slashes in the path \
names. The following patch achieves that and retains the configured udev-created \
symlink.
--- kdf/disklist.cpp.orig 2006-01-20 02:19:24.000000000 +0930
+++ kdf/disklist.cpp 2006-07-03 13:44:14.000000000 +0930
@@ -470,7 +470,9 @@
// Same device name, but maybe one is a symlink and the other is its target
// Keep the shorter one then, /dev/hda1 looks better than \
/dev/ide/host0/bus0/target0/lun0/part1
- if ( disk->deviceName().length() > olddisk->deviceName().length() )
+ // but redefine "shorter" to be the number of slashes in the path as a count \
on characters + // breaks legitimate symlinks created by udev
+ if ( disk->deviceName().contains( '/' ) > olddisk->deviceName().contains( '/' \
) ) disk->setDeviceName(olddisk->deviceName());
//FStab after an older DF ... needed for critFull
Cheers,
Kevin
[Attachment #7 (text/html)]
<html><head><meta name="qrichtext" content="1" /></head><body \
style="font-size:12pt;font-family:Nimbus Sans L"> <p><span \
style="color:#000000">Hi,</span></p> <p></p>
<p><span style="color:#000000">The is an annoying "feature" in kwikdisk. If \
you use udev to create a symlink to a device and the path name of the symlink is \
longer than that of the raw device path, kwikdisk replaces any configured mount \
command with the default command.</span></p> <p></p>
<p><span style="color:#000000">What I propose is that the "length" be \
redefined as the number of slashes in the path names. The following patch achieves \
that and retains the configured udev-created symlink.</span></p> <p></p>
<p><span style="font-family:Nimbus Mono L;color:#000000">--- kdf/disklist.cpp.orig \
2006-01-20 02:19:24.000000000 +0930</span></p> <p><span style="font-family:Nimbus \
Mono L;color:#000000">+++ kdf/disklist.cpp 2006-07-03 13:44:14.000000000 \
+0930</span></p> <p><span style="font-family:Nimbus Mono L;color:#000000">@@ -470,7 \
+470,9 @@</span></p> <p></p>
<p><span style="font-family:Nimbus Mono L;color:#000000"> // Same device name, \
but maybe one is a symlink and the other is its target</span></p> <p><span \
style="font-family:Nimbus Mono L;color:#000000"> // Keep the shorter one then, \
/dev/hda1 looks better than /dev/ide/host0/bus0/target0/lun0/part1</span></p> \
<p><span style="font-family:Nimbus Mono L;color:#000000">- if ( \
disk->deviceName().length() > olddisk->deviceName().length() )</span></p> \
<p><span style="font-family:Nimbus Mono L;color:#000000">+ // but redefine \
"shorter" to be the number of slashes in the path as a count on \
characters</span></p> <p><span style="font-family:Nimbus Mono L;color:#000000">+ \
// breaks legitimate symlinks created by udev</span></p> <p><span \
style="font-family:Nimbus Mono L;color:#000000">+ if ( \
disk->deviceName().contains( '/' ) > olddisk->deviceName().contains( '/' ) \
)</span></p> <p><span style="font-family:Nimbus Mono L;color:#000000"> \
disk->setDeviceName(olddisk->deviceName());</span></p> <p></p>
<p><span style="font-family:Nimbus Mono L;color:#000000"> //FStab after an \
older DF ... needed for critFull</span></p> <p></p>
<p></p>
<p><span style="color:#000000">Cheers,</span></p>
<p></p>
<p><span style="color:#000000">Kevin</span></p>
</body></html>
[Attachment #8 (application/pgp-signature)]
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic