hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Thu Jul 27 17:27:27 PDT 2006
tools/Makefile.am | 6
tools/freebsd/Makefile.am | 5
tools/freebsd/hal-system-storage-cleanup-mountpoints-freebsd | 29 ---
tools/freebsd/hal-system-storage-eject-freebsd | 52 ------
tools/freebsd/hal-system-storage-unmount-freebsd | 77 ----------
tools/linux/Makefile.am | 5
tools/linux/hal-system-storage-cleanup-mountpoints-linux | 33 ----
tools/linux/hal-system-storage-eject-linux | 41 -----
tools/linux/hal-system-storage-unmount-linux | 83 -----------
9 files changed, 3 insertions(+), 328 deletions(-)
New commits:
diff-tree 47328a31b8c0050ba63c6c44c320e986d83fdadf (from 21150f4e76bbc64e9fc7b343d23d93a714c014d4)
Author: David Zeuthen <davidz at zelda.fubar.dk>
Date: Thu Jul 27 20:27:22 2006 -0400
Forgot to tweak tools/[linux/,freebsd/,]Makefile.am and remove old files.
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 1deb321..a065331 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -87,11 +87,7 @@ script_SCRIPTS = \
hal-system-power-reboot \
hal-system-lcd-get-brightness \
hal-system-lcd-set-brightness \
- hal-system-power-set-power-save \
- hal-system-storage-unmount \
- hal-system-storage-eject \
- hal-system-storage-cleanup-mountpoint \
- hal-system-storage-cleanup-mountpoints
+ hal-system-power-set-power-save
EXTRA_DIST=$(man_MANS) $(MAN_IN_FILES) gen-libgphoto-hal-fdi $(script_SCRIPTS)
diff --git a/tools/freebsd/Makefile.am b/tools/freebsd/Makefile.am
index 67c41e1..8bb4b8f 100644
--- a/tools/freebsd/Makefile.am
+++ b/tools/freebsd/Makefile.am
@@ -8,10 +8,7 @@ script_SCRIPTS = \
hal-system-power-reboot-freebsd \
hal-system-lcd-get-brightness-freebsd \
hal-system-lcd-set-brightness-freebsd \
- hal-system-power-set-power-save-freebsd \
- hal-system-storage-unmount-freebsd \
- hal-system-storage-eject-freebsd \
- hal-system-storage-cleanup-mountpoints-freebsd
+ hal-system-power-set-power-save-freebsd
EXTRA_DIST = $(script_SCRIPTS)
diff --git a/tools/freebsd/hal-system-storage-cleanup-mountpoints-freebsd b/tools/freebsd/hal-system-storage-cleanup-mountpoints-freebsd
deleted file mode 100755
index e731e93..0000000
--- a/tools/freebsd/hal-system-storage-cleanup-mountpoints-freebsd
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2006, Jean-Yves Lefort <jylefort at FreeBSD.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
-
-MOUNT_ROOT="/media"
-
-for DIR in $MOUNT_ROOT/*; do
-
- # check if we created it
- if [ -e "$DIR/.created-by-hal" ]; then
- BUSY=0
- /sbin/mount | while read dev on dir rest; do
- if [ "x$dir" = "x$DIR" ]; then
- exit 1
- fi
- done
- BUSY=$?
-
- if [ "$BUSY" != "1" ]; then
- rm -f "$DIR/.created-by-hal"
- rmdir "$DIR" 2>/dev/null || true
- fi
- fi
-done
-
-exit 0
diff --git a/tools/freebsd/hal-system-storage-eject-freebsd b/tools/freebsd/hal-system-storage-eject-freebsd
deleted file mode 100755
index 1f054f2..0000000
--- a/tools/freebsd/hal-system-storage-eject-freebsd
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2006, Jean-Yves Lefort <jylefort at FreeBSD.org>
-# Copyright (C) 2006, Joe Marcus Clarke <marcus at FreeBSD.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
-#
-
-# read parameters
-# "<option1>\t<option2>\n"
-# Only allow ^a-zA-Z0-9_= in the string because otherwise someone may
-# pass e.g. umask=0600,suid,dev or umask=`/bin/evil`
-
-rc=0
-read GIVEN_EJECTOPTIONS
-GIVEN_EJECTOPTIONS="`echo \"$GIVEN_EJECTOPTIONS\" | tr -Cd \"a-zA-Z0-9_=[:space:]\"`"
-if [ -n "$HAL_PROP_VOLUME_MOUNT_POINT" ]; then
- RESULT=$(umount $HAL_PROP_VOLUME_MOUNT_POINT 2>&1)
- rc=$?
-
- if [ $? -eq 0 ]; then
- RESULT=$(cdcontrol -f "$HAL_PROP_BLOCK_DEVICE" eject 2>&1)
- rc=$?
- fi
-else
- RESULT=$(cdcontrol -f "$HAL_PROP_BLOCK_DEVICE" eject 2>&1)
- rc=$?
-fi
-
-if [ $rc -ne 0 ]; then
- case "$RESULT" in
- *busy*)
- echo "org.freedesktop.Hal.Device.Volume.Busy" >&2
- echo "Device is busy." >&2
- ;;
- *)
- echo "org.freedesktop.Hal.Device.Volume.UnknownFailure" >&2
- echo "Unknown failure." >&2
- esac
- exit 1
-fi
-
-if [ -n "$HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT" ]; then
- # remove directory only if HAL has created it
- if [ -e $HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT/.created-by-hal ]; then
- rm -f $HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT/.created-by-hal
- rmdir "$HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT" 2>/dev/null || true
- fi
-fi
-
-exit 0
diff --git a/tools/freebsd/hal-system-storage-unmount-freebsd b/tools/freebsd/hal-system-storage-unmount-freebsd
deleted file mode 100755
index 7178013..0000000
--- a/tools/freebsd/hal-system-storage-unmount-freebsd
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2005, Kay Sievers <kay.sievers at vrfy.org>
-# Copyright (C) 2006, David Zeuthen <david at fubar.dk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
-
-# read parameters
-# "lazy\tforce\n"
-# Only allow ^a-zA-Z0-9_= in the string because otherwise someone may
-# pass e.g. umask=0600,suid,dev or umask=`/bin/evil`
-
-read GIVEN_UNMOUNTOPTIONS
-GIVEN_UNMOUNTOPTIONS="`echo \"$GIVEN_UNMOUNTOPTIONS\" | tr -Cd \"a-zA-Z0-9_=[:space:]\"`"
-
-if [ -n "$GIVEN_UNMOUNTOPTIONS" ]; then
- for OPTION in $GIVEN_UNMOUNTOPTIONS; do
- OPTION_WAS_OK="0"
- for VALID_OPTION in $HAL_PROP_VOLUME_UNMOUNT_VALID_OPTIONS; do
- if [ "x$OPTION" = "x$VALID_OPTION" ]; then
- OPTION_WAS_OK="1"
- break
- fi
- done
-
- if [ "$OPTION_WAS_OK" = "1" ]; then
- case "$OPTION" in
- "lazy")
- UNMOUNTOPTIONS="$UNMOUNTOPTIONS -l"
- OPTION_WAS_OK="1"
- ;;
- "force")
- UNMOUNTOPTIONS="$UNMOUNTOPTIONS -f"
- OPTION_WAS_OK="1"
- ;;
- *)
- echo "org.freedesktop.Hal.Device.Volume.UnsupportedUnmountOption" >&2
- echo "The option '$OPTION' is not supported" >&2
- exit 1
- esac
- else
- echo "org.freedesktop.Hal.Device.Volume.InvalidUnmountOption" >&2
- echo "The option '$OPTION' is invalid" >&2
- exit 1
- fi
- done
-fi
-
-RESULT=$(umount $UNMOUNTOPTIONS "$MOUNT_POINT" 2>&1)
-if [ $? -ne 0 ]; then
- case "$RESULT" in
- *busy*)
- echo "org.freedesktop.Hal.Device.Volume.Busy" >&2
- echo "Device is busy." >&2
- ;;
- *"not mounted"*)
- echo "org.freedesktop.Hal.Device.Volume.NotMounted" >&2
- echo "Device is not mounted." >&2
- ;;
- *)
- echo "org.freedesktop.Hal.Device.Volume.UnknownFailure" >&2
- echo "Unknown failure." >&2
- esac
- exit 1
-fi
-
-# remove directory only if HAL has created it
-if [ -e "$MOUNT_POINT/.created-by-hal" ]; then
- rm -f "$MOUNT_POINT/.created-by-hal"
- rmdir "$MOUNT_POINT" 2>/dev/null || true
-fi
-
-hal-set-property --udi $UDI --key info.hal_mount.created_mount_point --remove > /dev/null 2>&1
-hal-set-property --udi $UDI --key info.hal_mount.mounted_by_uid --remove > /dev/null 2>&1
-
-exit 0
diff --git a/tools/linux/Makefile.am b/tools/linux/Makefile.am
index 423acca..2e8b4cb 100644
--- a/tools/linux/Makefile.am
+++ b/tools/linux/Makefile.am
@@ -15,10 +15,7 @@ script_SCRIPTS = \
hal-system-power-reboot-linux \
hal-system-lcd-get-brightness-linux \
hal-system-lcd-set-brightness-linux \
- hal-system-power-set-power-save-linux \
- hal-system-storage-unmount-linux \
- hal-system-storage-eject-linux \
- hal-system-storage-cleanup-mountpoints-linux
+ hal-system-power-set-power-save-linux
EXTRA_DIST = 90-hal.rules $(script_SCRIPTS)
diff --git a/tools/linux/hal-system-storage-cleanup-mountpoints-linux b/tools/linux/hal-system-storage-cleanup-mountpoints-linux
deleted file mode 100755
index 23d1c80..0000000
--- a/tools/linux/hal-system-storage-cleanup-mountpoints-linux
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2005, Kay Sievers <kay.sievers at vrfy.org>
-# Copyright (C) 2006, David Zeuthen <davidz at redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
-
-MOUNT_ROOT="/media"
-
-for DIR in $MOUNT_ROOT/*; do
-
- # check if we created it
- if [ -e "$DIR/.created-by-hal" ]; then
- BUSY=0
- # /proc/mounts substitute spaces with 040
- DIRMOD=`echo "$DIR" | sed -e 's/[[:space:]]/040/g'`
-
- while read dev dir type options; do
- if [ "$dir" = "$DIRMOD" ]; then
- BUSY=1
- break
- fi
- done < /proc/mounts
-
- if [ "$BUSY" != "1" ]; then
- rm -f "$DIR/.created-by-hal"
- rmdir "$DIR" 2>/dev/null || true
- fi
- fi
-done
-
-exit 0
diff --git a/tools/linux/hal-system-storage-eject-linux b/tools/linux/hal-system-storage-eject-linux
deleted file mode 100755
index af4bbc1..0000000
--- a/tools/linux/hal-system-storage-eject-linux
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2005, Kay Sievers <kay.sievers at vrfy.org>
-# Copyright (C) 2006, David Zeuthen <david at fubar.dk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
-#
-
-# read parameters
-# "<option1>\t<option2>\n"
-# Only allow ^a-zA-Z0-9_= in the string because otherwise someone may
-# pass e.g. umask=0600,suid,dev or umask=`/bin/evil`
-
-read GIVEN_EJECTOPTIONS
-GIVEN_EJECTOPTIONS="`echo \"$GIVEN_EJECTOPTIONS\" | tr -cd \"a-zA-Z0-9_=[:space:]\"`"
-
-RESULT=$(eject $GIVEN_EJECTOPTIONS "$HAL_PROP_BLOCK_DEVICE" 2>&1)
-
-if [ $? -ne 0 ]; then
- case "$RESULT" in
- *busy*)
- echo "org.freedesktop.Hal.Device.Volume.Busy" >&2
- echo "Device is busy." >&2
- ;;
- *)
- echo "org.freedesktop.Hal.Device.Volume.UnknownFailure" >&2
- echo "Unknown failure: $RESULT" >&2
- esac
- exit 1
-fi
-
-if [ -n "$HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT" ]; then
- # remove directory only if HAL has created it
- if [ -e $HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT/.created-by-hal ]; then
- rm -f $HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT/.created-by-hal
- rmdir "$HAL_PROP_INFO_HAL_MOUNT_CREATED_MOUNT_POINT" 2>/dev/null || true
- fi
-fi
-
-exit 0
diff --git a/tools/linux/hal-system-storage-unmount-linux b/tools/linux/hal-system-storage-unmount-linux
deleted file mode 100755
index 4b2b78f..0000000
--- a/tools/linux/hal-system-storage-unmount-linux
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2005, Kay Sievers <kay.sievers at vrfy.org>
-# Copyright (C) 2006, David Zeuthen <david at fubar.dk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
-
-# read parameters
-# "lazy\tforce\n"
-# Only allow ^a-zA-Z0-9_= in the string because otherwise someone may
-# pass e.g. umask=0600,suid,dev or umask=`/bin/evil`
-
-read GIVEN_UNMOUNTOPTIONS
-GIVEN_UNMOUNTOPTIONS="`echo \"$GIVEN_UNMOUNTOPTIONS\" | tr -cd \"a-zA-Z0-9_=[:space:]\"`"
-
-if [ -z "$MOUNT_POINT" ]; then
- echo "org.freedesktop.Hal.Device.Volume.UnknownMountpoint" >&2
- echo "Missing mountpoint, cannot figure out where device is mounted." >&2
- exit 1
-fi
-
-if [ -n "$GIVEN_UNMOUNTOPTIONS" ]; then
- for OPTION in $GIVEN_UNMOUNTOPTIONS; do
- OPTION_WAS_OK="0"
- for VALID_OPTION in $HAL_PROP_VOLUME_UNMOUNT_VALID_OPTIONS; do
- if [ "x$OPTION" = "x$VALID_OPTION" ]; then
- OPTION_WAS_OK="1"
- break
- fi
- done
-
- if [ "$OPTION_WAS_OK" = "1" ]; then
- case "$OPTION" in
- "lazy")
- UNMOUNTOPTIONS="$UNMOUNTOPTIONS -l"
- OPTION_WAS_OK="1"
- ;;
- "force")
- UNMOUNTOPTIONS="$UNMOUNTOPTIONS -f"
- OPTION_WAS_OK="1"
- ;;
- *)
- echo "org.freedesktop.Hal.Device.Volume.UnsupportedUnmountOption" >&2
- echo "The option '$OPTION' is not supported" >&2
- exit 1
- esac
- else
- echo "org.freedesktop.Hal.Device.Volume.InvalidUnmountOption" >&2
- echo "The option '$OPTION' is invalid" >&2
- exit 1
- fi
- done
-fi
-
-RESULT=$(umount $UNMOUNTOPTIONS "$MOUNT_POINT" 2>&1)
-if [ $? -ne 0 ]; then
- case "$RESULT" in
- *busy*)
- echo "org.freedesktop.Hal.Device.Volume.Busy" >&2
- echo "Device is busy." >&2
- ;;
- *"not mounted"*)
- echo "org.freedesktop.Hal.Device.Volume.NotMounted" >&2
- echo "Device is not mounted." >&2
- ;;
- *)
- echo "org.freedesktop.Hal.Device.Volume.UnknownFailure" >&2
- echo "Unknown failure: $RESULT" >&2
- esac
- exit 1
-fi
-
-# remove directory only if HAL has created it
-if [ -e "$MOUNT_POINT/.created-by-hal" ]; then
- rm -f "$MOUNT_POINT/.created-by-hal"
- rmdir "$MOUNT_POINT" 2>/dev/null || true
-fi
-
-hal-set-property --udi $UDI --key info.hal_mount.created_mount_point --remove > /dev/null 2>&1
-hal-set-property --udi $UDI --key info.hal_mount.mounted_by_uid --remove > /dev/null 2>&1
-
-exit 0
More information about the hal-commit
mailing list