build/lib/compilation.sh

966 lines
37 KiB
Bash
Raw Permalink Normal View History

#!/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 the Armbian build script
# https://github.com/armbian/build/
2014-10-07 20:49:46 +02:00
2015-12-18 12:22:42 +03:00
# Functions:
# compile_atf
2015-12-18 12:22:42 +03:00
# compile_uboot
# compile_kernel
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
# compile_firmware
# compile_armbian-config
# compile_sunxi_tools
# install_rkbin_tools
# grab_version
# find_toolchain
# advanced_patch
# process_patch_file
# userpatch_create
# overlayfs_wrapper
2014-10-07 20:49:46 +02:00
compile_atf()
{
if [[ $CLEAN_LEVEL == *make* ]]; then
display_alert "Cleaning" "$ATFSOURCEDIR" "info"
(cd "${SRC}/cache/sources/${ATFSOURCEDIR}"; make distclean > /dev/null 2>&1)
fi
if [[ $USE_OVERLAYFS == yes ]]; then
local atfdir
atfdir=$(overlayfs_wrapper "wrap" "$SRC/cache/sources/$ATFSOURCEDIR" "atf_${LINUXFAMILY}_${BRANCH}")
else
local atfdir="$SRC/cache/sources/$ATFSOURCEDIR"
fi
cd "$atfdir" || exit
display_alert "Compiling ATF" "" "info"
# build aarch64
if [[ $(dpkg --print-architecture) == amd64 ]]; then
local toolchain
toolchain=$(find_toolchain "$ATF_COMPILER" "$ATF_USE_GCC")
2018-02-06 11:29:21 +03:00
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${ATF_COMPILER}gcc $ATF_USE_GCC"
if [[ -n $ATF_TOOLCHAIN2 ]]; then
local toolchain2_type toolchain2_ver toolchain2
toolchain2_type=$(cut -d':' -f1 <<< "${ATF_TOOLCHAIN2}")
toolchain2_ver=$(cut -d':' -f2 <<< "${ATF_TOOLCHAIN2}")
toolchain2=$(find_toolchain "$toolchain2_type" "$toolchain2_ver")
[[ -z $toolchain2 ]] && exit_with_error "Could not find required toolchain" "${toolchain2_type}gcc $toolchain2_ver"
fi
# build aarch64
fi
display_alert "Compiler version" "${ATF_COMPILER}gcc $(eval env PATH="${toolchain}:${PATH}" "${ATF_COMPILER}gcc" -dumpversion)" "info"
local target_make target_patchdir target_files
target_make=$(cut -d';' -f1 <<< "${ATF_TARGET_MAP}")
target_patchdir=$(cut -d';' -f2 <<< "${ATF_TARGET_MAP}")
target_files=$(cut -d';' -f3 <<< "${ATF_TARGET_MAP}")
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
advanced_patch "atf" "${ATFPATCHDIR}" "$BOARD" "$target_patchdir" "$BRANCH" "${LINUXFAMILY}-${BOARD}-${BRANCH}"
# create patch for manual source changes
[[ $CREATE_PATCHES == yes ]] && userpatch_create "atf"
echo -e "\n\t== atf ==\n" >> "${DEST}"/debug/compilation.log
# ENABLE_BACKTRACE="0" has been added to workaround a regression in ATF.
# Check: https://github.com/armbian/build/issues/1157
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${toolchain2}:${PATH}" \
'make ENABLE_BACKTRACE="0" $target_make $CTHREADS \
CROSS_COMPILE="$CCACHE $ATF_COMPILER"' 2>> "${DEST}"/debug/compilation.log \
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'} \
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Compiling ATF..." $TTY_Y $TTY_X'} \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
[[ ${PIPESTATUS[0]} -ne 0 ]] && exit_with_error "ATF compilation failed"
[[ $(type -t atf_custom_postprocess) == function ]] && atf_custom_postprocess
atftempdir=$(mktemp -d)
chmod 700 ${atftempdir}
trap "rm -rf \"${atftempdir}\" ; exit 0" 0 1 2 3 15
# copy files to temp directory
for f in $target_files; do
local f_src
f_src=$(cut -d':' -f1 <<< "${f}")
if [[ $f == *:* ]]; then
local f_dst
f_dst=$(cut -d':' -f2 <<< "${f}")
else
local f_dst
f_dst=$(basename "${f_src}")
fi
[[ ! -f $f_src ]] && exit_with_error "ATF file not found" "$(basename "${f_src}")"
cp "${f_src}" "${atftempdir}/${f_dst}"
done
# copy license file to pack it to u-boot package later
[[ -f license.md ]] && cp license.md "${atftempdir}"/
}
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
2016-06-15 19:44:14 +03:00
compile_uboot()
{
# not optimal, but extra cleaning before overlayfs_wrapper should keep sources directory clean
2016-12-08 18:44:41 +03:00
if [[ $CLEAN_LEVEL == *make* ]]; then
display_alert "Cleaning" "$BOOTSOURCEDIR" "info"
(cd "${SRC}/cache/sources/${BOOTSOURCEDIR}"; make clean > /dev/null 2>&1)
2016-12-08 18:44:41 +03:00
fi
2016-11-03 20:57:56 +03:00
if [[ $USE_OVERLAYFS == yes ]]; then
local ubootdir
ubootdir=$(overlayfs_wrapper "wrap" "$SRC/cache/sources/$BOOTSOURCEDIR" "u-boot_${LINUXFAMILY}_${BRANCH}")
2016-11-03 20:57:56 +03:00
else
local ubootdir="$SRC/cache/sources/$BOOTSOURCEDIR"
2016-11-03 20:57:56 +03:00
fi
cd "${ubootdir}" || exit
2016-06-14 16:14:40 +03:00
# read uboot version
local version hash
version=$(grab_version "$ubootdir")
hash=$(improved_git --git-dir="$ubootdir"/.git rev-parse HEAD)
display_alert "Compiling u-boot" "$version" "info"
# build aarch64
if [[ $(dpkg --print-architecture) == amd64 ]]; then
local toolchain
toolchain=$(find_toolchain "$UBOOT_COMPILER" "$UBOOT_USE_GCC")
2018-02-06 11:29:21 +03:00
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${UBOOT_COMPILER}gcc $UBOOT_USE_GCC"
if [[ -n $UBOOT_TOOLCHAIN2 ]]; then
local toolchain2_type toolchain2_ver toolchain2
toolchain2_type=$(cut -d':' -f1 <<< "${UBOOT_TOOLCHAIN2}")
toolchain2_ver=$(cut -d':' -f2 <<< "${UBOOT_TOOLCHAIN2}")
toolchain2=$(find_toolchain "$toolchain2_type" "$toolchain2_ver")
[[ -z $toolchain2 ]] && exit_with_error "Could not find required toolchain" "${toolchain2_type}gcc $toolchain2_ver"
fi
# build aarch64
fi
display_alert "Compiler version" "${UBOOT_COMPILER}gcc $(eval env PATH="${toolchain}:${toolchain2}:${PATH}" "${UBOOT_COMPILER}gcc" -dumpversion)" "info"
[[ -n $toolchain2 ]] && display_alert "Additional compiler version" "${toolchain2_type}gcc $(eval env PATH="${toolchain}:${toolchain2}:${PATH}" "${toolchain2_type}gcc" -dumpversion)" "info"
# create directory structure for the .deb package
uboottempdir=$(mktemp -d)
chmod 700 ${uboottempdir}
trap "rm -rf \"${uboottempdir}\" ; exit 0" 0 1 2 3 15
2016-03-23 20:58:58 +01:00
local uboot_name=${CHOSEN_UBOOT}_${REVISION}_${ARCH}
rm -rf $uboottempdir/$uboot_name
mkdir -p $uboottempdir/$uboot_name/usr/lib/{u-boot,$uboot_name} $uboottempdir/$uboot_name/DEBIAN
# process compilation for one or multiple targets
while read -r target; do
local target_make target_patchdir target_files
target_make=$(cut -d';' -f1 <<< "${target}")
target_patchdir=$(cut -d';' -f2 <<< "${target}")
target_files=$(cut -d';' -f3 <<< "${target}")
# needed for multiple targets and for calling compile_uboot directly
display_alert "Checking out to clean sources"
improved_git checkout -f -q HEAD
if [[ $CLEAN_LEVEL == *make* ]]; then
display_alert "Cleaning" "$BOOTSOURCEDIR" "info"
(cd "${SRC}/cache/sources/${BOOTSOURCEDIR}"; make clean > /dev/null 2>&1)
fi
advanced_patch "u-boot" "$BOOTPATCHDIR" "$BOARD" "$target_patchdir" "$BRANCH" "${LINUXFAMILY}-${BOARD}-${BRANCH}"
# create patch for manual source changes
[[ $CREATE_PATCHES == yes ]] && userpatch_create "u-boot"
2020-11-12 19:46:47 +01:00
if [[ -n $ATFSOURCE ]]; then
cp -Rv "${atftempdir}"/*.bin .
rm -rf "${atftempdir}"
fi
echo -e "\n\t== u-boot make $BOOTCONFIG ==\n" >> "${DEST}"/debug/compilation.log
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${toolchain2}:${PATH}" \
'make $CTHREADS $BOOTCONFIG \
CROSS_COMPILE="$CCACHE $UBOOT_COMPILER"' 2>> "${DEST}"/debug/compilation.log \
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'} \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
# armbian specifics u-boot settings
[[ -f .config ]] && sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-armbian"/g' .config
[[ -f .config ]] && sed -i 's/CONFIG_LOCALVERSION_AUTO=.*/# CONFIG_LOCALVERSION_AUTO is not set/g' .config
# for modern kernel and non spi targets
if [[ ${BOOTBRANCH} =~ ^tag:v201[8-9](.*) && ${target} != "spi" && -f .config ]]; then
sed -i 's/^.*CONFIG_ENV_IS_IN_FAT.*/# CONFIG_ENV_IS_IN_FAT is not set/g' .config
sed -i 's/^.*CONFIG_ENV_IS_IN_EXT4.*/CONFIG_ENV_IS_IN_EXT4=y/g' .config
sed -i 's/^.*CONFIG_ENV_IS_IN_MMC.*/# CONFIG_ENV_IS_IN_MMC is not set/g' .config
sed -i 's/^.*CONFIG_ENV_IS_NOWHERE.*/# CONFIG_ENV_IS_NOWHERE is not set/g' .config | echo \
"# CONFIG_ENV_IS_NOWHERE is not set" >> .config
echo 'CONFIG_ENV_EXT4_INTERFACE="mmc"' >> .config
echo 'CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"' >> .config
echo 'CONFIG_ENV_EXT4_FILE="/boot/boot.env"' >> .config
fi
[[ -f tools/logos/udoo.bmp ]] && cp "${SRC}"/packages/blobs/splash/udoo.bmp tools/logos/udoo.bmp
touch .scmversion
# $BOOTDELAY can be set in board family config, ensure autoboot can be stopped even if set to 0
[[ $BOOTDELAY == 0 ]] && echo -e "CONFIG_ZERO_BOOTDELAY_CHECK=y" >> .config
[[ -n $BOOTDELAY ]] && sed -i "s/^CONFIG_BOOTDELAY=.*/CONFIG_BOOTDELAY=${BOOTDELAY}/" .config || [[ -f .config ]] && echo "CONFIG_BOOTDELAY=${BOOTDELAY}" >> .config
# workaround when two compilers are needed
cross_compile="CROSS_COMPILE=$CCACHE $UBOOT_COMPILER";
[[ -n $UBOOT_TOOLCHAIN2 ]] && cross_compile="ARMBIAN=foe"; # empty parameter is not allowed
echo -e "\n\t== u-boot make $target_make ==\n" >> "${DEST}"/debug/compilation.log
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${toolchain2}:${PATH}" \
'make $target_make $CTHREADS \
"${cross_compile}"' 2>>"${DEST}"/debug/compilation.log \
${PROGRESS_LOG_TO_FILE:+' | tee -a "${DEST}"/debug/compilation.log'} \
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Compiling u-boot..." $TTY_Y $TTY_X'} \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
[[ ${PIPESTATUS[0]} -ne 0 ]] && exit_with_error "U-boot compilation failed"
[[ $(type -t uboot_custom_postprocess) == function ]] && uboot_custom_postprocess
# copy files to build directory
for f in $target_files; do
local f_src
f_src=$(cut -d':' -f1 <<< "${f}")
if [[ $f == *:* ]]; then
local f_dst
f_dst=$(cut -d':' -f2 <<< "${f}")
else
local f_dst
f_dst=$(basename "${f_src}")
fi
[[ ! -f $f_src ]] && exit_with_error "U-boot file not found" "$(basename "${f_src}")"
cp "${f_src}" "$uboottempdir/${uboot_name}/usr/lib/${uboot_name}/${f_dst}"
done
done <<< "$UBOOT_TARGET_MAP"
2016-10-22 18:34:18 +03:00
# declare -f on non-defined function does not do anything
cat <<-EOF > "$uboottempdir/${uboot_name}/usr/lib/u-boot/platform_install.sh"
2016-10-06 18:37:20 +03:00
DIR=/usr/lib/$uboot_name
$(declare -f write_uboot_platform)
$(declare -f write_uboot_platform_mtd)
2016-10-22 18:34:18 +03:00
$(declare -f setup_write_uboot_platform)
2016-10-06 18:37:20 +03:00
EOF
# set up control file
cat <<-EOF > "$uboottempdir/${uboot_name}/DEBIAN/control"
Package: linux-u-boot-${BOARD}-${BRANCH}
Version: $REVISION
Architecture: $ARCH
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Installed-Size: 1
Section: kernel
Priority: optional
Provides: armbian-u-boot
Replaces: armbian-u-boot
2016-10-05 19:33:12 +03:00
Conflicts: armbian-u-boot, u-boot-sunxi
2016-08-30 19:25:32 +03:00
Description: Uboot loader $version
EOF
# copy config file to the package
# useful for FEL boot with overlayfs_wrapper
[[ -f .config && -n $BOOTCONFIG ]] && cp .config "$uboottempdir/${uboot_name}/usr/lib/u-boot/${BOOTCONFIG}"
# copy license files from typical locations
[[ -f COPYING ]] && cp COPYING "$uboottempdir/${uboot_name}/usr/lib/u-boot/LICENSE"
[[ -f Licenses/README ]] && cp Licenses/README "$uboottempdir/${uboot_name}/usr/lib/u-boot/LICENSE"
[[ -n $atftempdir && -f $atftempdir/license.md ]] && cp "${atftempdir}/license.md" "$uboottempdir/${uboot_name}/usr/lib/u-boot/LICENSE.atf"
2016-11-03 20:57:56 +03:00
display_alert "Building deb" "${uboot_name}.deb" "info"
fakeroot dpkg-deb -b "$uboottempdir/${uboot_name}" "$uboottempdir/${uboot_name}.deb" >> "${DEST}"/debug/output.log 2>&1
rm -rf "$uboottempdir/${uboot_name}"
[[ -n $atftempdir ]] && rm -rf "${atftempdir}"
2014-10-24 18:56:18 +02:00
[[ ! -f $uboottempdir/${uboot_name}.deb ]] && exit_with_error "Building u-boot package failed"
rsync --remove-source-files -rq "$uboottempdir/${uboot_name}.deb" "${DEB_STORAGE}/"
rm -rf "$uboottempdir"
2014-10-07 20:49:46 +02:00
}
2016-06-15 19:44:14 +03:00
compile_kernel()
{
2016-12-08 18:44:41 +03:00
if [[ $CLEAN_LEVEL == *make* ]]; then
display_alert "Cleaning" "$LINUXSOURCEDIR" "info"
(cd "${SRC}/cache/sources/${LINUXSOURCEDIR}"; make ARCH="${ARCHITECTURE}" clean >/dev/null 2>&1)
2016-12-08 18:44:41 +03:00
fi
2016-11-03 20:57:56 +03:00
if [[ $USE_OVERLAYFS == yes ]]; then
local kerneldir
kerneldir=$(overlayfs_wrapper "wrap" "$SRC/cache/sources/$LINUXSOURCEDIR" "kernel_${LINUXFAMILY}_${BRANCH}")
2016-11-03 20:57:56 +03:00
else
local kerneldir="$SRC/cache/sources/$LINUXSOURCEDIR"
2016-11-03 20:57:56 +03:00
fi
cd "${kerneldir}" || exit
if ! grep -qoE '^-rc[[:digit:]]+' <(grep "^EXTRAVERSION" Makefile | head -1 | awk '{print $(NF)}'); then
sed -i 's/EXTRAVERSION = .*/EXTRAVERSION = /' Makefile
fi
2019-12-31 13:47:01 +01:00
rm -f localversion
2019-12-31 13:47:01 +01:00
# read kernel version
local version hash
version=$(grab_version "$kerneldir")
Improve all kernel building (#2017) * Improve all kernel building Store hashes and rebuild only changed kernels. TBD: support for patch directory not fully implemented yet Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Add support for patch directory checking Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update build-all-ng.sh * Disable u-boot hashing for now * remove banana r2 breaks compilation ... no time for inspection ATM * typo * Change s5p6818 to COMMIT instead of TAG TAG points to a different HASH and its not posible to resolve hash without cloning. This can be addressed later, but now commit HASH will do. Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version * Bumping to new version * Bump Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * few changes Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Test * Bumping to new version * Bumping to new version BOARD Cubox i2eX/i4 * Bumping to new version imx6 current meson-gxl current * Bumping to new version linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels:\n * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.5-trunk_arm64.deb linux-image-current-sunxi_20.08.5-trunk_armhf.deb linux-image-legacy-meson_20.08.5-trunk_armhf.deb linux-image-legacy-s5p6818_20.08.5-trunk_arm64.deb * fix versioning Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.1_arm64.deb * Put version back Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.0-trunk_armhf.deb linux-image-current-meson64_20.08.0-trunk_arm64.deb linux-image-current-mvebu_20.08.0-trunk_armhf.deb linux-image-current-mvebu64_20.08.0-trunk_arm64.deb linux-image-current-odroidxu4_20.08.0-trunk_armhf.deb linux-image-current-rockchip_20.08.0-trunk_armhf.deb linux-image-current-rockchip64_20.08.0-trunk_arm64.deb linux-image-current-sunxi_20.08.0-trunk_armhf.deb linux-image-dev-mvebu_20.08.0-trunk_armhf.deb linux-image-dev-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-meson_20.08.0-trunk_armhf.deb linux-image-legacy-meson64_20.08.0-trunk_arm64.deb linux-image-legacy-mvebu_20.08.0-trunk_armhf.deb linux-image-legacy-mvebu64_20.08.0-trunk_arm64.deb linux-image-legacy-odroidxu4_20.08.0-trunk_armhf.deb linux-image-legacy-rk3399_20.08.0-trunk_arm64.deb linux-image-legacy-rockchip_20.08.0-trunk_armhf.deb linux-image-legacy-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-rockpis_20.08.0-trunk_arm64.deb linux-image-legacy-s5p6818_20.08.0-trunk_arm64.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: linux-image-dev-rockchip_20.08.0-trunk.2_armhf.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Report error code, adjust version * Adjust ver * Add another switch Co-authored-by: Manuel Rüger <manuel@rueg.eu> Co-authored-by: root <root@workstation>
2020-06-17 11:38:17 +02:00
# read kernel git hash
hash=$(improved_git --git-dir="$kerneldir"/.git rev-parse HEAD)
Improve all kernel building (#2017) * Improve all kernel building Store hashes and rebuild only changed kernels. TBD: support for patch directory not fully implemented yet Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Add support for patch directory checking Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update build-all-ng.sh * Disable u-boot hashing for now * remove banana r2 breaks compilation ... no time for inspection ATM * typo * Change s5p6818 to COMMIT instead of TAG TAG points to a different HASH and its not posible to resolve hash without cloning. This can be addressed later, but now commit HASH will do. Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version * Bumping to new version * Bump Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * few changes Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Test * Bumping to new version * Bumping to new version BOARD Cubox i2eX/i4 * Bumping to new version imx6 current meson-gxl current * Bumping to new version linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels:\n * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.5-trunk_arm64.deb linux-image-current-sunxi_20.08.5-trunk_armhf.deb linux-image-legacy-meson_20.08.5-trunk_armhf.deb linux-image-legacy-s5p6818_20.08.5-trunk_arm64.deb * fix versioning Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.1_arm64.deb * Put version back Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.0-trunk_armhf.deb linux-image-current-meson64_20.08.0-trunk_arm64.deb linux-image-current-mvebu_20.08.0-trunk_armhf.deb linux-image-current-mvebu64_20.08.0-trunk_arm64.deb linux-image-current-odroidxu4_20.08.0-trunk_armhf.deb linux-image-current-rockchip_20.08.0-trunk_armhf.deb linux-image-current-rockchip64_20.08.0-trunk_arm64.deb linux-image-current-sunxi_20.08.0-trunk_armhf.deb linux-image-dev-mvebu_20.08.0-trunk_armhf.deb linux-image-dev-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-meson_20.08.0-trunk_armhf.deb linux-image-legacy-meson64_20.08.0-trunk_arm64.deb linux-image-legacy-mvebu_20.08.0-trunk_armhf.deb linux-image-legacy-mvebu64_20.08.0-trunk_arm64.deb linux-image-legacy-odroidxu4_20.08.0-trunk_armhf.deb linux-image-legacy-rk3399_20.08.0-trunk_arm64.deb linux-image-legacy-rockchip_20.08.0-trunk_armhf.deb linux-image-legacy-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-rockpis_20.08.0-trunk_arm64.deb linux-image-legacy-s5p6818_20.08.0-trunk_arm64.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: linux-image-dev-rockchip_20.08.0-trunk.2_armhf.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Report error code, adjust version * Adjust ver * Add another switch Co-authored-by: Manuel Rüger <manuel@rueg.eu> Co-authored-by: root <root@workstation>
2020-06-17 11:38:17 +02:00
# build 3rd party drivers
2019-12-31 13:47:01 +01:00
compilation_prepare
advanced_patch "kernel" "$KERNELPATCHDIR" "$BOARD" "" "$BRANCH" "$LINUXFAMILY-$BRANCH"
# create patch for manual source changes in debug mode
[[ $CREATE_PATCHES == yes ]] && userpatch_create "kernel"
# re-read kernel version after patching
local version
version=$(grab_version "$kerneldir")
# create linux-source package - with already patched sources
local sources_pkg_dir tmp_src_dir
tmp_src_dir=$(mktemp -d)
trap "rm -rf \"${tmp_src_dir}\" ; exit 0" 0 1 2 3 15
sources_pkg_dir=${tmp_src_dir}/${CHOSEN_KSRC}_${REVISION}_all
mkdir -p "${sources_pkg_dir}"/usr/src/ "${sources_pkg_dir}"/usr/share/doc/linux-source-${version}-${LINUXFAMILY} "${sources_pkg_dir}"/DEBIAN
if [[ $BUILD_KSRC != no ]]; then
display_alert "Compressing sources for the linux-source package"
tar cp --directory="$kerneldir" --exclude='./.git/' --owner=root . \
| pv -p -b -r -s "$(du -sb "$kerneldir" --exclude=='./.git/' | cut -f1)" \
| pixz -4 > "${sources_pkg_dir}/usr/src/linux-source-${version}-${LINUXFAMILY}.tar.xz"
cp COPYING "${sources_pkg_dir}/usr/share/doc/linux-source-${version}-${LINUXFAMILY}/LICENSE"
fi
2016-08-30 19:25:32 +03:00
display_alert "Compiling $BRANCH kernel" "$version" "info"
# build aarch64
if [[ $(dpkg --print-architecture) == amd64 ]]; then
local toolchain
toolchain=$(find_toolchain "$KERNEL_COMPILER" "$KERNEL_USE_GCC")
2018-02-06 11:29:21 +03:00
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${KERNEL_COMPILER}gcc $KERNEL_USE_GCC"
# build aarch64
fi
display_alert "Compiler version" "${KERNEL_COMPILER}gcc $(eval env PATH="${toolchain}:${PATH}" "${KERNEL_COMPILER}gcc" -dumpversion)" "info"
# copy kernel config
if [[ $KERNEL_KEEP_CONFIG == yes && -f "${DEST}"/config/$LINUXCONFIG.config ]]; then
display_alert "Using previous kernel config" "${DEST}/config/$LINUXCONFIG.config" "info"
cp "${DEST}/config/${LINUXCONFIG}.config" .config
else
if [[ -f $USERPATCHES_PATH/$LINUXCONFIG.config ]]; then
display_alert "Using kernel config provided by user" "userpatches/$LINUXCONFIG.config" "info"
cp "${USERPATCHES_PATH}/${LINUXCONFIG}.config" .config
else
display_alert "Using kernel config file" "config/kernel/$LINUXCONFIG.config" "info"
cp "${SRC}/config/kernel/${LINUXCONFIG}.config" .config
fi
2015-12-09 14:39:27 +01:00
fi
# hack for OdroidXU4. Copy firmare files
if [[ $BOARD == odroidxu4 ]]; then
mkdir -p "${kerneldir}/firmware/edid"
cp "${SRC}"/packages/blobs/odroidxu4/*.bin "${kerneldir}/firmware/edid"
fi
2015-12-09 14:39:27 +01:00
# hack for deb builder. To pack what's missing in headers pack.
cp "${SRC}"/patch/misc/headers-debian-byteshift.patch /tmp
if [[ $KERNEL_CONFIGURE != yes ]]; then
if [[ $BRANCH == default ]]; then
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
2018-02-06 11:29:21 +03:00
'make ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" silentoldconfig'
2015-12-09 14:39:27 +01:00
else
# TODO: check if required
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
2018-02-06 11:29:21 +03:00
'make ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" olddefconfig'
2015-12-09 14:39:27 +01:00
fi
else
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
2018-02-06 11:29:21 +03:00
'make $CTHREADS ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" oldconfig'
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
2018-02-06 11:29:21 +03:00
'make $CTHREADS ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" ${KERNEL_MENUCONFIG:-menuconfig}'
[[ ${PIPESTATUS[0]} -ne 0 ]] && exit_with_error "Error kernel menuconfig failed"
2016-11-21 19:01:48 +03:00
# store kernel config in easily reachable place
display_alert "Exporting new kernel config" "$DEST/config/$LINUXCONFIG.config" "info"
cp .config "${DEST}/config/${LINUXCONFIG}.config"
# export defconfig too if requested
if [[ $KERNEL_EXPORT_DEFCONFIG == yes ]]; then
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
2018-02-06 11:29:21 +03:00
'make ARCH=$ARCHITECTURE CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" savedefconfig'
[[ -f defconfig ]] && cp defconfig "${DEST}/config/${LINUXCONFIG}.defconfig"
fi
fi
xz < .config > "${sources_pkg_dir}/usr/src/${LINUXCONFIG}_${version}_${REVISION}_config.xz"
echo -e "\n\t== kernel ==\n" >> "${DEST}"/debug/compilation.log
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
'make $CTHREADS ARCH=$ARCHITECTURE \
CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" \
$SRC_LOADADDR \
LOCALVERSION="-$LINUXFAMILY" \
$KERNEL_IMAGE_TYPE modules dtbs 2>>$DEST/debug/compilation.log' \
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'} \
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" \
--progressbox "Compiling kernel..." $TTY_Y $TTY_X'} \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
if [[ ${PIPESTATUS[0]} -ne 0 || ! -f arch/$ARCHITECTURE/boot/$KERNEL_IMAGE_TYPE ]]; then
exit_with_error "Kernel was not built" "@host"
fi
2014-11-17 16:20:02 +01:00
2016-05-24 18:12:48 +03:00
# different packaging for 4.3+
if linux-version compare "${version}" ge 4.3; then
local kernel_packing="bindeb-pkg"
else
local kernel_packing="deb-pkg"
fi
display_alert "Creating packages"
# produce deb packages: image, headers, firmware, dtb
echo -e "\n\t== deb packages: image, headers, firmware, dtb ==\n" >> "${DEST}"/debug/compilation.log
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
'make $CTHREADS $kernel_packing \
KDEB_PKGVERSION=$REVISION \
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
BRANCH=$BRANCH \
LOCALVERSION="-${LINUXFAMILY}" \
KBUILD_DEBARCH=$ARCH \
ARCH=$ARCHITECTURE \
DEBFULLNAME="$MAINTAINER" \
DEBEMAIL="$MAINTAINERMAIL" \
CROSS_COMPILE="$CCACHE $KERNEL_COMPILER" 2>>$DEST/debug/compilation.log' \
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'} \
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Creating kernel packages..." $TTY_Y $TTY_X'} \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
cat <<-EOF > "${sources_pkg_dir}"/DEBIAN/control
Package: linux-source-${version}-${BRANCH}-${LINUXFAMILY}
Version: ${version}-${BRANCH}-${LINUXFAMILY}+${REVISION}
Architecture: all
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Section: kernel
Priority: optional
Depends: binutils, coreutils
Provides: linux-source, linux-source-${version}-${LINUXFAMILY}
Recommends: gcc, make
Description: This package provides the source code for the Linux kernel $version
EOF
if [[ $BUILD_KSRC != no ]]; then
fakeroot dpkg-deb -z0 -b "${sources_pkg_dir}" "${sources_pkg_dir}.deb"
rsync --remove-source-files -rq "${sources_pkg_dir}.deb" "${DEB_STORAGE}/"
fi
rm -rf "${tmp_src_dir}"
cd .. || exit
# remove firmare image packages here - easier than patching ~40 packaging scripts at once
rm -f linux-firmware-image-*.deb
rsync --remove-source-files -rq ./*.deb "${DEB_STORAGE}/" || exit_with_error "Failed moving kernel DEBs"
Improve all kernel building (#2017) * Improve all kernel building Store hashes and rebuild only changed kernels. TBD: support for patch directory not fully implemented yet Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Add support for patch directory checking Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update build-all-ng.sh * Disable u-boot hashing for now * remove banana r2 breaks compilation ... no time for inspection ATM * typo * Change s5p6818 to COMMIT instead of TAG TAG points to a different HASH and its not posible to resolve hash without cloning. This can be addressed later, but now commit HASH will do. Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version * Bumping to new version * Bump Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * few changes Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Test * Bumping to new version * Bumping to new version BOARD Cubox i2eX/i4 * Bumping to new version imx6 current meson-gxl current * Bumping to new version linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels:\n * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.5-trunk_arm64.deb linux-image-current-sunxi_20.08.5-trunk_armhf.deb linux-image-legacy-meson_20.08.5-trunk_armhf.deb linux-image-legacy-s5p6818_20.08.5-trunk_arm64.deb * fix versioning Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.1_arm64.deb * Put version back Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.0-trunk_armhf.deb linux-image-current-meson64_20.08.0-trunk_arm64.deb linux-image-current-mvebu_20.08.0-trunk_armhf.deb linux-image-current-mvebu64_20.08.0-trunk_arm64.deb linux-image-current-odroidxu4_20.08.0-trunk_armhf.deb linux-image-current-rockchip_20.08.0-trunk_armhf.deb linux-image-current-rockchip64_20.08.0-trunk_arm64.deb linux-image-current-sunxi_20.08.0-trunk_armhf.deb linux-image-dev-mvebu_20.08.0-trunk_armhf.deb linux-image-dev-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-meson_20.08.0-trunk_armhf.deb linux-image-legacy-meson64_20.08.0-trunk_arm64.deb linux-image-legacy-mvebu_20.08.0-trunk_armhf.deb linux-image-legacy-mvebu64_20.08.0-trunk_arm64.deb linux-image-legacy-odroidxu4_20.08.0-trunk_armhf.deb linux-image-legacy-rk3399_20.08.0-trunk_arm64.deb linux-image-legacy-rockchip_20.08.0-trunk_armhf.deb linux-image-legacy-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-rockpis_20.08.0-trunk_arm64.deb linux-image-legacy-s5p6818_20.08.0-trunk_arm64.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: linux-image-dev-rockchip_20.08.0-trunk.2_armhf.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Report error code, adjust version * Adjust ver * Add another switch Co-authored-by: Manuel Rüger <manuel@rueg.eu> Co-authored-by: root <root@workstation>
2020-06-17 11:38:17 +02:00
# store git hash to the file
2020-10-18 16:34:44 +02:00
echo "${hash}" > "${SRC}/cache/hash"$([[ ${BETA} == yes ]] && echo "-beta")"/linux-image-${BRANCH}-${LINUXFAMILY}.githash"
Improve all kernel building (#2017) * Improve all kernel building Store hashes and rebuild only changed kernels. TBD: support for patch directory not fully implemented yet Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Add support for patch directory checking Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/build-all-ng.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update lib/compilation.sh Co-authored-by: Manuel Rüger <manuel@rueg.eu> * Update build-all-ng.sh * Disable u-boot hashing for now * remove banana r2 breaks compilation ... no time for inspection ATM * typo * Change s5p6818 to COMMIT instead of TAG TAG points to a different HASH and its not posible to resolve hash without cloning. This can be addressed later, but now commit HASH will do. Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version * Bumping to new version * Bump Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * few changes Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Test * Bumping to new version * Bumping to new version BOARD Cubox i2eX/i4 * Bumping to new version imx6 current meson-gxl current * Bumping to new version linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels:\n * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.4-trunk_armhf.deb linux-image-current-meson64_20.08.4-trunk_arm64.deb * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.5-trunk_arm64.deb linux-image-current-sunxi_20.08.5-trunk_armhf.deb linux-image-legacy-meson_20.08.5-trunk_armhf.deb linux-image-legacy-s5p6818_20.08.5-trunk_arm64.deb * fix versioning Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-meson64_20.08.1_arm64.deb * Put version back Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com> * Bumping to new version Adding following kernels: linux-image-current-imx6_20.08.0-trunk_armhf.deb linux-image-current-meson64_20.08.0-trunk_arm64.deb linux-image-current-mvebu_20.08.0-trunk_armhf.deb linux-image-current-mvebu64_20.08.0-trunk_arm64.deb linux-image-current-odroidxu4_20.08.0-trunk_armhf.deb linux-image-current-rockchip_20.08.0-trunk_armhf.deb linux-image-current-rockchip64_20.08.0-trunk_arm64.deb linux-image-current-sunxi_20.08.0-trunk_armhf.deb linux-image-dev-mvebu_20.08.0-trunk_armhf.deb linux-image-dev-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-meson_20.08.0-trunk_armhf.deb linux-image-legacy-meson64_20.08.0-trunk_arm64.deb linux-image-legacy-mvebu_20.08.0-trunk_armhf.deb linux-image-legacy-mvebu64_20.08.0-trunk_arm64.deb linux-image-legacy-odroidxu4_20.08.0-trunk_armhf.deb linux-image-legacy-rk3399_20.08.0-trunk_arm64.deb linux-image-legacy-rockchip_20.08.0-trunk_armhf.deb linux-image-legacy-rockchip64_20.08.0-trunk_arm64.deb linux-image-legacy-rockpis_20.08.0-trunk_arm64.deb linux-image-legacy-s5p6818_20.08.0-trunk_arm64.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: linux-image-dev-rockchip_20.08.0-trunk.2_armhf.deb * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Bumping to new version Adding following kernels: * Report error code, adjust version * Adjust ver * Add another switch Co-authored-by: Manuel Rüger <manuel@rueg.eu> Co-authored-by: root <root@workstation>
2020-06-17 11:38:17 +02:00
[[ -z ${KERNELPATCHDIR} ]] && KERNELPATCHDIR=$LINUXFAMILY-$BRANCH
[[ -z ${LINUXCONFIG} ]] && LINUXCONFIG=linux-$LINUXFAMILY-$BRANCH
hash_watch_1=$(find "${SRC}/patch/kernel/${KERNELPATCHDIR}/" -maxdepth 1 -printf '%s %P\n' 2> /dev/null | sort)
hash_watch_2=$(cat "${SRC}/config/kernel/${LINUXCONFIG}.config")
echo "${hash_watch_1}${hash_watch_2}" | improved_git hash-object --stdin >> "${SRC}/cache/hash"$([[ ${BETA} == yes ]] && echo "-beta")"/linux-image-${BRANCH}-${LINUXFAMILY}.githash"
2014-10-07 20:49:46 +02:00
}
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
compile_firmware()
{
display_alert "Merging and packaging linux firmware" "@host" "info"
local firmwaretempdir plugin_dir
firmwaretempdir=$(mktemp -d)
chmod 700 ${firmwaretempdir}
trap "rm -rf \"${firmwaretempdir}\" ; exit 0" 0 1 2 3 15
plugin_dir="armbian-firmware${FULL}"
mkdir -p "${firmwaretempdir}/${plugin_dir}/lib/firmware"
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
fetch_from_repo "https://github.com/armbian/firmware" "armbian-firmware-git" "branch:master"
if [[ -n $FULL ]]; then
fetch_from_repo "$MAINLINE_FIRMWARE_SOURCE" "linux-firmware-git" "branch:master"
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
# cp : create hardlinks
cp -af --reflink=auto "${SRC}"/cache/sources/linux-firmware-git/* "${firmwaretempdir}/${plugin_dir}/lib/firmware/"
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
fi
# overlay our firmware
# cp : create hardlinks
cp -af --reflink=auto "${SRC}"/cache/sources/armbian-firmware-git/* "${firmwaretempdir}/${plugin_dir}/lib/firmware/"
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
# cleanup what's not needed for sure
rm -rf "${firmwaretempdir}/${plugin_dir}"/lib/firmware/{amdgpu,amd-ucode,radeon,nvidia,matrox,.git}
cd "${firmwaretempdir}/${plugin_dir}" || exit
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
# set up control file
mkdir -p DEBIAN
cat <<-END > DEBIAN/control
Package: armbian-firmware${FULL}
Version: $REVISION
Architecture: all
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Installed-Size: 1
Replaces: linux-firmware, firmware-brcm80211, firmware-ralink, firmware-samsung, firmware-realtek, armbian-firmware${REPLACE}
Section: kernel
Priority: optional
Description: Linux firmware${FULL}
END
cd "${firmwaretempdir}" || exit
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
# pack
2020-11-12 19:46:47 +01:00
mv "armbian-firmware${FULL}" "armbian-firmware${FULL}_${REVISION}_all"
fakeroot dpkg -b "armbian-firmware${FULL}_${REVISION}_all" >> "${DEST}"/debug/install.log 2>&1
2020-11-12 19:46:47 +01:00
mv "armbian-firmware${FULL}_${REVISION}_all" "armbian-firmware${FULL}"
rsync -rq "armbian-firmware${FULL}_${REVISION}_all.deb" "${DEB_STORAGE}/"
# remove temp directory
rm -rf "${firmwaretempdir}"
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
}
compile_armbian-zsh()
{
local tmp_dir armbian_zsh_dir
tmp_dir=$(mktemp -d)
chmod 700 ${tmp_dir}
trap "rm -rf \"${tmp_dir}\" ; exit 0" 0 1 2 3 15
armbian_zsh_dir=armbian-zsh_${REVISION}_all
display_alert "Building deb" "armbian-zsh" "info"
fetch_from_repo "https://github.com/robbyrussell/oh-my-zsh" "oh-my-zsh" "branch:master"
fetch_from_repo "https://github.com/mroth/evalcache" "evalcache" "branch:master"
mkdir -p "${tmp_dir}/${armbian_zsh_dir}"/{DEBIAN,etc/skel/,etc/oh-my-zsh/,/etc/skel/.oh-my-zsh/cache}
# set up control file
cat <<-END > "${tmp_dir}/${armbian_zsh_dir}"/DEBIAN/control
Package: armbian-zsh
Version: $REVISION
Architecture: all
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Depends: zsh, tmux
Section: utils
Priority: optional
Description: Armbian improved ZShell
END
# set up post install script
cat <<-END > "${tmp_dir}/${armbian_zsh_dir}"/DEBIAN/postinst
#!/bin/sh
# copy cache directory if not there yet
awk -F'[:]' '{if (\$3 >= 1000 && \$3 != 65534 || \$3 == 0) print ""\$6"/.oh-my-zsh"}' /etc/passwd | xargs -i sh -c 'test ! -d {} && cp -R --attributes-only /etc/skel/.oh-my-zsh {}'
awk -F'[:]' '{if (\$3 >= 1000 && \$3 != 65534 || \$3 == 0) print ""\$6"/.zshrc"}' /etc/passwd | xargs -i sh -c 'test ! -f {} && cp -R /etc/skel/.zshrc {}'
# fix owner permissions in home directory
awk -F'[:]' '{if (\$3 >= 1000 && \$3 != 65534 || \$3 == 0) print ""\$1":"\$3" "\$6"/.oh-my-zsh"}' /etc/passwd | xargs -n2 chown -R
awk -F'[:]' '{if (\$3 >= 1000 && \$3 != 65534 || \$3 == 0) print ""\$1":"\$3" "\$6"/.zshrc"}' /etc/passwd | xargs -n2 chown -R
# add support for bash profile
! grep emulate /etc/zsh/zprofile >/dev/null && echo "emulate sh -c 'source /etc/profile'" >> /etc/zsh/zprofile
exit 0
END
cp -R "${SRC}"/cache/sources/oh-my-zsh "${tmp_dir}/${armbian_zsh_dir}"/etc/
cp -R "${SRC}"/cache/sources/evalcache "${tmp_dir}/${armbian_zsh_dir}"/etc/oh-my-zsh/plugins
cp "${tmp_dir}/${armbian_zsh_dir}"/etc/oh-my-zsh/templates/zshrc.zsh-template "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc
chmod -R g-w,o-w "${tmp_dir}/${armbian_zsh_dir}"/etc/oh-my-zsh/
# we have common settings
sed -i "s/^export ZSH=.*/export ZSH=\/etc\/oh-my-zsh/" "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc
# user cache
sed -i "/^export ZSH=.*/a export ZSH_CACHE_DIR=~\/.oh-my-zsh\/cache" "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc
# define theme
sed -i 's/^ZSH_THEME=.*/ZSH_THEME="mrtazz"/' "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc
# disable prompt while update
sed -i 's/# DISABLE_UPDATE_PROMPT="true"/DISABLE_UPDATE_PROMPT="true"/g' "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc
# disable auto update since we provide update via package
sed -i 's/# DISABLE_AUTO_UPDATE="true"/DISABLE_AUTO_UPDATE="true"/g' "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc
# define default plugins
sed -i 's/^plugins=.*/plugins=(evalcache git git-extras debian tmux screen history extract colorize web-search docker)/' "${tmp_dir}/${armbian_zsh_dir}"/etc/skel/.zshrc
2021-03-08 07:41:52 +00:00
chmod 755 "${tmp_dir}/${armbian_zsh_dir}"/DEBIAN/postinst
fakeroot dpkg -b "${tmp_dir}/${armbian_zsh_dir}" >/dev/null
rsync --remove-source-files -rq "${tmp_dir}/${armbian_zsh_dir}.deb" "${DEB_STORAGE}/"
rm -rf "${tmp_dir}"
}
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
compile_armbian-config()
{
local tmp_dir armbian_config_dir
tmp_dir=$(mktemp -d)
chmod 700 ${tmp_dir}
trap "rm -rf \"${tmp_dir}\" ; exit 0" 0 1 2 3 15
armbian_config_dir=armbian-config_${REVISION}_all
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
display_alert "Building deb" "armbian-config" "info"
fetch_from_repo "https://github.com/armbian/config" "armbian-config" "branch:master"
fetch_from_repo "https://github.com/dylanaraps/neofetch" "neofetch" "tag:7.1.0"
fetch_from_repo "https://github.com/complexorganizations/wireguard-manager" "wireguard-manager" "tag:1.0.11"
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
mkdir -p "${tmp_dir}/${armbian_config_dir}"/{DEBIAN,usr/bin/,usr/sbin/,usr/lib/armbian-config/}
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
# set up control file
cat <<-END > "${tmp_dir}/${armbian_config_dir}"/DEBIAN/control
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
Package: armbian-config
Version: $REVISION
Architecture: all
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Replaces: armbian-bsp, neofetch
Depends: bash, iperf3, psmisc, curl, bc, expect, dialog, pv, zip, \
debconf-utils, unzip, build-essential, html2text, apt-transport-https, html2text, dirmngr, software-properties-common, debconf, jq
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
Recommends: armbian-bsp
Suggests: libpam-google-authenticator, qrencode, network-manager, sunxi-tools
Section: utils
Priority: optional
Description: Armbian configuration utility
END
install -m 755 "${SRC}"/cache/sources/neofetch/neofetch "${tmp_dir}/${armbian_config_dir}"/usr/bin/neofetch
cd "${tmp_dir}/${armbian_config_dir}"/usr/bin/
process_patch_file "${SRC}/patch/misc/add-armbian-neofetch.patch" "applying"
install -m 755 "${SRC}"/cache/sources/wireguard-manager/wireguard-manager.sh "${tmp_dir}/${armbian_config_dir}"/usr/bin/wireguard-manager
install -m 755 "${SRC}"/cache/sources/armbian-config/scripts/tv_grab_file "${tmp_dir}/${armbian_config_dir}"/usr/bin/tv_grab_file
install -m 755 "${SRC}"/cache/sources/armbian-config/debian-config "${tmp_dir}/${armbian_config_dir}"/usr/sbin/armbian-config
install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-jobs "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/jobs.sh
install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-submenu "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/submenu.sh
install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-functions "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/functions.sh
install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-functions-network "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/functions-network.sh
install -m 755 "${SRC}"/cache/sources/armbian-config/softy "${tmp_dir}/${armbian_config_dir}"/usr/sbin/softy
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
# fallback to replace armbian-config in BSP
ln -sf /usr/sbin/armbian-config "${tmp_dir}/${armbian_config_dir}"/usr/bin/armbian-config
ln -sf /usr/sbin/softy "${tmp_dir}/${armbian_config_dir}"/usr/bin/softy
fakeroot dpkg -b "${tmp_dir}/${armbian_config_dir}" >/dev/null
rsync --remove-source-files -rq "${tmp_dir}/${armbian_config_dir}.deb" "${DEB_STORAGE}/"
rm -rf "${tmp_dir}"
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
}
compile_sunxi_tools()
{
# Compile and install only if git commit hash changed
cd "${SRC}"/cache/sources/sunxi-tools || exit
2017-08-03 16:45:15 +03:00
# need to check if /usr/local/bin/sunxi-fexc to detect new Docker containers with old cached sources
if [[ ! -f .commit_id || $(improved_git rev-parse @ 2>/dev/null) != $(<.commit_id) || ! -f /usr/local/bin/sunxi-fexc ]]; then
display_alert "Compiling" "sunxi-tools" "info"
make -s clean >/dev/null
make -s tools >/dev/null
mkdir -p /usr/local/bin/
make install-tools >/dev/null 2>&1
improved_git rev-parse @ 2>/dev/null > .commit_id
fi
}
install_rkbin_tools()
{
# install only if git commit hash changed
cd "${SRC}"/cache/sources/rkbin-tools || exit
# need to check if /usr/local/bin/sunxi-fexc to detect new Docker containers with old cached sources
if [[ ! -f .commit_id || $(improved_git rev-parse @ 2>/dev/null) != $(<.commit_id) || ! -f /usr/local/bin/loaderimage ]]; then
display_alert "Installing" "rkbin-tools" "info"
mkdir -p /usr/local/bin/
install -m 755 tools/loaderimage /usr/local/bin/
install -m 755 tools/trust_merger /usr/local/bin/
improved_git rev-parse @ 2>/dev/null > .commit_id
fi
}
grab_version()
{
local ver=()
ver[0]=$(grep "^VERSION" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+')
ver[1]=$(grep "^PATCHLEVEL" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+')
ver[2]=$(grep "^SUBLEVEL" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+')
ver[3]=$(grep "^EXTRAVERSION" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^-rc[[:digit:]]+')
echo "${ver[0]:-0}${ver[1]:+.${ver[1]}}${ver[2]:+.${ver[2]}}${ver[3]}"
}
# find_toolchain <compiler_prefix> <expression>
#
# returns path to toolchain that satisfies <expression>
#
find_toolchain()
{
local compiler=$1
2016-05-04 12:10:45 +03:00
local expression=$2
local dist=10
local toolchain=""
# extract target major.minor version from expression
local target_ver
target_ver=$(grep -oE "[[:digit:]]+\.[[:digit:]]" <<< "$expression")
for dir in "${SRC}"/cache/toolchain/*/; do
# check if is a toolchain for current $ARCH
2016-05-04 12:10:45 +03:00
[[ ! -f ${dir}bin/${compiler}gcc ]] && continue
# get toolchain major.minor version
local gcc_ver
gcc_ver=$("${dir}bin/${compiler}gcc" -dumpversion | grep -oE "^[[:digit:]]+\.[[:digit:]]")
# check if toolchain version satisfies requirement
awk "BEGIN{exit ! ($gcc_ver $expression)}" >/dev/null || continue
# check if found version is the closest to target
2017-08-19 17:33:37 +03:00
# may need different logic here with more than 1 digit minor version numbers
# numbers: 3.9 > 3.10; versions: 3.9 < 3.10
# dpkg --compare-versions can be used here if operators are changed
local d
d=$(awk '{x = $1 - $2}{printf "%.1f\n", (x > 0) ? x : -x}' <<< "$target_ver $gcc_ver")
if awk "BEGIN{exit ! ($d < $dist)}" >/dev/null ; then
dist=$d
toolchain=${dir}bin
fi
done
echo "$toolchain"
# logging a stack of used compilers.
if [[ -f "${DEST}"/debug/compiler.log ]]; then
if ! grep -q "$toolchain" "${DEST}"/debug/compiler.log; then
echo "$toolchain" >> "${DEST}"/debug/compiler.log;
fi
else
echo "$toolchain" >> "${DEST}"/debug/compiler.log;
fi
}
# advanced_patch <dest> <family> <board> <target> <branch> <description>
#
# parameters:
# <dest>: u-boot, kernel, atf
# <family>: u-boot: u-boot, u-boot-neo; kernel: sun4i-default, sunxi-next, ...
# <board>: cubieboard, cubieboard2, cubietruck, ...
# <target>: optional subdirectory
# <description>: additional description text
#
# priority:
# $USERPATCHES_PATH/<dest>/<family>/target_<target>
# $USERPATCHES_PATH/<dest>/<family>/board_<board>
# $USERPATCHES_PATH/<dest>/<family>/branch_<branch>
# $USERPATCHES_PATH/<dest>/<family>
# $SRC/patch/<dest>/<family>/target_<target>
# $SRC/patch/<dest>/<family>/board_<board>
# $SRC/patch/<dest>/<family>/branch_<branch>
# $SRC/patch/<dest>/<family>
#
2016-09-29 19:42:17 +03:00
advanced_patch()
{
local dest=$1
local family=$2
local board=$3
local target=$4
local branch=$5
local description=$6
display_alert "Started patching process for" "$dest $description" "info"
display_alert "Looking for user patches in" "userpatches/$dest/$family" "info"
local names=()
local dirs=(
"$USERPATCHES_PATH/$dest/$family/target_${target}:[\e[33mu\e[0m][\e[34mt\e[0m]"
"$USERPATCHES_PATH/$dest/$family/board_${board}:[\e[33mu\e[0m][\e[35mb\e[0m]"
"$USERPATCHES_PATH/$dest/$family/branch_${branch}:[\e[33mu\e[0m][\e[33mb\e[0m]"
"$USERPATCHES_PATH/$dest/$family:[\e[33mu\e[0m][\e[32mc\e[0m]"
"$SRC/patch/$dest/$family/target_${target}:[\e[32ml\e[0m][\e[34mt\e[0m]"
"$SRC/patch/$dest/$family/board_${board}:[\e[32ml\e[0m][\e[35mb\e[0m]"
"$SRC/patch/$dest/$family/branch_${branch}:[\e[32ml\e[0m][\e[33mb\e[0m]"
"$SRC/patch/$dest/$family:[\e[32ml\e[0m][\e[32mc\e[0m]"
)
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
local links=()
# required for "for" command
shopt -s nullglob dotglob
# get patch file names
for dir in "${dirs[@]}"; do
for patch in ${dir%%:*}/*.patch; do
names+=($(basename "${patch}"))
done
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# add linked patch directories
if [[ -d ${dir%%:*} ]]; then
local findlinks
findlinks=$(find "${dir%%:*}" -maxdepth 1 -type l -print0 2>&1 | xargs -0)
[[ -n $findlinks ]] && readarray -d '' links < <(find "${findlinks}" -maxdepth 1 -type f -follow -print -iname "*.patch" -print | grep "\.patch$" | sed "s|${dir%%:*}/||g" 2>&1)
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
fi
done
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# merge static and linked
names=("${names[@]}" "${links[@]}")
# remove duplicates
local names_s=($(echo "${names[@]}" | tr ' ' '\n' | LC_ALL=C sort -u | tr '\n' ' '))
# apply patches
for name in "${names_s[@]}"; do
for dir in "${dirs[@]}"; do
if [[ -f ${dir%%:*}/$name ]]; then
if [[ -s ${dir%%:*}/$name ]]; then
process_patch_file "${dir%%:*}/$name" "${dir##*:}"
else
2017-09-19 19:33:31 +03:00
display_alert "* ${dir##*:} $name" "skipped"
fi
break # next name
fi
done
done
}
# process_patch_file <file> <description>
#
# parameters:
# <file>: path to patch file
# <status>: additional status text
#
2016-09-29 19:42:17 +03:00
process_patch_file()
{
local patch=$1
local status=$2
# detect and remove files which patch will create
lsdiff -s --strip=1 "${patch}" | grep '^+' | awk '{print $2}' | xargs -I % sh -c 'rm -f %'
echo "Processing file $patch" >> "${DEST}"/debug/patching.log
patch --batch --silent -p1 -N < "${patch}" >> "${DEST}"/debug/patching.log 2>&1
if [[ $? -ne 0 ]]; then
display_alert "* $status $(basename "${patch}")" "failed" "wrn"
2016-06-14 16:14:40 +03:00
[[ $EXIT_PATCHING_ERROR == yes ]] && exit_with_error "Aborting due to" "EXIT_PATCHING_ERROR"
else
display_alert "* $status $(basename "${patch}")" "" "info"
fi
echo >> "${DEST}"/debug/patching.log
}
2014-10-07 20:49:46 +02:00
userpatch_create()
{
# create commit to start from clean source
git add .
git -c user.name='Armbian User' -c user.email='user@example.org' commit -q -m "Cleaning working copy"
local patch="$DEST/patch/$1-$LINUXFAMILY-$BRANCH.patch"
# apply previous user debug mode created patches
if [[ -f $patch ]]; then
display_alert "Applying existing $1 patch" "$patch" "wrn" && patch --batch --silent -p1 -N < "${patch}"
# read title of a patch in case Git is configured
if [[ -n $(git config user.email) ]]; then
COMMIT_MESSAGE=$(cat "${patch}" | grep Subject | sed -n -e '0,/PATCH/s/.*PATCH]//p' | xargs)
display_alert "Patch name extracted" "$COMMIT_MESSAGE" "wrn"
fi
fi
# prompt to alter source
display_alert "Make your changes in this directory:" "$(pwd)" "wrn"
display_alert "Press <Enter> after you are done" "waiting" "wrn"
read -r </dev/tty
tput cuu1
git add .
# create patch out of changes
if ! git diff-index --quiet --cached HEAD; then
# If Git is configured, create proper patch and ask for a name
if [[ -n $(git config user.email) ]]; then
display_alert "Add / change patch name" "$COMMIT_MESSAGE" "wrn"
read -e -p "Patch description: " -i "$COMMIT_MESSAGE" COMMIT_MESSAGE
[[ -z "$COMMIT_MESSAGE" ]] && COMMIT_MESSAGE="Patching something"
git commit -s -m "$COMMIT_MESSAGE"
git format-patch -1 HEAD --stdout --signature="Created with Armbian build tools https://github.com/armbian/build" > "${patch}"
PATCHFILE=$(git format-patch -1 HEAD)
rm $PATCHFILE # delete the actual file
# create a symlink to have a nice name ready
find $DEST/patch/ -type l -delete # delete any existing
ln -sf $patch $DEST/patch/$PATCHFILE
else
git diff --staged > "${patch}"
fi
display_alert "You will find your patch here:" "$patch" "info"
else
display_alert "No changes found, skipping patch creation" "" "wrn"
fi
git reset --soft HEAD~
for i in {3..1..1}; do echo -n "$i." && sleep 1; done
}
2016-10-31 20:05:24 +03:00
# overlayfs_wrapper <operation> <workdir> <description>
#
# <operation>: wrap|cleanup
# <workdir>: path to source directory
2016-10-31 20:05:24 +03:00
# <description>: suffix for merged directory to help locating it in /tmp
# return value: new directory
#
# Assumptions/notes:
# - Ubuntu Xenial host
# - /tmp is mounted as tmpfs
# - there is enough space on /tmp
# - UB if running multiple compilation tasks in parallel
# - should not be used with CREATE_PATCHES=yes
#
overlayfs_wrapper()
{
local operation="$1"
if [[ $operation == wrap ]]; then
local srcdir="$2"
2016-10-31 20:05:24 +03:00
local description="$3"
mkdir -p /tmp/overlay_components/ /tmp/armbian_build/
local tempdir workdir mergeddir
tempdir=$(mktemp -d --tmpdir="/tmp/overlay_components/")
workdir=$(mktemp -d --tmpdir="/tmp/overlay_components/")
mergeddir=$(mktemp -d --suffix="_$description" --tmpdir="/tmp/armbian_build/")
mount -t overlay overlay -o lowerdir="$srcdir",upperdir="$tempdir",workdir="$workdir" "$mergeddir"
2016-10-25 23:12:08 +03:00
# this is executed in a subshell, so use temp files to pass extra data outside
echo "$tempdir" >> /tmp/.overlayfs_wrapper_cleanup
echo "$mergeddir" >> /tmp/.overlayfs_wrapper_umount
echo "$mergeddir" >> /tmp/.overlayfs_wrapper_cleanup
echo "$mergeddir"
return
fi
if [[ $operation == cleanup ]]; then
2016-10-26 16:48:27 +03:00
if [[ -f /tmp/.overlayfs_wrapper_umount ]]; then
for dir in $(</tmp/.overlayfs_wrapper_umount); do
[[ $dir == /tmp/* ]] && umount -l "$dir" > /dev/null 2>&1
2016-10-26 16:48:27 +03:00
done
fi
if [[ -f /tmp/.overlayfs_wrapper_cleanup ]]; then
for dir in $(</tmp/.overlayfs_wrapper_cleanup); do
[[ $dir == /tmp/* ]] && rm -rf "$dir"
done
fi
2016-10-25 23:12:08 +03:00
rm -f /tmp/.overlayfs_wrapper_umount /tmp/.overlayfs_wrapper_cleanup
fi
}