2008-05-10 09:34:39 -06:00
|
|
|
#!/bin/sh
|
2008-04-21 09:22:00 -06:00
|
|
|
#
|
2008-05-10 09:34:39 -06:00
|
|
|
# Purpose: Perform appropriate startup of GParted executable gpartedbin.
|
|
|
|
#
|
|
|
|
# On systems with hal-lock, use hal-lock to acquire device
|
|
|
|
# locks prior to running gpartedbin.
|
2008-04-21 09:22:00 -06:00
|
|
|
# This is to prevent devices from being automounted.
|
|
|
|
# File system problems can occur if devices are mounted
|
|
|
|
# prior to the completion of GParted's operations.
|
|
|
|
# See GParted bug #324220
|
|
|
|
# http://bugzilla.gnome.org/show_bug.cgi?id=324220
|
|
|
|
#
|
2008-05-10 09:34:39 -06:00
|
|
|
# On systems without hal-lock, invoke gpartedbin directly.
|
2008-04-21 09:22:00 -06:00
|
|
|
#
|
2008-05-10 09:34:39 -06:00
|
|
|
|
2008-04-21 09:22:00 -06:00
|
|
|
#
|
2008-05-10 09:34:39 -06:00
|
|
|
# Search PATH to determine if hal-lock program can be found
|
2008-04-21 09:22:00 -06:00
|
|
|
#
|
2008-05-10 09:34:39 -06:00
|
|
|
HAVE_HAL_LOCK=no
|
|
|
|
for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
|
|
|
|
if test -x "$k/hal-lock"; then
|
|
|
|
HAVE_HAL_LOCK=yes
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2008-04-21 09:22:00 -06:00
|
|
|
|
2008-05-10 09:34:39 -06:00
|
|
|
#
|
|
|
|
# Use hal-lock for invocation if it exists, otherwise simply run gpartedbin
|
|
|
|
#
|
|
|
|
if test "x$HAVE_HAL_LOCK" = "xyes"; then
|
|
|
|
hal-lock --interface org.freedeskdesktop.Hal.Device.Storage --exclusive \
|
|
|
|
--run "@installdir@/gpartedbin $*"
|
|
|
|
else
|
|
|
|
@installdir@/gpartedbin $*
|
|
|
|
fi
|