diff --git "a/\345\275\222\346\241\243/OH\347\216\257\345\242\203\346\220\255\345\273\272 .md" "b/\345\275\222\346\241\243/OH\347\216\257\345\242\203\346\220\255\345\273\272 .md" index ff9d0c39e6af0fbca0b2bf18f3b239f1e72fa7e4..597ca70de380696fa1e6934e1e9393d2b070073c 100644 --- "a/\345\275\222\346\241\243/OH\347\216\257\345\242\203\346\220\255\345\273\272 .md" +++ "b/\345\275\222\346\241\243/OH\347\216\257\345\242\203\346\220\255\345\273\272 .md" @@ -15,11 +15,10 @@ --------------------上述为wsl所需步骤,如使用VM等请忽略上述步骤----------------------- -4.执行:ls -l /bin/sh,如果为dash环境则需要修改为bash。sudo dpkg-reconfigure dash,选择No,将Ubuntu shell由dash修改为bash。再次执行:ls -l /bin/sh,会看到环境为bash。 +4.执行:ls -l /bin/sh,如果为dash环境则需要修改为bash。sudo dpkg-reconfigure dash,选择No,将Ubuntu shell由dash修改为bash。 +5.配置git与ssh公钥:https://www.jianshu.com/p/0c88bcaaaf13 -5.生成ubuntu的git公钥 用户:xxx 邮箱:xx@xx.com 链接:https://www.jianshu.com/p/0c88bcaaaf13 - -git配置 +6.git配置 配置用户名 git config --global user.name "用户名" 配置邮箱 @@ -33,8 +32,7 @@ ssh-keygen -t rsa -C "用户邮箱(同上)" cat ~/.ssh/id_rsa.pub 测试配置是否成功 ssh -T git@gitee.com - -6.将上面的公钥配置到gitee公钥 (gitee点头像--设置--安全设置--ssh公钥--添加公钥:把上面复制的公钥粘贴进去) +将上面的公钥配置到gitee公钥 (gitee点头像--设置--安全设置--ssh公钥--添加公钥:把上面复制的公钥粘贴进去) 7.安装依赖 sudo apt-get update @@ -45,8 +43,10 @@ sudo pip3 install --upgrade pip sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3-pip ruby -sudo apt-get install default-jdk && sudo apt-get install libssl-dev && sudo apt-get install genext2fs && sudo apt-get install u-boot-tools && sudo apt-get install mtools &&sudo apt-get install mtd-utils -sudo apt-get install scons && sudo apt-get install gcc-arm-none-eabi && sudo apt-get install gcc-arm-linux-gnueabi && sudo apt-get install genext2fs && sudo apt-get install liblz4-tool && sudo apt-get install openssl +sudo apt-get install default-jdk && sudo apt-get install libssl-dev && sudo apt-get install genext2fs +sudo apt-get install u-boot-tools && sudo apt-get install mtools &&sudo apt-get install mtd-utils +sudo apt-get install scons && sudo apt-get install gcc-arm-none-eabi && sudo apt-get install gcc-arm-linux-gnueabi +sudo apt-get install genext2fs && sudo apt-get install liblz4-tool && sudo apt-get install openssl sudo apt-get install libssl-dev && sudo apt install libtinfo5 8.安装repo 必须先切换为root,装完切换回普通用户 @@ -65,10 +65,15 @@ git lfs install sudo rm -rf /usr/bin/python sudo ln -s /usr/bin/python3 /usr/bin/python -11.repo拉代码 +11.repo拉代码 +(1) 初始化repo repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify repo init -u git@gitee.com:openharmony/manifest.git -b monthly --no-repo-verify(monthly分支) repo init -u git@gitee.com:openharmony/manifest.git -b OpenHarmony-3.2-Beta3 --no-repo-verify +# 拉取指定日期代码 +repo forall -c 'commitID=`git log --before "yyyy-MM-dd HH:mm" -1 --pretty=format:"%H"`;git reset --hard $commitID' +https://blog.csdn.net/fanyun_01/article/details/127129523 +(2)拉取代码 repo sync -c # 下载代码等待时间长 repo forall -c 'git lfs pull' bash build/prebuilts_download.sh diff --git "a/\345\275\222\346\241\243/\347\274\226\350\257\221\351\227\256\351\242\230\350\247\243\345\206\263\346\216\252\346\226\275.md" "b/\345\275\222\346\241\243/\347\274\226\350\257\221\351\227\256\351\242\230\350\247\243\345\206\263\346\216\252\346\226\275.md" index afef71c089d2b07bfa265c5eef0267398ba017d3..caf1acef41edfa4ad6d8623cf9e5689dfe73ac3e 100644 --- "a/\345\275\222\346\241\243/\347\274\226\350\257\221\351\227\256\351\242\230\350\247\243\345\206\263\346\216\252\346\226\275.md" +++ "b/\345\275\222\346\241\243/\347\274\226\350\257\221\351\227\256\351\242\230\350\247\243\345\206\263\346\216\252\346\226\275.md" @@ -16,53 +16,53 @@ 5、修改完,保存,重启。 - ## 四、编译 - -1. 编译 L2 获取 prebuilts: -```shell -bash build/prebuilts_download.sh # 下载并解压 prebuilts 压缩包到指定位置 -``` -./build.sh --product-name rk3568 --build-target dsoftbus_standard_test +蓝区L1(3516)、L2(3568)下文统一称为L1/L2 不特殊说明默认编译为32系统 +1. 编译命令: +./build.sh --product-name hispark_taurus_standard L1 image +./build.sh --product-name rk3568 --ccache --build-target make_all --target-cpu arm64 L2 64位 image (蓝区基本已放弃) +./build.sh --product-name rk3568 --ccache --build-target make_all 32位 L2 image +./build.sh --product-name rk3568 --fast-rebuild 跳过预编译(基于上一次修改,不修改gn情况下可使用) -2. L2 编译命令: -```shell -./build.sh --product-name hispark_taurus_standard 3516 -./build.sh --product-name rk3568 --ccache --build-target make_all --target-cpu arm64 3568 64位 -./build.sh --product-name rk3568 --ccache --build-target make_all 32位 -./build.sh --product-name rk3568 --ccache --build-target make_test UT -``` -./build.sh --product-name rk3568 --fast-rebuild +测试用例编译命令:(包括UT,FUZZ,distributedtest,benchmark) +./build.sh --product-name hispark_taurus_standard --build-target make_test L1 +./build.sh --product-name rk3568 --ccache --build-target make_test L2所有用例(编译较多、时间较长, 建议仅编译自己子系统) +./build.sh --product-name rk3568 --build-target dsoftbus_test L2软总线用例 +./build.sh --product-name rk3568 --ccache --build-target dsoftbus_test --target-cpu arm64 -repo sync -c --no-tags -j1 --fail-fast +恒玄开发板(L0) +hb set -root . +bestechnic + > display_demo +编译命令 +hb build -f -编译xts[进入对应目录] +编译xts[进入对应目录] /test/xts/ ./build.sh product_name=rk3568 suite=communication system_size=standard (communication替换为对应的,如acts、dcts等) -## F&Q(持续更新 +## 问题及建议 ### 1. 异常情况不知道怎么具体怎么解决,编译问题三板斧用起来! -- 删除 out - -```shell +(1) 删除 out rm -rf out -``` -- 更新工具链: -```shell + +(2) ./build/prebuilts_download.sh -``` + - 更新二进制和代码: -```shell -# 二进制更新 -repo forall -c "git lfs pull" # 代码更新 repo sync -c --no-tags +# 二进制更新 +repo forall -c "git lfs pull" -# 拉取指定日期代码 -repo forall -c 'commitID=`git log --before "yyyy-MM-dd HH:mm" -1 --pretty=format:"%H"`;git reset --hard $commitID' -https://blog.csdn.net/fanyun_01/article/details/127129523 -``` +修改自己部件后代码更新失败 +例: +error: Unable to fully sync the tree. +error: Checking out local projects failed. +Failing repos: +foundation/communication/dsoftbus +Try re-running with "-j1 --fail-fast" to exit at the first error. git checkout . 代码拉取失败: @@ -71,126 +71,82 @@ rm -rf developtools repo sync --force-sync -显示: -error: Unable to fully sync the tree. -error: Checking out local projects failed. -Failing repos: -foundation/communication/dsoftbus -Try re-running with "-j1 --fail-fast" to exit at the first error. +回退代码到库上最新节点(先进行本地保存自身代码,再使用) +repo forall -c 'git reset --hard ; git clean -fdx' -repo forall -c 'git reset --hard ; git clean -fdx'(慎用) +更新工具链出现 + +npm ERR! Maximum call stack size exceeded +npm ERR! A complete log of this run can be found in: + +cd arkcompiler/ets_frontend/ts2panda +rm package-lock.json +rm -fr node_modules/ 编译打包失败: apt-get install genext2fs - apt-get install clang -gitee 提交代码 +gitee 修改代码 +(1)拉取私仓 +先从主仓Fork一份至私仓,拉取代码 git clone https://gitee.com/lei-mingqiang/communication_dsoftbus_16.git 私仓地址 分支 git clone https://gitee.com/lei-mingqiang/communication_dsoftbus_16.git -b 分支名 -提交 +提交修改 git status git diff git add . git commit -s -git push origin master /分支名 +git push origin master/分支名 -本地修改强推 +本地修改强推适用于上面提交修改一次后 git add . git commit --amend -git push origin -f - - -ut测试用例编译命令: - ./build.sh --product-name Hi3516DV300 --build-target make_test 3516 - ./build.sh --product-name rk3568 --build-target make_test 3568 - --build-target dsoftbus_standard_test - - ./build.sh --product-name rk3568 --build-target dsoftbus_standard_test - -./build.sh --product-name rk3568 --ccache --build-target dsoftbus_test --target-cpu arm64 +git push origin -f(不分分支主干) +跑测试套 run -t FUZZ -ts OpenAuthSessionFuzzTest run -t UT -tp dsoftbus_standard -tm connection -ts DiscManagerTest run -t UT -tp dsoftbus_standard -tm connection -ts DiscSdkTest run -t UT -tp dsoftbus_standard -tm connection -ts softbus_conn_manager_test -hdc file send D:\test_64\test\unittest\dsoftbus_standard\discovery\DiscSdkTest /data/test/ -修改p2p使能: -vim adapter/default_config/feature_config/standard/config.gni - - -daily构建版本 -http://ci.openharmony.cn/dailybuilds - -转测版本路径https://gitee.com/openharmony-sig/oh-inner-release-management/blob/master/Release-Testing-Version.md +推送文件进入设备 +hdc_std file send 本地文件路径(D:\test\xxxTest) 设备路径(如:/data/test) +hdc_std file recv 设备路径(/data/log/xxxx.log) 本地路径(C:\User\xxx\Desktop\UtLog) +推送so +在存放so文件夹内打开控制台输入下方两条(lib与lib64实际为32位与64位so存放地址) hdc_std shell "mount -o rw,remount /" for %f in (*.so) do hdc_std file send %f /system/lib/ -推so: + hdc_std shell "mount -o rw,remount /" for %f in (*.so) do hdc_std file send %f /system/lib64/ -hdc_std -t 7001005458323933328a519c2fa83800 shell "mount -o rw,remount /" -for %f in (*.so) do hdc_std -t 7001005458323933328a519c2fa83800 file send %f /system/lib64/ - -hdc_std -t 7001005458323933328a52dc31c73800 shell "mount -o rw,remount /" -for %f in (*.so) do hdc_std -t 7001005458323933328a52dc31c73800 file send %f /system/lib64/ - -推测试用例 -hdc_std file send C:\Users\lmq\Desktop\T\RefreshLNN\BusCenterSdkTest_MID /data/test -板子文件出本地 -hdc_std file recv /data/udp2.pacp ./Desktop - +日构件版本地址 +http://ci.openharmony.cn/dailys/dailybuilds +转测版本路径 +https://gitee.com/openharmony-sig/oh-inner-release-management/blob/master/Release-Testing-Version.md - -L0恒玄 -hb set -root . -bestechnic - > display_demo -编译 -hb build -f - -工具链出现此情况 -Traceback (most recent call last): - File "/home/liusong/build/prebuilts_download.py", line 293, in - sys.exit(main()) - File "/home/liusong/build/prebuilts_download.py", line 287, in main - _hwcloud_download(args, copy_config, args.bin_dir, args.code_dir) - File "/home/liusong/build/prebuilts_download.py", line 138, in _hwcloud_download - _npm_install(args, code_dir, unzip_dir, unzip_filename) - File "/home/liusong/build/prebuilts_download.py", line 192, in _npm_install - raise Exception(err.decode()) -Exception: npm WARN using --force I sure hope you know what you are doing. -npm ERR! Maximum call stack size exceeded - -npm ERR! A complete log of this run can be found in: -npm ERR! /root/.npm/_logs/2022-08-25T06_37_20_784Z-debug.log -cd arkcompiler/ets_frontend/ts2panda -rm package-lock.json -rm -fr node_modules/ 查看依赖 sed -in 's/\"-Wl,--as-needed\",/# \"-Wl,--as-needed\",/g' build/config/compiler/BUILD.gn find . -name "*" -type f -printf "%p\n" | xargs -I param sh -c "echo param; readelf -d param | grep NEEDED" > bad.log -门禁中format_check项失败 +格式化gn文件 ./prebuilts/build-tools/linux-x86/bin/gn format gn路径 -crash后查看堆栈信息 addr2line -Cfie so 进程号 +crash后查看堆栈信息 addr2line -Cfie so/用例名 进程号 错误: make:**[Makefile:1162:vmlinux] -sudo apt install dwarves +sudo apt install dwarves sudo apt install libelf-dev - -