Stewart Smith | c4b9bf6 | 2018-08-24 13:30:15 +1000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | set -eo pipefail |
| 5 | |
| 6 | if [ -z "$1" ]; then |
| 7 | echo "No build distro specified" |
| 8 | exit 1; |
| 9 | fi |
| 10 | |
| 11 | if [ -z "$2" ]; then |
| 12 | echo "No defconfig to build SDK from specified" |
| 13 | exit 1; |
| 14 | fi |
| 15 | |
| 16 | if [ -z "$CCACHE_DIR" ]; then |
| 17 | CCACHE_DIR=`pwd`/.op-build_ccache |
| 18 | fi |
| 19 | |
| 20 | shopt -s expand_aliases |
| 21 | source op-build-env |
| 22 | |
| 23 | if [ -n "$DL_DIR" ]; then |
| 24 | unset BR2_DL_DIR |
| 25 | export BR2_DL_DIR=${DL_DIR} |
| 26 | fi |
| 27 | |
| 28 | export O=`pwd`/output-$1-$2/ |
| 29 | op-build O=$O $2 |
Klaus Heinrich Kiwi | 9fda1c7 | 2020-04-17 10:18:38 -0300 | [diff] [blame] | 30 | ./buildroot/utils/config --file $O/.config --enable CCACHE |
| 31 | ./buildroot/utils/config --file $O/.config --set-str CCACHE_DIR $CCACHE_DIR |
| 32 | |
| 33 | # Disable things not necessary for the sdk |
| 34 | # (Buildroot manual section 6.1.3) |
| 35 | ./buildroot/utils/config --file $O/.config --disable INIT_BUSYBOX \ |
| 36 | --enable INIT_NONE \ |
| 37 | --disable SYSTEM_BIN_SH_BUSYBOX \ |
| 38 | --disable TARGET_ROOTFS_TAR |
| 39 | |
| 40 | # Additionally, disable OpenPower packages and |
| 41 | # ROOTFS stuff that we won't need |
| 42 | ./buildroot/utils/config --file $O/.config --disable OPENPOWER_PLATFORM \ |
| 43 | --undefine ROOTFS_USERS_TABLES \ |
| 44 | --undefine ROOTFS_OVERLAY \ |
| 45 | --undefine ROOTFS_POST_BUILD_SCRIPT \ |
| 46 | --undefine ROOTFS_POST_FAKEROOT_SCRIPT \ |
| 47 | --undefine ROOTFS_POST_IMAGE_SCRIPT \ |
| 48 | --undefine ROOTFS_POST_SCRIPT_ARGS |
| 49 | |
Stewart Smith | c4b9bf6 | 2018-08-24 13:30:15 +1000 | [diff] [blame] | 50 | op-build O=$O olddefconfig |
| 51 | op-build O=$O sdk |