livecd-rootfs/live-build/ubuntu-touch/hooks/02-add_user_to_groups.chroot
Colin Watson f00349b766 Import patches-unapplied version 2.125 to ubuntu/saucy-proposed
Imported using git-ubuntu import.

Changelog parent: 65b7f7a10a9bd05c60185f5c282af1a4c4efff57

New changelog entries:
  * live-build/auto/config: Add basic ubuntu-touch enablement (based on
    patch from Oliver Grawert, for which thanks).
  * live-build/auto/config, live-build/ubuntu-touch: Copy a huge pile of
    customisation by Ricardo Salveti from
    lp:~phablet-team/touch-preview-images/ubuntu-build-phablet, which should
    be close to enough for the architecture-independent parts of
    ubuntu-touch builds.
2013-05-01 19:33:32 +00:00

116 lines
3.2 KiB
Bash
Executable File

#!/bin/sh -x
USER=phablet
DEFGROUPS="tty,admin,adm,dialout,cdrom,plugdev,audio,dip,video,android_net,android_net2,android_net3,android_graphics,android_input,sdcard_rw"
/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 "^tty" /etc/group
if [ $? -eq 0 ]; then
echo "User tty exists in /etc/group"
else
echo "User tty does not exists in /etc/group must create"
groupadd tty
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 "^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 "^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 "^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 "^android_net" /etc/group
if [ $? -eq 0 ]; then
echo "User android_net exists in /etc/group"
else
echo "User android_net does not exist in /etc/group -- must create"
groupadd -g 3003 android_net
fi
/bin/egrep -i "^android_net2" /etc/group
if [ $? -eq 0 ]; then
echo "User android_net2 exists in /etc/group"
else
echo "User android_net2 does not exist in /etc group -- must create"
groupadd -g 3004 android_net2
fi
/bin/egrep -i "^android_net3" /etc/group
if [ $? -eq 0 ]; then
echo "User android_net3 exists in /etc/group"
else
echo "User android_net3 does not exist in /etc group -- must create"
groupadd -g 3002 android_net3
fi
/bin/egrep -i "^android_graphics" /etc/group
if [ $? -eq 0 ]; then
echo "User android_graphics exists in /etc/group"
else
echo "User android_graphics does not exist in /etc group -- must create"
groupadd -g 1003 android_graphics
fi
/bin/egrep -i "^android_input" /etc/group
if [ $? -eq 0 ]; then
echo "User android_input exists in /etc/group"
else
echo "User android_input does not exist in /etc group -- must create"
groupadd -g 1004 android_input
fi
/bin/egrep -i "^sdcard_rw" /etc/group
if [ $? -eq 0 ]; then
echo "User sdcard_rw exists in /etc/group"
else
echo "User sdcard_rw does not exist in /etc group -- must create"
groupadd -g 1015 sdcard_rw
fi
echo "I: add $USER to ($DEFGROUPS) groups"
usermod -a -G ${DEFGROUPS} ${USER}