Allow to use different template
@@ -17,7 +17,7 @@ echo "Building in $BRDIR"
echo $VERSION > $BRDIR/.piversion
echo $VERSION > buildroot/PIVERSION
-if [ "$2" == "" ]; then
+if [[ "$2" == "" || "$2" == "release" ]]; then
TEMPLATE=hifiberryos
else
TEMPLATE=$2
@@ -33,8 +33,13 @@ if [ ! -f $PLATFORM ]; then
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
