From 89ea840e74299eaa5e8680426622bb0d38df9e78 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 22 Jun 2023 20:13:47 +0200 Subject: [PATCH] board/common: append $INFIX_RELEASE to artifact names This patch affects the various artiact file names in release tarballs. The files /etc/os-release and /etc/version in the image use the actual GIT commit (git describe), as per post-build.sh Guiding principle: artifacts without release suffix are development or "nightly" builds. Artifacts *with* release suffix are released ones. This drops the $GITVER from .img files for consistency with the other artifacts, e.g. .gns3a and .pkg. Signed-off-by: Joachim Wiberg --- board/common/mkgns3a.sh | 6 +++++- board/common/mkrauc.sh | 5 ++++- board/common/post-image.sh | 24 ++++++++++-------------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/board/common/mkgns3a.sh b/board/common/mkgns3a.sh index 51a6145b..10837d6d 100755 --- a/board/common/mkgns3a.sh +++ b/board/common/mkgns3a.sh @@ -1,6 +1,10 @@ #!/bin/sh -NM="${1:-custom}" +if [ -n "$INFIX_RELEASE" ]; then + rel="-${INFIX_RELEASE}" +fi + +NM="${1:-custom}${rel}" RAM=${2:-512} IFNUM=${3:-1} diff --git a/board/common/mkrauc.sh b/board/common/mkrauc.sh index 7c71dbbb..14e33b29 100755 --- a/board/common/mkrauc.sh +++ b/board/common/mkrauc.sh @@ -3,8 +3,11 @@ set -e GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags) +if [ -n "$INFIX_RELEASE" ]; then + rel="-${INFIX_RELEASE}" +fi -name=$1 +name=$1${rel} arch=$2 sign=$3 diff --git a/board/common/post-image.sh b/board/common/post-image.sh index a402d233..92ff7358 100755 --- a/board/common/post-image.sh +++ b/board/common/post-image.sh @@ -8,16 +8,10 @@ NAME=infix-$(basename "$BR2_DEFCONFIG" _defconfig | tr _ - | sed 's/x86-64/x86_6 ver() { - [ -n "$RELEASE" ] || return - GITVER=$(git describe --tags --dirty) - if echo "$GITVER" |grep -q 'latest-'; then - latest=$(echo "$GITVER" | sed 's/latest-[0-9]*-\(g.*\)/\1/') - cd "$BR2_EXTERNAL_INFIX_PATH/buildroot" || exit 1 - br2ver=$(git describe --tags --dirty | sed 's/..\([^-]*\).*/\1/g') - cd - || exit 1 - GITVER=$br2ver-$latest + if [ -n "$INFIX_RELEASE" ]; then + printf -- "-%s" "$INFIX_RELEASE" + return fi - printf "-%s" "$GITVER" } load_cfg SIGN_ENABLED @@ -53,10 +47,12 @@ if [ "$FIT_IMAGE" = "y" ]; then $common/mkfit.sh fi -# For use outside of the build system, e.g., Qeneth if [ -z "${NAME##*minimal*}" ]; then - COMMON_NAME=$(echo "$NAME" | sed 's/-minimal//') - ln -sf rootfs.squashfs "$BINARIES_DIR/$COMMON_NAME$(ver).img" -else - ln -sf rootfs.squashfs "$BINARIES_DIR/$NAME$(ver).img" + NAME=$(echo "$NAME" | sed 's/-minimal//') +fi + +rel=$(ver) +ln -sf rootfs.squashfs "$BINARIES_DIR/${NAME}${rel}.img" +if [ -n "$rel" ]; then + ln -sf "$BINARIES_DIR/${NAME}${rel}.img" "$BINARIES_DIR/${NAME}.img" fi