summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fabo@debian.org>2012-03-04 14:16:23 +0200
committerFathi Boudra <fabo@debian.org>2012-03-04 14:16:23 +0200
commite5a5f926f1927d76e44614c5810f4bb98e3ac930 (patch)
tree4971956942f4a403cbf05a262ca36db6bacce06e
parente648ddc9bcef6d49dd52465c326f57203e23db55 (diff)
customization: add hooks and includes
fix hostname: linaro -> linaro-ubuntu-desktop
-rwxr-xr-xprecise-armhf-ubuntu-desktop/configure2
-rwxr-xr-xprecise-armhf-ubuntu-desktop/customization/hooks/01-setup_user_linaro.chroot7
-rwxr-xr-xprecise-armhf-ubuntu-desktop/customization/hooks/02-add_linaro_to-groups.chroot63
-rwxr-xr-xprecise-armhf-ubuntu-desktop/customization/hooks/03-check_sudoers_for_admin.chroot17
-rwxr-xr-xprecise-armhf-ubuntu-desktop/customization/hooks/05-setsudomode.chroot3
-rwxr-xr-xprecise-armhf-ubuntu-desktop/customization/hooks/20-extract-initrd-uuid.binary29
-rw-r--r--precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/default/locale1
-rw-r--r--precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hostname1
-rw-r--r--precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hosts8
-rw-r--r--precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/lightdm/lightdm.conf5
10 files changed, 135 insertions, 1 deletions
diff --git a/precise-armhf-ubuntu-desktop/configure b/precise-armhf-ubuntu-desktop/configure
index 5d6cbeb..8fa4018 100755
--- a/precise-armhf-ubuntu-desktop/configure
+++ b/precise-armhf-ubuntu-desktop/configure
@@ -23,7 +23,7 @@ lb config \
--chroot-filesystem none \
--distribution precise \
--gzip-options '-9 --rsyncable' \
- --hostname linaro \
+ --hostname linaro-ubuntu-desktop \
--linux-flavours none \
--linux-packages none \
--mode ubuntu \
diff --git a/precise-armhf-ubuntu-desktop/customization/hooks/01-setup_user_linaro.chroot b/precise-armhf-ubuntu-desktop/customization/hooks/01-setup_user_linaro.chroot
new file mode 100755
index 0000000..9c65f97
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/hooks/01-setup_user_linaro.chroot
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+echo "I: create linaro user"
+adduser --gecos linaro --disabled-login linaro
+
+echo "I: set linaro user password"
+echo "linaro:linaro" | chpasswd
diff --git a/precise-armhf-ubuntu-desktop/customization/hooks/02-add_linaro_to-groups.chroot b/precise-armhf-ubuntu-desktop/customization/hooks/02-add_linaro_to-groups.chroot
new file mode 100755
index 0000000..f3b2d4e
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/hooks/02-add_linaro_to-groups.chroot
@@ -0,0 +1,63 @@
+#!/bin/sh -x
+
+DEFGROUPS="admin,adm,dialout,cdrom,plugdev,audio,dip,video"
+
+/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 "^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
+
+echo "I: add linaro to ($DEFGROUPS) groups"
+usermod -a -G ${DEFGROUPS} linaro
diff --git a/precise-armhf-ubuntu-desktop/customization/hooks/03-check_sudoers_for_admin.chroot b/precise-armhf-ubuntu-desktop/customization/hooks/03-check_sudoers_for_admin.chroot
new file mode 100755
index 0000000..5c82429
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/hooks/03-check_sudoers_for_admin.chroot
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# check to make sure sudoers file has ref for admin
+ADMINEXISTS="$(awk '$1 == "%admin" { print $1 }' /etc/sudoers)"
+if [ -z "$ADMINEXISTS" ]; then
+ # append admin entry to sudoers
+ echo "# Members of the admin group may gain root privileges" >> /etc/sudoers
+ echo "%admin ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
+fi
+
+# make sure that NOPASSWD is set for %admin
+# expecially in the case that we didn't add it to /etc/sudoers
+# just blow the %admin line away and force it to be NOPASSWD
+sed -i -e '
+/\%admin/ c \
+%admin ALL = (ALL) NOPASSWD: ALL
+' /etc/sudoers
diff --git a/precise-armhf-ubuntu-desktop/customization/hooks/05-setsudomode.chroot b/precise-armhf-ubuntu-desktop/customization/hooks/05-setsudomode.chroot
new file mode 100755
index 0000000..ee02901
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/hooks/05-setsudomode.chroot
@@ -0,0 +1,3 @@
+#!/bin/sh -x
+
+gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/gksu/sudo-mode true
diff --git a/precise-armhf-ubuntu-desktop/customization/hooks/20-extract-initrd-uuid.binary b/precise-armhf-ubuntu-desktop/customization/hooks/20-extract-initrd-uuid.binary
new file mode 100755
index 0000000..fee2b1b
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/hooks/20-extract-initrd-uuid.binary
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+mkdir -p uuid
+cd uuid
+
+prefix=
+
+if ls ../binary/casper/initrd.img-* 2>&1 > /dev/null; then
+ prefix=../binary/boot/filesystem.dir/casper/
+else
+ prefix=../binary/boot/filesystem.dir/boot/
+fi
+
+UUID=`uuidgen -r`
+
+for initrd in `ls $prefix/initrd.img-*`; do
+ zcat $initrd | cpio --quiet -id
+ echo $UUID > conf/uuid.conf
+ find . | cpio --quiet --dereference -o -H newc | gzip > $initrd
+ rm -rf *
+done
+
+echo "I: setting rootfs UUID $UUID in initrd... copying to '.disk/casper-uuid'."
+if [ ! -d ../binary/boot/filesystem.dir/.disk ]; then
+ mkdir -p ../binary/boot/filesystem.dir/.disk
+fi
+echo $UUID > ../binary/boot/filesystem.dir/.disk/casper-uuid
+cd ..
+rm -rf uuid
diff --git a/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/default/locale b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/default/locale
new file mode 100644
index 0000000..f9c983c
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/default/locale
@@ -0,0 +1 @@
+LANG=C.UTF-8
diff --git a/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hostname b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hostname
new file mode 100644
index 0000000..e78067c
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hostname
@@ -0,0 +1 @@
+linaro-ubuntu-desktop
diff --git a/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hosts b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hosts
new file mode 100644
index 0000000..31ec184
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/hosts
@@ -0,0 +1,8 @@
+127.0.0.1 localhost
+::1 localhost ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+127.0.1.1 linaro-ubuntu-desktop
+
diff --git a/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/lightdm/lightdm.conf b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/lightdm/lightdm.conf
new file mode 100644
index 0000000..f11302d
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop/customization/includes/precise/common/boot/filesystem.dir/etc/lightdm/lightdm.conf
@@ -0,0 +1,5 @@
+
+[SeatDefaults]
+greeter-session=unity-greeter
+user-session=ubuntu
+autologin-user=linaro