$(MAKE) -C $(BUILD_DIR)/$(KERNEL_VER) ARCH=$(ARCH_TYPE) CROSS_COMPILE=$(OSDRV_CROSS)- -j 4 uImage moudles
时间: 2023-09-18 18:09:31 浏览: 129
这是一个IT类问题,该命令是一个Makefile中的命令,用于编译Linux内核和模块。$(MAKE)表示调用Make命令,-C指定了内核源代码所在的目录,ARCH指定了架构类型,CROSS_COMPILE指定了交叉编译工具链的前缀,-j 4表示使用4个线程进行编译,uImage表示编译内核镜像,modules表示编译内核模块。
相关问题
<builders> <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditional-buildstep@1.4.2"> <condition class="org.jenkins_ci.plugins.run_condition.contributed.ShellCondition" plugin="run-condition@1.5"> <command>if git show --summary HEAD | grep -q -E "\(cherry picked from commit \b[0-9a-f]{5,40}\b\)"; then exit 1 fi</command> </condition> <buildStep class="hudson.tasks.Shell"> <command>./scripts/checkpatch.pl --min-conf-desc-length=1 --ignore GERRIT_CHANGE_ID -g HEAD </command> <configuredLocalRules/> </buildStep> <runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$Run" plugin="run-condition@1.5"/> </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder> <hudson.tasks.Shell> <command>NCPU=$(expr $(nproc --all ) / 2) make O=build-${BUILD_ID} -s defconfig make O=build-${BUILD_ID} -j$NCPU -s Image make O=build-${BUILD_ID} -j$NCPU -s modules make O=build-${BUILD_ID} INSTALL_MOD_PATH=../install-${BUILD_ID} -s modules_install mkdir -p install-${BUILD_ID}/boot/ KERNELVER=$(cat build-${BUILD_ID}/include/config/kernel.release 2> /dev/null) cat build-${BUILD_ID}/arch/arm64/boot/Image > install-${BUILD_ID}/boot/Image-$KERNELVER cp build-${BUILD_ID}/System.map install-${BUILD_ID}/boot/System.map-$KERNELVER cp build-${BUILD_ID}/.config install-${BUILD_ID}/boot/config-$KERNELVER tar -cJf install-${BUILD_ID}/linux-$KERNELVER.tar.xz -C install-${BUILD_ID}/ boot lib</command> <configuredLocalRules/> </hudson.tasks.Shell> <hudson.tasks.Shell> <command>cd $HOME/src/linux git fetch -p -t git pull </command> <configuredLocalRules/> </hudson.tasks.Shell> </builders> 这是一段Jenkins job的定义,请把它转成对应的JJB的yaml格式配置文件
对应的JJB的yaml格式配置文件如下所示:
```yaml
- builders:
- conditional-step:
conditional-buildstep@1.4.2:
condition:
shell-condition:
run-condition@1.5:
command: "if git show --summary HEAD | grep -q -E \"\\(cherry picked from commit \\b[0-9a-f]{5,40}\\b\\)\"; then exit 1 fi"
buildStep:
shell:
command: "./scripts/checkpatch.pl --min-conf-desc-length=1 --ignore GERRIT_CHANGE_ID -g HEAD"
configuredLocalRules: ""
runner:
run-build-step-runner:
run-condition@1.5: ""
- shell:
command: "NCPU=$(expr $(nproc --all ) / 2) make O=build-${BUILD_ID} -s defconfig make O=build-${BUILD_ID} -j$NCPU -s Image make O=build-${BUILD_ID} -j$NCPU -s modules make O=build-${BUILD_ID} INSTALL_MOD_PATH=../install-${BUILD_ID} -s modules_install mkdir -p install-${BUILD_ID}/boot/ KERNELVER=$(cat build-${BUILD_ID}/include/config/kernel.release 2> /dev/null) cat build-${BUILD_ID}/arch/arm64/boot/Image > install-${BUILD_ID}/boot/Image-$KERNELVER cp build-${BUILD_ID}/System.map install-${BUILD_ID}/boot/System.map-$KERNELVER cp build-${BUILD_ID}/.config install-${BUILD_ID}/boot/config-$KERNELVER tar -cJf install-${BUILD_ID}/linux-$KERNELVER.tar.xz -C install-${BUILD_ID}/ boot lib"
configuredLocalRules: ""
- shell:
command: "cd $HOME/src/linux git fetch -p -t git pull"
configuredLocalRules: ""
```
#!/bin/bash #bash -x ./build_package.sh -a aarch64 -w `pud` -i 123abc -v 1,4.0 -r 3 -b /root/packaging_releases/build_root_a3860623d/virtual_rootfs/usr/local/ -l /usr/local -t deb OS=Kylin VERSION= WORK_ROOT= PACKAGE_TYPE=deb BUILD_ID= RELEASE= DISTRO_ID=`cat /etc/*-release | grep ^ID= | awk -F'=' '{print $2}' | sed '/\"//g'` DISTRO _VERSION_ID=`cat /etc/*-release | grep ^VERSION_ID= | awk -F'=' '{print $2}' | sed "s/\"//g'` usage() { echo "Usage:" echo "build_package.sh " } build_rpm_package() { mkdir -p $BUILD ROOT pushd $BUILD ROOT RPMBUILD=$BUILD_ROOT/rpmbuild_$BUILD_ID rpmbuild --bb --target=$ARCH \ -D "_topdir $RPMBUILD" \ -D "_arch $ARCH" \ -D "current_version $VERSION" \ -D "current_release $RELEASE.$DISTRO_ID$DISTRO_VERSION_ID" \ -D "lib $BIN PATH" \ -D "lib_prefix $_LIB_PREFTX" \ $WORK_ROOT/rpm_package/package.spec cp `find ./ -name *.rpm` $WORK_ROOT; popd exit } build_deb_package() { mkdir -p $BUILD_ROOT pushd $BUILD_ROOT PACKAGE_NAME="sietium-umod-drv_"$VERSION"-"$RELEASE"."$DISTRO_ID$DISTRO_VERSION_ID"_"$ARCH DEBBUILD=$BUILD_ROOT/debbuild_$BUILD_ID mkdir -p $DEBBUILD/$_LIB_PREFIX sed-i "s/Version:/Version:$VERSION-$RELEASE/g" $WORK_ROOT/deb_package/DEBIAN/control sed -i "s/Architecture:/Architecture:$ARCH/g"$WORK_ROOT/deb_package/DEBIAN/control rsync -rat $WORK_ROOT/deb_package/DEBIAN $DEBBUILD rsync -rat $BIN_PATH $DEBBUILD/$_LIB_PREFIX pushd $DEBBUILD mv ./DEBIAN ./debian mv usr/local/sietium/lib64/pkgconfig . dpkg-shlibdeps usr/local/sietium/lib64/* mv ./pkgconfig usr/local/sietium/lib64/ DEPS=`cat debian/substvars | awk -F'shlibs:Depends=' '{print $2}'` sed -i "s/Depends:/Depends:$DEPS/g" debian/control mv ./debian ./DEBIAN popd dpkg-deb--build $DEBBUILD $WORK_ROOT/$PACKAGE_NAME.deb Popd exit } while getopts a:b:d:o:v:w:t:i:h:r:l:c:h: option do case $option in a) ARCH=$OPTARG;; b) BIN_PATH=$OPTARG;; f) CONF_PATH=$OPTARG;; o) OS=$OPTARG;; v) VERSION=$OPTARG;; w)WORK_ROOT=$OPTARG;; t) PACKAGE_TYPE=$OPTARG;; i) BUILD_ID=$OPTARG;; r) RELEASE=$OPTARG;; l) _LIB_PREFIX=$OPTARG;; c)_CONF_PREFIX=$OPTARG;; h) usage;; ?) usage;; esac done echo "build env:" echo " Arch:" $ARCH echo " OS:" $OS echo " Version:" $VERSION echo " RELEASE:" $RELEASE echo " Work dir:" SWORK_ROOT echo " Package type:" $PACKAGE_TYPE BUILD_ROOT=$WORK_ROOT/build _package_$BUILD_ID if [ $PACKAGE_TYPE =='rpm']; then build_rpm_package elif[$PACKAGE_TYPE =='deb']; then build_deb_package else build_rpm_package build_deb_package fi解释脚本意义
这是一个 Bash 脚本,用于构建软件包。它包含了两个函数 `build_rpm_package()` 和 `build_deb_package()`,分别用于构建 RPM 和 DEB 类型的软件包。脚本接受一些参数,如架构 `-a`、二进制文件路径 `-b`、操作系统 `-o`、版本号 `-v`、工作目录 `-w`、软件包类型 `-t`、构建 ID `-i`、发布版本号 `-r`、库路径前缀 `-l` 等等。脚本中使用了一些 Linux 命令,如 `mkdir`、`pushd`、`popd`、`rsync`、`sed`、`awk`、`dpkg-shlibdeps`、`dpkg-deb` 等等,用于创建目录、切换工作目录、复制文件、修改文件内容、生成软件包依赖信息等等。脚本最后根据软件包类型调用相应的构建函数,如果类型不是 RPM 或 DEB,则默认同时构建 RPM 和 DEB。
阅读全文