forked from hifiberry/hifiberry-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-config
executable file
·83 lines (68 loc) · 2.89 KB
/
build-config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
cd `dirname $0`
if [ "$1" == "" ]; then
VERSION=`cat .piversion`
echo No version given, assuming Pi$VERSION
else
VERSION=$1
fi
echo $VERSION > .piversion
BRDIR=`./brdir $VERSION`
echo "Building in $BRDIR"
echo $VERSION > $BRDIR/.piversion
echo $VERSION > buildroot/PIVERSION
if [[ "$2" == "" || "$2" == "release" ]]; then
TEMPLATE=hifiberryos
else
TEMPLATE=$2
fi
SRC=configs/$TEMPLATE
#SRC=configs/hifiberryos-gui
TMP=./tmpfile.$$
DST=./config.$$
PLATFORM=configs/config$VERSION
if [ ! -f $PLATFORM ]; then
echo Platform default configuration $PLATFORM not found. You need to create one using make xxxx_defconfig in buildroot
exit 1
fi
if [ ! -f $SRC ]; then
echo "template $SRC does not exist, aborting..."
exit 1
fi
cp $SRC $TMP
# These settings differ at at different Pi types
for i in BR2_ARCH_NEEDS_GCC_AT_LEAST_4_8 BR2_ARCH_NEEDS_GCC_AT_LEAST_4_9 BR2_ARCH_NEEDS_GCC_AT_LEAST_5 BR2_GCC_TARGET_CPU BR2_GCC_TARGET_FPU BR2_cortex_a53 BR2_cortex_a72 BR2_DEFCONFIG BR2_ROOTFS_POST_BUILD_SCRIPT BR2_ROOTFS_POST_IMAGE_SCRIPT BR2_LINUX_KERNEL_DEFCONFIG BR2_LINUX_KERNEL_INTREE_DTS_NAME BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4 BR2_ARM_CPU_HAS_NEON BR2_ARM_CPU_HAS_VFPV3 BR2_ARM_CPU_HAS_VFPV4 BR2_ARM_CPU_HAS_FP_ARMV8 BR2_ARM_CPU_HAS_THUMB BR2_ARM_CPU_ARMV6 BR2_arm1176jzf_s BR2_ARM_FPU_VFPV2 BR2_ARM_FPU_VFPV3 BR2_ARM_FPU_VFPV3D16 BR2_ARM_FPU_VFPV4 BR2_ARM_FPU_VFPV4D16 BR2_ARM_FPU_NEON BR2_ARM_FPU_FP_ARMV8 BR2_ARM_FPU_NEON_FP_ARMV8 BR2_SYSTEM_DHCP BR2_PACKAGE_BAYER2RGB_NEON BR2_PACKAGE_JPEG_SIMD_SUPPORT BR2_PACKAGE_NE10 BR2_PACKAGE_OPENBLAS BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET BR2_PACKAGE_OPENBLAS_ARCH_SUPPORTS BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4 BR2_ARM_INSTRUCTIONS_THUMB2 BR2_ARM_ENABLE_VFP BR2_ARM_CPU_ARMV7A BR2_cortex_a7; do
cat $TMP | grep -v $i > $DST
cat $PLATFORM | grep $i >> $DST
mv $DST $TMP
done
# Always disable these
for i in BR2_PACKAGE_KVM_UNIT_TESTS BR2_PACKAGE_WF111 BR2_PACKAGE_XEN BR2_TARGET_TS4800_MBRBOOT BR2_PACKAGE_VALGRIND; do
echo "$i=n" >> $TMP
done
if [ "$2" == "release" ]; then
# for the releases, remove debug tools
for i in BR2_PACKAGE_STRESS BR2_PACKAGE_STRESS_NG BR2_PACKAGE_STRACE BR2_PACKAGE_TCPDUMP; do
echo "$i=n" >> $TMP
done
for i in BR2_PACKAGE_CONFIGTXT_QUIET; do
echo "$i=y" >> $TMP
done
else
# use verbose mode for development release
for i in BR2_PACKAGE_CONFIGTXT_QUIET; do
echo "$i=n" >> $TMP
done
fi
# Roon and Squeezelite are not supported on the Pi Zero
if [ "$VERSION" == "0w" ]; then
for PKG in BR2_PACKAGE_RAAT BR2_PACKAGE_HIFIBERRY_SQUEEZELITE BR2_PACKAGE_LMSMPRIS BR2_PACKAGE_HIFIBERRY_MPD BR2_PACKAGE_MPD BR2_PACKAGE_MPD_MPRIS BR2_PACKAGE_HIFIBERRY_YMPD BR2_PACKAGE_SPOTIFY; do
echo "$PKG=n" >> $TMP
done
echo BR2_PACKAGE_HIFIBERRY_TOOLS_AUDIO_LITE=y >> $TMP
fi
mv $TMP $DST
mv $DST $BRDIR/.config
# Update version
TS=`date +%Y%m%d`
echo $TS > buildroot/VERSION