嵌入式 linux 内核编译版本后有一串字符

编译后的版本为:5.6.65-g0afd3c3ee045-dirty 需要去掉“-g0afd3c3ee045-dirty ”,不然与驱动不匹配,无法加载相应驱动、

include/config/kernel.release    include/generated/utsrelease.h  里面的版本号是编译后生成的,修改这里没用。

修改办法和原因:

由于git仓库管理的原因而加了一串字符

修改办法:config CONFIG_LOCALVERSION_AUTO is not set,然后在setlocalversion 文件中,将
176 # CONFIG_LOCALVERSION and LOCALVERSION (if set)
177 res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}"
178
179 # scm version string if not at a tagged commit
180 if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
181     # full scm version string
182     res="$res$(scm_version)"
183 else
184     # append a plus sign if the repository is not in a clean
185     # annotated or signed tagged state (as git describe only
186     # looks at signed or annotated tags - git tag -a/-s) and
187     # LOCALVERSION= is not specified
188     if test "${LOCALVERSION+set}" != "set"; then
189         scm=$(scm_version --short)
190         res="$res${scm:}"     //去掉两个++
191     fi
192 fi

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值