From 3324c268ca01b4ad3b40a9a031bc8c51500cf35f Mon Sep 17 00:00:00 2001 From: clayton craft Date: Fri, 18 Aug 2017 08:55:30 -0700 Subject: [PATCH] Fix #396: No root autologin except for weston (#407) This commit disables root autologin for postmarketos-base and enabled root autologin for postmarketos-ui-weston (since weston-launcher is not built, weston can only be run by root). --- aports/main/postmarketos-base/APKBUILD | 4 ++-- .../postmarketos-base/postmarketos-base.post-install | 9 --------- aports/main/postmarketos-ui-weston/APKBUILD | 4 ++-- .../postmarketos-ui-weston.post-install | 11 +++++++++++ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/aports/main/postmarketos-base/APKBUILD b/aports/main/postmarketos-base/APKBUILD index 4d5c15ac..16ae8014 100644 --- a/aports/main/postmarketos-base/APKBUILD +++ b/aports/main/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base pkgver=2 -pkgrel=3 +pkgrel=4 pkgdesc="Meta package for minimal postmarketos base" url="https://github.com/postmarketOS" arch="noarch" @@ -18,4 +18,4 @@ package() { "$pkgdir"/etc/sudoers.d/postmarketos } sha512sums="c6de3b44bc45b9f9c641a7e34c69a481ee39b99ac0251cd28f2b3aae49c1a8d1ca448f4936b7942b1a8b8f7c18a5415c938098765ed8cf08456543800160e64b sudoers -2b243f7ac38b54cdbb834db45d0bb216c9343ec52aa2a0e4786cc925ef1503089fb1e8a2ca1e3dd833b8797c20c970b0e7989eea1da79d545bec36b233384315 postmarketos-base.post-install" +62d91b43c9f2c64f8eeeb8cd89a03d3d00a904c6563ea81c09aed8df0187abe71f458503716df8e78d5aaecd1205d218d2b90c982929d1c698c5d0b1d26e85e4 postmarketos-base.post-install" diff --git a/aports/main/postmarketos-base/postmarketos-base.post-install b/aports/main/postmarketos-base/postmarketos-base.post-install index 65534596..83297f62 100644 --- a/aports/main/postmarketos-base/postmarketos-base.post-install +++ b/aports/main/postmarketos-base/postmarketos-base.post-install @@ -19,15 +19,6 @@ done # Add user account adduser -u 1000 -D -h /home/user -G users user 2>/dev/null -# Autologin on tty1, let busybox autoconfigure 2-6 -autologin="root" -for i in 1 2 3 4 5 6; do - old="^tty$i::respawn:/sbin/getty 38400 tty$i" - new="# tty$i::respawn:/sbin/getty 38400 tty$i" - [ "$i" == "1" ] && new="tty1::respawn:/bin/login -f $autologin" - sed -i -e "s.$old.$new.g" /etc/inittab -done - # Adjust welcome messages /etc (unless the files have been modified) if ! apk audit /etc | grep -q etc/issue; then { diff --git a/aports/main/postmarketos-ui-weston/APKBUILD b/aports/main/postmarketos-ui-weston/APKBUILD index cb40746e..a29b69f7 100644 --- a/aports/main/postmarketos-ui-weston/APKBUILD +++ b/aports/main/postmarketos-ui-weston/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-ui-weston pkgver=1 -pkgrel=2 +pkgrel=3 pkgdesc="Meta package for weston" url="https://github.com/postmarketOS" arch="noarch" @@ -19,4 +19,4 @@ package() { "$pkgdir"/etc/profile.d/start_weston.sh || return 1 } sha512sums="c58547a8e3f184f97aabb746b6b2d4e84292809d00c2fbd16e4051f142246798cdf26a7a5861d632afaf2c103d47045aa3ba7b740157c2f0f9c2a404716252b0 start_weston.sh -430854b0591089f266d02c00986052f0ecf2e4b67e4e55fef7d7f7eff1bbdaa2322349f2f869492c6b571509b65360b3d4c8cf95f333269d829370a81fccd0f4 postmarketos-ui-weston.post-install" +94a690ed8f86c23620fa437bdcae01a851dfd9d8ffa64802be53dbb6bcd4f71cd59145f45c08a45ddd85082890095610946e6baa51fb4e9dc0b982fdc5ec2dc3 postmarketos-ui-weston.post-install" diff --git a/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install b/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install index a12da2df..1c2113be 100644 --- a/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install +++ b/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install @@ -37,3 +37,14 @@ if [ ! -f $weston_config ]; then echo "keymap_model=$deviceinfo_weston_keymap_model" >> $weston_config fi fi + +# Autologin on tty1, let busybox autoconfigure 2-6 +autologin="root" +for i in 1 2 3 4 5 6; do + old="^tty$i::respawn:/sbin/getty 38400 tty$i" + new="# tty$i::respawn:/sbin/getty 38400 tty$i" + [ "$i" == "1" ] && new="tty1::respawn:/bin/login -f $autologin" + sed -i -e "s.$old.$new.g" /etc/inittab +done + +