zl程序教程

您现在的位置是:首页 >  其它

当前栏目

[英语单词] Kernel:upstream/downstream;上下游

Kernel 英语单词 upstream
2023-09-14 09:13:11 时间

参考

https://content.techgig.com/technology-guide/linux-jargon-buster-what-are-upstream-and-downstream/articleshow/89639375.cms
https://sourceware.org/systemtap/wiki/Myths

简介

有些概念,需要根据语境来说它们的意思;而且有时候这种以方位名命的概念,容易让人产生困惑,特别是以左右为名词修饰语时,比如两个人面对面交流,或者教官与学生之间的交流,如果A说右,他是以自己的角度还是按照B的角度说右;上下作为名词修饰语略微好一些,但是也是需要具体的语境来理解。所以我们的胃,没有左右、上下弯,而只有大小弯;以大小作为区分事物的指标好于方位指标,歧义的产生会小。当然大小也容易产出歧义,多地有什么多大的区别为大?
而且左右与上下的区别度不大。而大小有区别度。

概念

现在我们来说一下这个upstream和downstream;

up、down在这里不是副词向上面或者向下面的动作;而是一个介词,在上面,在下面的意思。
当然stream也就是流,是一个比喻,将kernel的代码比作一个流,代码管理里面的分支,主版本,分支版本,等等概念。而不是流水,如果按照流水的含义来理解,肯定可以理解错;因为水向低处流,如果说upstream,难道要理解成向上流的水。
按照一般意识上来说水流:支流会于主流。而不是主流分成支流。

Linux distributions start with the source code from an unmodified kernel when building a distribution (also known as a “distro”). The kernel is then configured when the necessary fixes have been applied. The kernel’s configuration is determined by the distribution’s desired features and options. The kernel is then produced in accordance with the decision.

upstream是原始kernel源代码(也可以称为meta source):也就是:https://www.kernel.org/这个网址提供的源代码。然后每个分销商,包括红帽,CentOS,RockyOS,等等,再根据这个原始源代码,制作自己的kernel版本。upstream和downstream来说是个相对的概念,对于分销商来说,原始的kernel源代码是upstream,而自己则是downstream;对于最终用户来说,分销商和原始kernel源代码都是upstream,自己是downstream。
所以翻译成上游下游比较合适。
Upstream from the distribution is the original kernel. When the source code is received by the distribution, it flows downstream. Once the code is in the distribution, it remains with the creators of the distribution while work is done on it. Until it is ready for release, it is still upstream from the users.

实例

https://sourceware.org/systemtap/wiki/Myths
这里有应用这个stream;可以体会体会。
https://github.com/SELinuxProject/selinux
这里的代码也是,selinux的上游。
This is the upstream repository for the Security Enhanced Linux (SELinux) userland libraries and tools.