pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/hal Add rudementary cdrom HAL info. Probing a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a8548cdc01ab
branches:  trunk
changeset: 551260:a8548cdc01ab
user:      reinoud <reinoud%pkgsrc.org@localhost>
date:      Thu Dec 11 15:05:01 2008 +0000

description:
Add rudementary cdrom HAL info. Probing and volume management needs to be
implemented still.

diffstat:

 sysutils/hal/Makefile                                 |  4 ++--
 sysutils/hal/files/hald-netbsd/Makefile.am            |  7 +++++--
 sysutils/hal/files/hald-netbsd/addons/addon-storage.c |  8 ++++----
 sysutils/hal/files/hald-netbsd/devinfo.c              |  4 ++++
 sysutils/hal/files/hald-netbsd/osspec_netbsd.h        |  2 +-
 5 files changed, 16 insertions(+), 9 deletions(-)

diffs (104 lines):

diff -r 276bd37c1809 -r a8548cdc01ab sysutils/hal/Makefile
--- a/sysutils/hal/Makefile     Thu Dec 11 10:35:18 2008 +0000
+++ b/sysutils/hal/Makefile     Thu Dec 11 15:05:01 2008 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.18 2008/12/08 20:26:13 ahoka Exp $
+# $NetBSD: Makefile,v 1.19 2008/12/11 15:05:01 reinoud Exp $
 #
 
 DISTNAME=              hal-0.5.11
-PKGREVISION=           13
+PKGREVISION=           14
 CATEGORIES=            sysutils
 MASTER_SITES=          http://hal.freedesktop.org/releases/
 EXTRACT_SUFX=          .tar.bz2
diff -r 276bd37c1809 -r a8548cdc01ab sysutils/hal/files/hald-netbsd/Makefile.am
--- a/sysutils/hal/files/hald-netbsd/Makefile.am        Thu Dec 11 10:35:18 2008 +0000
+++ b/sysutils/hal/files/hald-netbsd/Makefile.am        Thu Dec 11 15:05:01 2008 +0000
@@ -18,7 +18,10 @@
        osspec.c drvctl.c envsys.c vfsstat.c \
        devinfo.c devinfo_misc.c devinfo_audio.c devinfo_video.c \
        devinfo_mass.c \
-       hotplug.c hal-file-monitor.c
-#      devinfo_pci.c devinfo_storage.c devinfo_usb.c
+       hotplug.c hal-file-monitor.c \
+       devinfo_optical.c 
+#      devinfo_scsipi.c
+#      devinfo_usb.c \
+#      devinfo_pci.c
 
 libhald_netbsd_la_LDFLAGS = -lprop @VOLUME_ID_LIBS@
diff -r 276bd37c1809 -r a8548cdc01ab sysutils/hal/files/hald-netbsd/addons/addon-storage.c
--- a/sysutils/hal/files/hald-netbsd/addons/addon-storage.c     Thu Dec 11 10:35:18 2008 +0000
+++ b/sysutils/hal/files/hald-netbsd/addons/addon-storage.c     Thu Dec 11 15:05:01 2008 +0000
@@ -18,6 +18,7 @@
 #include <strings.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <syslog.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -60,7 +61,7 @@
        req.databuf = NULL;
        req.datalen = 0;
        req.timeout = 10000;
-       req.flags = 0;
+       req.flags = SCCMD_READ;
        req.senselen = SENSEBUFLEN;
 
        if (ioctl(fd, SCIOCCOMMAND, &req) == -1)
@@ -224,7 +225,7 @@
                goto out;
        if ((device_file = getenv ("HAL_PROP_BLOCK_DEVICE")) == NULL)
                goto out;
-       if ((raw_device_file = getenv ("HAL_PROP_BLOCK_SOLARIS_RAW_DEVICE")) == NULL)
+       if ((raw_device_file = getenv ("HAL_PROP_BLOCK_NETBSD_RAW_DEVICE")) == NULL)
                goto out;
        if ((bus = getenv ("HAL_PROP_STORAGE_BUS")) == NULL)
                goto out;
@@ -263,12 +264,11 @@
         * keeps media constantly spun up. All this needs more thought.
         */
        for (;;) {
+               sleep (SLEEP_PERIOD);
                if (is_mounted (device_file)) {
                        close_device (&fd);
-                       sleep (SLEEP_PERIOD);
                } else if ((fd < 0) && ((fd = open (raw_device_file, O_RDONLY | O_NONBLOCK)) < 0)) {
                        HAL_DEBUG (("open failed for %s: %s", raw_device_file, strerror (errno)));
-                       sleep (SLEEP_PERIOD);
                } else {
                        /* Check if a disc is in the drive */
                        state = scsi_test_unit_ready (fd);
diff -r 276bd37c1809 -r a8548cdc01ab sysutils/hal/files/hald-netbsd/devinfo.c
--- a/sysutils/hal/files/hald-netbsd/devinfo.c  Thu Dec 11 10:35:18 2008 +0000
+++ b/sysutils/hal/files/hald-netbsd/devinfo.c  Thu Dec 11 15:05:01 2008 +0000
@@ -36,6 +36,8 @@
 #include "devinfo_usb.h"
 #include "devinfo_misc.h"
 #include "devinfo_cpu.h"
+#include "devinfo_optical.h"
+/* #include "devinfo_scsipi.h" */
 #include "drvctl.h"
 
 void devinfo_add_subtree(HalDevice *parent, const char *devnode, gboolean is_root);
@@ -142,7 +144,9 @@
 static DevinfoDevHandler *devinfo_handlers[] = {
        &devinfo_computer_handler,
        &devinfo_cpu_handler,
+       &devinfo_optical_handler,
 #if notyet
+       &devinfo_scsipi_handler,
        &devinfo_ide_handler,
        &devinfo_scsi_handler,
        &devinfo_floppy_handler,
diff -r 276bd37c1809 -r a8548cdc01ab sysutils/hal/files/hald-netbsd/osspec_netbsd.h
--- a/sysutils/hal/files/hald-netbsd/osspec_netbsd.h    Thu Dec 11 10:35:18 2008 +0000
+++ b/sysutils/hal/files/hald-netbsd/osspec_netbsd.h    Thu Dec 11 15:05:01 2008 +0000
@@ -18,4 +18,4 @@
 HalDevice *hal_util_find_closest_ancestor (const gchar *devfs_path, gchar **ancestor_devfs_path, gchar **hotplug_devfs_path);
 char *dsk_to_rdsk(char *);
 
-#endif /* OSSPEC_SOLARIS_H */
+#endif /* OSSPEC_NETBSD_H */



Home | Main Index | Thread Index | Old Index