mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-18 22:31:36 +00:00
live-build/ubuntu-touch/hooks/02-add_user_to_groups.chroot: Fix
detection of existing groups not to misfire if there is an existing group with the desired group name as a prefix.
This commit is contained in:
parent
699ed3f6a1
commit
d3f766d5da
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -3,6 +3,9 @@ livecd-rootfs (2.148) UNRELEASED; urgency=low
|
|||||||
* live-build/ubuntu-touch/hooks/02-add_user_to_groups.chroot: Delete
|
* live-build/ubuntu-touch/hooks/02-add_user_to_groups.chroot: Delete
|
||||||
redundant code to create global static groups, which are already created
|
redundant code to create global static groups, which are already created
|
||||||
more correctly by base-passwd on every Ubuntu system.
|
more correctly by base-passwd on every Ubuntu system.
|
||||||
|
* live-build/ubuntu-touch/hooks/02-add_user_to_groups.chroot: Fix
|
||||||
|
detection of existing groups not to misfire if there is an existing
|
||||||
|
group with the desired group name as a prefix.
|
||||||
|
|
||||||
-- Colin Watson <cjwatson@ubuntu.com> Wed, 05 Jun 2013 13:11:34 +0100
|
-- Colin Watson <cjwatson@ubuntu.com> Wed, 05 Jun 2013 13:11:34 +0100
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@ USER=phablet
|
|||||||
|
|
||||||
DEFGROUPS="tty,admin,adm,dialout,cdrom,plugdev,audio,dip,video,gps,radio,bluetooth,android_net,android_net2,android_net3,android_graphics,android_input,sdcard_rw"
|
DEFGROUPS="tty,admin,adm,dialout,cdrom,plugdev,audio,dip,video,gps,radio,bluetooth,android_net,android_net2,android_net3,android_graphics,android_input,sdcard_rw"
|
||||||
|
|
||||||
/bin/egrep -i "^admin" /etc/group
|
/bin/egrep -i "^admin:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User admin exists in /etc/group"
|
echo "User admin exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User admin does not exists in /etc/group must create"
|
echo "User admin does not exists in /etc/group must create"
|
||||||
groupadd admin
|
groupadd admin
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^audio" /etc/group
|
/bin/egrep -i "^audio:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# Needed to change group id as audio is already created by ubuntu
|
# Needed to change group id as audio is already created by ubuntu
|
||||||
echo "User audio exists in /etc/group, changing gid to be android compatible"
|
echo "User audio exists in /etc/group, changing gid to be android compatible"
|
||||||
@ -20,63 +20,63 @@ else
|
|||||||
echo "User audio does not exists in /etc/group must create"
|
echo "User audio does not exists in /etc/group must create"
|
||||||
groupadd -g 1005 audio
|
groupadd -g 1005 audio
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^gps" /etc/group
|
/bin/egrep -i "^gps:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User gps exists in /etc/group"
|
echo "User gps exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User gps does not exist in /etc/group -- must create"
|
echo "User gps does not exist in /etc/group -- must create"
|
||||||
groupadd -g 1021 gps
|
groupadd -g 1021 gps
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^radio" /etc/group
|
/bin/egrep -i "^radio:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User radio exists in /etc/group"
|
echo "User radio exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User radio does not exist in /etc/group -- must create"
|
echo "User radio does not exist in /etc/group -- must create"
|
||||||
groupadd -g 1001 radio
|
groupadd -g 1001 radio
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^bluetooth" /etc/group
|
/bin/egrep -i "^bluetooth:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User bluetooth exists in /etc/group"
|
echo "User bluetooth exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User bluetooth does not exist in /etc/group -- must create"
|
echo "User bluetooth does not exist in /etc/group -- must create"
|
||||||
groupadd -g 1002 bluetooth
|
groupadd -g 1002 bluetooth
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^android_net" /etc/group
|
/bin/egrep -i "^android_net:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User android_net exists in /etc/group"
|
echo "User android_net exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User android_net does not exist in /etc/group -- must create"
|
echo "User android_net does not exist in /etc/group -- must create"
|
||||||
groupadd -g 3003 android_net
|
groupadd -g 3003 android_net
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^android_net2" /etc/group
|
/bin/egrep -i "^android_net2:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User android_net2 exists in /etc/group"
|
echo "User android_net2 exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User android_net2 does not exist in /etc group -- must create"
|
echo "User android_net2 does not exist in /etc group -- must create"
|
||||||
groupadd -g 3004 android_net2
|
groupadd -g 3004 android_net2
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^android_net3" /etc/group
|
/bin/egrep -i "^android_net3:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User android_net3 exists in /etc/group"
|
echo "User android_net3 exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User android_net3 does not exist in /etc group -- must create"
|
echo "User android_net3 does not exist in /etc group -- must create"
|
||||||
groupadd -g 3002 android_net3
|
groupadd -g 3002 android_net3
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^android_graphics" /etc/group
|
/bin/egrep -i "^android_graphics:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User android_graphics exists in /etc/group"
|
echo "User android_graphics exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User android_graphics does not exist in /etc group -- must create"
|
echo "User android_graphics does not exist in /etc group -- must create"
|
||||||
groupadd -g 1003 android_graphics
|
groupadd -g 1003 android_graphics
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^android_input" /etc/group
|
/bin/egrep -i "^android_input:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User android_input exists in /etc/group"
|
echo "User android_input exists in /etc/group"
|
||||||
else
|
else
|
||||||
echo "User android_input does not exist in /etc group -- must create"
|
echo "User android_input does not exist in /etc group -- must create"
|
||||||
groupadd -g 1004 android_input
|
groupadd -g 1004 android_input
|
||||||
fi
|
fi
|
||||||
/bin/egrep -i "^sdcard_rw" /etc/group
|
/bin/egrep -i "^sdcard_rw:" /etc/group
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "User sdcard_rw exists in /etc/group"
|
echo "User sdcard_rw exists in /etc/group"
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user