diff options
author | obache <obache> | 2011-01-08 13:00:13 +0000 |
---|---|---|
committer | obache <obache> | 2011-01-08 13:00:13 +0000 |
commit | 0f2fe231e97b3a2670c528051bbed82ececbd3f5 (patch) | |
tree | 0c7a9b5d3661995e73ad604ac64a236ecaf8840a /sysutils/hal | |
parent | eb5e1e8f3793dcb0df7c1e3ba6d5a55b39587fde (diff) | |
download | pkgsrc-0f2fe231e97b3a2670c528051bbed82ececbd3f5.tar.gz |
Bring back DragonFly BSD support.
Based on PR#44338 from Rumko, also fixes PLIST.FreeBSD and self-tests by me.
Diffstat (limited to 'sysutils/hal')
-rw-r--r-- | sysutils/hal/PLIST.FreeBSD | 17 | ||||
-rw-r--r-- | sysutils/hal/distinfo | 13 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-ak | 96 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-ao | 14 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-ar | 44 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-as | 14 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-at | 16 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-au | 11 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-av | 13 | ||||
-rw-r--r-- | sysutils/hal/patches/patch-na | 37 |
10 files changed, 236 insertions, 39 deletions
diff --git a/sysutils/hal/PLIST.FreeBSD b/sysutils/hal/PLIST.FreeBSD index c1ea9f7fcd6..ea32d857bec 100644 --- a/sysutils/hal/PLIST.FreeBSD +++ b/sysutils/hal/PLIST.FreeBSD @@ -1,14 +1,15 @@ -@comment $NetBSD: PLIST.FreeBSD,v 1.2 2009/06/14 18:16:07 joerg Exp $ -lib/hal/scripts/freebsd/hal-system-lcd-get-brightness-freebsd -lib/hal/scripts/freebsd/hal-system-lcd-set-brightness-freebsd -lib/hal/scripts/freebsd/hal-system-power-reboot-freebsd -lib/hal/scripts/freebsd/hal-system-power-set-power-save-freebsd -lib/hal/scripts/freebsd/hal-system-power-shutdown-freebsd -lib/hal/scripts/freebsd/hal-system-power-suspend-freebsd -lib/libhald_freebsd_probe.la +@comment $NetBSD: PLIST.FreeBSD,v 1.3 2011/01/08 13:00:13 obache Exp $ +libexec/hald-addon-mouse-sysmouse libexec/hald-addon-storage libexec/hald-probe-hiddev +libexec/hald-probe-mouse libexec/hald-probe-scsi libexec/hald-probe-smbios libexec/hald-probe-storage libexec/hald-probe-volume +libexec/scripts/freebsd/hal-system-lcd-get-brightness-freebsd +libexec/scripts/freebsd/hal-system-lcd-set-brightness-freebsd +libexec/scripts/freebsd/hal-system-power-reboot-freebsd +libexec/scripts/freebsd/hal-system-power-set-power-save-freebsd +libexec/scripts/freebsd/hal-system-power-shutdown-freebsd +libexec/scripts/freebsd/hal-system-power-suspend-freebsd diff --git a/sysutils/hal/distinfo b/sysutils/hal/distinfo index be887d915ef..cbea1d5ed20 100644 --- a/sysutils/hal/distinfo +++ b/sysutils/hal/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.19 2010/12/29 00:12:15 tron Exp $ +$NetBSD: distinfo,v 1.20 2011/01/08 13:00:13 obache Exp $ SHA1 (hal-0.5.14.tar.bz2) = a6ec098d78112e18e2773afa5f9ed642b00c4c59 RMD160 (hal-0.5.14.tar.bz2) = 0314dace9512bf49a62bd1556963fc60a6c9caf9 @@ -12,14 +12,19 @@ SHA1 (patch-af) = 161b59ee30d59dbc9e0c79f7f3162bcec5480d99 SHA1 (patch-ag) = 3fd8b7d10b1a43311541d2c6ad67a944e286c5ec SHA1 (patch-ah) = 6d801a2c30cee6199b25acf46d7e9866f6004182 SHA1 (patch-aj) = f20e4b1286d177e53a550b2ba1608d22e4b5c609 -SHA1 (patch-ak) = f4ba0655a452fc13e83a7b93703b4da417e8597f +SHA1 (patch-ak) = c6e9f20df9230de1bbf599315ad7f32fe6433f48 SHA1 (patch-al) = fe567d7504e961cb623e492f8dc155ef2f3b4c9e SHA1 (patch-am) = 6a4940006e583300d9a983511bdcb05268f74b1a SHA1 (patch-an) = 0307b2f0f6bb5e4a6d7bf837163e74749b7d24b2 -SHA1 (patch-ao) = e450f8d5fd4705cf9f4eb3e827a61179b4148646 +SHA1 (patch-ao) = 2bbd39404284c5c05068e87c9d20b8f6a65c3503 SHA1 (patch-ap) = 9051ced9c00911b993198c98c6d02f5846c16728 SHA1 (patch-aq) = 7d0b224b4b1e6052983a6512217eee4f530e0720 +SHA1 (patch-ar) = bf44c939b338359f18457b1e65434731c3605130 +SHA1 (patch-as) = a6319e523affc90701f09266949cb7891c044ba7 +SHA1 (patch-at) = 040a018a7be5b28a0dc23dd66a0c10bbb0abc6bf +SHA1 (patch-au) = c9e843f57b8a31f1bdc42478d450ea5606b4d7db +SHA1 (patch-av) = 075ab5e265be4733d856a17184129d0b301bc0b8 SHA1 (patch-ax) = 278cbf10dd288f7a4aeedd7545b325c1a82715db -SHA1 (patch-na) = 127bd8aa2c837a525685e4ab8ef0429059130b2b +SHA1 (patch-na) = dbd9d7ae94e80163537db547f0907d700e8f13b9 SHA1 (patch-nb) = 1693b7a2faa5bee20a594f0b60b8ff6caea0efdc SHA1 (patch-nc) = 32453e49734902749ce24eb4364fc7f531986227 diff --git a/sysutils/hal/patches/patch-ak b/sysutils/hal/patches/patch-ak index 227b9662590..8bdd6c28bc7 100644 --- a/sysutils/hal/patches/patch-ak +++ b/sysutils/hal/patches/patch-ak @@ -1,43 +1,109 @@ -$NetBSD: patch-ak,v 1.2 2010/12/26 20:59:31 markd Exp $ +$NetBSD: patch-ak,v 1.3 2011/01/08 13:00:13 obache Exp $ --- hald/freebsd/probing/probe-volume.c.orig 2009-09-17 13:45:09.000000000 +0000 +++ hald/freebsd/probing/probe-volume.c -@@ -33,7 +33,9 @@ +@@ -33,7 +33,11 @@ #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> -+#ifndef __DragonFly__ ++#ifdef __DragonFly__ ++#include <sys/diskslice.h> ++#else #include <sys/disk.h> +#endif #include <sys/cdio.h> #include <sys/param.h> #include <sys/mount.h> -@@ -371,6 +373,7 @@ main (int argc, char **argv) +@@ -41,7 +45,11 @@ + #include <ufs/ufs/ufsmount.h> + #include <ufs/ufs/dinode.h> + #include <ufs/ffs/fs.h> ++#ifdef __DragonFly__ ++#include <ufs/ufs/ufs_types.h> ++#else + #include <libufs.h> ++#endif + #include <isofs/cd9660/iso.h> + #include <glib.h> + #include <libvolume_id.h> +@@ -332,6 +340,9 @@ main (int argc, char **argv) + gboolean is_blank = FALSE; + const char *usage; + char *label; ++#ifdef __DragonFly__ ++ struct partinfo device_info; ++#endif + unsigned int sector_size = 0; + off_t media_size = 0; + +@@ -371,7 +382,12 @@ main (int argc, char **argv) is_blank = (! has_audio && ! has_data); } -+#ifndef __DragonFly__ ++#ifdef __DragonFly__ ++ ioctl(fd, DIOCGPART, &device_info); ++ media_size = device_info.media_size; ++#else ioctl(fd, DIOCGMEDIASIZE, &media_size); ++#endif /* -@@ -396,6 +399,7 @@ main (int argc, char **argv) + * We only check for filesystems if the volume has no children, +@@ -563,16 +579,35 @@ main (int argc, char **argv) + + if (vid && ! strcmp (vid->type, "ufs")) + { ++#ifdef __DragonFly__ ++ struct fs fs; ++ int rfd; ++ ssize_t nr; ++ ++ if ((rfd = open(device_file, O_RDONLY)) >= 0) { ++ lseek(rfd, (off_t) SBOFF, SEEK_SET); ++ ++ nr = read(rfd, &fs, (size_t) SBSIZE); ++ close(rfd); ++ } ++ ++ if (nr == (ssize_t) SBSIZE) ++#else + struct uufsd ufsdisk; + + if (ufs_disk_fillout(&ufsdisk, device_file) == 0) ++#endif + { + char ufsid[64]; + char **ufs_devs = NULL; + int num_udis; + int i; + ++#ifdef __DragonFly__ ++ snprintf(ufsid, sizeof(ufsid), "%08x%08x", fs.fs_id[0], fs.fs_id[1]); ++#else + snprintf(ufsid, sizeof(ufsid), "%08x%08x", ufsdisk.d_fs.fs_id[0], ufsdisk.d_fs.fs_id[1]); ++#endif + libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.freebsd.ufsid", ufsid, &hfp_error); + ufs_devs = libhal_manager_find_device_string_match(hfp_ctx, + "volume.freebsd.ufsid", +@@ -597,7 +632,9 @@ main (int argc, char **argv) } + if (ufs_devs) + libhal_free_string_array(ufs_devs); ++#ifndef __DragonFly__ + ufs_disk_close(&ufsdisk); ++#endif } } -+#endif - if (! has_children && ! is_swap && ! has_audio && ! has_data && ! is_blank) - goto end; -@@ -628,10 +632,12 @@ main (int argc, char **argv) +@@ -628,7 +665,11 @@ main (int argc, char **argv) libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.uuid", vid ? vid->uuid : "", &hfp_error); -+#ifndef __DragonFly__ ++#ifdef __DragonFly__ ++ sector_size = device_info.media_blksize; ++#else ioctl(fd, DIOCGSECTORSIZE, §or_size); ++#endif if (sector_size != 0) libhal_device_set_property_uint64(hfp_ctx, hfp_udi, "volume.block_size", sector_size, &hfp_error); -+#endif - if (media_size != 0) - libhal_device_set_property_uint64(hfp_ctx, hfp_udi, "volume.size", media_size, &hfp_error); - if (sector_size != 0 && media_size != 0) diff --git a/sysutils/hal/patches/patch-ao b/sysutils/hal/patches/patch-ao index 8f642217965..fa91c4f3b42 100644 --- a/sysutils/hal/patches/patch-ao +++ b/sysutils/hal/patches/patch-ao @@ -1,4 +1,8 @@ -$NetBSD: patch-ao,v 1.2 2010/12/26 20:59:31 markd Exp $ +$NetBSD: patch-ao,v 1.3 2011/01/08 13:00:13 obache Exp $ + +On DragonFly /dev/usb will be taken by usbd(8), but that does not +mean that one cannot check usbX devices. The same behaviour was present +in older versions of hald(8). --- hald/freebsd/hf-usb.c.orig 2009-09-17 13:49:46.000000000 +0000 +++ hald/freebsd/hf-usb.c @@ -16,3 +20,11 @@ $NetBSD: patch-ao,v 1.2 2010/12/26 20:59:31 markd Exp $ #include "../logger.h" #include "../osspec.h" +@@ -613,7 +617,6 @@ hf_usb_privileged_init (void) + if (hf_usb_fd < 0) + { + HAL_INFO(("unable to open %s: %s", HF_USB_DEVICE, g_strerror(errno))); +- return; + } + + for (i = 0; i < 16; i++) diff --git a/sysutils/hal/patches/patch-ar b/sysutils/hal/patches/patch-ar new file mode 100644 index 00000000000..47a153c2e5a --- /dev/null +++ b/sysutils/hal/patches/patch-ar @@ -0,0 +1,44 @@ +$NetBSD: patch-ar,v 1.1 2011/01/08 13:00:13 obache Exp $ + +--- hald/freebsd/probing/probe-storage.c.orig 2009-08-24 12:42:29.000000000 +0000 ++++ hald/freebsd/probing/probe-storage.c +@@ -32,7 +32,11 @@ + #include <errno.h> + #include <sys/types.h> + #include <sys/ioctl.h> ++#ifdef __DragonFly__ ++#include <sys/diskslice.h> ++#else + #include <sys/disk.h> ++#endif + #include <netinet/in.h> + #include <glib.h> + #include <libvolume_id.h> +@@ -171,6 +175,9 @@ int + main (int argc, char **argv) + { + char *device_file; ++#ifdef __DragonFly__ ++ struct partinfo device_info; ++#endif + char *drive_type; + char *parent; + int ret = 0; /* no media/filesystem */ +@@ -221,10 +228,17 @@ main (int argc, char **argv) + fd = open(device_file, O_RDONLY | O_NONBLOCK); + if (fd > -1) + { ++#ifdef __DragonFly__ ++ if (ioctl (fd, DIOCGPART, &device_info) == 0) ++ { ++ libhal_device_set_property_uint64(hfp_ctx, hfp_udi, "storage.removable.media_size", device_info.media_size, &hfp_error); ++ } ++#else + if (ioctl (fd, DIOCGMEDIASIZE, &size) == 0) + { + libhal_device_set_property_uint64(hfp_ctx, hfp_udi, "storage.removable.media_size", size, &hfp_error); + } ++#endif + close(fd); + } + ret = 2; /* has media */ diff --git a/sysutils/hal/patches/patch-as b/sysutils/hal/patches/patch-as new file mode 100644 index 00000000000..7a5fef4cbda --- /dev/null +++ b/sysutils/hal/patches/patch-as @@ -0,0 +1,14 @@ +$NetBSD: patch-as,v 1.1 2011/01/08 13:00:13 obache Exp $ + +--- hald/freebsd/addons/addon-mouse.c.orig 2009-08-24 12:42:29.000000000 +0000 ++++ hald/freebsd/addons/addon-mouse.c +@@ -29,7 +29,9 @@ + #include <sys/types.h> + #include <sys/event.h> + #include <sys/time.h> ++#ifdef __FreeBSD__ + #include <sys/proc.h> ++#endif + #if __FreeBSD_version >= 800058 + #include <sys/types.h> + #include <sys/user.h> diff --git a/sysutils/hal/patches/patch-at b/sysutils/hal/patches/patch-at new file mode 100644 index 00000000000..73a129e3473 --- /dev/null +++ b/sysutils/hal/patches/patch-at @@ -0,0 +1,16 @@ +$NetBSD: patch-at,v 1.1 2011/01/08 13:00:13 obache Exp $ + +--- hald/freebsd/hf-pci.c.orig 2009-05-12 12:27:00.000000000 +0000 ++++ hald/freebsd/hf-pci.c +@@ -27,7 +27,11 @@ + + #include <stdio.h> + #include <string.h> ++#ifdef __DragonFly__ ++#include <bitstring.h> ++#else + #include <sys/bitstring.h> ++#endif + #include <errno.h> + #include <fcntl.h> + #include <unistd.h> diff --git a/sysutils/hal/patches/patch-au b/sysutils/hal/patches/patch-au new file mode 100644 index 00000000000..ac8fdcfed3d --- /dev/null +++ b/sysutils/hal/patches/patch-au @@ -0,0 +1,11 @@ +$NetBSD: patch-au,v 1.1 2011/01/08 13:00:13 obache Exp $ + +--- hald/freebsd/probing/Makefile.am.orig 2009-08-24 12:42:29.000000000 +0000 ++++ hald/freebsd/probing/Makefile.am +@@ -67,5 +67,5 @@ hald_probe_volume_CPPFLAGS = $(AM_CPPFLA + hald_probe_volume_LDADD = \ + @GLIB_LIBS@ \ + @VOLUME_ID_LIBS@ \ +- -lufs \ ++ @LIBUFS_LIBS@ \ + $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la diff --git a/sysutils/hal/patches/patch-av b/sysutils/hal/patches/patch-av new file mode 100644 index 00000000000..5e66f4c14e2 --- /dev/null +++ b/sysutils/hal/patches/patch-av @@ -0,0 +1,13 @@ +$NetBSD: patch-av,v 1.1 2011/01/08 13:00:13 obache Exp $ + +--- policy/Makefile.am.orig 2009-01-21 00:14:28.000000000 +0000 ++++ policy/Makefile.am +@@ -20,7 +20,7 @@ check: + echo -n "Validate PolicyKit policy in $$f : "; \ + $(POLKIT_POLICY_FILE_VALIDATE) $(srcdir)/$$f ; \ + ret=$$?; \ +- if [ "$$ret" == "0" ]; \ ++ if [ "$$ret" = "0" ]; \ + then \ + echo ok; \ + else \ diff --git a/sysutils/hal/patches/patch-na b/sysutils/hal/patches/patch-na index a487bd9dc04..b79258aa5dc 100644 --- a/sysutils/hal/patches/patch-na +++ b/sysutils/hal/patches/patch-na @@ -1,9 +1,12 @@ -$NetBSD: patch-na,v 1.8 2010/12/29 00:12:15 tron Exp $ +$NetBSD: patch-na,v 1.9 2011/01/08 13:00:13 obache Exp $ ---- configure.in.orig 2009-08-24 13:42:29.000000000 +0100 -+++ configure.in 2010-12-29 00:07:13.000000000 +0000 -@@ -484,7 +484,7 @@ +--- configure.in.orig 2009-08-24 12:42:29.000000000 +0000 ++++ configure.in +@@ -482,9 +482,10 @@ AM_CONDITIONAL([HAVE_LIBPCI], [test "x$U + USE_LIBUSB20=no + USE_LIBUSB=no LIBUSB20_LIBS="" ++LIBUFS_LIBS="" AC_ARG_WITH([backend], AS_HELP_STRING([--with-backend=<name>], - [backend to use (linux/solaris/freebsd/dummy)]), @@ -11,7 +14,7 @@ $NetBSD: patch-na,v 1.8 2010/12/29 00:12:15 tron Exp $ [backend=$withval]) if ! test -z "$with_backend" ; then HALD_BACKEND="$with_backend" -@@ -493,6 +493,9 @@ +@@ -493,6 +494,9 @@ else *-*-solaris*) HALD_BACKEND="solaris" ;; @@ -21,24 +24,36 @@ $NetBSD: patch-na,v 1.8 2010/12/29 00:12:15 tron Exp $ *-*-freebsd* | *-*-kfreebsd*-gnu) HALD_BACKEND="freebsd" ;; -@@ -508,6 +511,7 @@ +@@ -508,8 +512,10 @@ AM_CONDITIONAL(HALD_COMPILE_DUMMY, [test AM_CONDITIONAL(HALD_COMPILE_LINUX, [test x$HALD_BACKEND = xlinux], [Compiling for Linux]) AM_CONDITIONAL(HALD_COMPILE_FREEBSD, [test x$HALD_BACKEND = xfreebsd], [Compiling for FreeBSD]) AM_CONDITIONAL(HALD_COMPILE_SOLARIS, [test x$HALD_BACKEND = xsolaris], [Compiling for Solaris]) +AM_CONDITIONAL(HALD_COMPILE_NETBSD, [test x$HALD_BACKEND = xnetbsd], [Compiling for NetBSD]) AC_SUBST(HALD_BACKEND) if test "x$HALD_BACKEND" = "xfreebsd"; then ++ AC_SEARCH_LIBS([ufs_disk_fillout], [ufs], [LIBUFS_LIBS="-lufs"], []) AC_CHECK_LIB([usb20], [libusb20_dev_get_info], [USE_LIBUSB20=yes], [USE_LIBUSB20=no]) -@@ -707,7 +711,7 @@ + fi + if test "x$USE_LIBUSB20" = "xno"; then +@@ -526,6 +532,8 @@ elif test "x$USE_LIBUSB" = "xyes"; then + fi + AC_SUBST(LIBUSB20_LIBS) + ++AC_SUBST(LIBUFS_LIBS) ++ + dnl DBUS API is subject to changes + AC_DEFINE_UNQUOTED(DBUS_API_SUBJECT_TO_CHANGE, [], [DBUS API is subject to change]) + +@@ -707,7 +715,7 @@ fi AC_MSG_RESULT($have_glib_2_14) case "$host" in - *-*-freebsd*) -+ *-*-freebsd* | *-*-netbsd*) ++ *-*-freebsd* | *-*-netbsd* | *-*-dragonfly*) PKG_CHECK_MODULES(VOLUME_ID, [$volume_id_module]) AC_SUBST(VOLUME_ID_CFLAGS) AC_SUBST(VOLUME_ID_LIBS) -@@ -718,14 +722,13 @@ +@@ -718,14 +726,13 @@ esac # blkid (util-linux-ng) case "$host" in @@ -57,7 +72,7 @@ $NetBSD: patch-na,v 1.8 2010/12/29 00:12:15 tron Exp $ esac # OS specific libs -@@ -1086,6 +1089,9 @@ +@@ -1086,6 +1093,9 @@ hald/linux/addons/Makefile hald/solaris/Makefile hald/solaris/probing/Makefile hald/solaris/addons/Makefile @@ -67,7 +82,7 @@ $NetBSD: patch-na,v 1.8 2010/12/29 00:12:15 tron Exp $ hald/freebsd/Makefile hald/freebsd/probing/Makefile hald/freebsd/libprobe/Makefile -@@ -1096,6 +1102,7 @@ +@@ -1096,6 +1106,7 @@ libhal-storage/Makefile tools/Makefile tools/freebsd/Makefile tools/linux/Makefile |