* Udev support for EDD
@ 2005-09-01 20:15 John_Hull
2005-09-02 0:57 ` Kay Sievers
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: John_Hull @ 2005-09-01 20:15 UTC (permalink / raw)
To: linux-hotplug
I'd like to get feedback from this mailing list on a small project I've
been working on, which is adding support to udev for the persistent
naming of BIOS disk devices via EDD. EDD is mechanism to match x86 BIOS
device names (e.g. int13 device 80h) to Linux device names (e.g.
/dev/sda, /dev/hda), and a kernel module to support this was written by
Matt Domsch (see http://linux.dell.com/projects.shtml#edd for more
information). The EDD module makes device information available in
/sys/firmware/edd/int13_dev8*/, with the directory containing various
information for each device. For example, the first BIOS disk drive
would be int13_dev80, the second int13_dev81, etc.
My udev persistent namimg implementation for EDD results in the example
following tree:
$ tree /dev/disk/by-bios-id
/dev/disk/by-bios-id/
|-- int13_dev80 -> ../../sda
|-- int13_dev80part1 -> ../../sda1
|-- int13_dev80part2 -> ../../sda2
|-- int13_dev80part5 -> ../../sda5
|-- int13_dev80part6 -> ../../sda6
|-- int13_dev81 -> ../../sdb
|-- int13_dev81part1 -> ../../sdb1
`-- int13_dev81part2 -> ../../sdb2
To match the int13_dev8* device to the kernel block device, the
"mbr_signature" for the device exposed by EDD must be matched to the
disk signature read directly from the device by a user-space program
(signature is 4-bytes long starting at offset 0x1B8 on the disk). To
ensure that each disk can be matched to the corresponding BIOS disk,
each disk should have a unique disk signature. In my current
implementation with udev, I pass the kernel device (hd* or sd*) to a
bash script which reads its signature and then tries to match it to a
corresponding mbr_signature in the int13_dev* directories. If there is a
unique match, it returns this directory to udev, and returns nothing
otherwise.
I have placed a rules file and the script that it calls here:
http://linux.dell.com/files/edd/udev/, as well as a Python module that
can be used to read and write the signatures. Please review my approach
and let me know how I can improve this for eventual inclusion with udev.
John
John A. Hull
Linux Solutions Development
Dell Inc.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Udev support for EDD
2005-09-01 20:15 Udev support for EDD John_Hull
@ 2005-09-02 0:57 ` Kay Sievers
2005-09-02 15:13 ` John_Hull
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2005-09-02 0:57 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 2749 bytes --]
On Thu, Sep 01, 2005 at 03:15:38PM -0500, John_Hull@Dell.com wrote:
> I'd like to get feedback from this mailing list on a small project I've
> been working on, which is adding support to udev for the persistent
> naming of BIOS disk devices via EDD. EDD is mechanism to match x86 BIOS
> device names (e.g. int13 device 80h) to Linux device names (e.g.
> /dev/sda, /dev/hda), and a kernel module to support this was written by
> Matt Domsch (see http://linux.dell.com/projects.shtml#edd for more
> information). The EDD module makes device information available in
> /sys/firmware/edd/int13_dev8*/, with the directory containing various
> information for each device. For example, the first BIOS disk drive
> would be int13_dev80, the second int13_dev81, etc.
Nice to see more *_id programs. :)
> My udev persistent namimg implementation for EDD results in the example
> following tree:
>
> $ tree /dev/disk/by-bios-id
> /dev/disk/by-bios-id/
> |-- int13_dev80 -> ../../sda
> |-- int13_dev80part1 -> ../../sda1
> |-- int13_dev80part2 -> ../../sda2
> |-- int13_dev80part5 -> ../../sda5
> |-- int13_dev80part6 -> ../../sda6
> |-- int13_dev81 -> ../../sdb
> |-- int13_dev81part1 -> ../../sdb1
> `-- int13_dev81part2 -> ../../sdb2
How about "by-firmware-id" to match the kernel sysfs name?
Or putting the links just in /dev/disk/by-id/* with an edd- prefix?
> To match the int13_dev8* device to the kernel block device, the
> "mbr_signature" for the device exposed by EDD must be matched to the
> disk signature read directly from the device by a user-space program
> (signature is 4-bytes long starting at offset 0x1B8 on the disk). To
> ensure that each disk can be matched to the corresponding BIOS disk,
> each disk should have a unique disk signature. In my current
> implementation with udev, I pass the kernel device (hd* or sd*) to a
> bash script which reads its signature and then tries to match it to a
> corresponding mbr_signature in the int13_dev* directories. If there is a
> unique match, it returns this directory to udev, and returns nothing
> otherwise.
>
> I have placed a rules file and the script that it calls here:
> http://linux.dell.com/files/edd/udev/, as well as a Python module that
> can be used to read and write the signatures. Please review my approach
> and let me know how I can improve this for eventual inclusion with udev.
The edd_id.sh should not check for a loaded module, otherwise it will not
work with compiled in EDD, right?
What is this -t option for? You need to pass an option to the program
and it just checks if the option equals "disk"?
I did a quick conversion to C. :) So we can use in in initramfs without
all the tools needed by the shell script. Please have a look at it...
Thanks,
Kay
[-- Attachment #2: edd-01.patch --]
[-- Type: text/plain, Size: 4956 bytes --]
diff --git a/extras/edd_id/Makefile b/extras/edd_id/Makefile
new file mode 100644
--- /dev/null
+++ b/extras/edd_id/Makefile
@@ -0,0 +1,50 @@
+# Makefile for edd_id
+#
+# Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+
+PROG = edd_id
+
+all: $(PROG)
+
+prefix =
+exec_prefix = ${prefix}
+etcdir = ${prefix}/etc
+sbindir = ${exec_prefix}/sbin
+usrbindir = ${exec_prefix}/usr/bin
+usrsbindir = ${exec_prefix}/usr/sbin
+mandir = ${prefix}/usr/share/man
+devddir = ${etcdir}/dev.d/default
+configdir = ${etcdir}/udev/
+initdir = ${etcdir}/init.d/
+srcdir = .
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+
+OBJS = $(PROG).o $(LIBUDEV)
+
+$(OBJS): $(HEADERS)
+
+.c.o:
+ $(QUIET) $(CC) $(CFLAGS) -c -o $@ $<
+
+$(PROG): $(OBJS) $(HEADERS)
+ $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS)
+
+clean:
+ rm -f $(PROG) $(OBJS)
+
+spotless: clean
+
+install: all
+ $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
+
+uninstall:
+ - rm $(DESTDIR)$(sbindir)/$(PROG)
diff --git a/extras/edd_id/edd_id.c b/extras/edd_id/edd_id.c
new file mode 100644
--- /dev/null
+++ b/extras/edd_id/edd_id.c
@@ -0,0 +1,156 @@
+/*
+ * cdrom_id - naming of BIOS disk devices via EDD
+ *
+ * Copyright (C) 2005 John Hull <John_Hull@dell.com>
+ * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 of the License.
+ *
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <errno.h>
+#include <dirent.h>
+#include <stdint.h>
+
+#include "../../logging.h"
+#include "../../udev_utils.h"
+
+#ifdef USE_LOG
+void log_message(int priority, const char *format, ...)
+{
+ va_list args;
+ static int udev_log = -1;
+
+ if (udev_log == -1) {
+ const char *value;
+
+ value = getenv("UDEV_LOG");
+ if (value)
+ udev_log = log_priority(value);
+ else
+ udev_log = LOG_ERR;
+ }
+
+ if (priority > udev_log)
+ return;
+
+ va_start(args, format);
+ vsyslog(priority, format, args);
+ va_end(args);
+}
+#endif
+
+int main(int argc, char *argv[])
+{
+ const char *node = NULL;
+ int i;
+ int export = 0;
+ uint32_t disk_id;
+ struct dirent *dent;
+ int disk_fd;
+ int sysfs_fd;
+ DIR *dir = NULL;
+ int rc = 1;
+
+ logging_init("edd_id");
+
+ for (i = 1 ; i < argc; i++) {
+ char *arg = argv[i];
+
+ if (strcmp(arg, "--export") == 0) {
+ export = 1;
+ } else
+ node = arg;
+ }
+ if (!node) {
+ err("no node specified");
+ fprintf(stderr, "no node specified\n");
+ rc = 2;
+ goto exit;
+ }
+
+ dir = opendir("/sys/firmware/edd");
+ if (!dir) {
+ info("no kernel EDD support");
+ fprintf(stderr, "no kernel EDD support\n");
+ goto exit;
+ }
+
+ disk_fd = open(node, O_RDONLY);
+ if (disk_fd < 0) {
+ info("unable to open '%s'", node);
+ fprintf(stderr, "unable to open '%s'\n", node);
+ rc = 3;
+ goto closedir;
+ }
+
+ if (lseek(disk_fd, 440, SEEK_SET) < 0) {
+ info("'%s' seek to signature failed", node);
+ rc = 4;
+ goto close;
+ }
+
+ if (read(disk_fd, &disk_id, sizeof(disk_id)) != sizeof(disk_id)) {
+ info("'%s' read signature failed", node);
+ rc = 5;
+ goto close;
+ }
+ info("read id 0x%08x from '%s'", disk_id, node);
+
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
+ char file[PATH_SIZE];
+ char sysfs_id_buf[256];
+ uint32_t sysfs_id;
+ ssize_t size;
+
+ if (dent->d_name[0] == '.')
+ continue;
+
+ snprintf(file, sizeof(file), "/sys/firmware/edd/%s/mbr_signature", dent->d_name);
+ file[sizeof(file)-1] = '\0';
+
+ sysfs_fd = open(file, O_RDONLY);
+ if (sysfs_fd < 0) {
+ info("unable to open sysfs '%s'", file);
+ continue;
+ }
+
+ size = read(sysfs_fd, sysfs_id_buf, sizeof(sysfs_id_buf)-1);
+ close(sysfs_fd);
+ if (size < 0) {
+ info("read sysfs '%s' failed", file);
+ continue;
+ }
+ sysfs_id_buf[size] = '\0';
+ info("read '%s' from '%s'", sysfs_id_buf, file);
+
+ sysfs_id = strtoul(sysfs_id_buf, NULL, 16);
+ if (disk_id == sysfs_id) {
+ if (export)
+ printf("ID_EDD=%s\n", dent->d_name);
+ else
+ printf("%s\n", dent->d_name);
+ rc = 0;
+ break;
+ }
+ }
+
+close:
+ close(disk_fd);
+closedir:
+ closedir(dir);
+exit:
+ logging_close();
+ return rc;
+}
diff --git a/test/simple-build-check.sh b/test/simple-build-check.sh
--- a/test/simple-build-check.sh
+++ b/test/simple-build-check.sh
@@ -8,6 +8,7 @@ EXTRAS="\
extras/usb_id \
extras/dasd_id \
extras/cdrom_id \
+ extras/edd_id \
extras/floppy \
extras/run_directory \
extras/firmware"
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Udev support for EDD
2005-09-01 20:15 Udev support for EDD John_Hull
2005-09-02 0:57 ` Kay Sievers
@ 2005-09-02 15:13 ` John_Hull
2005-09-02 18:30 ` John_Hull
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: John_Hull @ 2005-09-02 15:13 UTC (permalink / raw)
To: linux-hotplug
>How about "by-firmware-id" to match the kernel sysfs name?
>Or putting the links just in /dev/disk/by-id/* with an edd- prefix?
I don't have any particular preference on what to name the directory;
"by-bios-id", "by-firmware-id", or "by-edd-id" are all fine by me. Ild
rather do that, though, than put the links in /dev/disk/by-id.
> To match the int13_dev8* device to the kernel block device, the
> "mbr_signature" for the device exposed by EDD must be matched to the
> disk signature read directly from the device by a user-space program
> (signature is 4-bytes long starting at offset 0x1B8 on the disk). To
> ensure that each disk can be matched to the corresponding BIOS disk,
> each disk should have a unique disk signature. In my current
> implementation with udev, I pass the kernel device (hd* or sd*) to a
> bash script which reads its signature and then tries to match it to a
> corresponding mbr_signature in the int13_dev* directories. If there is
> a unique match, it returns this directory to udev, and returns nothing
> otherwise.
>
> I have placed a rules file and the script that it calls here:
> http://linux.dell.com/files/edd/udev/, as well as a Python module that
> can be used to read and write the signatures. Please review my
> approach and let me know how I can improve this for eventual inclusion
with udev.
>The edd_id.sh should not check for a loaded module, otherwise it will
not work with compiled in EDD, right?
Agreed...I hadn't thought of that. The solution of just checking that
/sys/firmware/edd exists is definitely the better solution
>What is this -t option for? You need to pass an option to the program
and it just checks if the option equals "disk"?
That was my hack to make sure it only does the check for disk devices,
and not things like CD-ROMs. I'm sure there is a better way.
> I did a quick conversion to C. :) So we can use in in initramfs
without all the tools needed by the shell script. Please have a look at
it...
I did it in bash just to get do a proof-of-concept for review (plus my C
is rusty). C certainly makes more sense, so I'm glad tyou wrote that Kay
:-). The code looks good to me, so start testing with it.
John
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Udev support for EDD
2005-09-01 20:15 Udev support for EDD John_Hull
2005-09-02 0:57 ` Kay Sievers
2005-09-02 15:13 ` John_Hull
@ 2005-09-02 18:30 ` John_Hull
2005-09-06 3:10 ` Matt Domsch
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: John_Hull @ 2005-09-02 18:30 UTC (permalink / raw)
To: linux-hotplug
Kay,
Your patch looks really good so far (I've been testing on opensuse 10
beta 3). I modified the udev rules to work with edd_id, and put them
here: http://linux.dell.com/files/edd/udev/60-edd.rules. I like your
idea of matching by-*-id to the sysfs name, so I changed it to by-edd-id
to reflect that.
The one problem I noticed is when the disks do not have unique
signatures. For example, on my test box, I made the signatures be 0x00
on both sda and sdb. When I run edd_id for each disk, both spit out
int13_dev81. My thought is that it should return nothing, as we can't
verify which disk is which int13_dev8* device. Thoughts?
John
> -----Original Message-----
> From: Kay Sievers [mailto:kay.sievers@vrfy.org]
> Sent: Thursday, September 01, 2005 7:58 PM
> To: Hull, John
> Cc: linux-hotplug-devel@lists.sourceforge.net
> Subject: Re: Udev support for EDD
>
> On Thu, Sep 01, 2005 at 03:15:38PM -0500, John_Hull@Dell.com wrote:
> > I'd like to get feedback from this mailing list on a small project
> > I've been working on, which is adding support to udev for the
> > persistent naming of BIOS disk devices via EDD. EDD is mechanism to
> > match x86 BIOS device names (e.g. int13 device 80h) to
> Linux device names (e.g.
> > /dev/sda, /dev/hda), and a kernel module to support this
> was written
> > by Matt Domsch (see
> http://linux.dell.com/projects.shtml#edd for more
> > information). The EDD module makes device information available in
> > /sys/firmware/edd/int13_dev8*/, with the directory
> containing various
> > information for each device. For example, the first BIOS disk drive
> > would be int13_dev80, the second int13_dev81, etc.
>
> Nice to see more *_id programs. :)
>
> > My udev persistent namimg implementation for EDD results in the
> > example following tree:
> >
> > $ tree /dev/disk/by-bios-id
> > /dev/disk/by-bios-id/
> > |-- int13_dev80 -> ../../sda
> > |-- int13_dev80part1 -> ../../sda1
> > |-- int13_dev80part2 -> ../../sda2
> > |-- int13_dev80part5 -> ../../sda5
> > |-- int13_dev80part6 -> ../../sda6
> > |-- int13_dev81 -> ../../sdb
> > |-- int13_dev81part1 -> ../../sdb1
> > `-- int13_dev81part2 -> ../../sdb2
>
> How about "by-firmware-id" to match the kernel sysfs name?
> Or putting the links just in /dev/disk/by-id/* with an edd- prefix?
>
> > To match the int13_dev8* device to the kernel block device, the
> > "mbr_signature" for the device exposed by EDD must be
> matched to the
> > disk signature read directly from the device by a
> user-space program
> > (signature is 4-bytes long starting at offset 0x1B8 on the
> disk). To
> > ensure that each disk can be matched to the corresponding
> BIOS disk,
> > each disk should have a unique disk signature. In my current
> > implementation with udev, I pass the kernel device (hd* or
> sd*) to a
> > bash script which reads its signature and then tries to
> match it to a
> > corresponding mbr_signature in the int13_dev* directories.
> If there is
> > a unique match, it returns this directory to udev, and
> returns nothing
> > otherwise.
> >
> > I have placed a rules file and the script that it calls here:
> > http://linux.dell.com/files/edd/udev/, as well as a Python
> module that
> > can be used to read and write the signatures. Please review my
> > approach and let me know how I can improve this for
> eventual inclusion with udev.
>
> The edd_id.sh should not check for a loaded module, otherwise
> it will not work with compiled in EDD, right?
> What is this -t option for? You need to pass an option to the
> program and it just checks if the option equals "disk"?
>
> I did a quick conversion to C. :) So we can use in in
> initramfs without all the tools needed by the shell script.
> Please have a look at it...
>
> Thanks,
> Kay
>
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Udev support for EDD
2005-09-01 20:15 Udev support for EDD John_Hull
` (2 preceding siblings ...)
2005-09-02 18:30 ` John_Hull
@ 2005-09-06 3:10 ` Matt Domsch
2005-09-06 3:23 ` Matt Domsch
2005-09-06 10:24 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Matt Domsch @ 2005-09-06 3:10 UTC (permalink / raw)
To: linux-hotplug
On Fri, Sep 02, 2005 at 01:30:18PM -0500, John_Hull@Dell.com wrote:
> Kay,
>
> Your patch looks really good so far (I've been testing on opensuse 10
> beta 3). I modified the udev rules to work with edd_id, and put them
> here: http://linux.dell.com/files/edd/udev/60-edd.rules. I like your
> idea of matching by-*-id to the sysfs name, so I changed it to by-edd-id
> to reflect that.
>
> The one problem I noticed is when the disks do not have unique
> signatures. For example, on my test box, I made the signatures be 0x00
> on both sda and sdb. When I run edd_id for each disk, both spit out
> int13_dev81. My thought is that it should return nothing, as we can't
> verify which disk is which int13_dev8* device. Thoughts?
Agreed.
--
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Udev support for EDD
2005-09-01 20:15 Udev support for EDD John_Hull
` (3 preceding siblings ...)
2005-09-06 3:10 ` Matt Domsch
@ 2005-09-06 3:23 ` Matt Domsch
2005-09-06 10:24 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Matt Domsch @ 2005-09-06 3:23 UTC (permalink / raw)
To: linux-hotplug
On Fri, Sep 02, 2005 at 02:57:33AM +0200, Kay Sievers wrote:
> I did a quick conversion to C. :) So we can use in in initramfs without
> all the tools needed by the shell script. Please have a look at it...
Thanks, this is a great start.
One missing item is the test of the last 2 bytes of the MBR for the 2
bytes (0xAA55 stored on disk as little endian) which indicates that
this is an MBR, so the 4-bytes it then reads and treats as the
signature field has the expected meaning. Something like this
(untested) patch.
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com>
Thanks,
Matt
--
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
--- edd_id.c.orig 2005-09-05 22:11:15.000000000 -0500
+++ edd_id.c 2005-09-05 22:19:00.000000000 -0500
@@ -57,6 +57,7 @@
int i;
int export = 0;
uint32_t disk_id;
+ uint16_t mbr_valid;
struct dirent *dent;
int disk_fd;
int sysfs_fd;
@@ -95,6 +96,24 @@
goto closedir;
}
+ if (lseek(disk_fd, 510, SEEK_SET) < 0) {
+ info("'%s' seek to MBR validity failed", node);
+ rc = 4;
+ goto close;
+ }
+
+ if (read(disk_fd, &mbr_valid, sizeof(mbr_valid)) != sizeof(mbr_valid)) {
+ info("'%s' read MBR validity failed", node);
+ rc = 5;
+ goto close;
+ }
+
+ if (mbr_valid != 0xAA55) {
+ info("'%s' this is not an MBR", node);
+ rc=5;
+ goto close;
+ }
+
if (lseek(disk_fd, 440, SEEK_SET) < 0) {
info("'%s' seek to signature failed", node);
rc = 4;
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Udev support for EDD
2005-09-01 20:15 Udev support for EDD John_Hull
` (4 preceding siblings ...)
2005-09-06 3:23 ` Matt Domsch
@ 2005-09-06 10:24 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2005-09-06 10:24 UTC (permalink / raw)
To: linux-hotplug
On Mon, Sep 05, 2005 at 10:23:53PM -0500, Matt Domsch wrote:
> On Fri, Sep 02, 2005 at 02:57:33AM +0200, Kay Sievers wrote:
> > I did a quick conversion to C. :) So we can use in in initramfs without
> > all the tools needed by the shell script. Please have a look at it...
>
> Thanks, this is a great start.
>
> One missing item is the test of the last 2 bytes of the MBR for the 2
> bytes (0xAA55 stored on disk as little endian) which indicates that
> this is an MBR, so the 4-bytes it then reads and treats as the
> signature field has the expected meaning. Something like this
> (untested) patch.
Works on by box. I've added the program to my udev tree:
http://ehlo.org/~kay/?p=linux/hotplug/udev-kay.git;a=commitdiff;h\a7ed27c55a9ea661262d7b3ec8be184445ab82e
Thanks,
Kay
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-09-06 10:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-01 20:15 Udev support for EDD John_Hull
2005-09-02 0:57 ` Kay Sievers
2005-09-02 15:13 ` John_Hull
2005-09-02 18:30 ` John_Hull
2005-09-06 3:10 ` Matt Domsch
2005-09-06 3:23 ` Matt Domsch
2005-09-06 10:24 ` Kay Sievers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).