From d6391791f7043ee4832012894ac8325510c9725e Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 23 Apr 2018 20:52:03 +0000 Subject: [PATCH] Set all of user's groups in "pmbootstrap install" (#1432) The postmarketos-base package used to make the user part of the "video" and "audio" groups. However, this did not work reliably, and we were adding the "wheel" group in "pmbootstrap install" anyway. Now all groups get added in "pmbootstrap install", and the names of the groups have been moved to `pmb.config.install_user_groups`. --- aports/main/postmarketos-base/APKBUILD | 2 +- aports/main/postmarketos-base/postmarketos-base.post-install | 4 ---- pmb/config/__init__.py | 3 +++ pmb/install/_install.py | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aports/main/postmarketos-base/APKBUILD b/aports/main/postmarketos-base/APKBUILD index 2f17137d..0af3d517 100644 --- a/aports/main/postmarketos-base/APKBUILD +++ b/aports/main/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base pkgver=3 -pkgrel=16 +pkgrel=17 pkgdesc="Meta package for minimal postmarketOS base" url="https://github.com/postmarketOS" arch="noarch" diff --git a/aports/main/postmarketos-base/postmarketos-base.post-install b/aports/main/postmarketos-base/postmarketos-base.post-install index 6580bff2..e4bb2dd7 100644 --- a/aports/main/postmarketos-base/postmarketos-base.post-install +++ b/aports/main/postmarketos-base/postmarketos-base.post-install @@ -76,10 +76,6 @@ touch /etc/wpa_supplicant/wpa_supplicant.conf # Enable the 'wheel' group sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers -# Add user to video group for proper framebuffer permissions -username="$(getent passwd 1000 | cut -d ":" -f 1)" -usermod -a -G video,audio "$username" - # Set chrony to quickly correct system time on first boot, if necessary if ! grep -q "makestep" /etc/chrony/chrony.conf; then echo "makestep 1 -1" >> /etc/chrony/chrony.conf diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 5c40167f..1bc22c72 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -287,6 +287,9 @@ install_device_packages = [ "ttf-droid" ] +# Groups for the default user +install_user_groups = ["wheel", "video", "audio"] + # # FLASH diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 57e08b7f..a147649e 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -184,7 +184,8 @@ def set_user(args): if not pmb.chroot.user_exists(args, args.user, suffix): pmb.chroot.root(args, ["adduser", "-D", "-u", "1000", args.user], suffix) - pmb.chroot.root(args, ["addgroup", args.user, "wheel"], suffix) + for group in pmb.config.install_user_groups: + pmb.chroot.root(args, ["addgroup", args.user, group], suffix) def setup_login(args):