1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00
Commit Graph

754 Commits

Author SHA1 Message Date
Kay Sievers
fc04059abf udev-acl: handle missing action when called in CK mode 2009-06-16 18:11:40 +02:00
David Zeuthen
bf05675a20 gudev: move from udev-extras
GObject libudev access. Initial version from Bastien Nocera, current
version by David Zeuthen.
2009-06-16 17:52:15 +02:00
Kay Sievers
af23b83ea7 udev-acl: move from udev-extras
The build of extras with larger external dependencies is wrapped in:
      --enable-extras
2009-06-16 17:43:12 +02:00
Kay Sievers
045a3bc89e USE_LOG -> ENABLE_LOGGING, DEBUG -> ENABLE_DEBUG, USE_SELINUX -> WITH_SELINUX 2009-06-14 17:53:15 +02:00
Kay Sievers
44b49d3736 move common stuff from udev/ to private parts of libudev/ 2009-06-09 23:05:25 +02:00
Kay Sievers
9060b066d9 move syslog wrapper to libudev 2009-06-09 22:47:48 +02:00
Kay Sievers
48a9b173e8 libudev: move to top-level directory 2009-06-08 21:36:06 +02:00
Kay Sievers
67dd1cdf9d path_id: rename scsi sub-fuctions 2009-06-08 19:22:53 +02:00
Kay Sievers
33a7615943 path_id: delete old shell script
Removed with this is SAS disk support which never really worked properly,
and legacy IDE disk support, which can be re-implemented if needed.
2009-06-08 16:51:13 +02:00
Kay Sievers
a2fe9450bb path_id: add iscsi support 2009-06-08 16:48:27 +02:00
Kay Sievers
7f011f6bf2 path_id: handle fibre channel 2009-06-08 14:56:49 +02:00
Kay Sievers
93ee84ce07 fix signed/unsigned warning 2009-06-06 21:19:56 +02:00
Kay Sievers
ffd0afe8a9 path_id: add comments 2009-06-06 20:36:46 +02:00
Kay Sievers
c122b6fadf path_id: update SCSI handling 2009-06-06 20:30:56 +02:00
Kay Sievers
185ea6a76d path_id: implement in C using libudev 2009-06-06 16:07:06 +02:00
Kay Sievers
e91ac78ffc cdrom_id: add error message if open() fails 2009-05-29 13:21:38 +02:00
Kay Sievers
d3c8231e73 cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable CDROM media
Some broken fake cdrom drives return ID_CDROM_MEDIA_STATE=blank.

  $ /lib/udev/cdrom_id -d /dev/sr1
  main: probing: '/dev/sr1'
  cd_inquiry: INQUIRY: [Nokia   ][S60             ][1.0 ]
  cd_profiles: GET CONFIGURATION: number of profiles 76
  cd_profiles: current profile 0x08
  cd_media_toc: READ TOC: len: 12
  cd_media_toc: last track 1 starts at block 0
  cd_media_info: disk type 00
  ID_CDROM=1
  ID_CDROM_MRW=1
  ID_CDROM_MRW_W=1
  ID_CDROM_MEDIA=1
  ID_CDROM_MEDIA_CD=1
  ID_CDROM_MEDIA_STATE=blank

Others work fine, but ID_CDROM_MEDIA_STATE is not needed for non-writable CDROM media:

  $ /lib/udev/cdrom_id -d /dev/sr1
  main: probing: '/dev/sr1'
  cd_inquiry: INQUIRY: [SanDisk ][U3 Cruzer Micro ][8.02]
  cd_profiles: GET CONFIGURATION: number of profiles 72
  cd_profiles: current profile 0x08
  cd_media_toc: READ TOC: len: 20
  cd_media_toc: track=1 info=0x4(data) start_block=0
  cd_media_toc: last track 1 starts at block 0
  cd_media_info: disk type 00
  ID_CDROM=1
  ID_CDROM_MRW=1
  ID_CDROM_MRW_W=1
  ID_CDROM_MEDIA=1
  ID_CDROM_MEDIA_CD=1
  ID_CDROM_MEDIA_STATE=complete
  ID_CDROM_MEDIA_SESSION_COUNT=1
  ID_CDROM_MEDIA_TRACK_COUNT=1
  ID_CDROM_MEDIA_TRACK_COUNT_DATA=1
2009-05-26 00:50:45 +02:00
Kay Sievers
eba87f55f6 edd_id: use openat() 2009-05-20 18:10:26 +02:00
Kay Sievers
065db05221 use more efficient string copying 2009-05-20 17:57:52 +02:00
Kay Sievers
b4fa1b67f8 rule-generator: cd - skip by-path links if we create by-id links 2009-05-14 12:57:19 +02:00
Kay Sievers
3de63a356f delete libvolume_id 2009-05-12 13:28:01 +02:00
Kay Sievers
f07996885d delete vol_id and require util-linux-ng's blkid 2009-05-11 04:12:23 +02:00
Lubomir Rintel
9379b7c16d rule-generator: net - whitelist NICs that violate MAC local scheme
According to list of assigned ethernet codes [1] referred to by
IANA [2] certain global addresses do not follow the assignement
scheme and use numbers reserved for local use. Several such adapters
are quite widely used, generate rules for them.

[1] http://www.cavebear.com/archive/cavebear/Ethernet/vendor.html
[2] http://www.iana.org/assignments/ethernet-numbers
2009-05-03 15:37:30 +02:00
Kay Sievers
1f698065bc rule_generator: net - fix usb comment generation
On Sat, Apr 4, 2009 at 22:17, Omair Eshkenazi <stimpson@phys.huji.ac.il> wrote:
> I noticed that in (70-)persistent-net.rules, the comments for USB devices
> are missing the device/vendor id's. Example:
> # USB device 0x:0x (rt73usb)
2009-04-26 20:53:30 +02:00
Kay Sievers
d6f0b22d57 cdrom_id: skip media tests if CDROM_DRIVE_STATUS != CDS_DISC_OK 2009-04-23 15:04:16 +02:00
John Wright
a947e5eaae edd_id: add cciss devices
Since cciss devices can be BIOS boot devices just as well as sd* and
hd*, the edd_id program should be run on them so that the later
/dev/disk/by-id/edd-* rules will work.
2009-04-22 14:53:35 +02:00
Kay Sievers
f907449eee cdrom_id: add and use ID_CDROM_MEDIA to decide if we run vol_id
Some broken mobile phones offer a faked cdrom drive with a media
without any tracks.
2009-04-21 03:27:14 +02:00
Kay Sievers
55d8f5e208 cdrom_id: add Xen cdrom support 2009-04-17 00:29:56 +02:00
Ian Campbell
09b2999210 path_id: support identification of Xen virtual block devices 2009-04-16 22:46:18 +02:00
Kay Sievers
241e5a21f9 usb_id: remove unused variable 2009-03-28 20:57:01 +01:00
Kay Sievers
9ae847f420 usb_id: add ID_VENDOR_ID, ID_MODEL_ID, ID_USB_INTERFACE_NUM, ID_USB_DRIVER
$ extras/usb_id/usb_id -x /class/tty/ttyUSB1
ID_VENDOR=HUAWEI_Technology
ID_VENDOR_ENC=HUAWEI\x20Technology
ID_VENDOR_ID=12d1
ID_MODEL=HUAWEI_Mobile
ID_MODEL_ENC=HUAWEI\x20Mobile
ID_MODEL_ID=1003
ID_REVISION=0000
ID_SERIAL=HUAWEI_Technology_HUAWEI_Mobile
ID_TYPE=generic
ID_BUS=usb
ID_USB_INTERFACES=:ffffff:080650:
ID_USB_INTERFACE_NUM=01
ID_USB_DRIVER=option
2009-03-25 21:24:21 +01:00
Adam Buchbinder
977f6f4b3d vol_id: fix language in manpage
The documentation for the --offset option wasn't in complete
sentences.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
2009-03-16 23:11:02 +01:00
Adam Buchbinder
9a2773c4a4 create_floppy_devices: expand manpage
Include a table of what the CMOS types are, and note that nothing
will be created unless the -t option is specified. Also clean up
the formatting and bump the date.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
2009-03-16 23:10:15 +01:00
Adam Buchbinder
57a9e68eb7 cdrom_id: update manpage
Include usage information on the -d/--debug flag. Also bump the date.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
2009-03-16 23:09:52 +01:00
Adam Buchbinder
57df0207aa usb_id: add manpage
Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
2009-03-16 23:09:32 +01:00
Kay Sievers
1597517c9e volume_id: ntfs - fix uuid setting
In my scenario, the ntfs prober did *not* detect the presence of a
ntfs filesystem (i.e. vol_id --probe-all returned *only* ext3).
However, if you examine the source of the ntfs prober, it overwrites
the uuid field of the volume_id object long before it actually
decides there's a valid filesystem there - this resulted in vol_id
returning the rather bizarre combination of type=ext3, but a uuid
populated by the ntfs prober.

https://bugs.edge.launchpad.net/ubuntu/+source/udev/+bug/337015
2009-03-03 20:11:09 +01:00
Kay Sievers
5afd777ebb usb_id: fix comment 2009-02-26 22:10:40 +01:00
Kay Sievers
468641f87f usb_id: fix NULL string usage 2009-02-26 20:57:48 +01:00
Kay Sievers
f95f1deea1 usb_id: return values if called directly for an usb_device 2009-02-26 17:58:22 +01:00
Kay Sievers
7e827bcde8 usb_id: add ID_USB_INTERFACES=:0e0100:0e0200:010100:010200: 2009-02-26 17:05:58 +01:00
David Zeuthen
ad88f9409a *_id: add model/vendor enc strings
So ID_MODEL and ID_VENDOR are pretty useful keys. However since we fix
them up (removing leading/trailing whitespace, converts spaces to
underscores) for use in device naming etc. we also force these fixups on
the desktop shell. And this looks pretty ugly.

The attached patch introduces the ID_MODEL_ENC and ID_VENDOR_ENC keys
that contains the encoded version of the raw strings obtained. It's
pretty similar in spirit to ID_FS_LABEL and its cousin ID_FS_LABEL_ENC.

With this patch a desktop shell can fix up these strings as it sees fit.
Note that some fixup is still needed though, for example

# /lib/udev/ata_id --export /dev/sda |grep ID_MODEL
ID_MODEL=INTEL_SSDSA2MH080G1GC
ID_MODEL_ENC=INTEL\x20SSDSA2MH080G1GC\x20\x20\x20\x20\x20\x20\x20\x20
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20

Note the trailing and leading whitespace. Anyway with the attached patch
the desktop shell should be able to display "INTEL SSDSA2MH080G1GC"
rather than "INTEL_SSDSA2MH080G1GC" to the user.
2009-02-17 21:45:43 +01:00
Karel Zak
7e5861ff70 vol_id: add missing id->type to swap0
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-24 15:21:15 +01:00
Karel Zak
3e2084614b vol_id: fix ddf version string
The version string in DDF suberblock does not include the null terminator
and the snprintf() function writes at most "size" bytes *including* the
null byte.

old version:
	ID_FS_VERSION=02.00.0
new version:
	ID_FS_VERSION=02.00.00

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-24 15:20:37 +01:00
Kay Sievers
e339233993 usb_id: handle ATAPI devices like SCSI devices
Some weird mass storage devices identify the disks as ATAPI/cdrom
devices, and all disks in such enclusure get the same ids which
overwrite each other, in such cases, get the typ of device from the
scsi device, which has more knowledge what kind of device it really
is.
2009-01-22 19:23:33 +01:00
Sven Jost
64b333fdcc volume_id: support via raid version 2 2009-01-15 19:09:12 +01:00
Adam Buchbinder
fdcd1f4666 extras: fix mis-spelling of "environment" 2009-01-06 19:43:01 +01:00
Kay Sievers
9bd66b9dbf usb_id: s/image/media/ 2009-01-05 03:44:28 +01:00
Kay Sievers
4fad506ed8 usb_id: use devtype lookup 2009-01-03 15:26:34 +01:00
Marcel Holtmann
61ee8cc92d libudev: device - remove udev_device_get_parent_with_subsystem 2009-01-03 15:12:28 +01:00
Kay Sievers
e6fa87a11f usb_id: add "image" class 2008-12-29 05:54:44 +01:00
Harald Hoyer
de2dc210e5 rule_generator: fix enumeration for write_cd_rules
quote +, as it would be taken as a part of the regexp otherwise
https://bugzilla.redhat.com/show_bug.cgi?id=477535
2008-12-22 15:05:11 +01:00
Kay Sievers
a31f59b570 rules: first simple step merging with Ubuntu rules 2008-12-19 16:49:56 +01:00
Jeremy Higdon
6a481373b4 path_id: rework SAS persistent names 2008-12-18 13:42:28 +01:00
Kay Sievers
14e1827888 volume_id: support sub-uuid's and plug in btrfs device uuid 2008-12-09 18:14:23 +01:00
Kay Sievers
c9809be568 volume_id: btrfs - update format 2008-12-09 15:33:23 +01:00
Kay Sievers
5d89ef7bf9 make: do not delete autotools generated file with distclean
[...] running the command
`make maintainer-clean' should not delete `configure' even if
`configure' can be remade using a rule in the Makefile.  More
generally, `make maintainer-clean' should not delete anything that
needs to exist in order to run `configure' and then begin to build
the program.  This is the only exception; `maintainer-clean' should
delete everything else that can be rebuilt.
2008-12-06 04:03:08 +01:00
Kay Sievers
bc4c751802 rules: add persistent /dev/serial/{by-id,by-path} rules
$ tree /dev/serial/
 /dev/serial/
 |-- by-id
 |   |-- usb-067b_2303-if00-port0 -> ../../ttyUSB0
 |   |-- usb-FTDI_FT232R_USB_UART_A7005uBP-if00-port0 -> ../../ttyUSB3
 |   |-- usb-HUAWEI_Technology_HUAWEI_Mobile-if00-port0 -> ../../ttyUSB1
 |   `-- usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0 -> ../../ttyUSB2
 `-- by-path
     |-- pci-0000:00:1d.0-usb-0:1:1.0-port0 -> ../../ttyUSB3
     |-- pci-0000:00:1d.7-usb-0:2.2.2:1.0-port0 -> ../../ttyUSB0
     |-- pci-0000:00:1d.7-usb-0:2.3:1.0-port0 -> ../../ttyUSB1
     `-- pci-0000:00:1d.7-usb-0:2.3:1.1-port0 -> ../../ttyUSB2

 $ tree /dev/serial/
 /dev/serial/
 |-- by-id
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port0 -> ../../ttyUSB0
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port1 -> ../../ttyUSB1
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port2 -> ../../ttyUSB2
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port3 -> ../../ttyUSB3
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port0 -> ../../ttyUSB8
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port1 -> ../../ttyUSB9
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port2 -> ../../ttyUSB10
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port3 -> ../../ttyUSB11
 |   `-- usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 -> ../../ttyUSB7
 `-- by-path
     |-- pci-0000:00:1d.2-usb-0:1.3:1.0-port0 -> ../../ttyUSB7
     |-- pci-0000:00:1d.7-usb-0:6.1.4.1:1.0-port0 -> ../../ttyUSB4
     |-- pci-0000:00:1d.7-usb-0:6.1.4.1:1.0-port1 -> ../../ttyUSB5
     |-- pci-0000:00:1d.7-usb-0:6.1.4.1:1.0-port2 -> ../../ttyUSB6
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port0 -> ../../ttyUSB0
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port1 -> ../../ttyUSB1
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port2 -> ../../ttyUSB2
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port3 -> ../../ttyUSB3
     |-- pci-0000:00:1d.7-usb-0:6.3:1.0-port0 -> ../../ttyUSB8
     |-- pci-0000:00:1d.7-usb-0:6.3:1.0-port1 -> ../../ttyUSB9
     |-- pci-0000:00:1d.7-usb-0:6.3:1.0-port2 -> ../../ttyUSB10
     `-- pci-0000:00:1d.7-usb-0:6.3:1.0-port3 -> ../../ttyUSB11
2008-12-04 01:43:33 +01:00
Karel Zak
43f7e87f54 volume_id: HPFS code clean up
* fix typo (hs vs. hbb)

 * set id->{version,usage,type} when all tests pass

 * be paranoid and don't use hs->version when "hs" source buffer was
   possibly modified by next volume_id_get_buffer() call.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-03 15:28:53 +01:00
Kay Sievers
caf4c97a2c scsi_id: do not fail if no serial is found like for optical drives 2008-12-02 19:23:38 +01:00
Kay Sievers
aba31da054 usb_id: add "break" to currently unused case labels 2008-11-26 13:38:49 +01:00
Marcel Holtmann
62a7b2d5a5 usb_id: fix switch statement for video type
Introducing the video type, creating a fall-through case where other
devices might now be declared as type video.
2008-11-26 13:31:37 +01:00
Kay Sievers
45a9e9e27b floppy: use ARRAY_SIZE() 2008-11-23 17:29:37 +01:00
Peter Breitenlohner
013332b93c floppy: fix array bounds check and minor calculation
Fix off-by-4 bug in floppy minors for fd[4-7].
Avoid segmentation fault for bad CMOS type.
Print mode in human readable, i.e., octal form.
2008-11-23 17:22:32 +01:00
Kay Sievers
6733f60178 update NEWS TODO 2008-11-22 00:34:42 +01:00
Kay Sievers
c3f0b654fc path_id: fix fibre channel handling 2008-11-21 20:48:24 +01:00
Peter Breitenlohner
4435308844 man: fix typos 2008-11-21 10:50:12 +01:00
Kay Sievers
f1ab8f912e volume_id: clear probing result before probing and do not probe a second time, if not needed
On Thu, Nov 20, 2008 at 14:17, Karel Zak <kzak@redhat.com> wrote:
>  I see the patch (volume_id_probe_filesystem()) and a few things come
>  to mind:
>
>  - shouldn't be the relevant parts (label, uuid, version, ...) of
>    the "struct volume_id" zeroized when you found a signature and
>    before you call the next probing function?
>
>  - it seems as overkill to use two for()s and probe two times for all
>    filesystems. What about to store the first result and re-use it?
>
>  - .. or at least never use the second for() when the fist for() found
>    nothing ;-)
2008-11-21 07:26:44 +01:00
Kay Sievers
7106902dce volume_id: update btrfs 2008-11-21 07:26:09 +01:00
Kay Sievers
405d283043 vol_id: if regular files are probed, use stat() for the size value 2008-11-21 05:02:02 +01:00
Kay Sievers
2b22881cae volume_id: remove unused usage types 2008-11-21 04:22:04 +01:00
Kay Sievers
1340a9e9ec scsi_id: make sure, we do not have slashes in values 2008-11-20 07:57:17 +01:00
Kay Sievers
97f37a7e78 ata_id: make sure, we do not have slashes in values 2008-11-20 07:52:33 +01:00
Kay Sievers
5317ca29e5 usb_id: replace chars in returned strings
Slashes are not funny in device names:
  |-- input
  |   |-- by-id
  |   |   `-- usb-Logitech_USB-PS
  |   |       |-- 2_Optical_Mouse-event-mouse -> ../../event2
  |   |       `-- 2_Optical_Mouse-mouse -> ../../mouse1
2008-11-20 02:44:08 +01:00
Kay Sievers
24239ded2d rules: v4l - add by-id/ links for USB devices
/dev/v4l
|-- by-id
|   |-- usb-046d_09a4_C4B15020-video-index0 -> ../../video0
|   `-- usb-05a9_a511-video-index0 -> ../../video1
`-- by-path
    |-- pci-0000:00:1d.0-usb-0:1:1.0-video-index0 -> ../../video1
    `-- pci-0000:00:1d.7-usb-0:2:1.0-video-index0 -> ../../video0
2008-11-20 02:26:13 +01:00
Kay Sievers
361b8a7423 volume_id: update btrfs magic 2008-11-18 19:14:37 +01:00
Kay Sievers
4dfe61c966 vol_id: clarify error message 2008-11-14 00:57:34 +01:00
Kay Sievers
510af2e939 volume_id: ntfs - mark as no other fs must match 2008-11-13 21:44:28 +01:00
Kay Sievers
8c7630b704 fix spelling in comment 2008-11-13 20:46:25 +01:00
Kay Sievers
387a827120 volume_id: fat - accept empty FAT32 fsinfo signature 2008-11-13 19:40:24 +01:00
Kay Sievers
779d2d851e volume_id: always check for all filesystem types and skip conflicting results
We probe for all known filesystems to find conflicting signatures. If
we find multiple matching signatures and one of the detected filesystem
types claims that it can not co-exist with any other filesystem type,
we do not return a probing result.

We can not afford to mount a volume with the wrong filesystem code and
possibly corrupt it. Linux ssytems have the problem of dozens of possible
filesystem types, and volumes with left-over signatures from former
filesystem types. Invalid signature need to be removed from the volume
to make the filesystem detection successful.

We do not want to read that many bytes from probed floppies, skip volumes
smaller than a usual floppy disk.
2008-11-13 19:34:41 +01:00
Karel Zak
3e39ff6365 volume_id: fat - move check for msdos signature (0x55 0xaa)
Make the msdos signature (0x55 0xaa) at 510 and 511 optional when
the standard FAT magic string is present.
2008-11-13 17:32:14 +01:00
Alan Jenkins
0bf41e6c24 scsi_id: we don't use DEVPATH env var anymore, update man page
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-11-13 01:37:25 +01:00
Kay Sievers
92f4313665 unify string replacement 2008-11-05 21:49:52 +01:00
Kay Sievers
b467444884 usb_id: MassStorage SubClass 6 is "scsi" not "disk" 2008-11-05 19:02:56 +01:00
Kay Sievers
0d5076dd92 volume_id: btrfs update 2008-11-05 02:22:07 +01:00
Kay Sievers
a0e17034ee firmware.sh: record missing files in /dev/.udev/firmware-missing/ 2008-11-04 18:38:06 +01:00
Kay Sievers
bf18270222 fstab_import: add "change" event match 2008-10-30 16:41:47 +01:00
Kay Sievers
11ddcbf7b4 edd_id: add "change" event match 2008-10-30 16:41:27 +01:00
Kay Sievers
1822e9b033 do not init string arrays, just clear first byte 2008-10-26 02:31:54 +01:00
Kay Sievers
f6bb9e981a fix uninitialized variable warnings 2008-10-24 09:37:37 +02:00
Kay Sievers
9bdca442ef rule_generator: fix netif NAME= value extraction regex
$ sed -n -r \
    -e 's/^#.*//' \
    -e 's/[[:space:],]NAME="(eth[0-9]*)"[[:space:]]*(,.*|\\|)$/\1/p' \
    /dev/null /etc/udev/rules.d/70-persistent-net.rules
  SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:41:e2:8d:c7", ATTR{type}=="1", KERNEL=="eth*",eth4

  $ sed -n -r \
    -e 's/^#.*//' \
    -e 's/.*[[:space:],]NAME="(eth[0-9]*)".*/\1/p' \
    /dev/null /etc/udev/rules.d/70-persistent-net.rules
  eth4
2008-10-23 15:44:34 +02:00
Kay Sievers
14f4025607 add util_resolve_subsys_kernel() 2008-10-22 18:03:38 +02:00
Matthias Koenig
fcd070d010 volume_id: swap - larger PAGE_SIZE support 2008-10-22 11:45:27 +02:00
Alan Jenkins
111e4f81ff replace strncpy() with strlcpy()
The problem was strncpy() doesn't stop after writing the terminating
NUL; by definition it goes on to zero the entire buffer.

I spy another use of strncpy in udev_device_add_property_from_string(),
which is responsible for another ~1% user cpu time...

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-10-21 23:55:13 +02:00
Alan Jenkins
b29a5e4ab9 use more appropriate alternatives to malloc()
Use calloc to request cleared memory instead.
Kernel and libc conspire to make this more efficient.

Also, replace one malloc() + strcpy() with strdup().

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-10-21 12:54:57 +02:00
Kay Sievers
e02d738ee4 cdrom_id: remove ARRAY_SIZE() declaration 2008-10-21 12:40:47 +02:00
Kay Sievers
69239210be libudev: device - get_attr_value() -> get_sysattr_value() 2008-10-20 18:12:36 +02:00
Kay Sievers
2d9a1b1ef2 pass make distcheck 2008-10-18 20:33:06 +02:00
Kay Sievers
54808d77a3 prefix udev-util.c functions with util_* 2008-10-18 20:12:55 +02:00
Kay Sievers
002a957762 collect: use udev_list 2008-10-17 19:29:02 +02:00
Kay Sievers
8460299b57 rename udev source files 2008-10-16 18:13:48 +02:00
Kay Sievers
d56f94d168 volume_id: btrfs - update magic to latest disk format 2008-10-16 17:10:47 +02:00
Kay Sievers
f183b6ed76 libudev: add global property list 2008-10-16 13:51:29 +02:00
Kay Sievers
f4700eb8a0 vol_id: update README 2008-10-13 03:34:37 +02:00
Steven Whitehouse
2f66462982 volume_id: support for GFS2 UUIDs 2008-10-13 03:23:31 +02:00
Kay Sievers
6a328058e0 volume_id: more fat debugging 2008-10-06 18:17:05 +02:00
Kay Sievers
3cbc96e3be volume_id: add more vfat debugging information 2008-10-06 12:17:47 +02:00
Kay Sievers
0565a00a4c volume_id: use PRIu64i, PRIx64 macros 2008-10-03 18:24:04 +02:00
Kay Sievers
99370c2152 volume_id: add btrfs 2008-10-03 17:23:12 +02:00
Kay Sievers
59315eeae4 volume_id: better DDF raid detection 2008-10-03 15:01:39 +02:00
Kay Sievers
ab7430c5d8 vol_id: always use the safe string versions for unencoded label and uuid 2008-10-03 14:58:02 +02:00
Kay Sievers
d4f687c013 vol_id: fix logging glue 2008-10-03 14:56:54 +02:00
Kay Sievers
3ab8ebf572 volume_id: add dbg() as noop to check for compile errors 2008-10-03 14:50:57 +02:00
Kay Sievers
7744e869ec move selinux noops to udev.h 2008-10-03 14:49:29 +02:00
Kay Sievers
22c89d3fd7 vol_id: add size= option 2008-10-03 11:42:47 +02:00
Kay Sievers
2f1a291e2f usb_id: use libudev 2008-10-02 21:20:18 +02:00
Kay Sievers
e598c5738c libudev: get rid of selinux
"Hello world!" linked against libselinux parses /proc/mounts and
whatever else on startup, even when the lib is not needed at all.
Not funny! Get rid of that thing where it's not absolutely needed.
2008-10-02 18:48:40 +02:00
Kay Sievers
033e9f8cde use no_argument, required_argument, optional_argument in longopts 2008-10-02 16:49:05 +02:00
Kay Sievers
842dacb76f volume_id: hpfs - read label and uuid 2008-10-02 15:16:11 +02:00
Kay Sievers
4dea370d49 build: include Makefile.am.inc in all Makefile.am
Many thanks to Chris Spiegel for finding the still current vol_id
non-large-file-access bug, because of not including config.h.
2008-10-01 18:02:39 +02:00
Kay Sievers
4aa0b15efb fix dbg() callers 2008-09-29 19:03:08 +02:00
Kay Sievers
d0f398bc25 gitignore: move *.8 to subdirs 2008-09-29 05:03:43 +02:00
Kay Sievers
e345e2670a libudev: rework list handling 2008-09-26 19:44:53 +02:00
Kay Sievers
38f27948cd always include config.h from Makefile 2008-09-19 23:03:49 -07:00
Alan Jenkins
a4354f9385 scsi_id: compiler warning on 32-bit
The sg_io_v4 interface passes pointers as u64s.  It turns out GCC
disapproves of us casting a u64 straight to a 32 bit pointer.

cc1: warnings being treated as errors
scsi_serial.c: In function ‘sg_err_category4’:
scsi_serial.c:159: warning: cast to pointer from integer of different size
scsi_serial.c: In function ‘scsi_dump_v4’:
scsi_serial.c:303: warning: cast to pointer from integer of different size
2008-09-19 22:14:46 -07:00
Kay Sievers
c68a293678 vol_id: fix lib logging glue 2008-09-16 00:40:47 -07:00
Kay Sievers
17fcfb5972 use size definitions from libudev 2008-09-10 21:50:21 +02:00
Kay Sievers
31c1f53745 get rid of udev_sysdeps.c 2008-09-10 18:59:42 +02:00
Kay Sievers
ecc9ec579f convert to libudev and delete udev_utils_string.c 2008-09-10 18:39:23 +02:00
Kay Sievers
7525097713 extras: use libudev code 2008-09-10 18:24:39 +02:00
Kay Sievers
3eb46ec6dd libudev: do not use any udev source file 2008-09-10 18:00:31 +02:00
Kay Sievers
b2946df419 libudev: rename libudev-utils.c libudev-util.c 2008-09-10 17:12:33 +02:00
Kay Sievers
7a01f11afb libudev: get rid of udev_utils.c 2008-09-10 17:08:24 +02:00
Kay Sievers
b21b95d722 libudev: get rid of udev_sysfs.c 2008-09-10 14:29:07 +02:00
Kay Sievers
55e9959b15 update file headers 2008-09-10 02:40:42 +02:00
Kay Sievers
ef5c2d048c volume_id: merge util.h in libvolume_id-private.h 2008-09-10 02:31:11 +02:00
Kay Sievers
4f4b12c203 libudev: add selinux 2008-09-10 00:46:17 +02:00
Kay Sievers
e5931bb7d8 udevadm: add --version --help options to man page, hide them as commands 2008-09-07 14:48:33 +02:00
Kay Sievers
f640b32fdd vol_id: add --debug option 2008-09-06 16:37:00 +02:00
Kay Sievers
7643819062 volume_id: linux_raid - fix logic for volumes with size == 0 2008-09-06 16:23:21 +02:00
Kay Sievers
7d563a17f3 use libudev code, unify logging, pass udev context around everywhere 2008-09-06 15:45:31 +02:00
Kay Sievers
c2175d2524 volume_id: fail on undefined __BYTE_ORDER 2008-09-01 16:39:34 +02:00
Kay Sievers
ac877d7cf4 volume_id: hfs - calculate proper uuid 2008-08-31 12:20:24 +02:00
Kay Sievers
2bb9f412bc firmware.sh: lookup lookup kernel provided firmware directory 2008-08-29 21:00:43 +02:00
Kay Sievers
550d5c2879 volume_id: remove left-over fd close() 2008-08-29 17:06:08 +02:00
Kay Sievers
2603474ff9 volume_id: remove deprecated functions and bump major version 2008-08-28 23:39:41 +02:00
Kay Sievers
f46a8a98a7 vol_id: make the --offset= argument optional 2008-08-22 10:04:55 +02:00
Kay Sievers
b7ec267e17 add missing includes 2008-08-12 11:18:39 +02:00
Kay Sievers
4337f8fcf1 volume_id: create relative links 2008-07-30 15:50:12 +02:00
Kay Sievers
4cf46e2c02 volume_id: move static lib to $prefix 2008-07-30 14:45:43 +02:00
Kay Sievers
01618658fd use autotools 2008-07-30 01:45:23 +02:00
Kay Sievers
726687ad48 delete all Makefiles and move udev source to udev/ 2008-07-30 00:39:15 +02:00
Thomas Koeller
aa5e29a581 use proper directory lib/lib64 for libvolume_id 2008-07-22 15:57:40 +02:00
Kay Sievers
282988c4f8 move default rules from /etc/udev/rules.d/ to /lib/udev/rules.d/
None of these rules is supposed to be changed by users, so move
them out of /etc. Custom rules, and automatically generated rules
stay in /etc. All rules are still processed in lexical order,
regardless which directory they live in.
2008-07-18 15:56:03 +02:00
Kay Sievers
05364975af scsi_id: the fallback fix broke error handling 2008-07-10 22:22:10 +02:00
Marco d'Itri
52b375bc3b scsi_id: man page fix
minus signs need to be escaped and the program is not in the $PATH anymore
2008-07-10 00:17:24 +02:00
Thomas Koeller
629e57e0d4 scsi_id: include sys/stat.h
I could not build scsi_id because of a missing #include
for sys/stat.h, so I had to add that.

Signed-off-by: Thomas Koeller <thomas@koeller.dyndns.org>
2008-07-10 00:08:32 +02:00
Marco d'Itri
03effd3bc9 rules_generator: net rules - do not print error if file is missing and ignore commented rules
Fix an error message displayed by write_net_rules when the rules file
does not exist yet. (See Debian bugs #442796 and #475699.)

Ignore commented rules, at least for the easy case.
For clarity, use extended instead of standard regular expressions.
2008-07-07 14:32:33 +02:00
Kay Sievers
24dabba541 scsi_id: fix fallback to sg v3 for sg nodes 2008-07-07 11:18:49 +02:00
Kay Sievers
dad1f0924b path_id: suppress trailing '-' like 'ID_PATH=pci-0000:05:01.0-' 2008-06-26 13:25:31 +02:00
Kay Sievers
7c389ce8a0 collect: fix size_t printf 2008-06-18 10:12:14 +02:00
Tobias Klauser
322fc7a636 collect: check realloc return value 2008-06-18 10:10:29 +02:00
Kay Sievers
9bbdf6eb3c cdrom_id: fix recognition of blank media
Thanks to David!
2008-06-12 07:20:14 +02:00
Kay Sievers
2c0644c1c2 release 123 2008-06-12 00:08:43 +02:00
Erik van Konijnenburg
0c6ecdfd9f volume_id: support for oracleasm 2008-06-11 23:54:56 +02:00
Harald Hoyer
1ecb086460 scsi_id: retry open() on -EBUSY 2008-06-11 23:26:18 +02:00
Kay Sievers
ec404619a6 cdrom_id: export ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=, ID_CDROM_MEDIA_TRACK_COUNT_DATA=
Iterate over all tracks, instead of looking only at the first
one for audio. Thanks to David!
2008-06-11 23:24:13 +02:00
Karel Zak
2f2f54c514 volume_id: enable GFS probing code, add LABEL support
* enables GFS/GFS2 probing code (it's disabled now!)

 * adds support for LABELs -- it seems that locktable name is usable as
   a LABEL (at least according to libblkid).

 * removes extra check of sb_header.mh_format -- nothing in kernel and
   blkid checks this superblock entry. It seems that check GFS_MAGIC and
   GFS_METATYPE_SB is enough.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-28 20:07:17 +02:00
Xinwei Hu
b5254b4203 collect: realloc buffer, if needed 2008-05-27 19:35:03 +02:00
Karel Zak
2aae673c96 volume_id: remove unnecessary global variable
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-27 01:41:41 +02:00
Kay Sievers
941d40a074 rules: persistent net - handle "locally administered" ibmveth MAC addresses 2008-05-26 17:11:13 +02:00
Kay Sievers
bc44071db2 edd_id: call it only for sd* and hd* 2008-05-20 08:46:29 +02:00
Kay Sievers
7031a67c95 volume_id: bump version 2008-05-17 16:19:12 +02:00
Kay Sievers
53ba69a0c2 scsi_id: add bsg.h 2008-05-16 12:52:42 +02:00
Matthias Schwarzott
4cd71da560 cdrom_id: fix segfault 2008-05-14 16:03:49 +02:00
Kay Sievers
025570aa3e scsi_id: add --sg-version= option 2008-05-14 15:02:17 +02:00
Kay Sievers
2d05764a77 scsi_id: remove bus_id option 2008-05-14 13:59:25 +02:00
Kay Sievers
138cf75e4e scsi_id: update man page 2008-05-14 13:59:11 +02:00
Hannes Reinecke
78d9ecfd4f scsi_id: add SGv4 support
Fall back to SGv3, if SGv3 returns a failure/is not available.
2008-05-14 13:55:49 +02:00
Hannes Reinecke
753417db2b scsi_id: remove all sysfs dependencies 2008-05-14 13:42:41 +02:00
MUNEDA Takahiro
838436fa32 man: scsi_id 2008-05-14 04:47:33 +02:00
Karel Zak
661a0bea80 volume_id: clean up linux_raid code
extra global and/or non-static variables suck in shared libraries
use "else if" rather than many "return" calls

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-05-13 11:29:17 +02:00
David Woodhouse
8b6e9f287d rules_generator: net rules - add "dev_id" value to generated rules 2008-04-27 20:19:44 +02:00
Kay Sievers
d8a9d01704 udevadm: control - fix --env key to accept --env=<KEY>=<value> 2008-04-22 03:19:21 +02:00
Kay Sievers
6b795c99e0 fstab_import: add program to IMPORT matching fstab entry
DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
  SUBSYSTEM=block
  ...
  ID_FS_USAGE=filesystem
  ID_FS_TYPE=ext3
  ID_FS_VERSION=1.0
  ...
  FSTAB_NAME=/dev/disk/by-id/scsi-SATA_ST910021AS_3MH0Y3KF-part6
  FSTAB_DIR=/home/kay/work
  FSTAB_TYPE=ext3
  FSTAB_OPTS=defaults
  FSTAB_FREQ=1
  FSTAB_PASSNO=1
2008-04-21 18:07:05 +02:00
Kay Sievers
953080abd9 cdrom_id: add more help text 2008-04-21 17:41:39 +02:00
Damjan Georgievski
be9c76b434 libvolume_id: recognize swap partitions with a tuxonice hibernate image 2008-04-21 12:44:25 +02:00
Kay Sievers
803ac7a6d8 scsi_id: initialize serial strings 2008-04-20 21:08:45 +02:00
Kay Sievers
c70560feef logging: add trailing newline to all strings 2008-04-20 21:07:06 +02:00
Kay Sievers
1d918b50cd path_id: remove subsystem whitelist 2008-04-18 21:08:07 +02:00
Kay Sievers
e6d70ed63a rules_generator: net rules - always add KERNEL== match to generated rules 2008-04-15 00:21:51 +02:00
Kay Sievers
fd7a285e62 cdrom_id: replace with version which also exports media properties
This is a 12 track audio CD with additional data session:
  $ extras/cdrom_id/cdrom_id /dev/dvd
  ID_CDROM=1
  ID_CDROM_CD_R=1
  ID_CDROM_CD_RW=1
  ID_CDROM_DVD=1
  ID_CDROM_DVD_R=1
  ID_CDROM_DVD_RW=1
  ID_CDROM_DVD_RAM=1
  ID_CDROM_DVD_PLUS_R=1
  ID_CDROM_DVD_PLUS_RW=1
  ID_CDROM_DVD_PLUS_R_DL=1
  ID_CDROM_MEDIA_CD=1
  ID_CDROM_MEDIA_STATE=complete
  ID_CDROM_MEDIA_HAS_AUDIO=1
  ID_CDROM_MEDIA_SESSION_COUNT=2
  ID_CDROM_MEDIA_TRACK_COUNT=13
  ID_CDROM_MEDIA_SESSION_LAST_OFFSET=444508160
2008-04-09 23:17:39 +02:00
Kay Sievers
8b5238670d vol_id: add --offset option 2008-04-09 12:35:03 +02:00
Roy Marples
064360cde8 Makefile: do not require GNU install 2008-03-15 00:02:39 +01:00
Kay Sievers
9138bcba99 rules_generator: add KERNEL=="<netifname>*" to generated rules
Some boxes, like the PS3, have multiple independent hardware
interfaces, all sharing the same MAC address. If they have
different interface names base names, we can distinguish them
that way.
2008-03-13 16:31:14 +01:00
Matthias Schwarzott
44d01dced1 volume_id: respect LDFLAGS 2008-02-21 12:28:45 +01:00
Kay Sievers
3f91a27d16 volume_id: update ext detection 2008-02-09 12:17:32 +01:00
Karel Zak
bf79d61233 volume_id: fix typo in function documentation
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-01-24 01:12:33 +01:00
Neil Williams
a141b43506 volume_id: add prefix=, exec_prefix= 2008-01-09 22:36:36 +01:00
Karel Zak
1b4f9b167b volume_id: fix UUID raw buffer usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-01-09 16:15:07 +01:00