summaryrefslogtreecommitdiffstats
path: root/data/hal-iphone-setup
blob: a6cffe61dcea1e58e903fc214be3e4320d927632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# borrowed from Fedora and modified to apply device major and minor nodes to the iPhone
#

hal_set () {
    if [ -n "$2" ]; then
	/usr/bin/hal-set-property --udi "$UDI" --key block.$1 --int "$2"
    else
	/usr/bin/hal-set-property --udi "$UDI" --key block.$1 --remove
    fi
}

DEVICE_NODE=`hal-get-property --udi "$UDI" --key block.device`

echo $DEVICE_NODE

MAJOR=`stat $DEVICE_NODE --format="%t"`
MINOR=`stat $DEVICE_NODE --format="%T"`

hal_set major 0x$MAJOR
hal_set minor 0x$MINOR