From 399de5ee1f43906298b1e32129b608bfff8d997e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 11 Nov 2010 02:50:41 +0100 Subject: [PATCH] xbps-casper: enable GDM autologin, full perms via polkit for GNOME. Bumpver. --- .../files/scripts/casper-bottom/15autologin | 27 ++++++++- .../scripts/casper-bottom/44pk_allow_ubuntu | 56 +++++++++++++++++++ srcpkgs/xbps-casper/template | 2 +- 3 files changed, 81 insertions(+), 4 deletions(-) create mode 100755 srcpkgs/xbps-casper/files/scripts/casper-bottom/44pk_allow_ubuntu diff --git a/srcpkgs/xbps-casper/files/scripts/casper-bottom/15autologin b/srcpkgs/xbps-casper/files/scripts/casper-bottom/15autologin index 88ef9872854..f75d529d67f 100755 --- a/srcpkgs/xbps-casper/files/scripts/casper-bottom/15autologin +++ b/srcpkgs/xbps-casper/files/scripts/casper-bottom/15autologin @@ -1,9 +1,7 @@ #!/bin/sh PREREQ="" -DESCRIPTION="Setting up automatic login" - -[ -r /scripts/casper-functions ] && . /scripts/casper-functions +DESCRIPTION="Setting up automatic login..." prereqs() { @@ -18,8 +16,31 @@ prereqs) ;; esac +. /scripts/casper-functions + log_begin_msg "$DESCRIPTION" + +# Enable autologin for getty(1). if [ -f "${rootmnt}/etc/inittab" ]; then sed -i -e "s|agetty|casper-getty|g" "${rootmnt}/etc/inittab" fi + +if [ -d /root/etc/gdm ]; then + # Configure GDM autologin + GDMCustomFile=/root/etc/gdm/custom.conf + AutologinParameters="AutomaticLoginEnable=true\n\ +AutomaticLogin=$USERNAME\n\ +TimedLoginEnable=true\n\ +TimedLogin=$USERNAME\n\ +TimedLoginDelay=10" + + # Prevent from updating if parameters already present (persistent usb key) + if ! `grep -qs 'AutomaticLoginEnable' $GDMCustomFile` ; then + if ! `grep -qs '\[daemon\]' $GDMCustomFile` ; then + echo '[daemon]' >> $GDMCustomFile + fi + sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile + fi +fi + log_end_msg diff --git a/srcpkgs/xbps-casper/files/scripts/casper-bottom/44pk_allow_ubuntu b/srcpkgs/xbps-casper/files/scripts/casper-bottom/44pk_allow_ubuntu new file mode 100755 index 00000000000..b3671923d74 --- /dev/null +++ b/srcpkgs/xbps-casper/files/scripts/casper-bottom/44pk_allow_ubuntu @@ -0,0 +1,56 @@ +#!/bin/sh + +PREREQ="" +DESCRIPTION="Grant administrative PolicyKit pivilieges to default user..." + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/casper-functions + +log_begin_msg "$DESCRIPTION" + +# configure PolicyKit in live session +mkdir -p /root/etc/PolicyKit +cat << EOF > /root/etc/PolicyKit/PolicyKit.conf + + + + + + + + + + + + + + + + +EOF + +mkdir -p /root/var/lib/polkit-1/localauthority/10-vendor.d +cat << EOF > /root/var/lib/polkit-1/localauthority/10-vendor.d/10-live-cd.pkla +# Policy to allow the livecd user to bypass policykit +[Live CD user permissions] +Identity=unix-user:$USERNAME +Action=* +ResultAny=no +ResultInactive=no +ResultActive=yes +EOF + +log_end_msg diff --git a/srcpkgs/xbps-casper/template b/srcpkgs/xbps-casper/template index 76d5ff47bb9..4146d45c1be 100644 --- a/srcpkgs/xbps-casper/template +++ b/srcpkgs/xbps-casper/template @@ -1,6 +1,6 @@ # Template file for 'xbps-casper' pkgname=xbps-casper -version=0.5.ubuntu1.236 +version=0.6.ubuntu1.236 build_style=custom-install short_desc="Run a live preinstalled system from read-only media" maintainer="Juan RP "