Skip to content

Commit

Permalink
Fix kvx buildroot build
Browse files Browse the repository at this point in the history
Cleanup buildroot config generation
Use local.mk with cloned repos instead of using sed to inject SHA1 in .config
  • Loading branch information
fallen committed Mar 7, 2024
1 parent e61c7ca commit 2f41cf5
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions build-kvx-buildroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,29 @@ function git_clone() {
fi
}

git_clone https://github.com/kalray/buildroot.git "${SHA1_BUILDROOT}" coolidge
git_clone https://github.com/kalray/br2_external_coolidge "${SHA1_BR2_EXTERNAL}" coolidge

BR2_EXTERNAL_PATH=${PWD}/br2_external_coolidge
git_clone https://github.com/kalray/buildroot.git "${SHA1_BUILDROOT}" main
git_clone https://github.com/kalray/linux_coolidge "${SHA1_LINUX}" main
git_clone https://github.com/kalray/uclibc-ng "${SHA1_UCLIBC}" main
git_clone https://github.com/kalray/musl "${SHA1_MUSL}" main
git_clone https://github.com/kalray/strace "${SHA1_STRACE}" main
git_clone https://github.com/kalray/gcc "${SHA1_GCC}" main
git_clone https://github.com/kalray/binutils "${SHA1_BINUTILS}" main
git_clone https://github.com/kalray/gdb "${SHA1_GDB}" main

cd buildroot
make BR2_EXTERNAL=${BR2_EXTERNAL_PATH} O=build_kvx kvx_defconfig
support/kconfig/merge_config.sh -e "${BR2_EXTERNAL_PATH}" -O $PWD/build_kvx/ $PWD/build_kvx/.config ${BR2_EXTERNAL_PATH}/configs/github.config
make BR2_EXTERNAL=${BR2_EXTERNAL_PATH} O=build_kvx syncconfig

# Patch config to use selected binutils, gdb, gcc, linux, uClibc-ng SHA1
sed -i -e "s/BR2_BINUTILS_VERSION=.*/BR2_BINUTILS_VERSION=${SHA1_BINUTILS}/" build_kvx/.config
sed -i -e "s/BR2_GDB_VERSION=.*/BR2_GDB_VERSION=${SHA1_GDB}/" build_kvx/.config
sed -i -e "s/BR2_GCC_VERSION=.*/BR2_GCC_VERSION=${SHA1_GCC}/" build_kvx/.config
sed -i -e "s@BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION=.*@BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION=\"\$(call github,kalray,linux_coolidge,${SHA1_LINUX})/linux-${SHA1_LINUX}.tar.gz\"@" build_kvx/.config
sed -i -e "s/BR2_UCLIBC_VERSION=.*/BR2_UCLIBC_VERSION=${SHA1_UCLIBC}/" build_kvx/.config
sed -i -e "s/BR2_STRACE_VERSION=.*/BR2_STRACE_VERSION=${SHA1_STRACE}/" build_kvx/.config
# need to investigate barebox

# Append to hash files
echo "sha512 ${HASH_GCC} gcc-${SHA1_GCC}.tar.gz" >> package/gcc/gcc.hash
echo "sha512 ${HASH_GDB} gdb-${SHA1_GDB}.tar.gz" >> package/gdb/gdb.hash
echo "sha512 ${HASH_BINUTILS} binutils-${SHA1_BINUTILS}.tar.gz" >> package/binutils/binutils.hash
echo "sha512 ${HASH_UCLIBC} uclibc-${SHA1_UCLIBC}.tar.gz" >> package/uclibc/uclibc.hash
echo "sha512 ${HASH_STRACE} strace-${SHA1_STRACE}.tar.gz" >> package/strace/strace.hash

cd build_kvx
make BR2_EXTERNAL=${BR2_EXTERNAL_PATH}
make O=../build_buildroot_kvx kvx_defconfig
cd ../build_buildroot_kvx
cat > local.mk << EOF
LINUX_OVERRIDE_SRCDIR := ../linux_coolidge
MUSL_OVERRIDE_SRCDIR := ../musl
STRACE_OVERRIDE_SRCDIR := ../strace
UCLIBC_NG_TEST_OVERRIDE_SRCDIR := ../uclibc-ng-test
BINUTILS_OVERRIDE_SRCDIR := ../binutils
GCC_FINAL_OVERRIDE_SRCDIR := ../gcc
HOST_GDB_OVERRIDE_SRCDIR := ../gdb
GCC_INITIAL_OVERRIDE_SRCDIR := ../gcc
GDB_OVERRIDE_SRCDIR := ../gdb
UCLIBC_OVERRIDE_SRCDIR := ../uclibc-ng
EOF

make

0 comments on commit 2f41cf5

Please sign in to comment.