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)
从lore.kernel.org获取补丁的工具b4 - Jello - 博客园 (cnblogs.com)
关于“.bash_profile”和“.bashrc”区别的总结_.bash_profile .bashrc_Storm啊的博客-CSDN博客