summaryrefslogtreecommitdiff
path: root/sid-arm64-blend/customization/hooks/02-add_linaro_to_groups.chroot
blob: ad43cb7c07f796396ea5a53e78c201ad705a1d9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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