chiark / gitweb /
replace binary firmware helper with shell script
[elogind.git] / extras / dasd_id / dasd_id.c
index 5c2143f45d5c3a98c44822051e48aca6137e01a3..b2496e99f811f79860ed919961a47acc9612956a 100644 (file)
@@ -6,16 +6,6 @@
  *     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.
- * 
- *     This program is distributed in the hope that it will be useful, but
- *     WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *     General Public License for more details.
- * 
- *     You should have received a copy of the GNU General Public License along
- *     with this program; if not, write to the Free Software Foundation, Inc.,
- *     675 Mass Ave, Cambridge, MA 02139, USA.
- *
  */
 
 #ifndef _GNU_SOURCE
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/ioctl.h>
-#include <asm/types.h>
 
-#include "../../logging.h"
-#include "../../udev_utils.h"
+#include "../../udev.h"
 
 #ifdef USE_LOG
 void log_message(int priority, const char *format, ...)
@@ -140,7 +128,7 @@ static unsigned char EBCtoASC[256] =
        0x38, 0x39, 0x07, 0x07, 0x9A, 0x07, 0x07, 0x07
 };
 
-static void vtoc_ebcdic_dec (const unsigned char *source, char *target, int l) 
+static void vtoc_ebcdic_dec (const unsigned char *source, unsigned char *target, int l) 
 {
        int i;
 
@@ -183,8 +171,8 @@ static int dasd_id(int fd)
 {
        int blocksize;
        dasd_information_t info;
-       __u8 *data;
-       __u8 *label_raw;
+       unsigned char *data;
+       unsigned char *label_raw;
 
        if (ioctl(fd, BIODASDINFO, &info) != 0) {
                dbg("not a dasd");
@@ -262,6 +250,7 @@ int main(int argc, char *argv[])
        if (export) {
                printf("ID_TYPE=disk\n");
                printf("ID_SERIAL=%s\n",serial);
+               printf("ID_BUS=ccw\n");
        } else
                printf("%s\n", serial);