diff --git a/thirdparty/postgresql/HPKBUILD b/thirdparty/postgresql/HPKBUILD index 12abee2045f113e097691bbc4b9bfb8d5e823c4a..d9f9dae387923984385cdaff34af9d394749f0a1 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 58de1d2c1780a0107f91d5a689014d3b57a1dd39..88ca74ec1941f57b528c385e0db74d23c7e24e91 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 ad505e995061d55dcb683386878dde41de5e7ec9..1ea933e6f636e2c8e4c1f9ebc6c9e4aeda4f9e7e 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命令可用 ## 参考资料