b4的安装及碰到的问题

b4的安装及碰到的问题

为了获取https://lore.kernel.org/的补丁源码,准备安装b4

首先因为网上中文的只有从lore.kernel.org获取补丁的工具b4,所以先按该链接下的方法逐步操作,在git下b4的源码之后,需要在.bash_profile下加入以下行

alias b4="$HOME/develop/source_code/kernel.org/b4/b4.sh"

但在我的系统下没有找到.bash_profile,只有.bashrc,在查阅资料后在.bashrc下加入了该行,重启bash之后b4命令可以使用了,但由于python缺少模块,b4仍无法使用

然后查看b4官方的安装说明

B4 tools
========
This is a helper utility to work with patches made available via a
public-inbox archive like lore.kernel.org. It is written to make it
easier to participate in a patch-based workflows, like those used in
the Linux kernel development.

The name "b4" was chosen for ease of typing and because B-4 was the
precursor to Lore and Data in the Star Trek universe.

See https://b4.docs.kernel.org/ for online documentation.

Installing
----------
To install from pypi::

    python3 -m pip install --user b4

Upgrading
---------
If you previously installed from pypi::

    python3 -m pip install --user --upgrade b4

Running from the checkout dir
-----------------------------
If you want to run from the checkout dir without installing the python
package, you can use the included ``b4.sh`` wrapper. You can set it as
an alias in your .bash_profile::

    alias b4="$HOME/path/to/b4/b4.sh"

Setting up a symlink should also be possible. Remember to run the
following command after the initial clone in order to pull in the
dependencies that are tracked via submodules::

    git submodule update --init

Support
-------
For support or with any other questions, please email
tools@linux.kernel.org, or browse the list archive at
https://lore.kernel.org/tools.

发现可以直接用

python3 -m pip install --user b4

安装,使用后报错如下
在这里插入图片描述

查阅资料之后发现原因是python版本低,切换到python3.8之后解决

随后使用pip安装b4,报错如下(此处借用别人的图)
在这里插入图片描述

原因:

python路径下缺少 ‘lsb_release.py’ 模块

解决:

1、查找到lsb_release模块所在的目录
sudo find / -name 'lsb_release.py'

2、将其复制到设置python3.8的系统模块加载位置,也就是报错处subprocess.py所在的目录
sudo cp  /usr/lib/python3/dist-packages/lsb_release.py /usr/local/python/lib/python3.8/	

在这里插入图片描述

随后继续使用pip进行安装,报错如下

在这里插入图片描述

或者下到一半突然报错

考虑是网络原因,所以使用国内镜像源进行加速

pip install 包名-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

–trusted-host http://pypi.douban.com 这是为了获得ssl证书的认证

安装成功!

但仍有问题

在这里插入图片描述

总共32个patch只获取了一个,且不知道下载之后文件的地址

内核补丁下载

在过了两天之后我找到一个网站可以直接查看补丁内容并下载
https://patchwork.kernel.org/project/netdevbpf/list/?state=%2A&archive=both
在这里插入图片描述
点击搜索项就可以直接查找补丁了
在这里插入图片描述
点进去之后可以直接下载,不需要b4!!!

参考

README.rst - b4/b4.git - B4 workflow tools (kernel.org)

b4/b4.git - B4 workflow tools (kernel.org)

pip安装包报错Could not find a version that satisfies the requirement pymysql (from versions: none) - 知乎 (zhihu.com)

实用 | 安装python模块socket.timeout: The read operation timed out解决方案_安装pytorch socket.timeout: the read operation timed_孙行者Monkey的博客-CSDN博客

从lore.kernel.org获取补丁的工具b4 - Jello - 博客园 (cnblogs.com)

关于“.bash_profile”和“.bashrc”区别的总结_.bash_profile .bashrc_Storm啊的博客-CSDN博客

【问题解决】subprocess.CalledProcessError: Command ‘(‘lsb_release‘, ‘-a‘)‘ returned non-zero exit status 1_JavonPeng的博客-CSDN博客

pip install 时报错:ERROR: Command errored out with exit status 1: python setup.py egg_inf_Xenonon的博客-CSDN博客

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值