2015-12-02 20:33:32 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 Igor Pecovnik, igor.pecovnik@gma**.com
|
|
|
|
#
|
|
|
|
# This file is licensed under the terms of the GNU General Public
|
|
|
|
# License version 2. This program is licensed "as is" without any
|
|
|
|
# warranty of any kind, whether express or implied.
|
|
|
|
#
|
|
|
|
# This file is a part of tool chain https://github.com/igorpecovnik/lib
|
|
|
|
#
|
2016-02-26 17:49:02 +03:00
|
|
|
|
|
|
|
# common options
|
|
|
|
|
2016-07-08 20:14:37 +02:00
|
|
|
REVISION="5.17$SUBREVISION" # all boards have same revision
|
2016-02-26 17:49:02 +03:00
|
|
|
ROOTPWD="1234" # Must be changed @first login
|
|
|
|
MAINTAINER="Igor Pecovnik" # deb signature
|
|
|
|
MAINTAINERMAIL="igor.pecovnik@****l.com" # deb signature
|
|
|
|
SDSIZE="4000" # SD image size in MB
|
|
|
|
TZDATA=`cat /etc/timezone` # Timezone for target is taken from host or defined here.
|
|
|
|
USEALLCORES="yes" # Use all CPU cores for compiling
|
|
|
|
EXIT_PATCHING_ERROR="" # exit patching if failed
|
2016-03-17 20:16:26 +01:00
|
|
|
MISC1="https://github.com/linux-sunxi/sunxi-tools.git" # Allwinner fex compiler / decompiler
|
2016-02-26 17:49:02 +03:00
|
|
|
MISC1_DIR="sunxi-tools" # local directory
|
|
|
|
MISC5="https://github.com/hglm/a10disp/" # Display changer for Allwinner
|
|
|
|
MISC5_DIR="sunxi-display-changer" # local directory
|
2016-04-20 19:12:46 +03:00
|
|
|
HOST="$BOARD" # set hostname to the board
|
2016-03-17 20:16:26 +01:00
|
|
|
CACHEDIR=$DEST/cache
|
2016-02-26 17:49:02 +03:00
|
|
|
|
2016-05-02 16:33:37 +03:00
|
|
|
# used by multiple sources - reduce code duplication
|
|
|
|
if [[ $USE_MAINLINE_GOOGLE_MIRROR == yes ]]; then
|
2016-08-11 17:52:37 +03:00
|
|
|
MAINLINE_KERNEL_SOURCE='https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable'
|
2016-05-02 16:33:37 +03:00
|
|
|
else
|
2016-08-11 17:52:37 +03:00
|
|
|
MAINLINE_KERNEL_SOURCE='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git'
|
2016-05-02 16:33:37 +03:00
|
|
|
fi
|
2016-07-27 20:38:29 +03:00
|
|
|
# allow upgrades for same major.minor versions
|
2016-08-17 00:49:53 +03:00
|
|
|
ARMBIAN_MAINLINE_KERNEL_VERSION="4.7"
|
2016-08-13 21:15:26 +03:00
|
|
|
MAINLINE_KERNEL_BRANCH=tag:v$(wget -qO- https://www.kernel.org/finger_banner | awk '{print $NF}' | grep -oE "^${ARMBIAN_MAINLINE_KERNEL_VERSION//./\\.}\.?[[:digit:]]*")
|
2016-07-27 20:38:29 +03:00
|
|
|
#MAINLINE_KERNEL_BRANCH="v$(wget -qO- https://www.kernel.org/finger_banner | grep "The latest st" | awk '{print $NF}' | head -1)"
|
2016-08-11 17:52:37 +03:00
|
|
|
MAINLINE_KERNEL_DIR="linux-vanilla"
|
2016-03-17 20:16:26 +01:00
|
|
|
|
2016-08-11 17:52:37 +03:00
|
|
|
MAINLINE_UBOOT_SOURCE='git://git.denx.de/u-boot.git'
|
2016-07-12 18:06:55 +03:00
|
|
|
#MAINLINE_UBOOT_BRANCH="v$(git ls-remote git://git.denx.de/u-boot.git | grep -v rc | grep -v '\^' | tail -1 | cut -d'v' -f 2)"
|
2016-08-13 21:15:26 +03:00
|
|
|
MAINLINE_UBOOT_BRANCH='tag:v2016.07'
|
2016-08-11 17:52:37 +03:00
|
|
|
MAINLINE_UBOOT_DIR='u-boot'
|
2016-03-17 20:16:26 +01:00
|
|
|
|
2016-05-02 16:33:37 +03:00
|
|
|
if [[ -f $SRC/lib/config/sources/$LINUXFAMILY.conf ]]; then
|
|
|
|
source $SRC/lib/config/sources/$LINUXFAMILY.conf
|
|
|
|
else
|
|
|
|
exit_with_error "Sources configuration not found" "$LINUXFAMILY"
|
|
|
|
fi
|
2016-03-17 20:16:26 +01:00
|
|
|
|
2016-02-26 17:49:02 +03:00
|
|
|
# Let's set defalt data if not defined in board configuration above
|
2016-04-16 18:06:21 +03:00
|
|
|
|
|
|
|
[[ -z $OFFSET ]] && OFFSET=1 # Bootloader space in MB (1 x 2048 = default)
|
|
|
|
[[ -z $ARCH ]] && ARCH=armhf
|
2016-04-24 17:51:19 +03:00
|
|
|
[[ -z $KERNEL_IMAGE_TYPE ]] && KERNEL_IMAGE_TYPE=zImage
|
2016-04-16 18:06:21 +03:00
|
|
|
[[ -z $SERIALCON ]] && SERIALCON=ttyS0
|
|
|
|
[[ -z $BOOTSIZE ]] && BOOTSIZE=0 # Mb size of boot partition
|
|
|
|
|
2016-05-02 16:33:37 +03:00
|
|
|
[[ $LINUXFAMILY == sun*i && $BRANCH != default && $LINUXFAMILY != sun8i ]] && LINUXCONFIG="linux-sunxi-${BRANCH}"
|
|
|
|
[[ -z $LINUXCONFIG ]] && LINUXCONFIG="linux-${LINUXFAMILY}-${BRANCH}"
|
2016-02-26 17:49:02 +03:00
|
|
|
|
2016-04-20 19:12:46 +03:00
|
|
|
# naming to distro
|
|
|
|
if [[ $RELEASE == trusty || $RELEASE == xenial ]]; then DISTRIBUTION="Ubuntu"; else DISTRIBUTION="Debian"; fi
|
|
|
|
|
2016-04-16 18:06:21 +03:00
|
|
|
case $ARCH in
|
|
|
|
arm64)
|
2016-05-03 19:35:20 +03:00
|
|
|
KERNEL_COMPILER="aarch64-linux-gnu-"
|
|
|
|
UBOOT_COMPILER="aarch64-linux-gnu-"
|
2016-04-16 18:06:21 +03:00
|
|
|
ARCHITECTURE=arm64
|
2016-08-14 21:53:12 +03:00
|
|
|
INITRD_ARCH=arm64
|
2016-04-18 19:20:15 +03:00
|
|
|
QEMU_BINARY="qemu-aarch64-static"
|
2016-04-16 18:06:21 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
armhf)
|
2016-05-03 19:35:20 +03:00
|
|
|
KERNEL_COMPILER="arm-linux-gnueabihf-"
|
|
|
|
UBOOT_COMPILER="arm-linux-gnueabihf-"
|
2016-04-16 18:06:21 +03:00
|
|
|
ARCHITECTURE=arm
|
2016-08-14 21:53:12 +03:00
|
|
|
INITRD_ARCH=arm
|
2016-04-18 19:20:15 +03:00
|
|
|
QEMU_BINARY="qemu-arm-static"
|
2016-04-16 18:06:21 +03:00
|
|
|
;;
|
|
|
|
esac
|
2016-02-26 19:25:49 +03:00
|
|
|
|
2016-05-03 19:35:20 +03:00
|
|
|
# temporary hacks/overrides
|
|
|
|
case $LINUXFAMILY in
|
2016-07-18 19:04:21 +03:00
|
|
|
sun*i)
|
|
|
|
# 2016.07 compilation fails due to GCC bug
|
2016-07-28 19:53:41 +03:00
|
|
|
# works on Linaro 5.3.1, fails on Ubuntu 5.3.1
|
|
|
|
UBOOT_NEEDS_GCC='< 5.3'
|
2016-07-18 19:04:21 +03:00
|
|
|
;;
|
2016-05-03 19:35:20 +03:00
|
|
|
pine64)
|
2016-08-14 21:53:12 +03:00
|
|
|
# fix for initramfs update script in board support package
|
|
|
|
[[ $BRANCH == default ]] && INITRD_ARCH=arm
|
2016-05-03 19:35:20 +03:00
|
|
|
;;
|
2016-05-19 07:19:24 +02:00
|
|
|
marvell)
|
2016-08-13 22:54:31 +03:00
|
|
|
# fix for u-boot needing arm soft float compiler
|
2016-05-23 17:39:51 +02:00
|
|
|
UBOOT_COMPILER="arm-linux-gnueabi-"
|
2016-05-19 07:19:24 +02:00
|
|
|
;;
|
2016-05-03 19:35:20 +03:00
|
|
|
esac
|
|
|
|
|
2016-02-26 19:25:49 +03:00
|
|
|
# Essential packages
|
2016-06-19 11:46:07 +03:00
|
|
|
PACKAGE_LIST="bash-completion bc bridge-utils build-essential cpufrequtils device-tree-compiler dosfstools figlet \
|
|
|
|
fbset fping git hostapd ifenslave-2.6 iw lirc fake-hwclock wpasupplicant psmisc ntp parted rsync sudo curl \
|
|
|
|
dialog crda wireless-regdb ncurses-term python3-apt sysfsutils toilet u-boot-tools unattended-upgrades \
|
2016-07-29 11:57:13 +02:00
|
|
|
unzip usbutils wireless-tools console-setup console-data console-common unicode-data openssh-server initramfs-tools ca-certificates"
|
2016-06-19 11:46:07 +03:00
|
|
|
|
|
|
|
# development related packages. remove when they are not needed for building packages in chroot
|
|
|
|
PACKAGE_LIST="$PACKAGE_LIST automake cmake libwrap0-dev libssl-dev libtool pkg-config libusb-dev libusb-1.0-0-dev libnl-3-dev libnl-genl-3-dev"
|
2016-02-26 19:25:49 +03:00
|
|
|
|
|
|
|
# Non-essential packages
|
2016-06-17 19:00:11 +03:00
|
|
|
PACKAGE_LIST_ADDITIONAL="alsa-utils btrfs-tools hddtemp iotop iozone3 stress sysbench screen ntfs-3g vim pciutils evtest htop pv lsof \
|
2016-06-18 16:28:02 +02:00
|
|
|
apt-transport-https libfuse2 libdigest-sha-perl libproc-processtable-perl w-scan aptitude dnsutils f3 haveged hdparm rfkill \
|
|
|
|
vlan sysstat"
|
2016-02-26 19:25:49 +03:00
|
|
|
|
2016-07-16 23:45:33 +03:00
|
|
|
PACKAGE_LIST_DESKTOP="xserver-xorg xserver-xorg-video-fbdev gvfs-backends gvfs-fuse xfonts-base xinit nodm x11-xserver-utils xfce4 lxtask xterm mirage radiotray wicd thunar-volman galculator \
|
2016-06-17 19:00:11 +03:00
|
|
|
gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf libgtk2.0-bin gcj-jre-headless xfce4-screenshooter libgnome2-perl gksu wifi-radar bluetooth"
|
|
|
|
|
|
|
|
PACKAGE_LIST_EXCLUDE=""
|
|
|
|
|
2016-02-26 19:25:49 +03:00
|
|
|
# Release specific packages
|
|
|
|
case $RELEASE in
|
|
|
|
wheezy)
|
2016-06-20 09:50:18 +02:00
|
|
|
PACKAGE_LIST_RELEASE="less makedev kbd acpid acpi-support-base iperf libudev1"
|
2016-05-02 16:33:37 +03:00
|
|
|
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP mozo pluma iceweasel icedove"
|
2016-02-26 19:25:49 +03:00
|
|
|
;;
|
|
|
|
jessie)
|
2016-07-16 23:45:33 +03:00
|
|
|
PACKAGE_LIST_RELEASE="less makedev kbd libpam-systemd iperf3 software-properties-common libnss-myhostname f2fs-tools"
|
|
|
|
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP mozo pluma iceweasel libreoffice-writer icedove policykit-1 policykit-1-gnome eject"
|
2016-02-26 19:25:49 +03:00
|
|
|
;;
|
2016-06-18 13:31:00 +03:00
|
|
|
trusty)
|
2016-06-19 11:46:07 +03:00
|
|
|
PACKAGE_LIST_RELEASE="man-db wget nano software-properties-common iperf f2fs-tools acpid"
|
2016-07-16 23:45:33 +03:00
|
|
|
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP libreoffice-writer thunderbird firefox gnome-icon-theme-full tango-icon-theme"
|
2016-03-31 07:25:34 +02:00
|
|
|
PACKAGE_LIST_EXCLUDE="ureadahead plymouth"
|
2016-03-08 21:22:35 +03:00
|
|
|
;;
|
|
|
|
xenial)
|
2016-06-19 11:46:07 +03:00
|
|
|
PACKAGE_LIST_RELEASE="man-db wget nano libpam-systemd software-properties-common libnss-myhostname f2fs-tools iperf3"
|
2016-07-16 23:45:33 +03:00
|
|
|
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP libreoffice-writer thunderbird firefox gnome-icon-theme-full tango-icon-theme policykit-1"
|
2016-02-26 19:25:49 +03:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-05-04 17:16:39 +03:00
|
|
|
DEBIAN_MIRROR='httpredir.debian.org/debian'
|
|
|
|
UBUNTU_MIRROR='ports.ubuntu.com/'
|
|
|
|
|
2016-03-17 20:16:26 +01:00
|
|
|
# For user override
|
2016-05-02 16:33:37 +03:00
|
|
|
if [[ -f $SRC/userpatches/lib.config ]]; then
|
2016-02-26 17:49:02 +03:00
|
|
|
display_alert "Using user configuration override" "userpatches/lib.config" "info"
|
|
|
|
source $SRC/userpatches/lib.config
|
|
|
|
fi
|
2016-02-26 19:25:49 +03:00
|
|
|
|
2016-05-04 17:16:39 +03:00
|
|
|
# apt-cacher-ng mirror configurarion
|
2016-05-06 23:59:36 +03:00
|
|
|
if [[ $DISTRIBUTION == Ubuntu ]]; then
|
2016-05-04 17:16:39 +03:00
|
|
|
APT_MIRROR=$UBUNTU_MIRROR
|
|
|
|
else
|
|
|
|
APT_MIRROR=$DEBIAN_MIRROR
|
|
|
|
fi
|
|
|
|
|
|
|
|
[[ -n $APT_PROXY_ADDR ]] && display_alert "Using custom apt-cacher-ng address" "$APT_PROXY_ADDR" "info"
|
|
|
|
|
2016-02-26 19:25:49 +03:00
|
|
|
# Build final package list after possible override
|
2016-05-02 16:33:37 +03:00
|
|
|
PACKAGE_LIST="$PACKAGE_LIST $PACKAGE_LIST_RELEASE $PACKAGE_LIST_ADDITIONAL"
|
|
|
|
[[ $BUILD_DESKTOP == yes ]] && PACKAGE_LIST="$PACKAGE_LIST $PACKAGE_LIST_DESKTOP"
|
2016-03-17 20:16:26 +01:00
|
|
|
|
2015-12-07 14:30:29 +01:00
|
|
|
# debug
|
2016-06-27 14:13:27 +03:00
|
|
|
cat <<-EOF >> $DEST/debug/output.log
|
|
|
|
## BUILD CONFIGURATION
|
2016-08-11 17:52:37 +03:00
|
|
|
Kernel configuration:
|
|
|
|
Repository: $KERNELSOURCE
|
2016-06-27 14:13:27 +03:00
|
|
|
Branch: $KERNELBRANCH
|
2016-08-11 17:52:37 +03:00
|
|
|
Config file: $LINUXCONFIG
|
|
|
|
|
|
|
|
U-boot configuration:
|
|
|
|
Repository: $BOOTSOURCE
|
|
|
|
Branch: $BOOTBRANCH
|
2016-06-27 14:13:27 +03:00
|
|
|
Offset: $OFFSET
|
2016-08-11 17:52:37 +03:00
|
|
|
Size: $BOOTSIZE
|
|
|
|
|
|
|
|
CPU configuration:
|
|
|
|
$CPUMIN - $CPUMAX with $GOVERNOR
|
2016-06-27 14:13:27 +03:00
|
|
|
EOF
|