Make OpenWRT build target configurable

This commit is contained in:
klzgrad 2019-12-02 01:39:07 +08:00
parent 04d06b1e0e
commit 9ecb32d4ae
5 changed files with 16 additions and 2668 deletions

View File

@ -23,7 +23,7 @@ matrix:
- name: "openwrt-mipsel_24kc"
os: linux
dist: bionic
env: EXTRA_FLAGS='target_cpu="mipsel" mips_arch_variant="r2" mips_float_abi="soft" mips_tune="24kc" use_allocator="none" use_allocator_shim=false is_openwrt=true ldso_path="/lib/ld-musl-mipsel-sf.so.1"' OPENWRT_ARCH=mipsel_24kc OPENWRT_RELEASE=19.07.0-rc1 OPENWRT_GCC=gcc-7.4.0
env: EXTRA_FLAGS='target_cpu="mipsel" mips_arch_variant="r2" mips_float_abi="soft" mips_tune="24kc" use_allocator="none" use_allocator_shim=false is_openwrt=true ldso_path="/lib/ld-musl-mipsel-sf.so.1"' OPENWRT_FLAGS='arch=mipsel_24kc release=19.07.0-rc1 gcc_ver=7.4.0 target=ramips subtarget=rt305x'
- name: "osx"
os: osx
osx_image: xcode10.2

View File

@ -12,7 +12,7 @@ build_sysroot() {
}
if [ "$ARCH" = Linux ]; then
if [ "$OPENWRT_ARCH" ]; then
if [ "$OPENWRT_FLAGS" ]; then
./get-openwrt.sh
else
eval "$EXTRA_FLAGS"

View File

@ -2,14 +2,7 @@
set -ex
arch=$OPENWRT_ARCH
release=$OPENWRT_RELEASE
gcc_ver=$OPENWRT_GCC
case "$arch" in
mipsel_24kc) target=ramips subtarget=rt305x;;
*) exit 1;;
esac
eval "$OPENWRT_FLAGS"
sysroot=$PWD/out/sysroot-build/openwrt/$release/$arch
if [ -d $sysroot/lib ]; then
@ -17,17 +10,20 @@ if [ -d $sysroot/lib ]; then
fi
mkdir -p $sysroot
SDK_PATH=openwrt-sdk-$release-$target-${subtarget}_${gcc_ver}_musl.Linux-x86_64
SDK_PATH=openwrt-sdk-$release-$target-${subtarget}_gcc-${gcc_ver}_musl.Linux-x86_64
SDK_URL=https://downloads.openwrt.org/releases/$release/targets/$target/$subtarget/$SDK_PATH.tar.xz
rm -rf $SDK_PATH
curl $SDK_URL | tar xJf -
cd $SDK_PATH
./scripts/feeds update base packages
./scripts/feeds install libnss
cp ../$target-$subtarget.config .config
yes | make oldconfig
make defconfig
for flag in ALL_NONSHARED ALL_KMODS ALL SIGNED_PACKAGES; do
sed -i "s/CONFIG_$flag=y/# CONFIG_$flag is not set/" .config
done
make oldconfig
make
full_root=staging_dir/toolchain-${arch}_${gcc_ver}_musl
full_root=staging_dir/toolchain-${arch}_gcc-${gcc_ver}_musl
cp -r staging_dir/target-${arch}_musl/usr $full_root
echo '
./include

View File

@ -1,8 +1,11 @@
get_sysroot() {
if [ "$OPENWRT_FLAGS" ]; then
eval "$OPENWRT_FLAGS"
echo "out/sysroot-build/openwrt/$release/$arch"
return
fi
eval "$EXTRA_FLAGS"
if [ "$OPENWRT_ARCH" -a "$OPENWRT_RELEASE" ]; then
echo "out/sysroot-build/openwrt/$OPENWRT_RELEASE/$OPENWRT_ARCH"
elif [ ! "$target_sysroot" ]; then
if [ ! "$target_sysroot" ]; then
local sysroot_type
case "$target_cpu" in
x64) sysroot_type=amd64;;

File diff suppressed because it is too large Load Diff