2022-02-05 14:23:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2020-present Fewtarius
|
|
|
|
|
|
|
|
###
|
|
|
|
### Simple script to build JELOS
|
|
|
|
###
|
|
|
|
|
|
|
|
if [ !"${ARCH}" == true ]
|
|
|
|
then
|
|
|
|
echo "export ARCH before building."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
export OS_VERSION=$(date +%Y%m%d)
|
|
|
|
export BUILD_DATE=$(date)
|
|
|
|
|
|
|
|
echo "Building ${DISTRO} for ${DEVICE}"
|
|
|
|
|
2022-04-10 11:31:14 +00:00
|
|
|
if [ ! "${DIRTY}" == true ]
|
2022-03-26 14:07:10 +00:00
|
|
|
then
|
|
|
|
# If this variable exists in the environment, expand it and clean those packages too.
|
2022-03-26 17:45:53 +00:00
|
|
|
PKG_CLEAN="${PKG_CLEAN} modules emulationstation retroarch lib32 jelos"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-26 14:07:10 +00:00
|
|
|
# Clean a few packages to ensure the build date and version are updated
|
|
|
|
for package in ${PKG_CLEAN}
|
|
|
|
do
|
|
|
|
./scripts/clean ${package}
|
|
|
|
done
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-26 14:07:10 +00:00
|
|
|
# Clean out old builds before starting the new one.
|
|
|
|
rm -f ./release/${DISTRO}-${DEVICE}.${ARCH}-*
|
2022-03-01 22:06:41 +00:00
|
|
|
|
2022-03-26 14:07:10 +00:00
|
|
|
# Remove the image root as it should be regenerated for every build.
|
|
|
|
rm -rf ./build.${DISTRO}-${DEVICE}.${ARCH}/image
|
|
|
|
fi
|
2022-03-25 18:51:38 +00:00
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
if [ "${ARCH}" == "aarch64" ]
|
|
|
|
then
|
|
|
|
make image
|
|
|
|
elif [ "${ARCH}" == "arm" ]
|
|
|
|
then
|
2022-04-10 11:31:14 +00:00
|
|
|
if [ "${BASE_ONLY}" == true ]
|
2022-04-10 11:27:57 +00:00
|
|
|
then
|
|
|
|
echo "Skipping 32bit."
|
|
|
|
exit 0
|
|
|
|
fi
|
2022-02-10 00:43:47 +00:00
|
|
|
scripts/build_compat
|
2022-02-05 14:23:32 +00:00
|
|
|
scripts/install arm32
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! $? == 0 ]
|
|
|
|
then
|
|
|
|
echo "Build failed..exiting."
|
|
|
|
exit 1
|
|
|
|
fi
|