rpms/eject/F-8 eject-2.1.5-umount.patch, 1.2, 1.3 eject.spec, 1.32, 1.33
Zdenek Prikryl (zprikryl)
fedora-extras-commits at redhat.com
Wed Apr 2 08:54:03 UTC 2008
- Previous message (by thread): rpms/buildbot/F-7 buildbot-no-shebang.patch, 1.1, 1.2 buildbot.spec, 1.5, 1.6
- Next message (by thread): rpms/kernel-xen-2.6/devel linux-2.6-merge-efifb-imacfb.patch, NONE, 1.1 patch-2.6.25-rc8.bz2.sign, NONE, 1.1 .cvsignore, 1.13, 1.14 .gitignore, 1.3, 1.4 Makefile, 1.9, 1.10 Makefile.config, 1.9, 1.10 config-generic, 1.4, 1.5 config-x86-generic, 1.3, 1.4 config-x86_64-generic, 1.4, 1.5 kernel.spec, 1.26, 1.27 linux-2.6-wireless-pending.patch, 1.3, 1.4 linux-2.6-wireless.patch, 1.4, 1.5 linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch, 1.2, 1.3 linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch, 1.2, 1.3 linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch, 1.2, 1.3 linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch, 1.1, 1.2 linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch, 1.3, 1.4 linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch, 1.4, 1.5 linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch, 1.4, 1.5 linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch, 1.4, 1.5 linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch, 1.3, 1.4 linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch, 1.3, 1.4 linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch, 1.3, 1.4 linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch, 1.3, 1.4 linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch, 1.3, 1.4 linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch, 1.3, 1.4 linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch, 1.3, 1.4 linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch, 1.3, 1.4 linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, 1.4, 1.5 linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, 1.1, 1.2 linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch, 1.3, 1.4 sources, 1.13, 1.14 upstream, 1.3, 1.4 patch-2.6.25-rc7-git6.bz2.sign, 1.1, NONE patch-2.6.25-rc7.bz2.sign, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: zprikryl
Update of /cvs/extras/rpms/eject/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10910
Modified Files:
eject-2.1.5-umount.patch eject.spec
Log Message:
Added check if device is hotpluggable (#438610)
Added support for symlinks in /sys/block (#439406)
eject-2.1.5-umount.patch:
Index: eject-2.1.5-umount.patch
===================================================================
RCS file: /cvs/extras/rpms/eject/F-8/eject-2.1.5-umount.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- eject-2.1.5-umount.patch 17 Mar 2008 15:39:31 -0000 1.2
+++ eject-2.1.5-umount.patch 2 Apr 2008 08:53:51 -0000 1.3
@@ -1,5 +1,5 @@
---- eject/eject.c.umount 2008-03-17 10:56:51.000000000 +0100
-+++ eject/eject.c 2008-03-17 13:19:12.000000000 +0100
+--- eject/eject.c.umount 2008-03-27 09:40:44.000000000 +0100
++++ eject/eject.c 2008-04-02 09:37:37.000000000 +0200
@@ -42,6 +42,7 @@
#include <string.h>
#include <fcntl.h>
@@ -8,7 +8,7 @@
#ifdef GETOPTLONG
#include <getopt.h>
-@@ -1127,6 +1128,71 @@ static char *MultiplePartitions(const ch
+@@ -1127,6 +1128,145 @@ static char *MultiplePartitions(const ch
return 0;
}
@@ -20,17 +20,17 @@
+{
+ DIR *dir = opendir("/sys/block");
+ struct dirent *d;
-+ char *baseName = strrchr(deviceName, '/');
++ const char *baseName = strrchr(deviceName, '/');
+ char *device;
+ int len;
+
+ baseName = baseName ? baseName + 1 : deviceName;
+ if (!dir) {
-+ perror("/sys/block");
++ fprintf(stderr, _("%s: can not open directory /sys/block/"), programName);
+ return NULL;
+ }
+ while ((d = readdir(dir)) != NULL) {
-+ if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
++ if (d->d_type != DT_DIR && d->d_type != DT_LNK && d->d_type != DT_UNKNOWN)
+ continue;
+ len = strlen(d->d_name);
+ if (!strncmp(baseName, d->d_name, len)) {
@@ -48,6 +48,32 @@
+}
+
+/*
++ * From given path gets a subsystem. Returns subsystem if any found
++ * otherwise returns NULL. Returned value must not be free()'d
++ */
++static char *GetSubSystem(const char *sysfspath)
++{
++ static char subsystem[PATH_MAX];
++ char link_subsystem[PATH_MAX];
++ struct stat buf;
++ char *pos;
++
++ snprintf(link_subsystem, sizeof(link_subsystem), "%s/subsystem", sysfspath);
++
++ if (lstat(link_subsystem, &buf) == -1)
++ return NULL;
++ if (!S_ISLNK(buf.st_mode))
++ return NULL;
++ if (readlink(link_subsystem, subsystem, sizeof(subsystem)) == -1)
++ return NULL;
++ if ((pos = strrchr(subsystem, '/')) == NULL)
++ return NULL;
++ strncpy(subsystem, pos+1, sizeof(subsystem));
++
++ return subsystem;
++}
++
++/*
+ * Check content of /sys/block/<dev>/removable. Returns 1 if the file
+ * contains '1' otherwise returns 0.
+ */
@@ -66,30 +92,80 @@
+ }
+ snprintf(path, sizeof(path), "/sys/block/%s/removable", device);
+ free(device);
-+ if((fp = fopen(path, "r")) == NULL) {
-+ perror(path);
-+ exit(1);
-+ }
-+
++ if((fp = fopen(path, "r")) == NULL)
++ return removable;
+ if (fgetc(fp) == '1')
+ removable = 1;
+
+ fclose(fp);
+ return removable;
+}
++
++/* Check if a device is on hotpluggable subsystem. Returns 1 if is
++ * otherwise returns 0.
++ */
++static int CheckHotpluggable(const char* deviceName)
++{
++ int hotpluggable = 0;
++ char *device;
++ char path[PATH_MAX];
++ char *device_chain;
++ struct stat buf;
++ char *subsystem;
++ char *pos;
++
++ if ((device = FindDeviceSysBlock(deviceName)) == NULL) {
++ fprintf(stderr, _("%s: did not find a device %s in /sys/block/\n"),
++ programName, deviceName);
++ exit(1);
++ }
++ snprintf(path, sizeof(path), "/sys/block/%s/device", device);
++ free(device);
++
++ if (lstat(path, &buf) == -1)
++ return hotpluggable;
++ if (!S_ISLNK(buf.st_mode))
++ return hotpluggable;
++ if ((device_chain = SymLink(path)) == NULL)
++ return hotpluggable;
++ while ( strncmp(device_chain, "", sizeof(device_chain) != 0)) {
++ subsystem = GetSubSystem(device_chain);
++ if (subsystem) {
++ /* as hotpluggable we assume devices on these buses */
++ if (strncmp("usb", subsystem, sizeof("usb")) == 0 ||
++ strncmp("ieee1394", subsystem, sizeof("ieee1394")) == 0 ||
++ strncmp("pcmcia", subsystem, sizeof("pcmcia")) == 0 ||
++ strncmp("mmc", subsystem, sizeof("mmc")) == 0 ||
++ strncmp("ccw", subsystem, sizeof("ccw")) == 0) {
++ hotpluggable = 1;
++ break;
++ }
++ }
++ /* remove one member from devicechain */
++ pos = strrchr(device_chain, '/');
++ if (pos)
++ pos[0] = '\0';
++ else
++ device_chain[0] = '\0';
++ }
++
++ return hotpluggable;
++}
/* handle -x option */
static void HandleXOption(char *deviceName)
-@@ -1270,6 +1336,15 @@ int main(int argc, char **argv)
+@@ -1270,6 +1410,17 @@ int main(int argc, char **argv)
exit(0);
}
+ /* Check if device has removable flag*/
+ if (v_option)
-+ printf(_("%s: checking if device \"%s\" has a removable flag\n"), programName, deviceName);
-+ if (!CheckRemovable(deviceName))
++ printf(_("%s: checking if device \"%s\" has a removable or hotpluggable flag\n"),
++ programName, deviceName);
++ if (!CheckRemovable(deviceName) && !CheckHotpluggable(deviceName))
+ {
-+ fprintf(stderr, _("%s: device \"%s\" doesn't have a removable flag\n"), programName, deviceName);
++ fprintf(stderr, _("%s: device \"%s\" doesn't have a removable or hotpluggable flag\n"),
++ programName, deviceName);
+ exit(1);
+ }
+
Index: eject.spec
===================================================================
RCS file: /cvs/extras/rpms/eject/F-8/eject.spec,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- eject.spec 17 Mar 2008 15:39:31 -0000 1.32
+++ eject.spec 2 Apr 2008 08:53:51 -0000 1.33
@@ -1,7 +1,7 @@
Summary: A program that ejects removable media using software control.
Name: eject
Version: 2.1.5
-Release: 7%{dist}
+Release: 8%{dist}
License: GPL
Group: System Environment/Base
Source: http://metalab.unc.edu/pub/Linux/utils/disk-management/%{name}-%{version}.tar.gz
@@ -74,6 +74,10 @@
%{_mandir}/man1/*
%changelog
+* Wed Apr 02 2008 Zdenek Prikryl <zprikryl at redhat.com> 2.1.5-8
+- Added check if device is hotpluggable (#438610)
+- Added support for symlinks in /sys/block (#439406)
+
* Mon Mar 17 2008 Zdenek Prikryl <zprikryl at redhat.com> 2.1.5-7
- Rewriten patch for removable flag
- Resolves #437362
- Previous message (by thread): rpms/buildbot/F-7 buildbot-no-shebang.patch, 1.1, 1.2 buildbot.spec, 1.5, 1.6
- Next message (by thread): rpms/kernel-xen-2.6/devel linux-2.6-merge-efifb-imacfb.patch, NONE, 1.1 patch-2.6.25-rc8.bz2.sign, NONE, 1.1 .cvsignore, 1.13, 1.14 .gitignore, 1.3, 1.4 Makefile, 1.9, 1.10 Makefile.config, 1.9, 1.10 config-generic, 1.4, 1.5 config-x86-generic, 1.3, 1.4 config-x86_64-generic, 1.4, 1.5 kernel.spec, 1.26, 1.27 linux-2.6-wireless-pending.patch, 1.3, 1.4 linux-2.6-wireless.patch, 1.4, 1.5 linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch, 1.2, 1.3 linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch, 1.2, 1.3 linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch, 1.2, 1.3 linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch, 1.1, 1.2 linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch, 1.3, 1.4 linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch, 1.4, 1.5 linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch, 1.4, 1.5 linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch, 1.4, 1.5 linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch, 1.3, 1.4 linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch, 1.3, 1.4 linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch, 1.3, 1.4 linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch, 1.3, 1.4 linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch, 1.3, 1.4 linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch, 1.3, 1.4 linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch, 1.3, 1.4 linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch, 1.3, 1.4 linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, 1.4, 1.5 linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, 1.1, 1.2 linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch, 1.3, 1.4 sources, 1.13, 1.14 upstream, 1.3, 1.4 patch-2.6.25-rc7-git6.bz2.sign, 1.1, NONE patch-2.6.25-rc7.bz2.sign, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list