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.
This commit is contained in:
Bhushan Shah 2018-05-16 16:19:29 +05:30 committed by Oliver Smith
parent ea03a32298
commit 26808e4d6a
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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)