===============================================================================
= Bootstrap a minimal base system.
===============================================================================

+base-files
+busybox-all-symlinks
+aept
+aeltra-repo-keys
+pam-config
+libc-dev

===============================================================================
= Mark essential packages
===============================================================================

#!/bin/sh

aept --offline-root "$AELTRA_SYSROOT" mark manual --all

===============================================================================
= Installing mount, sysctl, file and binutils may remove some of the busybox
= symlinks, that's why they are installed separately.
===============================================================================

+mount
+sysctl
+file
+binutils

===============================================================================
= Configure tools repository for AELTRA_HOST_ARCH and update the package cache.
===============================================================================

#!(chroot)/bin/sh

#
# Inside a build box target, the tools repository is configured per default, so
# we can skip it here.
#
if [ -f /etc/target ]; then
    exit 0
fi

echo "Configuring tools repository for $AELTRA_HOST_ARCH."

cat << EOF >> /etc/aept/aept.conf

arch tools
src/gz tools http://archive.aeltra.eu/dists/$AELTRA_RELEASE/core/$AELTRA_ARCH/$AELTRA_LIBC/tools/$AELTRA_HOST_ARCH
src/gz cross-tools http://archive.aeltra.eu/dists/$AELTRA_RELEASE/core/$AELTRA_ARCH/$AELTRA_LIBC/cross-tools/$AELTRA_HOST_ARCH
EOF

aept update

===============================================================================
= Install a minimal base system into the tools folder.
===============================================================================

+tools-base-files
+tools-busybox-all-symlinks
+tools-aept

===============================================================================
= Add compilers, build systems and other tools commonly needed during software
= development.
===============================================================================

+tools-target-gcc
+tools-target-g++
+tools-gcc
+tools-g++
+tools-gawk
+tools-grep
+tools-perl
+tools-autoconf
+tools-automake
+tools-make
+tools-cmake
+tools-patch
+tools-diffutils
+tools-file
+tools-tar
+tools-bzip2
+tools-xz-utils
+tools-pkg-config
+tools-libtool
+tools-gettext
+tools-autopoint
+tools-bash
+tools-libc-dev
+tools-aeltra-package
+tools-openssl

+ca-certificates
