Skip to content

Commit

Permalink
fix: get issue version from CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mingzhangqun committed Sep 14, 2024
1 parent 557db45 commit e59af2c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 31 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ override OUTDIR := $(TOPDIR)/$(OUTDIR)
endif

export TOPDIR EXTERNAL DEFCONFIGS OUTDIR
export BR2_EXTERNAL="$(EXTERNAL)/br2-external"

$(TARGETS): %:
@echo "build $@"
Expand Down
44 changes: 31 additions & 13 deletions external/build.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
#!/bin/bash

export PROJECT_OUT=$OUTDIR/$1
export PROJECT_DIR=$(dirname $(realpath $DEFCONFIGS/${1}_defconfig))

PROJECT_OUT=$OUTDIR/$1
export PROJECT_OUT
export BR2_EXTERNAL="$EXTERNAL/br2-external"
export BUILDROOT_DIR=$(basename $(realpath $TOPDIR/buildroot*))
export UBOOT_DIR=$(basename $(realpath $TOPDIR/u-boot*))
export LINUX_DIR=$(basename $(realpath $TOPDIR/linux*))

PROJECT_DIR=$(dirname $(realpath $DEFCONFIGS/${1}_defconfig))
export PROJECT_DIR
CHANGELOG=$TOPDIR/CHANGELOG.md

source $EXTERNAL/setenv.sh
defconfig $1

md5file=${1}_md5sum.txt
ISSUE_FILE=$PROJECT_DIR/rootfs/etc/issue
if [ -f $ISSUE_FILE ]; then
issue=$(cat $ISSUE_FILE)
fi
if [ -z "$issue" ]; then
target_name="${1}"
else
target_name=${CHIP}

version_name=$issue
target_name=${target_name}_${version_name}

# TODO: get version from CHANGELOG.md base on project name
if [ -f $CHANGELOG ]; then
verison_num=$(awk -F' ' 'BEGIN {f=0} /^## .*/ && !f {print $2; f=1; exit}' $CHANGELOG)
echo "$version_name $verison_num" > $BR_OVERLAY_DIR/etc/issue
cp -fv $CHANGELOG $BR_OVERLAY_DIR/etc/
target_name=${target_name}_${verison_num}
fi

target_name=${target_name}_${STORAGE_TYPE}
fi

export LIVE555_DIR=${TPU_SDK_INSTALL_PATH}
build_all || exit 1

##################################################
# gen packages
md5file=${1}_md5sum.txt
issue=$(cat $PROJECT_DIR/rootfs/etc/issue)
if [ -z "$issue" ]; then
target_name="${1}"
else
version_name=$(echo $issue | awk '{print $1}')
version_num=$(echo $issue | awk '{print $2}')
target_name=${CHIP}_${version_name}_${version_num}_${STORAGE_TYPE}
fi
echo "Target name: ${target_name}"

function gen_emmc_zip() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
reCamera 0.0.4
reCamera
31 changes: 15 additions & 16 deletions external/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ rsync_dir ./FreeRTOS-Kernel/ freertos/Source/
rsync_dir ./Lab-Project-FreeRTOS-POSIX/ freertos/Source/FreeRTOS-Plus-POSIX/
rsync_dir ./fsbl
rsync_dir ./opensbi
rsync_dir ./u-boot-2021.10
rsync_dir ./linux_5.10
rsync_dir ./$UBOOT_DIR
rsync_dir ./$LINUX_DIR
rsync_dir ./ramdisk
rsync_dir ./osdrv
rsync_dir ./cvi_mpi
rsync_dir ./oss
rsync_dir ./SensorSupportList/ cvi_mpi/component/isp
rsync_dir ./buildroot-2021.05
rsync_dir ./$BUILDROOT_DIR
rsync_dir ./cnpy
rsync_dir ./cvibuilder
rsync_dir ./cvikernel
Expand All @@ -41,29 +41,22 @@ rsync_dir ./cvi_rtsp
# patch externals
###################################
rsync_dir $EXTERNAL/build .
rsync_dir $EXTERNAL/buildroot/ buildroot*/
rsync_dir $EXTERNAL/buildroot/ $BUILDROOT_DIR/
rsync_dir $EXTERNAL/isp_tuning .
rsync_dir $EXTERNAL/ramdisk/ ramdisk/
rsync_dir $EXTERNAL/u-boot/ u-boot*/

# copy project rootfs to buildroot overlay
rsync_dir $PROJECT_DIR/rootfs/ buildroot*/board/cvitek/CV181X/overlay/
cp -fv $TOPDIR/CHANGELOG.md $PROJECT_OUT/buildroot*/board/cvitek/CV181X/overlay/etc/
rsync_dir $EXTERNAL/u-boot/ $UBOOT_DIR/

# driver: sg200x is soft link to cv182x
rsync -av $EXTERNAL/SensorSupportList/sensor/sg200x/ $PROJECT_OUT/cvi_mpi/component/isp/sensor/cv182x/

# isp parameter
cp -v $TOPDIR/isp_tuning/copyBin.sh $PROJECT_OUT/isp_tuning/

# patch buildroot packages
for subdir in $EXTERNAL/buildroot/package/*; do
if [ -d $subdir ]; then
pkg_name=$(basename $subdir)
if [ -f $subdir/Config.in ]; then
rsync -av --delete $subdir/ $PROJECT_OUT/buildroot*/package/$pkg_name/
rsync -av --delete $subdir/ $PROJECT_OUT/$BUILDROOT_DIR/package/$pkg_name/
else
rsync -av $subdir/ $PROJECT_OUT/buildroot*/package/$pkg_name/
rsync -av $subdir/ $PROJECT_OUT/$BUILDROOT_DIR/package/$pkg_name/
fi
fi
done
Expand Down Expand Up @@ -135,11 +128,17 @@ function pack_cfg
{(
print_notice "Run ${FUNCNAME[0]}() overided by $0"

# copy project rootfs to buildroot overlay
rsync_dir $PROJECT_DIR/rootfs/ $BR_OVERLAY_DIR

# isp parameter
cp -v $TOPDIR/isp_tuning/copyBin.sh $ISP_TUNING_PATH

_dir="$OUTPUT_DIR/rootfs/mnt/cfg/param"
mkdir -p $_dir

pushd "$ISP_TUNING_PATH"
./copyBin.sh $_dir "$SENSOR_TUNING_PARAM"
pushd $ISP_TUNING_PATH
./copyBin.sh $_dir $SENSOR_TUNING_PARAM
popd

mkdir -p $BR_OVERLAY_DIR/mnt
Expand Down

0 comments on commit e59af2c

Please sign in to comment.