Moxa i-learning (2)
RD_SW_Open Source License開源軟體授權
===
###### tags: `Moxa`
https://www.gnu.org/licenses/copyleft.zh-tw.html
https://www.facebook.com/itdogcom/posts/1346617245506668?sfnsw=cl
### 01-開源軟體的定義
- FOSS:free/open source software
- The Problems Moxa got:
- License violation
- Soc vendor provided GPL-incompatible kernel source code to Moxa in March, 2018
- License Misunderstanding
- the core technology might be exposed due to license of upstream
- The Problems other companies got
- Patrick McHardy and copyright profiteering
- former chair of the netfilter core development team (是kernel的一部分)
- 買商品回來,若有使用linux,就去翻使用說明書以及網站,看是否有地方可以下載原始碼,若無就跟德國聯邦政府提出訴訟
- estimated 50+ approaches = retailers, telcos, producers, importers in Germany
- 18 months, 200 million euros
- copyright trolls(著作權蟑螂)?
- linux kernel community不樂見這樣的訴訟,因為訴訟多用的人就少。它們已將Patrick Mchardy逐出社群
- 智慧財產權:
- 著作權 - copyright
- 專利 - patent
- 商標
- 商業秘密
※ open source license主要是提到copyright,部分提到專利
- Copyrights vs Patent
- copyrights:
- 只要是你創作的東西就有copyright,也就是著作權
- OPENCHAIN:open source license要遵守的規範很多,linux foundation為了讓公司行號、企業團體等能夠"有效"且"合規",因此提出此專案
- Patents:
- 需在地申請且經過專利局審查、公告、公開、最後授證、才有專利權
- 專利為屬地主義,不可跨國使用
- 有些國家不允許軟體專利
- 每年需付維護費用
- Open Invention Network, OIN:為非營利組織,目的是希望把linux的版圖做大,於是定義了一些核心技術,此核心圈內的專利共享不可進行專利訴訟,核心技術以外的可以做專利申請、訴訟
- Moxa已加入OIN
- Copyright vs Copyleft(著佐權)
- copyright: Protect work of the Author from unauthorized copying or selling the work
- copyleft: Provide a method for work to be modified and distributed back to the community
- 所有的修改新增刪除都要提交給community,取之於社群用之於社群
- open source license 義務成立的兩個前提
- 散佈(distribution):例如販賣銷售
- 開源的衍生作品(copying/modified version):有修改跟沒修改都算
- open source license
- 由open source initiative管控,所有open source license 都要被這個組織認可
- Open source definition(10個必備條件):
1. Free Redistribution: 可自由修改並再散佈
2. Source Code: 須具備原始碼,並能夠被編譯
3. Derived Works: 允許被修改並產生以生產品
4. Integrity of the author's source code: 原創作者原始碼的完整性
5. No Discriminaiton Against Persons or Groups: 不得對任何人或團體有差別待遇(中國公司大力發展的原因,例如中美貿易戰,open source基本上不受影響,但美國使用限制託管平台(如github)這樣的抵制方法)
6. No Discrimination Against Fields of Endeavor: 再任何領域內的利用不得有差別待遇(比如限定不可用於軍事,這是不行的)
7. Distribution of License: 散佈授權條款
8. License Must Not Restrict Other Software: 授權條款不得專屬於特定產品
9. License Must Not Redistrict Other Software: 授權條款不得限制其他軟體
10. License Must Be Technology-Neutral: 授權條款保持技術中立性(此條容易有問題,意思是授權條款不能只有紙本或是電子檔,須提供所有辦法,不能因為某人沒有電腦就沒辦法看授權條款)
### 02-不同類別的授權
- Popular Licenses
1. Apache License 2.0
2. BSD 3-Clause "New" or "Revised" license
3. BSD 2-Clause "Simplified" or "FreeBSD" license(ISC)
4. GNU General Public License (GPL)
5. GNU Library or "Lesser" General Public License (LGPL)
6. MIT license
7. Mozilla Public License 2.0
8. Common Development and Distribution License
9. Eclipse Public License
- other: https://opensource.org/licenses/category
- 
1. strong copyleft: 所有修改都要公布並提交回去,要公開原始碼,通常license都會講,如果違反某一條就會喪失使用權利
2. weaker copyleft: 有修改到原始碼才要公開,如果只是使用,也許就不用公開
3. Permissive(寬容、寬鬆) licenses: 大都不會要求公開原始碼,但有一些其他要求
- Licenses Permissions

- Commercial Use:如果不能商業使用基本上也不能叫open source license
- Patent Use:包含專利授權,也就是說除了著作權以外,它連專利一併授權給你
- GPLv2和MIT沒有寫,沒有寫不代表有授權
- 曾經有些公司拿了Apache的開源軟體之後,進行衍生作品的開發,但卻在衍生作品上申請了自己的專利,然後用這個專利拿回來告原本社群的人
- retaliation clause(反制條款):只要在community裡面發動專利訴訟,則授權給你的專利自動撤回失效

- disclose source:開放原始碼
- LGPL:只要沒有修改原來的程式碼,只是引用,是不需要公開的,例如,你只是include或呼叫api,就不需要公開原始碼
- permissive licenses基本上就不需要公開
- Network Use is Distribution:開源的義務有一個很大的前提,就是要散布,但是像雲端服務它並沒有散布的事實,所以有些公司會鑽這個漏洞(我提供服務,但是我沒有把程式散佈出去,所以不用盡這些義務),基於這樣的狀況,FSF(free software foundation)就制定了AGPLv3
- Same License: 拿來開發後license不能改
- state changes: 要把所有的修改內容與歷程列出

hold liable: 假設原作者的程式有問題,導致我們衍伸作品賣出後發生問題,不能跟原作者要求賠償
- trademark use: Mozilla和Apache有明定不可以商標使用,其他沒說
### 03-常見的開元軟體應用
- well-known GPLv2 Projects:
- Linux kernel
- Linus said "I give you source code, you give me your changes back, we are even. Right?That's my take on GPL version 2, right,it's that simple."
- BusyBox
- The main difference between GPLv2 & 3
- Tivoization(tivo條款):刷機條款,tivo是一間北美的機上盒公司,曾經發生過tivo這間公司有把它的程式碼公開,可是編譯出來的kernel卻無法運行在硬體上,原來它在上面有加DRM(Digital rights management),FSF認為這樣根本就不是open source的精神,所以加入了此條款,亦即,原始碼要可以在原來的硬體上執行
- 蠻多遷入式廠商都進用GPLv3,就是因為這一條款,車用車載廠商也是,原因是如果提供給用戶去刷機結果導致一些人員損傷等等的問題,責任歸屬要如何釐清
- FSF: Secure Boot impedes free software adoption
- 安全開機就是要避免被串改,但一旦允許可刷機,就沒有secure boot的功能
- x86的知名開機軟體GRUB,它本身就是GPLv3,所以如果x86使用GRUB就要有可以刷機的功能,所以軟體供應商想出另外一個辦法"Enrolling a MOK Key"
- MOK key(machine owner key):同時要有可刷機和類似secure boot的功能,那就讓machine的owner使用自己的key進行簽章或加密
- 
- Patent licensing:專利授權
- Additional Terms: 允許加入額外的條款
- Reinstatement clause:復權機制,GPLv2是沒有復權機制的,也就是說,一旦侵權則喪失使用權力,通常只有法官和原作者來告訴你可以復權,但這樣可能會造成依些問題,所以v3加入了復權機制,亦即,如果自己發現侵權,在60天內修正這個侵權的事實,就自動復權;如果是別人告知,則是30天內自動復權
- Why Doesn't Lnux Kernel Use GPLv3
- Linus said "It's not that I think Tivoization is necessarily something that you should strive for. But it is something that in my world view, it's your decision. If you make hardware that locks down the software, that's your decision as a hardware maker. That has no impact on my decision as a software maker to give you the software. Do you see where I am coming from? <font color=#FF0000>I don't like the locked down hardware, but at the same time that was never the social contract I intended with Linux.</font>"
- Linus說他不喜歡鎖硬體(DRM、Secure boot這些),但是他不想要強加這個限制在製造商身上,因為他是軟體開發者,所以他不想將這些限制推給硬體製造商
- Linus said "And I actually encourage people who don't care about the giving code back but care about the "Hey, I did something cool, please use it". I encourage people to use the BSD license for that. And I mean the BSD license is wonderful for that. It so happens that I thought that for my project the giving back is equally important so I, for me BSD is bad. But the point is for me. The GPLv3 maybe the perfect license for what you guys want to do. And that's fine. And then it's the license you should use. It's just that when somebody else wrote the code you don't get that choice."
- BSD是不錯的licnese,只是不適合Linux kernel這個專案
- 沒有最好的license,只有最適合的license
- BSD & MIT
- BSD和MIT大致等價,僅細微差異
- MIT有註明除了程式碼以外,說明文件也被license所管控
- joke:密西西比河以東用MIT 密西西比河以西用BSD
- 兩間學校:MIT麻省理工 BSD柏克萊
- Linux Kernel Gets An "Enforcement Statement" to deal with copyright trolls
- 因為Linux Kernel專案使用GPLv2,所以產生了很多議題
- Linux Kernel的維護者、貢獻者和作者們共同簽了一個enforcement statement,將此statement附加在GPLv2的授權上面
- https://www.kernel.org/doc/html/latest/process/kernel-enforcement-statement.html
- "We view legal action as a last resort, to be initiated only when other community efforts have failed to resolve the problem."
- 把法律訴訟視為最後的途徑"
- 其中也加入了GPLv2所缺的復權機制
- Is lInux Kernel Module GPLv2?
- But if the semantics of the communication are intimate enough, exchanging complex internal data structures, that too could be a basis to consider the two parts as combined into a larger program.
- 只要這個Module根據Linux Kernel進行設計,且在設計架構與互動關係上有緊密關聯的話,這個Module就是Linux Kernel的衍生著作
- 因為是衍生著作,就必須是GPLv2
- https://www.gnu.org/licenses/gpl-faq.en.html
- 搜尋:What is the difference between an “aggregate” and other kinds of “modified versions”?
- 兩個例外:
- kernel moduel誕生時間比linux kernel還早
- 卡內基美濃的Andrew FileSystem,AFS
- 為何叫Andrew?因為該校的創辦人是Andrew Carnegie和Andrew Mellon
- Code ported had no Linux origin
- NVidia
- 除此之外大概沒有了
- EXPORT_SYMBOL_GPL()
- Linux kernel裡面一些核心的API,用這個去做宣告,如果你自己的module要呼叫這些API,module的license要宣告為GPL
### 04-授權相容性(Licnese Compatibility)與其他授權
- License Compatibility
- 不可撤回條款:假設某軟體的V1.0用的是MIT,V2.0用的是GPL2.0+,V3.0用的是GPL3.0,假設我們用了V1.0,我們就要遵守MIT,避免養套殺的狀況發生
- 
- GPLv2到GPLv3的虛線:有些會寫GPLv2+,就可相容於GPLv3
- 
- Apache v2 is not compatible with GPL v2
- 感染性問題:如果是使用像GPL這種copyleft license的話,除非有用很嚴謹的隔離,譬如說用IPC把整個software的communication隔開,要不然就會自動變成GPL
- what is IPC?Inter-Process Communication?
- Apache foundation:覺得和GPLv2是可兼容的
- FSF:Richard Stallman認為不兼容,因為Apache v2有專利授權,但GPLv2是沒有的
- 把Apache v2的軟體和GPLv2的軟體合在一起開發,會有問題
- GPL with OpenSSL exception
- GPL和OpenSSL專案的條款也不兼容,因為有條款相衝
- OpenSSL 3.0.0改為Apache v2,但還是和GPL不兼容
- Fix License Issues in Upstream
- 作者寫的license不一定是對的
- libgpiod的license有問題,SZ已通知作者,作者已修正
- software update project的license也有問題
- Common Clause
- Redis Modules:改為使用Apache 2.0 modified with Common Clause
- Redis is open source BSD license
- Debian將redisearch設為有重大的bug(Severity: serious),然後下架,因為違反open source的精神
- Debian和Fedora的主席,共同建立GoodFORM,就是把還沒改license前的redis module給fork下來自己維護
- Redis將license改為Redis Source Available License(RSAL),它也不是open source license,RSAL只有限定特定領域不可商業使用,其他開放
- Common Clause: 不允許商業使用
- Server Side Public License
- MongoDB:2018/12將license改為SSPL,史上無敵最嚴格的copyleft條款,只要用了MongoDB架的服務,所有的web database都要開源,從web interface、前端、後端都要
- MongoDB有把SSPL拿去OSI(Open Source Initiative)這個組織進行open source license的申請,但沒過
- Community Data License Agreement(CDLA)
- sharing:要貢獻回去
- permissive:不受限
- Contributor License Agreement(CLA)
- 要貢獻才要注意的事
- 貢獻者要提交回去的時候,要簽CLA,基本上就是一種著作權授權的概念,也就是說你願意把這個提交,授權給原作者
- Sign-off-by: Linux Kernel所用的機制,提交kernel patch的時候都要簽一個sign-off-by,代表你願意把這個著作權,授權給Linux Kernel做使用
- 以往CLA是各家定義,內容多跟法律有關,久了被人詬病,因為很多人不懂
- Developer Certificate of Origin, DCO: Linux kernel為主要定義者,內容只有a、b、c、d四點,主要就是說我確定這個修改是我本人做的,我願意把著作權給原本的作者使用
- Gitlab switched to DCO
### 04-授權相容性(Licnese Compatibility)與其他授權
1. Can open source software be used for commercial purposes?
- Yes
2. Can I sell open source programs?Even if I haven't written it?
- Yes
3. Is "SOME LICENSE" an open source license, even if it is not listed on your web site?
- In general, NO.
- open source license是專有名詞,需透過OSI的審定
4. Can I call my program "Open Source" even if I don't use an approved license?
- Please don't do that. If you call it "Open Source" without using an approved license, you will confuse people.
- 有open source license授權的才叫open source project
5. Which Open Source license should I choose to release my software under?
- http://wiki.civiccommons.org/Choosing_a_License/
- http://choosealicense.com/
- (失效)http://www.openfoundry.org/LicenseWizard/index.htm
- Google使用的licenses
- Apache 2: 預設
- 其他:MIT/BSD、GPLv2、GPLv3
- 
- Another Licenses:
- 木蘭寬鬆許可證,中國的,和Apache很像
- 國家級的軟體發布,要用官方語言,這邊就是簡體中文
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE(WTFPL)
- 此license沒有過OSI審核,基本上它就是公共財
- DON'T BE A DICK PUBLIC LICENSE(DBAD)
- 此license沒有過OSI審核,基本上它就是公共財
- Beerware
- 你可以做任何事,如果你覺得好用,you can buy me a beer in return
- 作者:FreeBSD的主要貢獻者
- Teams channel
- 