summaryrefslogtreecommitdiff
path: root/sid-armhf-developer/customization/hooks/02-add_linaro_to_groups.chroot
diff options
context:
space:
mode:
Diffstat (limited to 'sid-armhf-developer/customization/hooks/02-add_linaro_to_groups.chroot')
-rwxr-xr-xsid-armhf-developer/customization/hooks/02-add_linaro_to_groups.chroot18
1 files changed, 18 insertions, 0 deletions
diff --git a/sid-armhf-developer/customization/hooks/02-add_linaro_to_groups.chroot b/sid-armhf-developer/customization/hooks/02-add_linaro_to_groups.chroot
new file mode 100755
index 0000000..ad43cb7
--- /dev/null
+++ b/sid-armhf-developer/customization/hooks/02-add_linaro_to_groups.chroot
@@ -0,0 +1,18 @@
+#!/bin/sh -x
+
+DEFGROUPS="adm,dialout,cdrom,audio,dip,video,plugdev,bluetooth,pulse-access,sudo,systemd-journal,netdev,staff"
+
+IFS=','
+for group in $DEFGROUPS; do
+ /bin/egrep -i "^$group" /etc/group
+ if [ $? -eq 0 ]; then
+ echo "Group '$group' exists in /etc/group"
+ else
+ echo "Group '$group' does not exists in /etc/group, creating"
+ groupadd $group
+ fi
+done
+unset IFS
+
+echo "I: add linaro to ($DEFGROUPS) groups"
+usermod -a -G ${DEFGROUPS} linaro