summaryrefslogtreecommitdiff
path: root/jessie-arm64-ros/customization/hooks/02-add_linaro_to_groups.chroot
diff options
context:
space:
mode:
Diffstat (limited to 'jessie-arm64-ros/customization/hooks/02-add_linaro_to_groups.chroot')
-rwxr-xr-xjessie-arm64-ros/customization/hooks/02-add_linaro_to_groups.chroot77
1 files changed, 77 insertions, 0 deletions
diff --git a/jessie-arm64-ros/customization/hooks/02-add_linaro_to_groups.chroot b/jessie-arm64-ros/customization/hooks/02-add_linaro_to_groups.chroot
new file mode 100755
index 0000000..fb20bdd
--- /dev/null
+++ b/jessie-arm64-ros/customization/hooks/02-add_linaro_to_groups.chroot
@@ -0,0 +1,77 @@
+#!/bin/sh -x
+
+DEFGROUPS="admin,adm,dialout,cdrom,audio,dip,video,plugdev,bluetooth,pulse-access"
+
+/bin/egrep -i "^admin" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User admin exists in /etc/group"
+else
+ echo "User admin does not exists in /etc/group must create"
+ groupadd admin
+fi
+/bin/egrep -i "^adm" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User adm exists in /etc/group"
+else
+ echo "User adm does not exists in /etc/group must create"
+ groupadd adm
+fi
+/bin/egrep -i "^dialout" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User dialout exists in /etc/group"
+else
+ echo "User dialout does not exists in /etc/group must create"
+ groupadd dialout
+fi
+/bin/egrep -i "^cdrom" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User cdrom exists in /etc/group"
+else
+ echo "User cdrom does not exists in /etc/group must create"
+ groupadd cdrom
+fi
+/bin/egrep -i "^audio" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User audio exists in /etc/group"
+else
+ echo "User audio does not exists in /etc/group must create"
+ groupadd audio
+fi
+/bin/egrep -i "^dip" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User dip exists in /etc/group"
+else
+ echo "User dip does not exists in /etc/group must create"
+ groupadd dip
+fi
+/bin/egrep -i "^video" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User video exists in /etc/group"
+else
+ echo "User video does not exists in /etc/group must create"
+ groupadd video
+fi
+/bin/egrep -i "^plugdev" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User plugdev exists in /etc/group"
+else
+ echo "User plugdev does not exists in /etc/group must create"
+ groupadd plugdev
+fi
+/bin/egrep -i "^bluetooth" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User bluetooth exists in /etc/group"
+else
+ echo "User bluetooth does not exists in /etc/group must create"
+ groupadd bluetooth
+fi
+/bin/egrep -i "^pulse-access" /etc/group
+if [ $? -eq 0 ]; then
+ echo "User pulse-access exists in /etc/group"
+else
+ echo "User pulse-access does not exists in /etc/group must create"
+ groupadd pulse-access
+fi
+
+echo "I: add linaro to ($DEFGROUPS) groups"
+usermod -a -G ${DEFGROUPS} linaro