aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authortheuni <theuni@svn>2010-10-24 19:27:41 +0000
committertheuni <theuni@svn>2010-10-24 19:27:41 +0000
commitefb426fc98ffbd5e47d80523c56b3f131760686b (patch)
tree902983cc3ee4d8d021c6bd32eb0de28f4fc827f1 /tools
parentc5cb06a23a2ec364e13d9afe8b70b62b05d82c8a (diff)
fixed: policykit has been depracated on Maverick in favor ov policykit-1.
This means that our dep was broken in Maverick, and the old policykit script would not work anyway. Use a pkla file for distros >= Maverick. Ping ceros and lcapriotti for review. git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@34993 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'tools')
-rw-r--r--tools/Linux/packaging/debian/control1
-rw-r--r--tools/Linux/packaging/debian/var_info9
-rwxr-xr-xtools/Linux/packaging/debian/xbmc-live.postinst18
-rwxr-xr-xtools/Linux/packaging/debian/xbmc-live.postrm8
4 files changed, 29 insertions, 7 deletions
diff --git a/tools/Linux/packaging/debian/control b/tools/Linux/packaging/debian/control
index c2b8a80923..169b0445f7 100644
--- a/tools/Linux/packaging/debian/control
+++ b/tools/Linux/packaging/debian/control
@@ -56,7 +56,6 @@ Description: XBMC Media Center (full metapackage)
Package: xbmc-live
Architecture: any
Depends: xbmc-standalone (= ${binary:Version}),
- policykit,
openssh-server,
${python:Depends},
python-apt,
diff --git a/tools/Linux/packaging/debian/var_info b/tools/Linux/packaging/debian/var_info
index a1c7d88701..c163d48e5b 100644
--- a/tools/Linux/packaging/debian/var_info
+++ b/tools/Linux/packaging/debian/var_info
@@ -35,7 +35,6 @@ case "$1" in
;;
XBMC_LIVE_DEPENDS)
XBMC_LIVE_DEPENDS="xbmc-standalone (= \${binary:Version}),
- policykit,
openssh-server,
\${python:Depends},
python-apt,
@@ -53,6 +52,14 @@ case "$1" in
XBMC_LIVE_DEPENDS="$XBMC_LIVE_DEPENDS
mkpasswd,"
fi
+ if [ $(lsb_release -cs) = "maverick" ]; then
+ XBMC_LIVE_DEPENDS="$XBMC_LIVE_DEPENDS
+ policykit-1,"
+ else
+ XBMC_LIVE_DEPENDS="$XBMC_LIVE_DEPENDS
+ policykit,"
+ fi
+
printf "$XBMC_LIVE_DEPENDS"
;;
LIBVDPAU_DEPENDS)
diff --git a/tools/Linux/packaging/debian/xbmc-live.postinst b/tools/Linux/packaging/debian/xbmc-live.postinst
index f6b0e69390..e5844e97d8 100755
--- a/tools/Linux/packaging/debian/xbmc-live.postinst
+++ b/tools/Linux/packaging/debian/xbmc-live.postinst
@@ -4,6 +4,7 @@
# see: dh_installdeb(1)
set -e
+release="$(lsb_release -r | cut -f2 | sed 's/\.//')"
case "$1" in
configure)
@@ -125,8 +126,18 @@ ENDOFBLOCK
rm $SUDOERS_TEMPFILE
rm $SUDOERSBLOCK_TEMPFILE
- # Our set of PolicyKit actions
-
+ #Maverick no longer has polkit-auth, we have to use a .pkla file instead
+ if [ $release -ge 1010 ]; then
+ cat > /var/lib/polkit-1/localauthority/50-local.d/20-xbmclive.pkla <<ENDOFBLOCK
+# Policy to allow the livecd user to bypass policykit. Should be installed at /var/lib/polkit-1/localauthority/50-local.d/20-xbmclive.pkla
+[XBMC-Live user permissions]
+Identity=unix-user:xbmc
+Action=*
+ResultAny=no
+ResultInactive=no
+ResultActive=yes
+ENDOFBLOCK
+ else
# This is a list of actions that the 'xbmc' user should be allowed to
# do. If we missed one, or we have one that's not necessary, please
# submit a bug report.
@@ -191,7 +202,7 @@ ENDOFBLOCK
polkit-auth --user $xbmcUser --grant $ACTION
fi
done
-
+fi
if ! grep -i -q XBMCLive /etc/lsb-release ; then
sed -i -e "/^DISTRIB_DESCRIPTION/s/\"\(.*\)\"/\"\1 - XBMCLive\"/" /etc/lsb-release
fi
@@ -223,7 +234,6 @@ ENDOFBLOCK
esac
# Upstart scripts tested on karmic+ only (>=9.10) and not backward compatible ATM
-release="$(lsb_release -r | cut -f2 | sed 's/\.//')"
if [ $release -ge 910 ]; then
if [ -f "/etc/init.d/xbmc-live" ]; then
update-rc.d -f xbmc-live remove >/dev/null
diff --git a/tools/Linux/packaging/debian/xbmc-live.postrm b/tools/Linux/packaging/debian/xbmc-live.postrm
index 7259f7561f..73136cbc4f 100755
--- a/tools/Linux/packaging/debian/xbmc-live.postrm
+++ b/tools/Linux/packaging/debian/xbmc-live.postrm
@@ -4,6 +4,7 @@
# see: dh_installdeb(1)
set -e
+release="$(lsb_release -r | cut -f2 | sed 's/\.//')"
if [ "$1" = "purge" ]; then
SUDOERS_TEMPFILE=$(mktemp -q)
@@ -27,6 +28,11 @@ if [ "$1" = "purge" ]; then
# Remove XBMC sudoers files
rm $SUDOERS_TEMPFILE
+if [ $release -ge 1010 ]; then
+ if [ -f " /var/lib/polkit-1/localauthority/50-local.d/20-xbmclive.pkla" ]; then
+ rm "/var/lib/polkit-1/localauthority/50-local.d/20-xbmclive.pkla" > /dev/null
+ fi
+else
POLKIT_ACTIONS="org.freedesktop.hal.dockstation.undock
org.freedesktop.hal.wol.enabled
org.freedesktop.hal.wol.enable
@@ -81,7 +87,7 @@ if [ "$1" = "purge" ]; then
polkit-auth --user xbmc --revoke $ACTION
fi
done
-
+fi
sed -i s/allowed_users=anybody/allowed_users=console/ /etc/X11/Xwrapper.config
if [ -f "/etc/X11/Xwrapper.config.bak-xbmc-live" ]; then
rm /etc/X11/Xwrapper.config.bak-xbmc-live > /dev/null