summaryrefslogtreecommitdiff
path: root/hald/debug-hald.sh
blob: d7c32065de765d55ba6206638fb94ca1ee93d458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

information_fdidir="../../hal-info/fdi"

case `uname -s` in
    FreeBSD)	backend=freebsd ;;
    SunOS)	backend=solaris ;;
    *)		backend=linux ;;
esac
export HALD_RUNNER_PATH=`pwd`/$backend:`pwd`/$backend/probing:`pwd`/$backend/addons:`pwd`/.:`pwd`/../tools:`pwd`/../tools/$backend
export PATH=`pwd`/../hald-runner:$PATH

HALD_TMPDIR=/tmp/run-hald-$USER

if [ "$1" = "--skip-fdi-install" ] ; then
    shift
else
    rm -rf $HALD_TMPDIR
    mkdir -p $HALD_TMPDIR
    make -C ../policy install DESTDIR=$HALD_TMPDIR prefix=/
    make -C ../fdi install DESTDIR=$HALD_TMPDIR prefix=/ && \
    if [ ! -d $information_fdidir ] ; then
    	echo "ERROR: You need to checkout hal-info in the same level"
    	echo "directory as hal to get the information fdi files."
    	exit
    fi
    make -C $information_fdidir install DESTDIR=$HALD_TMPDIR prefix=/
fi
export HAL_FDI_SOURCE_PREPROBE=$HALD_TMPDIR/share/hal/fdi/preprobe
export HAL_FDI_SOURCE_INFORMATION=$HALD_TMPDIR/share/hal/fdi/information
export HAL_FDI_SOURCE_POLICY=$HALD_TMPDIR/share/hal/fdi/policy
export HAL_FDI_CACHE_NAME=$HALD_TMPDIR/hald-local-fdi-cache
export POLKIT_POLICY_DIR=$HALD_TMPDIR/share/PolicyKit/policy

echo ========================================
echo Just type \'run\' to start debugging hald
echo ========================================
gdb run --args ./hald --daemon=no --verbose=yes $@