git am failed:cannot open <dir>/*.patch: No such file

本文介绍了一个在使用 Git 的脚本时遇到的问题:无法打开包含符号路径(以~开头)的补丁文件。文章解释了~在路径中的含义,并提供了解决方案——用绝对路径代替符号路径。

git am ~/xxx/xxx/xxx/*.patch

这个命令在脚本中执行的时候,出现了:

/usr/lib/git-core/git-am: 209: /usr/lib/git-core/git-am: cannot open ~/projects-develop/bosch-patch-scripts/bosch-patch-final2/u-boot/*.patch: No such file


不能解析:~指代的具体路径,代替~用绝对路径就好了。

admin12@admin12-virtual-machine:~/openwrt$ ./scripts/feeds update -a ./scripts/feeds install -a Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git^65e91999666573eac2d9d57ed4ecadac029cf8f3' ... 正克隆到 './feeds/packages'... remote: Enumerating objects: 225080, done. remote: Counting objects: 100% (225080/225080), done. remote: Compressing objects: 100% (90892/90892), done. error: RPC 失败。curl 56 GnuTLS recv error (-54): Error in the pull function. fetch-pack: unexpected disconnect while reading sideband packet fatal: 过早的文件结束符(EOF) fatal: fetch-pack:无效的 index-pack 输出 failed. Updating feed 'luci' from 'https://git.openwrt.org/project/luci.git^ab22243b4928bd81936f56422970c10192cdad8e' ... 正克隆到 './feeds/luci'... fatal: 无法访问 'https://git.openwrt.org/project/luci.git/':gnutls_handshake() failed: The TLS connection was non-properly terminated. failed. Updating feed 'routing' from 'https://git.openwrt.org/feed/routing.git^83f515d7ae76e5a7460c0eacadae806363df05a1' ... 正克隆到 './feeds/routing'... fatal: 无法访问 'https://git.openwrt.org/feed/routing.git/':gnutls_handshake() failed: The TLS connection was non-properly terminated. failed. Updating feed 'telephony' from 'https://git.openwrt.org/feed/telephony.git^8ecbdabc7c5cadbe571eb947f5cd333a5a785010' ... 正克隆到 './feeds/telephony'... remote: Enumerating objects: 12121, done. remote: Counting objects: 100% (12121/12121), done. remote: Compressing objects: 100% (7482/7482), done. remote: Total 12121 (delta 6806), reused 8135 (delta 4394), pack-reused 0 接收对象中: 100% (12121/12121), 2.48 MiB | 32.00 KiB/s, 完成. 处理 delta 中: 100% (6806/6806), 完成. 切换到一个新分支 '8ecbdabc7c5cadbe571eb947f5cd333a5a785010' /home/admin12/openwrt Create index file './feeds/telephony.index' Checking 'working-make'... ok. Checking 'case-sensitive-fs'... ok. Checking 'proper-umask'... ok. Checking 'gcc'... failed. Checking 'working-gcc'... ok. Checking 'g++'... failed. Checking 'working-g++'... ok. Checking 'ncurses'... ok. Checking 'perl-thread-queue'... ok. Checking 'tar'... ok. Checking 'find'... ok. Checking 'bash'... ok. Checking 'patch'... ok. Checking 'diff'... ok. Checking 'cp'... ok. Checking 'seq'... ok. Checking 'awk'... failed. Checking 'grep'... ok. Checking 'getopt'... ok. Checking 'stat'... ok. Checking 'unzip'... ok. Checking 'bzip2'... ok. Checking 'wget'... ok. Checking 'perl'... ok. Checking 'python3-cleanup'... ok. Checking 'python'... failed. Checking 'git'... ok. Checking 'file'... ok. Checking 'ldconfig-stub'... ok. Build dependency: Please install the GNU C Compiler (gcc) 4.8 or later Build dependency: Please install the GNU C++ Compiler (g++) 4.8 or later Build dependency: Please install GNU 'awk' Build dependency: Please install Python 2.x Prerequisite check failed. Use FORCE=1 to override. gmake: *** [/home/admin12/openwrt/include/toplevel.mk:168:staging_dir/host/.prereq-build] 错误 1 awk: include/scan.awk: line 21: function asort never defined awk: include/scan.awk: line 21: function asort never defined Collecting package info: done awk: include/scan.awk: line 21: function asort never defined awk: include/scan.awk: line 21: function asort never defined Collecting target info: done Checking 'working-make'... ok. Checking 'case-sensitive-fs'... ok. Checking 'proper-umask'... ok. Checking 'gcc'... failed. Checking 'working-gcc'... ok. Checking 'g++'... failed. Checking 'working-g++'... ok. Checking 'ncurses'... ok. Checking 'perl-thread-queue'... ok. Checking 'tar'... ok. Checking 'find'... ok. Checking 'bash'... ok. Checking 'patch'... ok. Checking 'diff'... ok. Checking 'cp'... ok. Checking 'seq'... ok. Checking 'awk'... failed. Checking 'grep'... ok. Checking 'getopt'... ok. Checking 'stat'... ok. Checking 'unzip'... ok. Checking 'bzip2'... ok. Checking 'wget'... ok. Checking 'perl'... ok. Checking 'python3-cleanup'... ok. Checking 'python'... failed. Checking 'git'... ok. Checking 'file'... ok. Checking 'ldconfig-stub'... ok. Build dependency: Please install the GNU C Compiler (gcc) 4.8 or later Build dependency: Please install the GNU C++ Compiler (g++) 4.8 or later Build dependency: Please install GNU 'awk' Build dependency: Please install Python 2.x Prerequisite check failed. Use FORCE=1 to override. gmake[1]: *** [/home/admin12/openwrt/include/toplevel.mk:168: staging_dir/host/.prereq-build] Error 1 gmake: *** [/home/admin12/openwrt/include/toplevel.mk:83:prepare-tmpinfo] 错误 2 Cannot open './tmp/.packageinfo': No such file or directory Can't open file './tmp/.targetinfo': No such file or directory Ignoring feed 'packages' - index missing Ignoring feed 'luci' - index missing Ignoring feed 'routing' - index missing Installing all packages from feed packages. Ignoring feed 'packages' - index missing Installing all packages from feed luci. Ignoring feed 'luci' - index missing Installing all packages from feed routing. Ignoring feed 'routing' - index missing Installing all packages from feed telephony. admin12@admin12-virtual-machine:~/openwrt$
09-20
bell@bell-virtual-machine:~/nm/openwrt-15.05.1$ make V=s -j4 make[1]: Entering directory '/home/bell/nm/openwrt-15.05.1' make[2]: Entering directory '/home/bell/nm/openwrt-15.05.1' make[2]: Entering directory '/home/bell/nm/openwrt-15.05.1' + mkdir -p /home/bell/nm/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi + mkdir -p /home/bell/nm/openwrt-15.05.1/staging_dir/host + cd /home/bell/nm/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi + mkdir -p bin lib include stamp + cd /home/bell/nm/openwrt-15.05.1/staging_dir/host + mkdir -p bin lib include stamp mkdir -p /home/bell/nm/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp mkdir -p /home/bell/nm/openwrt-15.05.1/build_dir/host/stamp /home/bell/nm/openwrt-15.05.1/staging_dir/host/include/sys touch /home/bell/nm/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/.prepared install -m0644 /home/bell/nm/openwrt-15.05.1/tools/include/*.h /home/bell/nm/openwrt-15.05.1/staging_dir/host/include/ install -m0644 /home/bell/nm/openwrt-15.05.1/tools/include/sys/*.h /home/bell/nm/openwrt-15.05.1/staging_dir/host/include/sys/ ln -sf lib /home/bell/nm/openwrt-15.05.1/staging_dir/host/lib64 touch /home/bell/nm/openwrt-15.05.1/staging_dir/host/.prepared make[3]: Entering directory '/home/bell/nm/openwrt-15.05.1/tools/patch' make[3]: Entering directory '/home/bell/nm/openwrt-15.05.1/tools/make-ext4fs' make[3]: Entering directory '/home/bell/nm/openwrt-15.05.1/tools/sstrip' rm -rf /home/bell/nm/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview make[2]: Leaving directory '/home/bell/nm/openwrt-15.05.1' make[3]: Entering directory '/home/bell/nm/openwrt-15.05.1/tools/firmware-utils' gcc -O2 -I/home/bell/nm/openwrt-15.05.1/staging_dir/host/include -I/home/bell/nm/openwrt-15.05.1/staging_dir/host/usr/include -include endian.h -o /home/bell/nm/openwrt-15.05.1/build_dir/host/sstrip/sstrip src/sstrip.c gcc: error trying to exec 'cc1': execvp: No such file or directory Makefile:25: recipe for target '/home/bell/nm/openwrt-15.05.1/build_dir/host/sstrip/.built' failed make[3]: *** [/home/bell/nm/openwrt-15.05.1/build_dir/host/sstrip/.built] Error 1 make[3]: Leaving directory '/home/bell/nm/openwrt-15.05.1/tools/sstrip' tools/Makefile:122: recipe for target 'tools/sstrip/compile' failed make[2]: *** [tools/sstrip/compile] Error 2 make[2]: *** Waiting for unfinished jobs.... (cd /home/bell/nm/openwrt-15.05.1/build_dir/host/patch-2.7.5/; if [ -x configure ]; then cp -fpR /home/bell/nm/openwrt-15.05.1/scripts/config.{guess,sub} /home/bell/nm/openwrt-15.05.1/build_dir/host/patch-2.7.5// &amp;&amp; bash ./configure CC="gcc" CFLAGS="-O2 -I/home/bell/nm/openwrt-15.05.1/staging_dir/host/include -I/home/bell/nm/openwrt-15.05.1/staging_dir/host/usr/include" CPPFLAGS="-I/home/bell/nm/openwrt-15.05.1/staging_dir/host/include -I/home/bell/nm/openwrt-15.05.1/staging_dir/host/usr/include" LDFLAGS="-L/home/bell/nm/openwrt-15.05.1/staging_dir/host/lib -L/home/bell/nm/openwrt-15.05.1/staging_dir/host/usr/lib" SHELL="/usr/bin/env bash" --target=x86_64-linux-gnu --host=x86_64-linux-gnu --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/home/bell/nm/openwrt-15.05.1/staging_dir/host --exec-prefix=/home/bell/nm/openwrt-15.05.1/staging_dir/host --sysconfdir=/home/bell/nm/openwrt-15.05.1/staging_dir/host/etc --localstatedir=/home/bell/nm/openwrt-15.05.1/staging_dir/host/var --sbindir=/home/bell/nm/openwrt-15.05.1/staging_dir/host/bin ; fi ) make[3]: Leaving directory '/home/bell/nm/openwrt-15.05.1/tools/make-ext4fs' mkdir -p /home/bell/nm/openwrt-15.05.1/build_dir/host/firmware-utils/bin gcc -O2 -I/home/bell/nm/openwrt-15.05.1/staging_dir/host/include -I/home/bell/nm/openwrt-15.05.1/staging_dir/host/usr/include -include endian.h -L/home/bell/nm/openwrt-15.05.1/staging_dir/host/lib -L/home/bell/nm/openwrt-15.05.1/staging_dir/host/usr/lib -o /home/bell/nm/openwrt-15.05.1/build_dir/host/firmware-utils/bin/addpattern src/addpattern.c gcc: error trying to exec 'cc1': execvp: No such file or directory Makefile:82: recipe for target '/home/bell/nm/openwrt-15.05.1/build_dir/host/firmware-utils/.built' failed make[3]: *** [/home/bell/nm/openwrt-15.05.1/build_dir/host/firmware-utils/.built] Error 1 make[3]: Leaving directory '/home/bell/nm/openwrt-15.05.1/tools/firmware-utils' tools/Makefile:122: recipe for target 'tools/firmware-utils/compile' failed make[2]: *** [tools/firmware-utils/compile] Error 2 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports nested variables... (cached) yes checking for x86_64-linux-gnu-gcc... gcc checking whether the C compiler works... no configure: error: in `/home/bell/nm/openwrt-15.05.1/build_dir/host/patch-2.7.5': configure: error: C compiler cannot create executables See `config.log' for more details Makefile:21: recipe for target '/home/bell/nm/openwrt-15.05.1/build_dir/host/patch-2.7.5/.configured' failed make[3]: *** [/home/bell/nm/openwrt-15.05.1/build_dir/host/patch-2.7.5/.configured] Error 77 make[3]: Leaving directory '/home/bell/nm/openwrt-15.05.1/tools/patch' tools/Makefile:122: recipe for target 'tools/patch/compile' failed make[2]: *** [tools/patch/compile] Error 2 make[2]: Leaving directory '/home/bell/nm/openwrt-15.05.1' tools/Makefile:121: recipe for target '/home/bell/nm/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy' failed make[1]: *** [/home/bell/nm/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2 make[1]: Leaving directory '/home/bell/nm/openwrt-15.05.1' Build failed - please re-run with -j1 to see the real error message /home/bell/nm/openwrt-15.05.1/include/toplevel.mk:181: recipe for target 'world' failed make: *** [world] Error 1 编译openwrt报错
08-07
#!/bin/bash # Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -e set +e echo "++++++++++++++++++++++++++++++++++++++++" function check_shell_environment() { case $(uname -s) in Linux) shell_result=$(/bin/sh -c 'echo ${BASH_VERSION}') if [ -n "${shell_result}" ]; then echo "The system shell is bash ${shell_result}" else echo -e "\033[33m Your system shell isn't bash, we recommend you to use bash, because some commands may not be supported in other shells, such as pushd and shopt are not supported in dash. \n You can follow these tips to modify the system shell to bash on Ubuntu: \033[0m" echo -e "\033[33m [1]:Open the Terminal tool and execute the following command: sudo dpkg-reconfigure dash \n [2]:Enter the password and select <no> \033[0m" fi ;; Darwin) echo "Darwin system is not supported yet" ;; *) echo "Unsupported this system: $(uname -s)" exit 1 esac } check_shell_environment echo "++++++++++++++++++++++++++++++++++++++++" date +%F' '%H:%M:%S echo $@ export SOURCE_ROOT_DIR=$(cd $(dirname $0);pwd) while [[ ! -f "${SOURCE_ROOT_DIR}/.gn" ]]; do SOURCE_ROOT_DIR="$(dirname "${SOURCE_ROOT_DIR}")" if [[ "${SOURCE_ROOT_DIR}" == "/" ]]; then echo "Cannot find source tree containing $(pwd)" exit 1 fi done if [[ "${SOURCE_ROOT_DIR}x" == "x" ]]; then echo "Error: SOURCE_ROOT_DIR cannot be empty." exit 1 fi case $(uname -s) in Darwin) HOST_DIR="darwin-x86" HOST_OS="mac" NODE_PLATFORM="darwin-x64" ;; Linux) HOST_DIR="linux-x86" HOST_OS="linux" NODE_PLATFORM="linux-x64" ;; *) echo "Unsupported host platform: $(uname -s)" RET=1 exit $RET esac # set python3 PYTHON3_DIR=${SOURCE_ROOT_DIR}/prebuilts/python/${HOST_DIR}/current/ PYTHON3=${PYTHON3_DIR}/bin/python3 PYTHON=${PYTHON3_DIR}/bin/python if [[ ! -f "${PYTHON3}" ]]; then echo -e "\033[33m Please execute the build/prebuilts_download.sh \033[0m" exit 1 else if [[ ! -f "${PYTHON}" ]]; then ln -sf "${PYTHON3}" "${PYTHON}" fi fi export PATH=${SOURCE_ROOT_DIR}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:$PATH # set nodejs and ohpm EXPECTED_NODE_VERSION="14.21.1" export PATH=${SOURCE_ROOT_DIR}/prebuilts/build-tools/common/nodejs/node-v${EXPECTED_NODE_VERSION}-${NODE_PLATFORM}/bin:$PATH export NODE_HOME=${SOURCE_ROOT_DIR}/prebuilts/build-tools/common/nodejs/node-v${EXPECTED_NODE_VERSION}-${NODE_PLATFORM} export PATH=${SOURCE_ROOT_DIR}/prebuilts/build-tools/common/oh-command-line-tools/ohpm/bin:$PATH echo "Current Node.js version is $(node -v)" NODE_VERSION=$(node -v) if [ "$NODE_VERSION" != "v$EXPECTED_NODE_VERSION" ]; then echo "Node.js version mismatch. Expected $EXPECTED_NODE_VERSION but found $NODE_VERSION" >&amp;2 exit 1 fi echo "Node.js version check passed" npm config set registry https://repo.huaweicloud.com/repository/npm/ npm config set @ohos:registry https://repo.harmonyos.com/npm/ npm config set strict-ssl false npm config set lockfile false cat $HOME/.npmrc | grep 'lockfile=false' || echo 'lockfile=false' >> $HOME/.npmrc function init_ohpm() { TOOLS_INSTALL_DIR="${SOURCE_ROOT_DIR}/prebuilts/build-tools/common" cd ${TOOLS_INSTALL_DIR} #command_line_version=2.0.1.0 if [[ ! -f "${SOURCE_ROOT_DIR}/prebuilts/build-tools/common/oh-command-line-tools/ohpm/bin/ohpm" ]]; then echo "download oh-command-line-tools" wget https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_package_901_9/a6/v3/cXARnGbKTt-4sPEi3GcnJA/ohcommandline-tools-linux-2.0.0.1.zip\?HW-CC-KV\=V1\&amp;HW-CC-Date\=20230512T075353Z\&amp;HW-CC-Expire\=315360000\&amp;HW-CC-Sign\=C82B51F3C9F107AB460EC26392E25B2E20EF1A6CAD10A26929769B21B8C8D5B6 -O ohcommandline-tools-linux.zip unzip ohcommandline-tools-linux.zip fi OHPM_HOME=${TOOLS_INSTALL_DIR}/oh-command-line-tools/ohpm chmod +x ${OHPM_HOME}/bin/init echo "init ohpm" ${OHPM_HOME}/bin/init echo "ohpm version is $(ohpm -v)" ohpm config set registry https://repo.harmonyos.com/ohpm/ ohpm config set strict_ssl false ohpm config set log_level debug cd ${SOURCE_ROOT_DIR} if [[ -d "$HOME/.hvigor" ]]; then echo "remove $HOME/.hvigor" rm -rf $HOME/.hvigor/daemon $HOME/.hvigor/wrapper fi mkdir -p $HOME/.hvigor/wrapper/tools echo '{"dependencies": {"pnpm": "7.30.0"}}' > $HOME/.hvigor/wrapper/tools/package.json pushd $HOME/.hvigor/wrapper/tools echo "install pnpm" npm install popd } if [[ "$*" != *ohos-sdk* ]]; then echo "start set ohpm" init_ohpm if [[ "$?" -ne 0 ]]; then echo "ohpm init failed!" exit 1 fi fi function build_sdk() { ROOT_PATH=${SOURCE_ROOT_DIR} if [ -d ${ROOT_PATH}/out/sdk/packages/ohos-sdk/linux ]; then echo "ohos-sdk exists." return 0 fi pushd ${ROOT_PATH} echo "building the latest ohos-sdk..." ./build.py --product-name ohos-sdk --get-warning-list=false --stat-ccache=false --compute-overlap-rate=false --deps-guard=false --generate-ninja-trace=false --gn-args skip_generate_module_list_file=true --gn-args sdk_platform=linux if [[ "$?" -ne 0 ]]; then echo "ohos-sdk build failed!" exit 1 fi if [ -d ${ROOT_PATH}/out/sdk/packages/ohos-sdk/linux ]; then pushd ${ROOT_PATH}/out/sdk/packages/ohos-sdk/linux mv ${ROOT_PATH}/out/sdk/ohos-sdk/linux/* . echo "extracting ohos-sdk package..." unzip -q "$(find . -name "native-linux*.zip")" api_version=$(grep apiVersion toolchains/oh-uni-package.json | awk '{print $2}' | sed -r 's/\",?//g') || api_version="10" mkdir -p $api_version for i in */; do if [ -d "$i" ] &amp;&amp; [ "$i" != "$api_version/" ]; then mv $i $api_version fi done popd fi if [ -d "${ROOT_PATH}/prebuilts/ohos-sdk/linux" ]; then rm -rf ${ROOT_PATH}/prebuilts/ohos-sdk/linux fi mkdir -p ${ROOT_PATH}/prebuilts/ohos-sdk/ cp -af ${ROOT_PATH}/out/sdk/packages/ohos-sdk/linux ${ROOT_PATH}/prebuilts/ohos-sdk/ popd } if [[ ! -d "${SOURCE_ROOT_DIR}/prebuilts/ohos-sdk/linux" &amp;&amp; "$*" != *ohos-sdk* &amp;&amp; "$*" != *"--no-prebuilt-sdk"* || "${@}" =~ "--prebuilt-sdk" ]]; then echo "start build ohos-sdk" build_sdk if [[ "$?" -ne 0 ]]; then echo "ohos-sdk build failed, please remove the out/sdk directory and try again!" exit 1 fi fi #add by ludao supportproduct=("rk3568" "ss2386" "rk3588" "rk3399" "bearpi_hm_micro" "ohos-sdk" "smart_s10e" "stm32" "t507" "long2k1500l1") supportdevices=("") autobuilddevices=("") supportdevices_rk3568=("langdao3568" "langdao3568_hdmi" "langdao3568_single_lvds" "skyworth_evt" "skyworth_dvt" "evb3568" "sbc3568" "sbc3568_agv" "kuanghong" "gwxt_ok3568_c" "zhongan_edp" "zhongan_dual_lvds" "zhongan_single_lvds" "em_r18" "em_pda" "zijin_gateway_r68s" "hcaio_2100" "hcaio_2100_ap6256" "em_r18_yjk" "em_r18_hongzos_2_0" "em_pda_hongzos_2_0" "duolun" "duolun_mipi_demo" "SK3530" "songshu_smartbot" "youibot" "newland_rz810" "em_r88_hongzos_2_0" "tk150" "eva_c1" "eva_c1_mipi" "duolun_new_board" "kunlun_smart" "evb3568_edu" "evb3568_box" "SHINTON" "duolun_t10" "archermind_driving" "8mile_tech_rk3568" "sbc3568_ap6256" "sbc3568_hsy" "qinuo3568" "sbc3568_hsy_railway") autobuild_rk3568=("langdao3568" "langdao3568_hdmi" "langdao3568_single_lvds" "em_r18_hongzos_2_0" "em_pda_hongzos_2_0" "em_r88_hongzos_2_0" "evb3568" "sbc3568" "sbc3568_agv" "tk150" "eva_c1" "eva_c1_mipi" "duolun_new_board" "evb3568_edu" "evb3568_box" "songshu_smartbot" "SHINTON" "skyworth_dvt" "kunlun_smart" "duolun_t10" "archermind_driving" "sbc3568_ap6256" "hcaio_2100_ap6256" "qinuo3568" "sbc3568_hsy_railway") supportdevices_rk3588=("rk3588_evt" "smart_phone_6inches_rk3588" "gateway_ir88mx01_rk3588" "gateway_ir88mx01_rk3588_cm358" "ops_ir88p03_rk3588" "lion_gateway_rk3588" "xinuo_rk3588" "em_r16") autobuild_rk3588=("xinuo_rk3588" "em_r16" "gateway_ir88mx01_rk3588" "ops_ir88p03_rk3588" "gateway_ir88mx01_rk3588_cm358" "ido_evb3588s" "lion_gateway_rk3588" "rk3588_evt") supportdevices_stm32=("smart_s10e") autobuild_stm32=("smart_s10e") supportdevices_ss2386=("pioneer5_sdp") autobuild_ss2386=("pioneer5_sdp") supportdevices_rk3399=("avatarmind_box") autobuild_rk3399=("avatarmind_box") supportdevices_t507=("t507") autobuild_t507=("t507") supportdevices_long2k1500=("long2k1500_evt") autobuild_long2k1500=("long2k1500_evt") platform="" platform_stmp32="" platform_loongson="" platform_t507="" find=0 find_target_cpu=0 target_cpu="" market_find=0 find_target=0 build_type="debug" buildInDefault_display_config="disable" export market_name="archermind" rom_type="normal" branch_type="" for i in $* do if [ $i == "--product-name" ];then find=1 continue fi if [ $i == "--target-cpu" ];then find_target_cpu=1 continue fi if [ $find_target_cpu == 1 ];then target_cpu=$i fi if [ $i == "market-name" ];then market_find=1 continue fi if [ $i == "XTS" ];then rom_type="xts" continue fi if [ $i == "jailhouse" ];then rom_type="jailhouse" continue fi if [ $i == "product-release" ];then build_type="release" continue fi if [ $i == "Forced_vertical_screen" ];then buildInDefault_display_config="enable" continue fi if [ $i == "product-userdebug" ];then build_type="userdebug" continue fi if [ $find == 1 ];then for product in ${supportproduct[*]} do if [ $i == $product ];then export product_name=$i echo "product_name = $product_name" find_target=1 break fi done fi if [ $market_find == 1 ];then export market_name=$i fi done echo "build_type = $build_type" echo "market_name = $market_name" if [ -d "productdefine/project_config" ] ;then branch_type="HongzOS" else branch_type="ohos" fi rom_type_name="${branch_type}" if [ "$buildInDefault_display_config" == "enable" ];then rom_type_name="${rom_type_name}_Forced_vertical_screen" fi export rom_type export branch_type export target_cpu echo "target_cpu = $target_cpu" echo "rom_type = $rom_type" echo "branch_type = $branch_type" echo "rom_type_name = $rom_type_name" if [ "$rom_type" != "xts" ];then build/build_time.py fi if [ $find_target == 0 ];then echo "Please select one of the following parameters to compile" for product in ${supportproduct[*]} do echo "--product-name $product" done exit -1 fi out_product_name=$product_name case $product_name in rk3568) supportdevices=${supportdevices_rk3568[*]} platform="rk356x" autobuilddevices=${autobuild_rk3568[*]} ;; ss2386) supportdevices=${supportdevices_ss2386[*]} autobuilddevices=${autobuild_ss2386[*]} ;; rk3588) supportdevices=${supportdevices_rk3588[*]} platform="rk3588" autobuilddevices=${autobuild_rk3588[*]} ;; rk3399) supportdevices=${supportdevices_rk3399[*]} platform="rk3399" autobuilddevices=${autobuild_rk3399[*]} ;; t507) supportdevices=${supportdevices_t507[*]} platform_t507="t507" autobuilddevices=${autobuild_t507[*]} ;; stm32) supportdevices=${supportdevices_stm32[*]} platform_stmp32="stm32" autobuilddevices=${autobuild_stm32[*]} ;; long2k1500l1) supportdevices=${supportdevices_long2k1500[*]} autobuilddevices=${autobuild_long2k1500[*]} platform_loongson="long2k1500l1" ;; *) export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:$PATH ${PYTHON3} ${source_root_dir}/build/scripts/tools_checker.py flag=true args_list=$@ for var in $@ do OPTIONS=${var%%=*} PARAM=${var#*=} if [[ "$OPTIONS" == "using_hb_new" &amp;&amp; "$PARAM" == "false" ]]; then flag=false ${PYTHON3} ${SOURCE_ROOT_DIR}/build/scripts/entry.py --source-root-dir ${SOURCE_ROOT_DIR} $args_list break fi done if [[ ${flag} == "true" ]]; then ${PYTHON3} ${SOURCE_ROOT_DIR}/build/hb/main.py build $args_list fi if [[ "$?" -ne 0 ]]; then echo -e "\033[31m=====build ${product_name} error=====\033[0m" exit -1 fi echo -e "\033[32m=====build ${product_name} successful=====\033[0m" date +%F' '%H:%M:%S echo "++++++++++++++++++++++++++++++++++++++++" exit 0 ;; esac find=0 find_target=0 for i in $* do if [ $i == "--device-name" ];then find=1 continue fi if [ $find == 1 ];then for device in ${supportdevices[*]} do if [ $i == $device ];then export device_name=$i echo "device_name = $device_name" find_target=1 break fi done fi done if [ $find_target == 0 ];then for device in ${autobuilddevices[*]} do echo "start build --device-name $device" if [ ${device##*|} != ${device%|*} ];then export market_name=${device##*|} else export market_name="archermind" fi export device_name=${device%|*} echo "device_name = $device_name" echo "market_name = $market_name" vendor/archermind/$product_name/overlay.sh rm -rf out/kernel/ rm -rf out/${out_product_name}/packages/imagesconf/ find -name hdf_default.hcb|xargs rm -Rf rm -rf ${SOURCE_ROOT_DIR}/product.json ln -s ${SOURCE_ROOT_DIR}/vendor/archermind/board/$device_name/product.json ${SOURCE_ROOT_DIR}/product.json export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:$PATH ${PYTHON3} ${source_root_dir}/build/scripts/tools_checker.py flag=true args_list=$@ for var in $@ do OPTIONS=${var%%=*} PARAM=${var#*=} if [[ "$OPTIONS" == "using_hb_new" &amp;&amp; "$PARAM" == "false" ]]; then flag=false ${PYTHON3} ${SOURCE_ROOT_DIR}/build/scripts/entry.py --source-root-dir ${SOURCE_ROOT_DIR} $args_list --gn-args board_name_internal=\"${device_name}\" --gn-args build_type=\"${build_type}\" --gn-args market_name=\"${market_name}\" --gn-args rom_type=\"${rom_type}\" branch_type=\"${branch_type}\" buildInDefault_display_config=\"${buildInDefault_display_config}\" break fi done if [[ ${flag} == "true" ]]; then ${PYTHON3} ${SOURCE_ROOT_DIR}/build/hb/main.py build $args_list --gn-args board_name_internal=\"${device_name}\" --gn-args build_type=\"${build_type}\" --gn-args market_name=\"${market_name}\" --gn-args rom_type=\"${rom_type}\" branch_type=\"${branch_type}\" buildInDefault_display_config=\"${buildInDefault_display_config}\" fi if [[ "$?" -ne 0 ]]; then echo -e "\033[31m=====build ${product_name} error=====\033[0m" exit -1 fi #add by ludao if [ -d out/${out_product_name}/packages/phone/images ]; then echo out/${out_product_name}/packages/phone/images_${device_name}/ rm -rf out/${out_product_name}/packages/phone/images_${device_name}/ mv out/${out_product_name}/packages/phone/images out/${out_product_name}/packages/phone/images_${device_name}/ rm -rf Image ln out/${out_product_name}/packages/phone/images_${device_name}/ -s Image if [ $platform ] &amp;&amp; [ -f Image/system.img ] &amp;&amp; [ -f Image/boot_linux.img ];then rm -rf images_${device_name}.img device/soc/rockchip/rockdev/mkupdate.sh ${platform} Image images_${rom_type_name}_v4_0_${device_name}_${market_name}.img rm -rf out/${out_product_name}/packages/phone/images_${rom_type_name}_v4_0_${device_name}/update.img rm -rf package-file-tmp rm -rf package-file fi if [ $platform_stmp32 ] &amp;&amp; [ -f Image/system.img ] &amp;&amp; [ -f Image/boot_linux.img ];then device/board/archermind/stm32/tool/image.sh images_ohos_v4_0_${device_name}_${market_name}.img fi fi if [ $platform_loongson ] &amp;&amp; [ -f out/long2k1500l1/long2k1500l1/userfs_vfat.img ] &amp;&amp; [ -f out/long2k1500l1/long2k1500l1/boot_linux.img ];then rm -rf images_${device_name}.img device/board/archermind/long2k1500l1/tools/image.sh images_ohos_v4_0_${device_name}_${market_name}.img fi #endif echo -e "\033[32m=====build ${product_name} successful=====\033[0m" date +%F' '%H:%M:%S echo "++++++++++++++++++++++++++++++++++++++++" done exit 0 fi vendor/archermind/$product_name/overlay.sh rm -rf out/kernel/ rm -rf out/${out_product_name}/packages/imagesconf/ find -name hdf_default.hcb|xargs rm -Rf rm -rf ${SOURCE_ROOT_DIR}/product.json ln -s ${SOURCE_ROOT_DIR}/vendor/archermind/board/$device_name/product.json ${SOURCE_ROOT_DIR}/product.json ln -s ${product_path} ${SOURCE_ROOT_DIR}/market.json #end ${PYTHON3} ${SOURCE_ROOT_DIR}/build/scripts/tools_checker.py flag=true args_list=$@ for var in $@ do OPTIONS=${var%%=*} PARAM=${var#*=} if [[ "$OPTIONS" == "using_hb_new" &amp;&amp; "$PARAM" == "false" ]]; then flag=false ${PYTHON3} ${SOURCE_ROOT_DIR}/build/scripts/entry.py --source-root-dir ${SOURCE_ROOT_DIR} $args_list --gn-args board_name_internal=\"${device_name}\" --gn-args build_type=\"${build_type}\" --gn-args market_name=\"${market_name}\" --gn-args rom_type=\"${rom_type}\" branch_type=\"${branch_type}\" buildInDefault_display_config=\"${buildInDefault_display_config}\" break fi done if [[ ${flag} == "true" ]]; then ${PYTHON3} ${SOURCE_ROOT_DIR}/build/hb/main.py build $args_list --gn-args board_name_internal=\"${device_name}\" --gn-args build_type=\"${build_type}\" --gn-args market_name=\"${market_name}\" --gn-args rom_type=\"${rom_type}\" branch_type=\"${branch_type}\" buildInDefault_display_config=\"${buildInDefault_display_config}\" fi if [[ "$?" -ne 0 ]]; then echo -e "\033[31m=====build ${product_name} error=====\033[0m" exit 1 fi #add by ludao if [ -d out/${out_product_name}/packages/phone/images ]; then echo out/${out_product_name}/packages/phone/images_${device_name}/ rm -rf out/${out_product_name}/packages/phone/images_${device_name}/ mv out/${out_product_name}/packages/phone/images out/${out_product_name}/packages/phone/images_${device_name}/ rm -rf Image ln out/${out_product_name}/packages/phone/images_${device_name}/ -s Image if [ $platform ] &amp;&amp; [ -f Image/system.img ] &amp;&amp; [ -f Image/boot_linux.img ];then rm -rf images_${device_name}.img device/soc/rockchip/rockdev/mkupdate.sh ${platform} Image images_${rom_type_name}_v4_0_${device_name}_${market_name}.img rm -rf out/${out_product_name}/packages/phone/images_${rom_type_name}_v4_0_${device_name}/update.img rm -rf package-file-tmp rm -rf package-file fi fi if [ $platform_loongson ] &amp;&amp; [ -f out/long2k1500l1/long2k1500l1/userfs_vfat.img ] &amp;&amp; [ -f out/long2k1500l1/long2k1500l1/boot_linux.img ];then rm -rf images_${device_name}.img device/board/archermind/long2k1500l1/tools/image.sh images_ohos_v4_0_${device_name}_${market_name}.img fi #end echo -e "\033[32m=====build ${product_name} successful=====\033[0m" date +%F' '%H:%M:%S echo "++++++++++++++++++++++++++++++++++++++++" 解读编译脚本
最新发布
12-17
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值