dos2unix/unix2dos指令在git代码管理中的使用

在Linux下处理DOS格式文件时,经常遇到^M字符问题。dos2unix和unix2dos命令用于在DOS与UNIX格式间转换文本文件。本文介绍了这两个命令的使用,包括转换参数和在Git操作中的应用,帮助解决因行结束符差异导致的代码管理问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

有时候我们在linux下用vi或者vim打开文件,偶尔在文件的每行末尾会出现^M,那怎么解决呢?
我们只需要在命令行输入:dos2unix filename

命令虽有点奇怪,但是也很好记(2->two->to,谐音嘛)。
这个dos2unix命令:将DOS格式文本文件转换成UNIX格式。与之相反的有unix2dos命令。

现在我们先看一下dos2unix命令

dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter)。
DOS下的文本文件是以 \r\n 作为断行标志的,表示成十六进制就是0D 0A。
Unix下的文本文件是以 \n 作为断行标志的,表示成十六进制就是 0A。
DOS格式的文本文件在Linux底下,用较低版本的vi打开时行尾会显示^M,而且很多命令都无法很好的处理这种格式的文件,如果是个shell脚本。
Unix格式的文本文件在Windows下用Notepad打开时会拼在一起显示。
 因此产生了两种格式文件相互转换的需求,对应的将UNIX格式文本文件转成成DOS格式的是unix2dos命令。

常用参数

将DOS格式文本文件转换成Unix格式,最简单的用法就是dos2unix直接跟上文件名。

格式:dos2unix file

如果一次转换多个文件,把这些文件名直接跟在dos2unix之后。(注:也可以加上-o参数,也可以不加,效果一样)

格式:dos2unix file1 file2 file3

格式:dos2unix -o file1 file2 file3

上面在转换时,都会直接在原来的文件上修改,如果想把转换的结果保存在别的文件,而源文件不变,则可以使用-n参数。

格式:dos2unix -n oldfile newfile

如果要保持文件时间戳不变,加上-k参数。所以上面几条命令都是可以加上-k参数来保持文件时间戳的。

格式:dos2unix -k file

格式:dos2unix -k file1 file2 file3

格式:dos2unix -k -o file1 file2 file3

格式:dos2unix -k -n oldfile newfile

注:unix2dos命令的使用方式与dos2unix命令的类似。


与dos2unix相对应的命令有unix2dos,关于unix2dos命令的用法在这里就不作详细的解释了。

此外,unix2dos命令在我们用Git管理代码时也是比较常用的。

比如我们在开发中会常常使用到git指令,patch指令相关的一些操作。

git diff > filename

patch -p1 < filename 在执行此命令之后我们用gitk指令查看时会发现与我们预想的结果又很大的差异,会出现无关的代码删除、添加的动作。

这是我们想要的结果:


这是我们执行patch -p1 < filename之后实际的结果:


这样我们怎么办呢?unix2dos就起到作用了,我们可以把相应打过补丁的文件拷到linux下执行:

unix2dos file (在这里的话就是evt.cpp了),然后把执行此指令之后得到的文件拷到对应的目录下面覆盖原来的文件就OK了吐舌头

如果你的电脑安装了Git(如果有需要的话,可以点击链接下载https://yunpan.cn/cY4jZUnuC8cQP  访问密码 011f)或者安装了cygwin的话,也可以在win电脑上执行此动作。

最后我们再执行gitk查看的话,就是我们想要的结果了。


我们也可以使用sed指令,理论上是一样的,只不过小白我没尝试过这样

dosUNIX格式:sed -i 's/^M//g' filename
UNIXdos格式:sed -i 's/$/^M/g' filename
^M的输入方式是 Ctrl + v ,然后Ctrl + M

#! /bin/bash function ascend_git_mm_init { echo "0:Main Branch(Default, Onetrack, br_hisi_trunk_ai)" echo "1:David Kernel Version 6.6" echo "2:David Kernel Version 5.10" echo "3:David Chip BVersion" echo "4:David Chip BVersion 510" echo "5:David Chip BVersion 600" echo "6:David Chip BVersion 610" echo "7:New Main Branch(Chip BVersion 610: br_bbit_torino_v100r001c10_protype_20240410)" echo "8:David Chip BVersion 630" echo "9:David Chip BVersion 632" echo "10:David Chip BVersion 800" #echo "default: Ascend Solution Main Branch" read -p "Please Select Branch: " br if [[ "I$br" == "I1" ]] then #echo "git mm Init David Kernel 6.6 Branch" git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v100r001c15_1982_kernel_switch -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I2" ]] then #echo "git mm Init David Kernel 5.10 Branch" git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v100r001c10_1982_chip_verify -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I3" ]] then #echo "git mm Init David Kernel 6.6 & UB Branch" git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v00r100c10_esl310_0515 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I4" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v00r100c10_esl510_0510 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I5" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v00r100c10_eslb600_0606 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I6" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v00r100c10_eslb610_0706 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I7" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v100r001c10_protype_20240410 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I8" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v00r100c10_esl630_0826 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I9" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v100r001c10_b632_20241219 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks elif [[ "I$br" == "I10" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_release_torino_v100r001c10b600_soc_abl -g all -p auto git mm sync open_source/libjpeg-turbo repohooks else #echo "git mm Init Main Branch" git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_hisi_trunk_ai -g all -p auto git mm sync open_source/libjpeg-turbo repohooks fi #git mm info -a } function ascend_pull_toolchain { #echo $ost $cpua if [[ "${ost}" == "openeuler" ]] then git mm sync \ hisi/bin/toolchain/"${cpua}"/euleros/ccec_libs_url \ hisi/bin/toolchain/"${cpua}"/euleros/hcc_libs_url \ hisi/bin/toolchain/"${cpua}"/euleros/llvm_libs_url \ -j$((`nproc` - 1)) else git mm sync \ hisi/bin/toolchain/"${cpua}"/"${osdst}"/ccec_libs_url \ hisi/bin/toolchain/"${cpua}"/"${osdst}"/hcc_libs_url \ hisi/bin/toolchain/"${cpua}"/"${osdst}"/llvm_libs_url \ -j$((`nproc` - 1)) fi if [[ "${ost}" == "ubuntu" || "${ost}" == "centos" ]] && [[ "${cpua}" == "x86" ]] then git mm sync hisi/bin/toolchain/x86/ubuntu/hcc_r52_libs_url -j$((`nproc` - 1)) fi } function ascend_pull_comsrc { if [[ -d cmake ]] then cd cmake git checkout . cd "${rootdir}" fi if [[ -d tests/kernel ]] then rm -rf tests/kernel fi #aisdk-product/driver/aisdk_bsp \ #hisi/bios \ #hisi/bootloader/xloader \ #hisi/drivers/network \ #hisi/bootloader/onchiprom_flash \ git mm sync \ hisi/cmake \ hisi/customize \ hisi/build/bin/os/aos_lite_libs_url \ OpenSourceCenter/openEuler/kernel \ hisi/tests/kernel/linux-6.6 \ open_source/kernel-6.6 \ hisi/kernel/vendor \ hisi/libc_sec \ -j$((`nproc` - 1)) } function pull_codes { read -p "Need Pull Turing Solution Codes Y/y or N/n: " rp rp=${rp^^} if [[ "I${rp}" != "IY" ]] then return fi if [[ ! -d .mm ]] then # echo git mm init "${prds}"_git_mm_init fi git mm sync open_source/libjpeg-turbo repohooks ascend_pull_toolchain if [[ ("${prds}" == "ascend" || "${prds}" == "pegasus") ]] then "${prds}"_pull_comsrc else common_pull_comsrc fi #git mm info -a } function pegasus_git_mm_init { echo "0:Main Branch(Default, Onetrack, br_hisi_trunk_ai)" echo "1:Hi1952V100 Kernel Version 5.10" #echo "default: Ascend Solution Main Branch" read -p "Please Select Branch: " br if [[ "I$br" == "I1" ]] then #git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_feature_pegasus_v200r001c10_chipout_test_1126 -g all -p auto git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_pegasus_v200r001c10_protype_20241018 -g all -p auto else #echo "git mm Init Main Branch" git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_hisi_trunk_ai -g all -p auto fi #git mm info -a } function pegasus_pull_comsrc { # peguas build need # $rootdir/build/bin/os 下AOS目录存在,AOS的压缩包解压会报错,未知原因 if [[ -d build/bin/os ]] then sudo rm -rf build/bin/os* fi git mm sync \ hisi/cmake \ hisi/customize \ hisi/build/bin/os/aos_lite_libs_url \ OpenSourceCenter/openEuler/kernel \ hisi/libc_sec \ -j$((`nproc` - 1)) #Godel_VOS/release/VOS \ #git mm info -a } function solomon_git_mm_init { echo "0:Main Branch(Default, Onetrack, Solomon Chip BVersion 500)" echo "1:Solomon Chip BVersion 500" #echo "default: Ascend Solution Main Branch" read -p "Please Select Branch: " br if [[ "I$br" == "I1" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v100r001c10_b632_20241219 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks else #echo "git mm Init Main Branch" git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_bbit_torino_v100r001c10_b632_20241219 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks fi #git mm info -a } function DavidV121_git_mm_init { echo "0:Main Branch(Default, Onetrack)" echo "1:DavidV121 Chip BVersion 800" #echo "default: Ascend Solution Main Branch" read -p "Please Select Branch: " br if [[ "I$br" == "I1" ]] then git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_release_torino_v100r001c10b530 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks else #echo "git mm Init Main Branch" git mm init -u ssh://git@szv-cr-y.codehub.huawei.com:2222/Turing_Solution/platform/manifest.git -b br_release_torino_v100r001c10b530 -g all -p auto git mm sync open_source/libjpeg-turbo repohooks fi #git mm info -a } function common_pull_comsrc { # peguas build need # $rootdir/build/bin/os 下AOS目录存在,AOS的压缩包解压会报错,未知原因 if [[ -d build/bin/os ]] then sudo rm -rf build/bin/os* fi git mm sync \ hisi/cmake \ hisi/customize \ hisi/build/bin/os/aos_lite_libs_url \ OpenSourceCenter/openEuler/kernel \ hisi/tests/kernel/linux-6.6 \ open_source/kernel-6.6 \ hisi/kernel/vendor \ hisi/libc_sec \ -j$((`nproc` - 1)) #Godel_VOS/release/VOS \ #git mm info -a } function pull_monalisa { cdir="${rootdir}"/tests/chipveri mdir="${cdir}"/monalisa mkdir -p tests "${cdir}" read -p "Need Pull monalisa code now, Y/y or N/n: " rp rp=${rp^^} if [[ "I${rp}" != "IY" ]] then return fi read -p "Input Checkout Branch name: " cbrm # $(()) only for digital #$(("Y${cbrm}" == "Y" ? cbrm="" : cbrm="-b ${cbrm}")) #[[ "Y${cbrm}" == "Y" ]] && gcbrm="" || gcbrm="-b ${cbrm}" if [[ -d ${mdir} ]] then cd "${mdir}" if [[ -d .git ]] then git checkout "${cbrm}" cd "${rootdir}" return fi rm -rf * .g* cd "${rootdir}" fi if [[ "Y${cbrm}" != "Y" ]] then cd "${cdir}" echo `git clone https://codehub-dg-y.huawei.com/ICT_bringup/monalisa/monalisa.git -b ${cbrm}` cd - else return fi read -p "Need Create Monalisa Branch, Y/y or N/n: " cbrm cbrm=${cbrm^^} if [[ "I${cbrm}" == "IY" ]] then cd "${mdir}" read -p "Input Branch name: " cbrm git branch ${cbrm} git checkout ${cbrm} read -p "Need Push Branch To remote now, Y/y or N/n: " pb pb="${pb^^}" if [[ "I${pb}" == "IY" ]] then git push origin "${cbrm}" fi fi cd "${rootdir}" } function code_init { sudo rm -rf a* b* c* d* C* D* H* i* M* o* p* r* tee tools v* .mm pull_monalisa pull_codes } function get_osinfo { cpua=`arch` ost=`lsb_release -a | grep "Distributor ID" | awk -F":" '{print $2}' | sed 's/^[ \t]*//g'` osdst=${ost,,} if [[ "${osdst}" != "ubuntu" ]] && [[ "${osdst}" != "centos" ]] && [[ "${osdst}" != "euleros" ]] && [[ "${osdst}" != "openeuler" ]] then echo "UnSupport OS Type!" exit 1 fi if [[ "${cpua}" == "x86_64" ]] then cpua="x86" else cpua="arm64" fi echo "OS Distr: "$osdst"CPU Arch:"$cpua } function git_install { # install git lfs curl -k https://cmc-szver-artifactory.cmc.tools.huawei.com/artifactory/cmc-software-release/CodeHub/git-lfs/release.v2/git_lfs_autoinstall.sh | sudo sh - && (git lfs uninstall; git lfs install) # 设置git默认编辑器 if [ -e "/usr/bin/vim" ]; then git config --global core.editor vim else git config --global core.editor vi fi echo "git install succ" } function dtc_build { dtcp=`which dtc` if [[ $dtcp != '' ]] then return fi git clone https://codehub-dg-y.huawei.com/ICT_bringup/tools/dtc.git cd dtc make all sudo make install cd - rm -rf dtc } function python_install { pypath=`which python3` # force python link to python3 sudo ln -sf $pypath /usr/bin/python # install pip3 for python3 pippath=`which pip3` if [[ $pippath == '' ]] then sudo apt install python3-pip fi sudo pip3 install Gitdb -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install GitPython -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install PyYAML -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install ruamel.yaml -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install ruamel.yaml.clib -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install rich -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install pytest -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install toml -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com # sudo pip3 install textual-dev -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install httpx -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo pip3 install openpyxl -i http://cmc-cd-mirror.rnd.huawei.com/pypi/simple/ --trusted-host cmc-cd-mirror.rnd.huawei.com sudo chmod 755 -R /usr/local/lib/python3* sudo chmod 755 -R /usr/local/lib64/python3* echo "Python install succ" } function ascend_modsig_init { #curl -s -o `pwd`/signature-jenkins-slave-5.1.19-RELEASE.zip https://cmc-szver-artifactory.cmc.tools.huawei.com/artifactory/cmc-builtools-prod/SignatureClient/0599A7L5/toolVersion/0599AC25/20221119162112511/Software/signature-jenkins-slave-5.1.19-RELEASE.zip wget --no-check-certificate -P `pwd`/ https://cmc-szver-artifactory.cmc.tools.huawei.com/artifactory/cmc-builtools-prod/SignatureClient/0599A7L5/toolVersion/0599AC25/20221119162112511/Software/signature-jenkins-slave-5.1.19-RELEASE.zip #curl -s -o `pwd`/jre-8u392-linux-x64.tar.gz https://cmc-hgh-artifactory.cmc.tools.huawei.com/artifactory/cmc-software-release/Huawei%20JDK/Huawei%20JDK%20V100R001/Huawei%20JDK%20V100R001C00SPC390B003/jre-8u392-linux-x64.tar.gz wget --no-check-certificate -P `pwd`/ https://cmc-hgh-artifactory.cmc.tools.huawei.com/artifactory/cmc-software-release/Huawei%20JDK/Huawei%20JDK%20V100R001/Huawei%20JDK%20V100R001C00SPC390B003/jre-8u392-linux-x64.tar.gz sudo unzip signature-jenkins-slave-5.1.19-RELEASE.zip -d /usr/local/ rm -f /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/root.jks sudo rm -f /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/client.jks sudo rm -f /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/ssl.properties sudo rm -f /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/trustcerts/root.crt sudo wget -P /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/ http://nexus.turing-ci.hisilicon.com/repository/files/turing-ci/root.jks sudo wget -P /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/ http://nexus.turing-ci.hisilicon.com/repository/files/turing-ci/newcert/client.jks sudo wget -P /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/ http://nexus.turing-ci.hisilicon.com/repository/files/turing-ci/newcert/ssl.properties sudo wget -P /usr/local/signature-jenkins-slave-5.1.19-RELEASE/sslcerts/trustcerts/ http://nexus.turing-ci.hisilicon.com/repository/files/turing-ci/newcert/root.crt sudo wget -P /usr/local/signature-jenkins-slave-5.1.19-RELEASE/certs/ http://nexus.turing-ci.hisilicon.com/repository/files/turing-ci/G2RootCATest.cer sudo cp /usr/local/signature-jenkins-slave-5.1.19-RELEASE/signature.jar /usr/local/signature-jenkins-slave-5.1.19-RELEASE/lib sudo cp jre-8u392-linux-x64.tar.gz /usr/local/signature-jenkins-slave-5.1.19-RELEASE/ sudo chmod -R 755 /usr/local/signature-jenkins-slave-5.1.19-RELEASE/ #unzip signature-jenkins-slave-5.1.19-RELEASE.zip #mv jre-8u392-linux-x64.tar.gz signature-jenkins-slave-5.1.19-RELEASE/ } function ascend_env_init { # 修改PATH变量,使得~/bin里的可执行文件能被找到 if [[ `cat ~/.bashrc | grep "PATH=~/bin"` == '' ]] then echo "export PATH=~/bin:$PATH" >> ~/.bashrc fi # 临时去掉代理, 保证获取的git mm工具是正确的 if [[ `cat ~/.bashrc | grep "export no_proxy"` == '' ]] then echo "export no_proxy+=,10.141.107.107,.hisilicon.com,.huawei.com" >> ~/.bashrc fi source ~/.bashrc dtc_build #${prds}_modsig_init } function euleros_init { sudo yum install -y \ autoconf automake autogen bc bison bzip2-devel \ cmake elfutils-libelf-devel flex \ gcc gcc-c++ gettext git libffi-devel libtool make \ ncurses openssl-devel openssl pkgconfig python3 python3-devel \ readline readline-devel rpm rpm-build \ samba sqlite-devel tcl tcsh texinfo tk unzip \ xz xz-devel zip zlib-devel sudo yum update } function ubuntu_init { sudo apt update sudo apt install lcov ntp expect unzip curl ntpdate \ lrzsz autoconf libtool nfs-common default-jre \ openssl git libssl-dev bison flex bc libncurses5 \ rpm2cpio build-essential ncurses-dev \ xz-utils libelf-dev cppcheck git gcc python3.8 \ fakeroot pkg-config libglib2.0-dev dos2unix \ libyaml-dev lsb-core automake texinfo gettext unrar zip \ checkinstall libgtk-3-dev \ libexpat1-dev zlib1g-dev libcurl4-gnutls-dev \ libncurses5-dev libreadline-dev help2man \ libncurses-dev apt-file rpm cmake libbz2-dev \ uuid-dev libtinfo-dev libtinfo5 cppcheck-gui \ ubuntu-restricted-extras #sudo apt install linux-headers-5.4.0-42-generic sudo apt upgrade } function tools_init { sudo ln -sf /usr/bin/bash /usr/bin/sh get_osinfo ${osdst}_init git_install python_install ascend_env_init } #echo $# if [[ $# < 2 ]] then echo "Usage: ./monalisa_init.sh operation product" echo " eg: ./monalisa_init.sh init ascend" echo " or: ./monalisa_init.sh update ascend /data/workdir/hi1982" exit 1 fi prds=$2 user_name="" user_email="" rootdir=`pwd` cpua="" osdst="" tools_init if [[ $1 == "init" ]] then code_init if [[ ("${prds}" == "ascend" || "${prds}" == "solomon" || "${prds}" == "DavidV121") && "${osdst}" == "euleros" ]] then echo "====================install numa=======================" sudo yum install numactl-devel sudo yum install numactl-libs cp /usr/lib64/libnuma.so* \ build/bin/toolchain/arm64/euleros/hcc_libs/hcc_glibc_trusted_arm64_euleros_2_12_adk/do_arm64le_native/sysroot/usr/lib64/ cp /usr/lib64/libnl-genl-3.so.200.26.0 build/bin/toolchain/arm64/euleros/hcc_libs/hcc_glibc_trusted_arm64_euleros_2_12_adk/do_arm64le_native/sysroot/usr/lib64/ cp /usr/lib64/libnl-3.so build/bin/toolchain/arm64/euleros/hcc_libs/hcc_glibc_trusted_arm64_euleros_2_12_adk/do_arm64le_native/sysroot/usr/lib64/ cp /usr/lib64/libnl-genl-3.so build/bin/toolchain/arm64/euleros/hcc_libs/hcc_glibc_trusted_arm64_euleros_2_12_adk/do_arm64le_native/sysroot/usr/lib64/ cp /usr/lib64/libnl-genl-3.so.200 build/bin/toolchain/arm64/euleros/hcc_libs/hcc_glibc_trusted_arm64_euleros_2_12_adk/do_arm64le_native/sysroot/usr/lib64/ cp /usr/lib64/libnl-3.so.200 build/bin/toolchain/arm64/euleros/hcc_libs/hcc_glibc_trusted_arm64_euleros_2_12_adk/do_arm64le_native/sysroot/usr/lib64/ cp /usr/lib64/libnl-3.so.200.26.0 build/bin/toolchain/arm64/euleros/hcc_libs/hcc_glibc_trusted_arm64_euleros_2_12_adk/do_arm64le_native/sysroot/usr/lib64/ fi if [[ "${prds}" == "solomon" ]] && [[ "I$br" == "I1" ]] && [[ "${osdst}" == "euleros" ]] then cd $rootdir/tests/kernel/linux-6.6/ git reset --hard bbd3e15c40570df1b4a66f9ac402a07710b7c7ed elif [[ "${prds}" == "DavidV121" ]] then cd $rootdir/open_source/kernel-6.6/ git reset --hard 21636d939ed4956cec36b4eba2fb18b8ad68efab cd $rootdir/drivers/kernel/ git reset --hard 0305b56317cd785db15e2f10cced6916bdba1abc fi exit 0 else pull_codes exit 0 fi
最新发布
07-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值