1 Star 0 Fork 7

Shiloong/ck-build

forked from src-anolis-sig/ck-build 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
update4koji.sh 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
DIST="anX"
KVER="5.16.10"
BASE=$1
RELEASE_TAG=$2
AUTHOR_MAIL="Shile Zhang <shile.zhang@linux.alibaba.com>"
CHANGELOG="$(pwd)/changelog"
CK_DIR="../ck/"
BRANCH="linux-next"
function update_spec() {
### update kernel release
KREL=${RELEASE_TAG##*-}
sed -i "s/!KREL:.*}/!KREL:${KREL}}/g" kernel.spec
### update changelog
echo "* $(date +"%a %b %d %Y") ${AUTHOR_MAIL} [${RELEASE_TAG}.${DIST}]" > ${CHANGELOG}
pushd ${CK_DIR} >/dev/null 2>&1
git checkout ${BRANCH} || { echo "Failed to switch target branch"; exit; }
git log --pretty=format:"- %s (%an)" "${BASE}..${RELEASE_TAG}" >> ${CHANGELOG}
popd >/dev/null 2>&1
echo "" >> ${CHANGELOG}
echo "" >> ${CHANGELOG}
sed -i "/%changelog/r ${CHANGELOG}" kernel.spec
rm -rf ${CHANGELOG}
echo
echo "kernel.spec has been update"
##echo "---"
##git diff kernel.spec
##echo "---"
}
function archive_kernel() {
pushd ${CK_DIR} >/dev/null 2>&1
git archive --format=tar --prefix="linux-${RELEASE_TAG}.${DIST}/" HEAD |xz -T$(nproc) > linux-${RELEASE_TAG}.${DIST}.tar.xz
mv linux-${RELEASE_TAG}.${DIST}.tar.xz ../anck-build/
popd >/dev/null 2>&1
}
if [ $# -lt 2 ]; then
echo "Invalid args!"
echo "Usage: $(basename -- $0) 25_rc2 25"
exit
fi
echo "Update the kernel.spec..."
update_spec
echo "Create the kernel source tar ball..."
archive_kernel
echo "Done."
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/shiloong/ck-build.git
git@gitee.com:shiloong/ck-build.git
shiloong
ck-build
ck-build
an8-ml

搜索帮助