From 26808e4d6a20e4e852416875a7578a9688ccf073 Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Wed, 16 May 2018 16:19:29 +0530 Subject: [PATCH] pmb: Add user to plugdev group and create it This allows the user to talk to networkmanager to manage the system connections. As it is mentioned in networkmanager pre-install. ``` Executing networkmanager-1.10.6-r0.pre-install * * To setup system connections, regular users must be member of 'plugdev' group. ``` The plugdev group gets created in the post-install hook of networkmanager. Not all UIs depend on networkmanager, which means that the group may not exist at installation time when we try to add the user to the group in the python code. Therefore we create the group first. --- pmb/config/__init__.py | 3 +-- pmb/install/_install.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 72e6761a..3f6d34a6 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -289,8 +289,7 @@ install_device_packages = [ ] # Groups for the default user -install_user_groups = ["wheel", "video", "audio", "input"] - +install_user_groups = ["wheel", "video", "audio", "input", "plugdev"] # # FLASH diff --git a/pmb/install/_install.py b/pmb/install/_install.py index bb88820f..ff6f1e1e 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -185,6 +185,8 @@ def set_user(args): pmb.chroot.root(args, ["adduser", "-D", "-u", "1000", args.user], suffix) for group in pmb.config.install_user_groups: + pmb.chroot.root(args, ["addgroup", "-S", group], suffix, + check=False) pmb.chroot.root(args, ["addgroup", args.user, group], suffix)