3 Commits

Author SHA1 Message Date
remittor
4be0aa94a4 xmake: Always try create vermagic-*.list file 2026-02-04 12:42:46 +03:00
remittor
c86f52cdb4 xmake: Add check for CONFIG_BUILD_ALL_HOST_TOOLS option 2026-02-04 11:56:44 +03:00
remittor
e7b3d9673d build: Add check for CONFIG_BUILD_ALL_HOST_TOOLS option 2026-02-04 11:56:21 +03:00
2 changed files with 39 additions and 10 deletions

View File

@@ -312,11 +312,18 @@ jobs:
rm -rf build_dir/
mkdir -p staging_dir/host
mkdir -p build_dir/host
#############################################
CONFIG_BUILD_ALL_HOST_TOOLS=n
if grep '^CONFIG_BUILD_ALL_HOST_TOOLS=y' $CFG ; then
CONFIG_BUILD_ALL_HOST_TOOLS=y
fi
########### check tools Makefile ############
if grep -q '(CONFIG_USES_MINOR),y) += yafut' tools/Makefile ; then
echo WARN: file tools/Makefile allowed compile yafut
echo ERROR: yafut compile not supported !!!
exit 51
if [ "$CONFIG_BUILD_ALL_HOST_TOOLS" != y ]; then
if grep -q '(CONFIG_USES_MINOR),y) += yafut' tools/Makefile ; then
echo WARN: file tools/Makefile allowed compile yafut
echo ERROR: yafut compile not supported !!!
exit 51
fi
fi
########### get hash of dir with tools Makefiles ############
TOOLS_SRC_CRC=$( echo $TOOLS_SRC_HASH | cksum | awk '{print $1}' )
@@ -345,7 +352,7 @@ jobs:
TOOLS_STATUS="$${TOOLS_STATUS}$${T_STATUS}" ; \
printf " %s\n" "$$tool"; \
done; \
: > $(STAGING_DIR_HOST)/.tools_compile_$$TOOLS_STATUS; \
printf "$$TOOLS_STATUS" > $(STAGING_DIR_HOST)/.tools_compile_mask; \
} > $(TOOLS_COMPILE_LIST)
endef
@@ -361,11 +368,13 @@ jobs:
exit 55
fi
cp -f $HOST_TOOLS_STG_DIR/.tools_compile_list logs/tools_compile_list.txt
for fn in $HOST_TOOLS_STG_DIR/.tools_compile_[yn]*; do
[ -e $fn ] && cp -f $fn logs/$( basename "$fn" | sed 's/^\.//' )
done
TOOLS_COMPILE_CRC=$( cat $TOOLS_STG_DIR/.tools_compile_list | cksum | awk '{print $1}' )
echo "TOOLS_COMPILE_CRC=$TOOLS_COMPILE_CRC" >> $GITHUB_ENV
#######
TOOLS_COMPILE_MASK=$( cat $TOOLS_STG_DIR/.tools_compile_mask )
cp -f $HOST_TOOLS_STG_DIR/.tools_compile_mask logs/tools_compile_mask.txt
touch logs/tools_compile_$TOOLS_COMPILE_MASK
echo TOOLS_COMPILE_MASK = $TOOLS_COMPILE_MASK
###################################################
if [ "$USE_CACHE" = "true" ]; then
echo USE_CACHE = $USE_CACHE
@@ -376,7 +385,7 @@ jobs:
echo "HOST_TOOLS_BLD_DIR=$HOST_TOOLS_BLD_DIR" >> $GITHUB_ENV
echo "status=success" >> $GITHUB_OUTPUT
- name: Restore cache for host tools
- name: Restore host tools from cache
id: tools_cache_restore
if: github.event.inputs.use_cache == 'true'
uses: actions/cache/restore@v4

View File

@@ -101,6 +101,26 @@ function build_target {
echo "CONFIG_TESTING_KERNEL=y" >> $CFG
fi
X_VERSION_MK=$XDIR/include/version.mk
X_VERSION_NUMBER=$( grep -o -P '(?<=,\$\(VERSION_NUMBER\),).*(?=\))' $X_VERSION_MK 2>/dev/null )
[ -z "$X_VERSION_NUMBER" ] && { echo "ERROR: Cannot determine VERSION_NUMBER"; exit 30; }
echo "VERSION_NUMBER = $X_VERSION_NUMBER"
X_BOARD_NAME=$( sed -n 's/^CONFIG_TARGET_\([^_=\n]\+\)=y$/\1/p' $CFG )
[ -z "$X_BOARD_NAME" ] && { echo "ERROR: cannot found BOARD_NAME"; exit 31; }
X_SUBTARGET_NAME=$( sed -n 's/^CONFIG_TARGET_[^_=\n]\+_\([^_=\n]\+\)=y$/\1/p' $CFG )
[ -z "$X_SUBTARGET_NAME" ] && { echo "ERROR: cannot found SUBTARGET"; exit 31; }
echo "BOARD_NAME = $X_BOARD_NAME SUBTARGET = $X_SUBTARGET_NAME"
VERMAGIC_FN=$XDIR/vermagic-$X_BOARD_NAME-$X_SUBTARGET_NAME-$X_VERSION_NUMBER.list
if [ ! -f $VERMAGIC_FN -a -f $XDIR/vermagic_update.sh ]; then
bash $XDIR/vermagic_update.sh $X_BOARD_NAME $X_SUBTARGET_NAME
if [ ! -f $VERMAGIC_FN ]; then
echo "ERROR: cannot create file $VERMAGIC_FN"
exit 41
fi
fi
if [ 1 = 1 ]; then
MK_IMAGE=$XDIR/include/image.mk
CURDATE=$( date --utc +%y%m%d )
@@ -125,7 +145,7 @@ function build_target {
fi
fi
if [ 1 = 1 ]; then
if ! grep '^CONFIG_BUILD_ALL_HOST_TOOLS=y' $CFG ; then
MK_HOST_TOOLS=$XDIR/tools/Makefile
# tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += yafut
if grep -q '(CONFIG_USES_MINOR),y)' $MK_HOST_TOOLS ; then