From 4cacb437320c54658043d06bb9eaa77412300604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A5=93=E6=99=A9?= Date: Fri, 13 Sep 2024 14:27:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=8D=E8=83=BD=E9=80=9A=E8=BF=87=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 楓晩 --- thirdparty/postgresql/HPKBUILD | 14 ++++++++++++++ thirdparty/postgresql/HPKCHECK | 21 +++++---------------- thirdparty/postgresql/docs/hap_integrate.md | 15 +++++++++------ 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/thirdparty/postgresql/HPKBUILD b/thirdparty/postgresql/HPKBUILD index 12abee20..d9f9dae3 100644 --- a/thirdparty/postgresql/HPKBUILD +++ b/thirdparty/postgresql/HPKBUILD @@ -32,6 +32,7 @@ builddir=$pkgname-${pkgver} packagename=$builddir.tar.gz buildtools="configure" patch_flag=true +ln_flag=true source envset.sh host= @@ -64,6 +65,11 @@ build() { export ICU_CFLAGS="-I${LYCIUM_ROOT}/usr/icu/${ARCH}/include" export ICU_LIBS="-L${LYCIUM_ROOT}/usr/icu/${ARCH}/lib -licuuc -licui18n -licudata" ./configure --without-readline --enable-debug "$@" --host=$host > $buildlog 2>&1 + + sed -i 's/\/usr\/bin\/install/\/bin\/install/g' ./src/Makefile.global + sed -i 's/\/usr\/bin\/mkdir/\/data\/CIusr\/bin\/mkdir/g' ./src/Makefile.global + sed -i 's/\/usr\/sbin\/zic/\/data\/bin\/zic/g' ./src/Makefile.global + $MAKE > $buildlog 2>&1 ret=$? cd $OLDPWD @@ -71,6 +77,14 @@ build() { } package() { + if [ "$ln_flag" == true ] + then + mkdir -p /data/CIusr/bin + mkdir -p /data/bin + ln -s /usr/sbin/zic /data/bin + ln -s /bin/mkdir /data/CIusr/bin + ln_flag=false + fi cd $builddir-$ARCH-build $MAKE install >> $buildlog 2>&1 cd $OLDPWD diff --git a/thirdparty/postgresql/HPKCHECK b/thirdparty/postgresql/HPKCHECK index 58de1d2c..88ca74ec 100644 --- a/thirdparty/postgresql/HPKCHECK +++ b/thirdparty/postgresql/HPKCHECK @@ -18,24 +18,17 @@ source HPKBUILD > /dev/null 2>&1 logfile=${LYCIUM_THIRDPARTY_ROOT}/${pkgname}/${pkgname}_${ARCH}_${OHOS_SDK_VER}_test.log openharmonycheck() { - chmod 777 -R /tmp + chmod 777 -R $builddir-$ARCH-build chmod 777 -R $LYCIUM_FAULT_PATH/$pkgname - mkdir -p /usr/sbin/ - ln -s /bin/install /usr/bin/ - ln -s $LYCIUM_THIRDPARTY_ROOT/tzdb/tzdb-2024a-$ARCH-build/zic /usr/sbin/ - - touch Enter.txt - echo " - + cd $builddir-$ARCH-build + mkdir -p /data/bin/ + ln -s $LYCIUM_THIRDPARTY_ROOT/tzdb/tzdb-2024a-$ARCH-build/zic /data/bin/ - " > Enter.txt - busybox adduser postgres < Enter.txt - cd $builddir-$ARCH-build - su postgres make check > ${logfile} 2>&1 + /data/CIusr/bin/su system make check > ${logfile} 2>&1 res=$? if [ $res -ne 0 ] then @@ -43,14 +36,10 @@ openharmonycheck() { cp test-suite.log ${LYCIUM_FAULT_PATH}/${pkgname}/ fi - rm Enter.txt - chmod 771 -R /tmp chmod 664 -R $builddir-$ARCH-build chmod 664 -R $LYCIUM_FAULT_PATH/$pkgname - busybox deluser postgres - cd $OLDPWD return $res } diff --git a/thirdparty/postgresql/docs/hap_integrate.md b/thirdparty/postgresql/docs/hap_integrate.md index ad505e99..1ea933e6 100644 --- a/thirdparty/postgresql/docs/hap_integrate.md +++ b/thirdparty/postgresql/docs/hap_integrate.md @@ -141,15 +141,17 @@ 进入到对应版本目录,根据你的实际路径,参考执行如下命令 ``` +hdc target mount +export PATH=/data/CIusr/bin:$PATH chmod -R 777 postgresql-16.3-arm64-v8a-build -chmod 777 -R /tmp + export LD_LIBRARY_PATH=/data/tpc_c_cplusplus/lycium/usr/icu/arm64-v8a/lib:$ LD_LIBRARY_PATH -mkdir -p /usr/sbin/ -ln -s /bin/install /usr/bin/ -ln -s /data/tpc_c_cplusplus/thirdparty/tzdb/tzdb-2024a-arm64-v8a-build/zic /usr/sbin/ -busybox adduser postgres +mkdir -p /data/bin/ + +ln -s /data/tpc_c_cplusplus/thirdparty/tzdb/tzdb-2024a-arm64-v8a-build/zic /data/bin/ + cd /home/cwx1312875/tpc_c_cplusplus/thirdparty/postgresql/postgresql-16.3-arm64-v8a-build -su postgres +su system make check ``` @@ -160,6 +162,7 @@ make check ## FAQ 在进行make check测试时,对测试的目标设备需要进行联网对时间同步,否则可能会有个别测试用例失败的情况。 +并且确保CI工具的su命令和make命令可用 ## 参考资料 -- Gitee