summaryrefslogtreecommitdiff
path: root/jessie-arm64-developer
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2015-01-21 14:51:19 +0200
committerFathi Boudra <fathi.boudra@linaro.org>2015-01-21 14:51:19 +0200
commit94c9e6b5ef143a2992647ccc5cfb3f4ee13c6131 (patch)
tree0a1c55ec622326bc8c51af8f09d6568e116e5d8f /jessie-arm64-developer
parent145be7c52df93d10707d0cd2a6f82107bafd96c4 (diff)
Add initial configuration for Jessie arm64 Developer
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'jessie-arm64-developer')
-rwxr-xr-xjessie-arm64-developer/Makefile35
-rw-r--r--jessie-arm64-developer/README16
-rwxr-xr-xjessie-arm64-developer/configure41
-rw-r--r--jessie-arm64-developer/customization/archives/linaro-overlay-repo.key.chroot18
-rw-r--r--jessie-arm64-developer/customization/archives/linaro-overlay-repo.list.chroot2
-rwxr-xr-xjessie-arm64-developer/customization/hooks/01-setup_user_linaro.chroot7
-rwxr-xr-xjessie-arm64-developer/customization/hooks/02-add_linaro_to_groups.chroot63
-rwxr-xr-xjessie-arm64-developer/customization/hooks/03-check_sudoers_for_admin.chroot17
-rwxr-xr-xjessie-arm64-developer/customization/hooks/04-lava_test.chroot13
-rwxr-xr-xjessie-arm64-developer/customization/hooks/20-extract_initrd_uuid.binary29
-rwxr-xr-xjessie-arm64-developer/customization/hooks/52-remove_etc_parts.binary14
-rwxr-xr-xjessie-arm64-developer/customization/hooks/99-cleanup_proxy.binary5
-rw-r--r--jessie-arm64-developer/customization/includes.chroot/etc/default/locale1
-rw-r--r--jessie-arm64-developer/customization/includes.chroot/etc/hostname1
-rw-r--r--jessie-arm64-developer/customization/includes.chroot/etc/hosts7
-rwxr-xr-xjessie-arm64-developer/customization/includes.chroot/etc/rc.local17
-rw-r--r--jessie-arm64-developer/customization/package-lists/linaro-developer.list.chroot81
17 files changed, 367 insertions, 0 deletions
diff --git a/jessie-arm64-developer/Makefile b/jessie-arm64-developer/Makefile
new file mode 100755
index 0000000..c7b0f42
--- /dev/null
+++ b/jessie-arm64-developer/Makefile
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# (C) 2012-2015 Fathi Boudra <fathi.boudra@linaro.org>
+
+# Calls all necessary live-build programs in the correct order to complete
+# the bootstrap, chroot, binary, and source stage.
+
+# You need live-build package installed and superuser privileges.
+
+BUILD_NUMBER?=1
+BASEIMG=linaro-jessie-developer
+IMAGEPREFIX=$(BASEIMG)-`date +%Y%m%d`-$(BUILD_NUMBER)
+LOGFILE=$(IMAGEPREFIX).build-log.txt
+CONFIGFILE=$(IMAGEPREFIX).config.tar.bz2
+LISTFILE=$(IMAGEPREFIX).contents
+PKGSFILE=$(IMAGEPREFIX).packages
+TARGZFILE=$(IMAGEPREFIX).tar.gz
+MD5SUMSFILE=$(IMAGEPREFIX).md5sums.txt
+SHA1SUMSFILE=$(IMAGEPREFIX).sha1sums.txt
+
+all:
+ set -e; sudo lb build 2>&1 | tee $(LOGFILE)
+ if [ -f binary-tar.tar.gz ]; then \
+ tar -jcf $(CONFIGFILE) auto/ config/ configure; \
+ sudo mv binary.contents $(LISTFILE); \
+ sudo mv chroot.packages.live $(PKGSFILE); \
+ sudo mv binary-tar.tar.gz $(TARGZFILE); \
+ md5sum $(LOGFILE) $(CONFIGFILE) $(LISTFILE) $(PKGSFILE) $(TARGZFILE) > $(MD5SUMSFILE); \
+ sha1sum $(LOGFILE) $(CONFIGFILE) $(LISTFILE) $(PKGSFILE) $(TARGZFILE) > $(SHA1SUMSFILE); \
+ fi
+
+clean:
+ sudo lb clean --purge
+ rm -f $(BASEIMG)-*
+ rm -rf config
diff --git a/jessie-arm64-developer/README b/jessie-arm64-developer/README
new file mode 100644
index 0000000..917e1f3
--- /dev/null
+++ b/jessie-arm64-developer/README
@@ -0,0 +1,16 @@
+* To build binary image:
+ * install live-build qemu-user-static
+ * run configure
+ * run make
+
+* Scripts:
+ * configure
+ * Makefile
+
+* Configuration Layout
+
+`-- ./config
+
+* Customization Layout
+
+`-- ./customization
diff --git a/jessie-arm64-developer/configure b/jessie-arm64-developer/configure
new file mode 100755
index 0000000..2155cf1
--- /dev/null
+++ b/jessie-arm64-developer/configure
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# (C) 2012-2015 Fathi Boudra <fathi.boudra@linaro.org>
+
+# Create configuration for live-build.
+
+# You need live-build package installed.
+
+set -e
+
+echo "I: create configuration"
+export LB_BOOTSTRAP_INCLUDE="apt-transport-https gnupg"
+lb config \
+ --apt-indices none \
+ --apt-secure false \
+ --architectures arm64 \
+ --archive-areas 'main contrib non-free' \
+ --binary-filesystem ext4 \
+ --binary-images tar \
+ --bootappend-live "hostname=linaro-developer username=linaro" \
+ --bootstrap-qemu-arch arm64 \
+ --bootstrap-qemu-static /usr/bin/qemu-aarch64-static \
+ --cache false \
+ --chroot-filesystem none \
+ --compression gzip \
+ --debootstrap-options "--variant=minbase" \
+ --distribution jessie \
+ --gzip-options '-9 --rsyncable' \
+ --iso-publisher 'Linaro; http://www.linaro.org/; linaro-dev@lists.linaro.org' \
+ --iso-volume 'Linaro Jessie $(date +%Y%m%d-%H:%M)' \
+ --linux-flavours none \
+ --linux-packages none \
+ --mode debian \
+ --security false \
+ --system normal \
+ --updates false
+
+echo "I: copy customization"
+test -d customization && cp -rf customization/* config/
+
+echo "I: done"
diff --git a/jessie-arm64-developer/customization/archives/linaro-overlay-repo.key.chroot b/jessie-arm64-developer/customization/archives/linaro-overlay-repo.key.chroot
new file mode 100644
index 0000000..31f1900
--- /dev/null
+++ b/jessie-arm64-developer/customization/archives/linaro-overlay-repo.key.chroot
@@ -0,0 +1,18 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.12 (GNU/Linux)
+
+mQENBFFKYd4BCAD1znxWHazOdG+F4BSPXdT3OrX3bwScw7ZVpyY9v4kNJwpr/PSj
+BICrpFPY0OkX7TjvtFAGTJF8YA0hnq5GFA2YVCRd1Xplz0zeS/ktMDEYEBA1B4Mk
+1wzX1Kp7LyJEntYBtd9g0Ge3f8Z4DCOTG15RnEONYXtbqdZ6xHGwDJtxyzU+ZPaH
+RfxGDdHlIKmCaV4W17zXoJOW7KIR1NwakfgBBUgPVH+i1iuIvtniKe6mAvAUDfmN
+DOMaMgofzIshKkq1wncwBmW81eW9Mg+JzTZaa0XAah1anbdCMoCS91txG2O3Gj1z
+OF1tY0WXYL9oPeBxDoN+KgKPyehKiSRwQ+0XABEBAAG0E0xpbmFybyByZXBvc2l0
+b3JpZXOJATgEEwECACIFAlFKYd4CGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheA
+AAoJEOE9iPfjwdVsqAoH/RGrCKW1b9jImsxVUqrBfHPekiFk44JiG04f46qY7u/l
+ZiWgsayBcE9JInUQF7GWYVamgj55263mOZfsezxEtxr+KWz0ny6miyQH+51XpI74
+8+6ljExfnYR/Fdkiplcc+Fr5oGWBZXNmTedo0nYWl3aVsjCgl7/wMt/hwbx3J/aA
+66/CmG2IMAEwbXdedrk+hiTNBjBaaKnkiqCX7fOstE1Ie0q7ro6d0nhkZezxVK1a
+GSOsIE2xtTOPlVp9k3YmxVVisZIRjIcEJu6YnuBI2G4MaOh6RJTQpw9Hprr58Z6v
+vzJBYZzXnLMl7RrXEw0NIYmPcEM6m5cphUlDpRBd8Tg=
+=dkH9
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/jessie-arm64-developer/customization/archives/linaro-overlay-repo.list.chroot b/jessie-arm64-developer/customization/archives/linaro-overlay-repo.list.chroot
new file mode 100644
index 0000000..f36c472
--- /dev/null
+++ b/jessie-arm64-developer/customization/archives/linaro-overlay-repo.list.chroot
@@ -0,0 +1,2 @@
+#deb http://repo.linaro.org/ubuntu/linaro-overlay @DISTRIBUTION@ main
+#deb-src http://repo.linaro.org/ubuntu/linaro-overlay @DISTRIBUTION@ main
diff --git a/jessie-arm64-developer/customization/hooks/01-setup_user_linaro.chroot b/jessie-arm64-developer/customization/hooks/01-setup_user_linaro.chroot
new file mode 100755
index 0000000..9c65f97
--- /dev/null
+++ b/jessie-arm64-developer/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/jessie-arm64-developer/customization/hooks/02-add_linaro_to_groups.chroot b/jessie-arm64-developer/customization/hooks/02-add_linaro_to_groups.chroot
new file mode 100755
index 0000000..f3b2d4e
--- /dev/null
+++ b/jessie-arm64-developer/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/jessie-arm64-developer/customization/hooks/03-check_sudoers_for_admin.chroot b/jessie-arm64-developer/customization/hooks/03-check_sudoers_for_admin.chroot
new file mode 100755
index 0000000..5c82429
--- /dev/null
+++ b/jessie-arm64-developer/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/jessie-arm64-developer/customization/hooks/04-lava_test.chroot b/jessie-arm64-developer/customization/hooks/04-lava_test.chroot
new file mode 100755
index 0000000..6113b2e
--- /dev/null
+++ b/jessie-arm64-developer/customization/hooks/04-lava_test.chroot
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+echo "I: run apt-get update"
+apt-get update
+
+echo "I: install extra package"
+apt-get install --yes build-essential git
+
+echo "I: install tests"
+#nano_tests=(pwrmgmt gatortests perf device-tree)
+#for nano_test in ${nano_tests[@]}; do
+# echo "lava-test install ${nano_test}"
+#done
diff --git a/jessie-arm64-developer/customization/hooks/20-extract_initrd_uuid.binary b/jessie-arm64-developer/customization/hooks/20-extract_initrd_uuid.binary
new file mode 100755
index 0000000..fee2b1b
--- /dev/null
+++ b/jessie-arm64-developer/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/jessie-arm64-developer/customization/hooks/52-remove_etc_parts.binary b/jessie-arm64-developer/customization/hooks/52-remove_etc_parts.binary
new file mode 100755
index 0000000..fbdfd07
--- /dev/null
+++ b/jessie-arm64-developer/customization/hooks/52-remove_etc_parts.binary
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+cd binary
+
+#echo "I: rm /etc/X11 and /etc/firefox"
+#rm -rf ./etc/X11
+#rm -rf ./etc/firefox
+
+echo "I: rm /etc/init/tty[2-6].conf"
+rm -f ./etc/init/tty2.conf
+rm -f ./etc/init/tty3.conf
+rm -f ./etc/init/tty4.conf
+rm -f ./etc/init/tty5.conf
+rm -f ./etc/init/tty6.conf
diff --git a/jessie-arm64-developer/customization/hooks/99-cleanup_proxy.binary b/jessie-arm64-developer/customization/hooks/99-cleanup_proxy.binary
new file mode 100755
index 0000000..751faf5
--- /dev/null
+++ b/jessie-arm64-developer/customization/hooks/99-cleanup_proxy.binary
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo "I: Clean up proxy"
+sed -i "s|localhost:3142/||" ./binary/etc/apt/sources.list
+sed -i "s|localhost:3142/||" ./binary/etc/apt/sources.list.d/*.list
diff --git a/jessie-arm64-developer/customization/includes.chroot/etc/default/locale b/jessie-arm64-developer/customization/includes.chroot/etc/default/locale
new file mode 100644
index 0000000..f9c983c
--- /dev/null
+++ b/jessie-arm64-developer/customization/includes.chroot/etc/default/locale
@@ -0,0 +1 @@
+LANG=C.UTF-8
diff --git a/jessie-arm64-developer/customization/includes.chroot/etc/hostname b/jessie-arm64-developer/customization/includes.chroot/etc/hostname
new file mode 100644
index 0000000..bafc623
--- /dev/null
+++ b/jessie-arm64-developer/customization/includes.chroot/etc/hostname
@@ -0,0 +1 @@
+linaro-developer
diff --git a/jessie-arm64-developer/customization/includes.chroot/etc/hosts b/jessie-arm64-developer/customization/includes.chroot/etc/hosts
new file mode 100644
index 0000000..135dd9d
--- /dev/null
+++ b/jessie-arm64-developer/customization/includes.chroot/etc/hosts
@@ -0,0 +1,7 @@
+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-developer
diff --git a/jessie-arm64-developer/customization/includes.chroot/etc/rc.local b/jessie-arm64-developer/customization/includes.chroot/etc/rc.local
new file mode 100755
index 0000000..bd2c208
--- /dev/null
+++ b/jessie-arm64-developer/customization/includes.chroot/etc/rc.local
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+#
+# rc.local
+#
+# This script is executed at the end of each multiuser runlevel.
+# Make sure that the script will "exit 0" on success or any other
+# value on error.
+#
+# In order to enable or disable this script just change the execution
+# bits.
+#
+# By default this script does nothing.
+
+# Generate the SSH keys if non-existent
+test -f /etc/ssh/ssh_host_dsa_key || dpkg-reconfigure openssh-server
+
+exit 0
diff --git a/jessie-arm64-developer/customization/package-lists/linaro-developer.list.chroot b/jessie-arm64-developer/customization/package-lists/linaro-developer.list.chroot
new file mode 100644
index 0000000..080d715
--- /dev/null
+++ b/jessie-arm64-developer/customization/package-lists/linaro-developer.list.chroot
@@ -0,0 +1,81 @@
+# Packages needed for Linaro - Developer
+adduser
+alsa-utils
+apt
+apt-utils
+babeltrace
+bluez
+btrfs-tools
+build-essential
+bzip2
+console-setup
+cpufrequtils
+crda
+curl
+debconf
+debconf-i18n
+debian-keyring
+#devmem2
+eject
+fbset
+gdb
+gdbserver
+git
+gnupg
+hostapd
+i2c-tools
+idlestat
+ifupdown
+initramfs-tools
+initscripts
+input-utils
+iotop
+iproute2
+iputils-ping
+isc-dhcp-client
+iw
+kbd
+kmod
+less
+#linaro-overlay-minimal
+lm-sensors
+lsb-release
+lsof
+#ltrace
+makedev
+mawk
+module-init-tools
+mountall
+#mutrace
+net-tools
+netbase
+netcat-openbsd
+netperf
+ntpdate
+obexftp
+obexpushd
+openssh-client
+openssh-server
+#oprofile
+powerdebug
+powertop
+procps
+python-minimal
+python3
+resolvconf
+rsyslog
+rt-app
+strace
+sudo
+trace-cmd
+#ubuntu-keyring
+udev
+#ureadahead
+usbutils
+user-setup
+vim
+vim-tiny
+wget
+whiptail
+wireless-tools
+wpasupplicant