blob: 684856590c8659d4b34dd20f9c83881d8645c828 [file] [log] [blame]
Stewart Smithc4b9bf62018-08-24 13:30:15 +10001#!/bin/bash
2
3set -ex
4set -eo pipefail
5
6if [ -z "$1" ]; then
7 echo "No build distro specified"
8 exit 1;
9fi
10
11if [ -z "$2" ]; then
12 echo "No defconfig to build SDK from specified"
13 exit 1;
14fi
15
16if [ -z "$CCACHE_DIR" ]; then
17 CCACHE_DIR=`pwd`/.op-build_ccache
18fi
19
20shopt -s expand_aliases
21source op-build-env
22
23if [ -n "$DL_DIR" ]; then
24 unset BR2_DL_DIR
25 export BR2_DL_DIR=${DL_DIR}
26fi
27
28export O=`pwd`/output-$1-$2/
29op-build O=$O $2
Klaus Heinrich Kiwi9fda1c72020-04-17 10:18:38 -030030./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 Smithc4b9bf62018-08-24 13:30:15 +100050op-build O=$O olddefconfig
51op-build O=$O sdk