Add parent process id propergation to find desired environment variable
This commit is contained in:
parent
9359fba54f
commit
e9e26c8397
1 changed files with 6 additions and 1 deletions
7
debian/postinst
vendored
7
debian/postinst
vendored
|
|
@ -30,7 +30,12 @@ then
|
|||
fi
|
||||
|
||||
if [ "$device" == unknown ]; then
|
||||
device=$TARGET_DEVICE
|
||||
pid=$$
|
||||
while [ "$device" == unknown -a $pid != 1 ]; do
|
||||
env=`strings /proc/$pid/environ`
|
||||
device=`echo "$env"|awk -F= '$1 == "TARGET_DEVICE" { print $2; }'`
|
||||
pid=`ps -oppid -p$pid|tail -1|awk '{print $1}'`
|
||||
done
|
||||
fi
|
||||
|
||||
[ -e /lib/udev/rules.d/80-keyboard.rules ] || \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue