mirror of
https://gitlab.gnome.org/GNOME/gparted
synced 2024-08-27 19:50:23 +00:00
38 lines
1.1 KiB
Bash
Executable file
38 lines
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Purpose: Perform appropriate startup of GParted executable gpartedbin.
|
|
#
|
|
# On systems with hal-lock, use hal-lock to acquire device
|
|
# locks prior to running gpartedbin.
|
|
# 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
|
|
#
|
|
# On systems without hal-lock, invoke gpartedbin directly.
|
|
#
|
|
|
|
#
|
|
# Search PATH to determine if hal-lock program can be found
|
|
#
|
|
HAVE_HAL_LOCK=no
|
|
for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
|
|
if test -x "$k/hal-lock"; then
|
|
if test "z`ps -e | grep hald`" != "z"; then
|
|
HAVE_HAL_LOCK=yes
|
|
break
|
|
fi
|
|
fi
|
|
done
|
|
|
|
#
|
|
# 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
|