diff options
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | 0002-Fix-separator-error.patch | 8 | ||||
-rw-r--r-- | 0002-guest-account-Add-default-GSettings-support.patch | 33 | ||||
-rw-r--r-- | PKGBUILD | 55 | ||||
-rw-r--r-- | add-autologin-group.install | 45 | ||||
-rw-r--r-- | add-autologin-group.script | 36 | ||||
-rw-r--r-- | add-autologin-group.service | 9 | ||||
-rw-r--r-- | lightdm.install | 17 |
8 files changed, 127 insertions, 83 deletions
@@ -4,6 +4,7 @@ pkgbase = lightdm-guest pkgrel = 1 epoch = 1 url = https://www.freedesktop.org/wiki/Software/LightDM/ + install = add-autologin-group.install arch = x86_64 license = GPL3 license = LGPL3 @@ -33,7 +34,8 @@ pkgbase = lightdm-guest source = lightdm-default-config.patch source = Xsession source = 0001-guest-account-Add-default-GSettings-support.patch - source = 0002-Fix-separator-error.patch + source = add-autologin-group.script + source = add-autologin-group.service sha256sums = 05fe38d10dc8966f19806f001561edc057e757656ed37e08ca3127ab32a02692 sha256sums = 0db37a14521be729411a767f157fbd07adb738b14006277def53a1efe4dacfb8 sha256sums = fd93291bfc9985f0a1bb288472866aa0a9bcd259e024c3a29d20ca158bc08403 @@ -44,7 +46,8 @@ pkgbase = lightdm-guest sha256sums = 70b1d952d1ea8ade6b5561e6de781cfbfe3a86a116c10ea9774cfae73281c7a6 sha256sums = d30321a1b490500483b8ed7825fcff2c24a7c760ac627789ff517693888ec3c5 sha256sums = e4c2c618f5484ba165776b747befadd101e40cfdbe4bc01cbb6d3e22beb6ab65 - sha256sums = 05ead7af1f631df8bcb690dfd4404fe8459e7757d744af0748b4e5a2e8b171e7 + sha256sums = 8b665387245531d4d25ffee9636a3735667876937238c376d7eece97f7a82c14 + sha256sums = 2199300cc27b6b407e46206abd181b2be2679d2520ddd183e4a37a3fc691739a pkgname = lightdm-guest depends = bindfs diff --git a/0002-Fix-separator-error.patch b/0002-Fix-separator-error.patch deleted file mode 100644 index 7cec52b96881..000000000000 --- a/0002-Fix-separator-error.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/help/Makefile.am 2016-12-16 20:45:09.453675407 -0800 -+++ b/help/Makefile.am 2016-12-16 20:45:25.577489985 -0800 -@@ -1,5 +1,3 @@ --@YELP_HELP_RULES@ -- - HELP_ID = lightdm - HELP_POT = lightdm-help.pot - HELP_FILES = autologin.page \ diff --git a/0002-guest-account-Add-default-GSettings-support.patch b/0002-guest-account-Add-default-GSettings-support.patch deleted file mode 100644 index 6970c8139310..000000000000 --- a/0002-guest-account-Add-default-GSettings-support.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 44e3fe3f4fe5c22b78dfe36c6affa9d42c1fb395 Mon Sep 17 00:00:00 2001 -From: Xiao-Long Chen <chenxiaolong@cxl.epac.to> -Date: Sun, 13 Apr 2014 01:02:42 -0400 -Subject: [PATCH 2/2] guest-account: Add default GSettings support - ---- - debian/guest-account.sh | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/debian/guest-account.sh b/debian/guest-account.sh -index 0fc3daa..38e849c 100644 ---- a/debian/guest-account.sh -+++ b/debian/guest-account.sh -@@ -131,6 +131,16 @@ add_account () - . /etc/guest-session/prefs.sh - fi - -+ # Load default dconf settings -+ mkdir -p "$HOME/.config/" "$HOME/.cache/" -+ chown -R $USER:$USER "$HOME/.config/" "$HOME/.cache/" -+ if [ -d /etc/guest-session/gsettings/ ]; then -+ for i in /etc/guest-session/gsettings/*; do -+ cat "${i}" | sed '/^\[.*\]$/ s/\./\//g' | \ -+ su - $USER -c 'dbus-launch dconf load /' -+ done -+ fi -+ - chown -R $USER:$USER "$HOME" - - echo $USER --- -2.3.3 - @@ -9,6 +9,7 @@ pkgver=1.30.0 pkgrel=1 epoch=1 pkgdesc='A lightweight display manager. With guest-session enabled' +_add_group=add-autologin-group arch=(x86_64) url=https://www.freedesktop.org/wiki/Software/LightDM/ license=( @@ -33,6 +34,7 @@ makedepends=( vala yelp-tools ) +install=$_add_group.install source=( "lightdm-${pkgver}.tar.gz::https://github.com/CanonicalLtd/lightdm/archive/${pkgver}.tar.gz" lightdm.service @@ -44,7 +46,9 @@ source=( lightdm-default-config.patch Xsession 0001-guest-account-Add-default-GSettings-support.patch - 0002-Fix-separator-error.patch) + $_add_group.script + $_add_group.service +) sha256sums=('05fe38d10dc8966f19806f001561edc057e757656ed37e08ca3127ab32a02692' '0db37a14521be729411a767f157fbd07adb738b14006277def53a1efe4dacfb8' 'fd93291bfc9985f0a1bb288472866aa0a9bcd259e024c3a29d20ca158bc08403' @@ -54,14 +58,14 @@ sha256sums=('05fe38d10dc8966f19806f001561edc057e757656ed37e08ca3127ab32a02692' 'a89566307e1c81c24f037d854cbd472d2f94f8a4b759877a01563a332319f7d6' '70b1d952d1ea8ade6b5561e6de781cfbfe3a86a116c10ea9774cfae73281c7a6' 'd30321a1b490500483b8ed7825fcff2c24a7c760ac627789ff517693888ec3c5' - 'e4c2c618f5484ba165776b747befadd101e40cfdbe4bc01cbb6d3e22beb6ab65' - '05ead7af1f631df8bcb690dfd4404fe8459e7757d744af0748b4e5a2e8b171e7') + 'e4c2c618f5484ba165776b747befadd101e40cfdbe4bc01cbb6d3e22beb6ab65' + '8b665387245531d4d25ffee9636a3735667876937238c376d7eece97f7a82c14' + '2199300cc27b6b407e46206abd181b2be2679d2520ddd183e4a37a3fc691739a') prepare() { cd "lightdm-${pkgver}" patch -Np1 -i ../lightdm-default-config.patch - # patch -p1 -i "${srcdir}"/0002-Fix-separator-error.patch # Do not use Ubuntu's language-tools sed -i '/04_language_handling.patch/d' debian/patches/series @@ -156,31 +160,36 @@ package_lightdm-guest() { install -m 644 ../lightdm.sysusers "${pkgdir}"/usr/lib/sysusers.d/lightdm.conf install -m 644 ../lightdm.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/lightdm.conf - # Additional LightDM configuration files - install -dm755 "${pkgdir}"/etc/lightdm/lightdm.conf.d/ - install -m644 debian/50-{xserver-command,greeter-wrapper,guest-wrapper,disable-log-backup}.conf \ + # Additional LightDM configuration files + install -dm755 "${pkgdir}"/etc/lightdm/lightdm.conf.d/ + install -m644 debian/50-{xserver-command,greeter-wrapper,guest-wrapper,disable-log-backup}.conf \ "${pkgdir}"/etc/lightdm/lightdm.conf.d/ - # Install binaries and scripts - install -dm755 "${pkgdir}"/usr/bin/ - install -m755 debian/guest-account.sh "${pkgdir}"/usr/bin/guest-account - install -m755 debian/guest-session-auto.sh "${pkgdir}"/usr/lib/lightdm/ - install -m755 debian/lightdm-session "${pkgdir}"/usr/bin/ - install -m755 debian/lightdm-greeter-session "${pkgdir}"/usr/lib/lightdm/ - install -m755 debian/config-error-dialog.sh "${pkgdir}"/usr/lib/lightdm/ - - # Skeleton files for guest account - install -dm755 "${pkgdir}"/usr/share/lightdm/guest-session/skel/.config/autostart/ - install -m644 debian/guest-session-startup.desktop \ + # Install binaries and scripts + install -dm755 "${pkgdir}"/usr/bin/ + install -m755 debian/guest-account.sh "${pkgdir}"/usr/bin/guest-account + install -m755 debian/guest-session-auto.sh "${pkgdir}"/usr/lib/lightdm/ + install -m755 debian/lightdm-session "${pkgdir}"/usr/bin/ + install -m755 debian/lightdm-greeter-session "${pkgdir}"/usr/lib/lightdm/ + install -m755 debian/config-error-dialog.sh "${pkgdir}"/usr/lib/lightdm/ + + # Skeleton files for guest account + install -dm755 "${pkgdir}"/usr/share/lightdm/guest-session/skel/.config/autostart/ + install -m644 debian/guest-session-startup.desktop \ "${pkgdir}"/usr/share/lightdm/guest-session/skel/.config/autostart/ - install -m755 debian/guest-session-setup.sh \ + install -m755 debian/guest-session-setup.sh \ "${pkgdir}"/usr/share/lightdm/guest-session/setup.sh - # Create GSettings defaults directory - install -dm755 "${pkgdir}"/etc/guest-session/gsettings/ + # Create GSettings defaults directory + install -dm755 "${pkgdir}"/etc/guest-session/gsettings/ + + # Remove apparmor stuff + rm -rvf "${pkgdir}"/etc/apparmor.d/ - # Remove apparmor stuff - rm -rvf "${pkgdir}"/etc/apparmor.d/ + # Install autologin systemd service + cd /$srcdir + install -Dm755 $_add_group.script $pkgdir/usr/bin/$_add_group + install -Dm644 $_add_group.service $pkgdir/etc/systemd/system/$_add_group.service } package_liblightdm-qt5-guest() { diff --git a/add-autologin-group.install b/add-autologin-group.install new file mode 100644 index 000000000000..c70fc5f03b74 --- /dev/null +++ b/add-autologin-group.install @@ -0,0 +1,45 @@ +# Colored makepkg-like functions +msg_blue() { + printf "${blue}==>${bold} $1${all_off}\n" +} + +note() { + printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" +} + +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +blue="${bold}$(tput setaf 4)" +yellow="${bold}$(tput setaf 3)" + +post_install() { + + systemctl is-active add-autologin-group >/dev/null || systemctl enable add-autologin-group + + echo "" + note "We have enabled autologin for all users." + note "Reboot your system the first time, so changes will take affect." + echo "" +} + +post_upgrade() { + + post_install +} + +post_remove() { + + ! systemctl is-active add-autologin-group >/dev/null || systemctl disable add-autologin-group + + grep autologin /etc/group + if [[ "$?" -eq 0 ]]; then + groupdel autologin >/dev/null + else echo "" + note"Autologin group already removed" + echo "" + echo "" + note "We have disabled autologin for all users and removed autologin group." + note "Reboot your system, so changes will take affect." + echo "" + fi +} diff --git a/add-autologin-group.script b/add-autologin-group.script new file mode 100644 index 000000000000..164edb6344ce --- /dev/null +++ b/add-autologin-group.script @@ -0,0 +1,36 @@ +#!/bin/bash + +##Bash script to add autologin group into /etc/group and after creation add all users present in /etc/paswd. Systemd service + +#Collect users +_users=$(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd) + +#Check if autologin group not exist and if not do the job +install() { +grep "autologin" /etc/group + if [ "$?" -eq 1 ]; then + #Add autologin group + groupadd -r autologin + #Add users + for i in $_users; do + gpasswd -a $i autologin + done + fi +} + +#Check if a new user is created +check-new-user() { + for i in $_users ; do + if groups $i | grep &>/dev/null '\bautologin\b'; then + : #echo "User $i ok" + else gpasswd -a $i autologin + fi + done +} + +#Job +grep autologin /etc/group + if [ "$?" -eq 1 ]; then + install + else check-new-user + fi diff --git a/add-autologin-group.service b/add-autologin-group.service new file mode 100644 index 000000000000..403dfed02e6f --- /dev/null +++ b/add-autologin-group.service @@ -0,0 +1,9 @@ +[Unit] +Description=Check if autologin group exist and also add the users. + +[Service] +Type=oneshot +ExecStart=/usr/bin/add-autologin-group + +[Install] +WantedBy=multi-user.target diff --git a/lightdm.install b/lightdm.install deleted file mode 100644 index c130f4771ccc..000000000000 --- a/lightdm.install +++ /dev/null @@ -1,17 +0,0 @@ -post_install() { - if ! getent group lightdm &>/dev/null; then - groupadd -g 620 lightdm - fi - - if ! getent passwd lightdm &>/dev/null; then - useradd -c 'Light Display Manager' -u 620 -g lightdm -d /var/lib/lightdm -s /usr/bin/nologin lightdm - fi - - passwd -l lightdm > /dev/null - - systemd-tmpfiles --create /usr/lib/tmpfiles.d/lightdm.conf -} - -post_upgrade() { - post_install -} |