Merge, with conflicts

This commit is contained in:
Acceleratorrrr 2020-05-17 22:32:34 +01:00
commit 84838264e3
6 changed files with 480 additions and 482 deletions

View File

@ -0,0 +1,69 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12225-1.html)
[#]: subject: (Getting started with FreeBSD as a desktop operating system)
[#]: via: (https://opensource.com/article/20/5/furybsd-linux)
[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja)
使用 FreeBSD 作为桌面操作系统
======
> FuryBSD 的实时桌面环境能让你在实际使用之前先尝试。
![FuryBSD Post-Install XFCE Desktop][10]
[FreeBSD][2] 是一个很棒的操作系统,但是从设计上讲,它并没有自带桌面环境。如果不从 FreeBSD 的 [ports 和软件包集][3]安装其他软件,那么 FreeBSD 仅能体验命令行。下面的截图显示了在安装过程中选择了每个“可选系统组件”后,登录 FreeBSD 12.1 的样子。
![FreeBSD][4]
FreeBSD 可以用各种桌面环境中的任何一种来变成桌面操作系统,但是这需要时间、精力和[遵循大量书面说明][5]。使用使用 desktop-installer 包(为用户提供基于文本的菜单并帮助自动执行大部分过程)仍然非常耗时。这两种方法的最大问题是,用户可能在花了很多时间进行设置之后,可能会发现他们的硬件系统与 FreeBSD 不完全兼容。
[FuryBSD][6] 通过提供实时桌面镜像来解决此问题用户可以在安装之前对其进行评估。目前FuryBSD 提供 Xfce 镜像和 KDE 镜像。每个镜像都提供了一个已预安装桌面环境的 FreeBSD。如果用户试用该镜像并发现其硬件工作正常那么他们可以安装 FuryBSD并拥有一个由 FreeBSD 驱动的即用桌面操作系统。在本文中,我会使用 Xfce 镜像,但 KDE 镜像的工作原理完全一样。
对于安装过 Linux 发行版、BSD 或任何其他类 Unix 的开源操作系统的人FuryBSD 的上手过程应该很熟悉。从 FuryBSD 网站下载 ISO将它复制到闪存盘然后从闪存盘启动计算机。如果从闪存盘引导失败请确保“安全引导”已禁用。
![FuryBSD Live XFCE Desktop][7]
从闪存盘启动后,桌面环境将自动加载。除了“家”、“文件系统”和“回收站”图标外,实时桌面还有用于配置 Xorg 的工具、入门指南、FuryBSD 安装程序和系统信息程序的图标。除了这些额外功能以及一些自定义的 Xfce 设置和壁纸外,桌面环境除了基本的 Xfce 应用和 Firefox 之外并没有其他功能。
![FuryBSD Xorg Tool][8]
此时仅加载基本的图形驱动,但足以检查 FuryBSD 是否支持系统的有线和无线网络接口。如果网络接口没有一个能自动工作,那么 `Getting Started.txt` 文件包含有关尝试配置网络接口和其他配置任务的说明。如果至少有一个网络接口有效,那么可以使用 Configure Xorg 应用安装 Intel、NVidia 或 VirtualBox 图形驱动。它将下载并安装驱动,并且需要重新启动 Xorg。如果系统未自动重新登录到实时镜像用户那么密码为 `furybsd`(你可以使用它来登录)。配置后,图形驱动将转移到已安装的系统中。
![FuryBSD Installer - ZFS Configuration][9]
如果一切都可以在实时环境中正常运行,那么 FuryBSD 安装程序可以将 FuryBSD 配置并安装到计算机上。该安装程序在终端中运行,但提供与大多数其他 BSD 和 Linux 安装程序相同的选项。系统将要求用户设置系统的主机名、配置 ZFS 存储、设置 root 密码,添加至少一个非 root 用户以及配置时间和日期。完成后,系统可以引导到预装有 Xfce (或 KDE的 FreeBSD 中。FuryBSD 完成了所有困难的工作,甚至还花了很多精力使桌面看起来更漂亮。
如上所述,桌面环境没有大量预装软件,因此几乎肯定要安装额外的软件包。最快的方法是在终端中使用 `pkg` 命令。该命令的行为很像 `dnf``apt`,因此使用过其中之一的来自 Linux 发行版的用户在查找和安装软件包时应该感到很熟悉。FreeBSD 的软件包集合非常多,因此大多数知名的开源软件包都可用。
如果用户在没有太多 FreeBSD 经验的情况下尝试 FuryBSD应查阅 [FreeBSD 手册][11],以了解有关如何以 FreeBSD 的方式操作。有任何 Linux 发行版或其他 BSD 使用经验的用户应该能弄清很多事情,但是手册可以帮助你弄清一些差异。进一步了解 FreeBSD 的一个很好的资源是 Michael W. Lucas 的 《[Absolute FreeBSD第三版][12]》。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/5/furybsd-linux
作者:[Joshua Allen Holm][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/holmja
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser)
[2]: https://www.freebsd.org
[3]: https://www.freebsd.org/ports/
[4]: https://opensource.com/sites/default/files/uploads/freebsd.png (FreeBSD)
[5]: https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-a-desktop-environment-on-freebsd/
[6]: https://www.furybsd.org
[7]: https://opensource.com/sites/default/files/uploads/furybsd_live_xfce_desktop.png (FuryBSD Live XFCE Desktop)
[8]: https://opensource.com/sites/default/files/uploads/furybsd_xorg_tool.png (FuryBSD Xorg Tool)
[9]: https://opensource.com/sites/default/files/uploads/furybsd_installer_-_zfs_configuration.png (FuryBSD Installer - ZFS Configuration)
[10]: https://opensource.com/sites/default/files/uploads/furybsd_post-install_xfce_desktop.png (FuryBSD Post-Install XFCE Desktop)
[11]: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/
[12]: https://nostarch.com/absfreebsd3

View File

@ -1,254 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (9 open source CSS frameworks for frontend web development)
[#]: via: (https://opensource.com/article/20/4/open-source-css-frameworks)
[#]: author: (Bryant Son https://opensource.com/users/brson)
9 open source CSS frameworks for frontend web development
======
Explore open source CSS frameworks and find the right one for your
project.
![Digital creative of a browser on the internet][1]
When most people think about web development, HTML or JavaScript usually come to mind. They usually forget about the technology that has far more impact on the ability to enjoy a website: [cascading style sheets (CSS)][2]. CSS is both one of the most important and the most often forgotten parts of any webpage, even though it's one of the three cornerstone technologies of the World Wide Web, according to Wikipedia.
This article explores nine popular, powerful, and open source frameworks that make CSS development straightforward for building beautiful website frontends.
Name | What It Is | License
---|---|---
[Bootstrap][3] | The most popular CSS framework; by Twitter | MIT
[PatternFly][4] | Open source framework; by Red Hat | MIT
[Material Components for the web][5] | Open source framework; by Google | MIT
[Pure][6] | Open source framework; by Yahoo | BSD
[Foundation][7] | Frontend framework; by Zurb Foundation | MIT
[Bulma][8] | Modern CSS framework based on Flexbox | MIT
[Skeleton][9] | Lightweight CSS framework | MIT
[Materialize][10] | CSS framework based on Material Design | MIT
[Bootflat][11] | Open source Flat UI kit based on Bootstrap 3.3.0 | MIT
 
If you prefer to follow along as I explore this live, you can watch my video.
### Bootstrap
[Bootstrap][12] is easily the most popular CSS framework, and it is the one that started all frontend web design. Developed by Twitter, Bootstrap offers usability, functionality, and extensibility.
![Bootstrap homepage][13]
Bootstrap also offers plenty of [examples][14] to get you started.
![Bootstrap examples][15]
With Bootstrap, you can stitch together different components and layouts to create an interesting page design. It also offers plenty of detailed documentation.
![Bootstrap documentation][16]
Bootstrap's [GitHub][3] repository lists more than 19,000 commits and 1,100 contributors. It is based on the MIT License, so (as with all of the frameworks on this list) you can jump in and contribute as well.
![Bootstrap GitHub][17]
### PatternFly
[PatternFly][18] is an open source (under the MIT License) CSS framework by Red Hat. PatternFly takes a different approach than Bootstrap: While Bootstrap is meant for anyone interested in creating a beautiful website, PatternFly is primarily focused on enterprise application developers and provides components, such as bars, charts, and navigations, that are very appealing for creating powerful, metrics-driven dashboards. In fact, Red Hat uses this CSS framework for the design of its products, such as OpenShift.
![PatternFly homepage][19]
In addition to static HTML, PatternFly also supports the ReactJS framework, a popular JavaScript framework developed by Facebook.
![PatternFly ReactJS support][20]
PatternFly has many advanced components, such as bars, charts, [modals][21], and layouts, that are suitable for enterprise-level applications.
![PatternFly chart component][22]
PatternFly's [GitHub][4] page lists more than 1,050 commits and 44 contributors. PatternFly is getting a lot of attention, and you are more than welcome to contribute.
![PatternFly GitHub][23]
### Material Components for the web
With its highly successful Android platform, Google set its own standard design guidelines with a concept called [Material Design][24]. The Material Design standards are intended to be reflected across all Google products, and they are also available to the general public and open source under the MIT License.
![Material Design homepage][25]
Material Design has a number of [Components][26], "interactive building blocks for creating a user interface." These buttons, cards, backdrops, and more can be used to create any type of user interface for a website or mobile application.
![Material Components webpage][27]
The maintainers provide thorough documentation for different platforms.
![Material Design documentation][28]
There are also step-by-step tutorials with exercises for accomplishing different goals.
![Material Design tutorial][29]
The Material Components GitHub page hosts repos for different platforms, including [Material Components for the web (MDC Web)][5] for website development. MDC Web has more than 5,700 commits and 349 contributors.
![MDC Web GitHub][30]
### Pure
Bootstrap, Patternfly, and MDC Web are very powerful CSS frameworks, yet they can be quite heavy and complex. If you want a lightweight CSS framework that it is closer to coding CSS yourself yet helps you build a nice web page, try [Pure.css][31]. Pure is a lightweight CSS framework with a minimal footprint. It was developed by Yahoo and is open source under the BSD License.
![Pure.css homepage][32]
Despite its small size, Pure offers plenty of the components necessary to build a good-looking webpage.
![Pure.css components][33]
Pure's [GitHub][6] page shows more than 565 commits and 59 contributors.
![Pure.css GitHub][34]
### Foundation
[Foundation][35] claims to be the most advanced responsive frontend framework in the world. It provides advanced features and tutorials for building professional websites.
![Foundation homepage][36]
The framework is [used][37] by many companies, organizations, and even politicians, and it has plenty of documentation available.
![Foundation documentation][38]
Foundation's [GitHub][7] page shows nearly 17,000 commits and 1,000 contributors. Like most of the other frameworks on this list, it's available under the MIT License.
![Foundation GitHub][39]
### Bulma
[Bulma][40] is an open source framework based on Flexbox and available under the MIT License. Bulma is a pretty lightweight framework, as it requires only one CSS file.
![Bulma homepage][41]
Bulma has clean and simple docs that make it easy to choose the topics you want to explore. It also has a number of web components you can just pick up and use in your design.
![Bulma documentation][42]
Bulma's [GitHub][8] page lists more than 1,400 commits and 300 contributors.
![Bulma GitHub][43]
### Skeleton
If even Pure is too heavy for you, there is an even lighter-weight framework called [Skeleton][44]. The Skeleton library is only about 400 lines long, and the framework provides only the essential components to start your CSS framework journey.
![Skeleton homepage][45]
Despite its simplicity, Skeleton offers detailed docs to help you get started right away.
![Skeleton documentation][46]
Skeleton's [GitHub][9] lists 167 commits and 22 contributors. However, it's not the most active project; its last update was in 2014, so it may need some maintenance before using it. Since it is released under the MIT License, feel free to do that yourself.
![Skeleton GitHub][47]
### Materialize
[Materialize][48] is a responsive frontend framework based on Google's Material Design with additional themes and components developed by Materialize's contributors.
![Materialize homepage][49]
Materialize's documentation page is comprehensive and pretty easy to follow. Its components page includes buttons, cards, navigations, and more.
![Materialize documentation][50]
Materialize is an open source project under the MIT License, and its [GitHub][10] lists more than 3,800 commits and 250 contributors.
![Materialize GitHub][51]
### Bootflat
[Bootflat][52] is an open source CSS framework derived from Twitter's Bootstrap. Compared to Bootstrap, Bootflat is simpler, with lighter-weight framework components.
![Bootflat homepage][53]
Bootflat's [documentation][54] almost seems inspired by IKEA—it shows an image of each component without much text.
![Bootflat docs][55]
Bootflat is available under the MIT License, and its [GitHub][11] page includes 159 commits and eight contributors, as of this writing.
![Bootflat GitHub][56]
### Which CSS framework should you choose?
You have many options for open source CSS frameworks, depending on how feature-rich or simple you want the tooling to be. Like all technology decisions, there is no single right answer for everything or everyone; there is only the right choice for the given time and the given project.
Give a few of these a spin and see which one you want to use in your next project. Also, did I miss any interesting open source CSS frameworks? Please share your feedback and ideas in the comments below.
Which frontend framework should you pick for your next web app? Pam Selle will address this...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/open-source-css-frameworks
作者:[Bryant Son][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/brson
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets
[3]: https://github.com/twbs/bootstrap
[4]: https://github.com/patternfly/patternfly
[5]: https://github.com/material-components/material-components-web
[6]: https://github.com/pure-css/pure
[7]: https://github.com/foundation/foundation-sites
[8]: https://github.com/jgthms/bulma
[9]: https://github.com/dhg/Skeleton
[10]: https://github.com/Dogfalo/materialize
[11]: https://github.com/bootflat/bootflat.github.io
[12]: https://getbootstrap.com
[13]: https://opensource.com/sites/default/files/uploads/2_bootstrapscreenshot.jpg (Bootstrap homepage)
[14]: https://getbootstrap.com/docs/4.4/examples/
[15]: https://opensource.com/sites/default/files/uploads/3_bootstrapsamples.jpg (Bootstrap examples)
[16]: https://opensource.com/sites/default/files/uploads/4_bootstrapdocs.jpg (Bootstrap documentation)
[17]: https://opensource.com/sites/default/files/uploads/5_bootstrapgithub.jpg (Bootstrap GitHub)
[18]: https://www.patternfly.org
[19]: https://opensource.com/sites/default/files/uploads/6_patternflyhomepage.jpg (PatternFly homepage)
[20]: https://opensource.com/sites/default/files/uploads/7_patternflyreactjs.jpg (PatternFly ReactJS support)
[21]: https://en.wikipedia.org/wiki/Modal_window
[22]: https://opensource.com/sites/default/files/uploads/8_patternflycomponents.jpg (PatternFly chart component)
[23]: https://opensource.com/sites/default/files/uploads/9_patternflygithub.jpg (PatternFly GitHub)
[24]: https://material.io
[25]: https://opensource.com/sites/default/files/uploads/10_materialhome.jpg (Material Design homepage)
[26]: https://material.io/components/
[27]: https://opensource.com/sites/default/files/uploads/11_materialcomponents.jpg (Material Components webpage)
[28]: https://opensource.com/sites/default/files/uploads/12_materialdocs.jpg (Material Design documentation)
[29]: https://opensource.com/sites/default/files/uploads/13_materialtutorial.jpg (Material Design tutorial)
[30]: https://opensource.com/sites/default/files/uploads/15_materialgithub.jpg (MDC Web GitHub)
[31]: https://purecss.io
[32]: https://opensource.com/sites/default/files/uploads/16_purehome.jpg (Pure.css homepage)
[33]: https://opensource.com/sites/default/files/uploads/17_purecomponents.jpg (Pure.css components)
[34]: https://opensource.com/sites/default/files/uploads/18_puregithub.jpg (Pure.css GitHub)
[35]: https://get.foundation
[36]: https://opensource.com/sites/default/files/uploads/19_foundationhome.jpg (Foundation homepage)
[37]: https://zurb.com/responsive
[38]: https://opensource.com/sites/default/files/uploads/21_foundationdocs.jpg (Foundation documentation)
[39]: https://opensource.com/sites/default/files/uploads/22_foundationgithub.jpg (Foundation GitHub)
[40]: https://bulma.io
[41]: https://opensource.com/sites/default/files/uploads/23_bulmahome.jpg (Bulma homepage)
[42]: https://opensource.com/sites/default/files/uploads/24_bulmadoc.jpg (Bulma documentation)
[43]: https://opensource.com/sites/default/files/uploads/25_bulmagithub.jpg (Bulma GitHub)
[44]: http://getskeleton.com
[45]: https://opensource.com/sites/default/files/uploads/26_skeletonhome.jpg (Skeleton homepage)
[46]: https://opensource.com/sites/default/files/uploads/27_skeletondocs.jpg (Skeleton documentation)
[47]: https://opensource.com/sites/default/files/uploads/28_skeletongithub.jpg (Skeleton GitHub)
[48]: https://materializecss.com
[49]: https://opensource.com/sites/default/files/uploads/29_materializehome.jpg (Materialize homepage)
[50]: https://opensource.com/sites/default/files/uploads/30_materializedocs.jpg (Materialize documentation)
[51]: https://opensource.com/sites/default/files/uploads/31_materializegithub.jpg (Materialize GitHub)
[52]: http://bootflat.github.io
[53]: https://opensource.com/sites/default/files/uploads/32_bootflathome.jpg (Bootflat homepage)
[54]: http://bootflat.github.io/documentation.html
[55]: https://opensource.com/sites/default/files/uploads/33_bootflatdocs.jpg (Bootflat docs)
[56]: https://opensource.com/sites/default/files/uploads/34_bootflatgithub.jpg (Bootflat GitHub)

View File

@ -1,161 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why strace doesn't work in Docker)
[#]: via: (https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/)
[#]: author: (Julia Evans https://jvns.ca/)
Why strace doesn't work in Docker
======
While editing the capabilities page of the [how containers work][1] zine, I found myself trying to explain why `strace` doesnt work in a Docker container.
The problem here is if you run `strace` in a Docker container, this happens:
```
$ docker run -it ubuntu:18.04 /bin/bash
$ # ... install strace ...
[email protected]:/# strace ls
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
```
strace works using the `ptrace` system call, so if `ptrace` isnt allowed, its definitely not gonna work! This is pretty easy to fix on my machine, this fixes it:
```
docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash
```
But I wasnt interested in fixing it, I wanted to know why it happens. So why does strace not work, and why does `--cap-add=SYS_PTRACE` fix it?
### hypothesis 1: container processes are missing the `CAP_SYS_PTRACE` capability
I always thought the reason was that Docker container processes by default didnt have the `CAP_SYS_PTRACE` capability. This is consistent with it being fixed by `--cap-add=SYS_PTRACE`, right?
But this actually doesnt make sense for 2 reasons.
**Reason 1**: Experimentally, as a regular user, I can strace on any process run by my user. But if I check if my current process has the `CAP_SYS_PTRACE` capability, I dont:
```
$ getpcaps $$
Capabilities for `11589': =
```
**Reason 2**: `man capabilities` says this about `CAP_SYS_PTRACE`:
```
CAP_SYS_PTRACE
* Trace arbitrary processes using ptrace(2);
```
So the point of `CAP_SYS_PTRACE` is to let you ptrace **arbitrary** processes owned by any user, the way that root usually can. You shouldnt need it to just ptrace a regular process owned by your user.
And I tested this a third way I ran a Docker container with `docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash`, dropped the `CAP_SYS_PTRACE` capability, and I could still strace processes even though I didnt have that capability anymore. What? Why?
### hypothesis 2: something about user namespaces???
My next (much less well-founded) hypothesis was something along the lines of “um, maybe the process is in a different user namespace and strace doesnt work because of… reasons?” This isnt really coherent but heres what happened when I looked into it.
Is the container process in a different user namespace? Well, in the container:
```
[email protected]:/# ls /proc/$$/ns/user -l
... /proc/1/ns/user -> 'user:[4026531837]'
```
On the host:
```
[email protected]:~$ ls /proc/$$/ns/user -l
... /proc/12177/ns/user -> 'user:[4026531837]'
```
Because the user namespace ID (`4026531837`) is the same, the root user in the container is the exact same user as the root user on the host. So theres definitely no reason it shouldnt be able to strace processes that it created!
This hypothesis doesnt make much sense but I hadnt realized that the root user in a Docker container is the same as the root user on the host, so I thought that was interesting.
### hypothesis 3: the ptrace system call is being blocked by a seccomp-bpf rule
I also knew that Docker uses seccomp-bpf to stop container processes from running a lot of system calls. And ptrace is in the [list of system calls blocked by Dockers default seccomp profile][2]! (actually the list of allowed system calls is a whitelist, so its just that ptrace is not in the default whitelist. But it comes out to the same thing.)
That easily explains why strace wouldnt work in a Docker container if the `ptrace` system call is totally blocked, then of course you cant call it at all and strace would fail.
Lets verify this hypothesis if we disable all seccomp rules, can we strace in a Docker container?
```
$ docker run --security-opt seccomp=unconfined -it ubuntu:18.04 /bin/bash
$ strace ls
execve("/bin/ls", ["ls"], 0x7ffc69a65580 /* 8 vars */) = 0
... it works fine ...
```
Yes! It works! Great. Mystery solved, except…
### why does `--cap-add=SYS_PTRACE` fix the problem?
What we still havent explained is: why does `--cap-add=SYS_PTRACE` would fix the problem?
The man page for `docker run` explains the `--cap-add` argument this way:
```
--cap-add=[]
Add Linux capabilities
```
That doesnt have anything to do with seccomp rules! Whats going on?
### lets look at the Docker source code.
When the documentation doesnt help, the only thing to do is go look at the source.
The nice thing about Go is, because dependencies are often vendored in a Go repository, you can just grep the repository to figure out where the code that does a thing is. So I cloned `github.com/moby/moby` and grepped for some things, like `rg CAP_SYS_PTRACE`.
Heres what I think is going on. In containerds seccomp implementation, in [contrib/seccomp/seccomp_default.go][3], theres a bunch of code that makes sure that if a process has a capability, then its also given access (through a seccomp rule) to use the system calls that go with that capability.
```
case "CAP_SYS_PTRACE":
s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
Names: []string{
"kcmp",
"process_vm_readv",
"process_vm_writev",
"ptrace",
},
Action: specs.ActAllow,
Args: []specs.LinuxSeccompArg{},
})
```
Theres some other code that seems to do something very similar in [profiles/seccomp/seccomp.go][4] in moby and the [default seccomp profile][5], so its possible that thats whats doing it instead.
So I think we have our answer!
### `--cap-add` in Docker does a little more than what it says
The upshot seems to be that `--cap-add` doesnt do exactly what it says it does in the man page, its more like `--cap-add-and-also-whitelist-some-extra-system-calls-if-required`. Which makes sense! If you have a capability like `CAP_SYS_PTRACE` which is supposed to let you use the `process_vm_readv` system call but that system call is blocked by a seccomp profile, thats not going to help you much!
So allowing the `process_vm_readv` and `ptrace` system calls when you give the container `CAP_SYS_PTRACE` seems like a reasonable choice.
### thats all!
This was a fun small thing to investigate, and I think its a nice example of how containers are made of lots of moving pieces that work together in not-completely-obvious ways.
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://wizardzines.com/zines/containers
[2]: https://docs.docker.com/engine/security/seccomp/
[3]: https://github.com/containerd/containerd/blob/4be98fa28b62e8a012491d655a4d6818ef87b080/contrib/seccomp/seccomp_default.go#L527-L537
[4]: https://github.com/moby/moby/blob/cc0dfb6e7b22ad120c60a9ce770ea15415767cf9/profiles/seccomp/seccomp.go#L126-L132
[5]: https://github.com/moby/moby/blob/master/profiles/seccomp/default.json#L723-L739

View File

@ -0,0 +1,250 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (9 open source CSS frameworks for frontend web development)
[#]: via: (https://opensource.com/article/20/4/open-source-css-frameworks)
[#]: author: (Bryant Son https://opensource.com/users/brson)
9 个用于前端 Web 开发的开源 CSS 框架
======
> 探索开源 CSS 框架,找到适合你的项目的框架。
![Digital creative of a browser on the internet][1]
当大多数人想到 Web 开发时,通常会想到 HTML 或 JavaScript。他们通常会忘记对网站的欣赏能力有更大影响的技术<ruby>[级联样式表][2]<rt>cascading style sheets</rt></ruby>简称CSS。据维基百科的说法CSS 既是任何网页中最重要的部分,也是最常被遗忘的部分,尽管它是万维网的三大基石技术之一。
本文将探讨九种流行的、强大的、开源的框架,是这些框架让构建漂亮的网站前端的 CSS 开发变得简单明了。
名称 | 介绍| 许可证
---|---|---
[Bootstrap][3] | 最流行的 CSS 框架,来自 Twitter | MIT
[PatternFly][4] | 开源框架,来自 Red Hat | MIT
[MDC Web][5] | 开源框架;来自 Google | MIT
[Pure][6] | 开源框架;来自 Yahoo | BSD
[Foundation][7] | 前端框架了;来自 Zurb 基金会 | MIT
[Bulma][8] | 现代 CSS 框架,基于 Flexbox | MIT
[Skeleton][9] | 轻量级 CSS 框架 | MIT
[Materialize][10] | 基于 Material Design 的 CSS 框架 | MIT
[Bootflat][11] | 开源 Flat UI 工具,基于 Bootstrap 3.3.0 | MIT
如果你更愿意跟着我一起探索这段直播,你可以看我的视频。 
### Bootstrap
[Bootstrap][2] 无疑是最流行的 CSS 框架,它是所有前端 Web 设计的开端。Bootstrap 由 Twitter 开发,提供了可用性、功能性和可扩展性。
![Bootstrap homepage][13]
Bootstrap 还提供了大量的[例子][14]来帮助你入门。
![Bootstrap examples][15]
使用 Bootstrap你可以将不同的组件和布局拼接在一起创造出一个有趣的页面设计。它还提供了大量详细的文档。
![Bootstrap documentation][16]
Bootstrap 的 [GitHub][3] 仓库列出了超过 19000 个提交和 1100 个贡献者。它基于 MIT 许可证,所以(和这个列表中的所有框架一样)你也可以加入并贡献。
![Bootstrap GitHub][17]
### PatternFly
[PatternFly][18] 是由 Red Hat 开发的一个开源的MIT 许可证CSS 框架。PatternFly 采取了与 Bootstrap 不同的方法Bootstrap 是为任何对创建一个漂亮网站感兴趣的人而设计的,而 PatternFly 主要针对企业级应用开发者它提供的组件如条形图、图表和导航对于创建强大的、指标驱动的仪表盘非常有吸引力。事实上Red Hat 在其产品(如 OpenShift的设计中也使用了这个 CSS 框架。
![PatternFly homepage][19]
除了静态 HTML 之外PatternFly 还支持 ReactJS 框架ReactJS 是 Facebook 开发的一个流行的 JavaScript 框架。
![PatternFly ReactJS support][20]
PatternFly 有许多高级组件,如条形图、图表、[模态窗口][21]和布局等,适用于企业级应用。
![PatternFly chart component][22]
PatternFly 的 [GitHub][4] 页面列出了超过 1050 个提交者和 44 个贡献者。PatternFly 得到了很多人的关注,欢迎大家踊跃贡献。
![PatternFly GitHub][23]
### MDC Web
凭借其大获成功的 Android 平台,谷歌以一个名为 [Material Design][24] 的概念制定了自己的标准设计准则。Material Design 标准旨在体现在所有谷歌的产品中,并且在 MIT 许可证下,这些标准也可以向大众和开放源代码。
![Material Design homepage][25]
Material Design 有许多“用于创建用户界面的交互式构建块”的[组件][26]。这些按钮、卡片、背景等可用于创建网站或移动应用程序的任何类型的用户界面。
![Material Components webpage][27]
维护人员为不同的平台提供了详尽的文档。
![Material Design documentation][28]
还有分步教程,其中包含用于实现不同目标的练习。
![Material Design tutorial][29]
Material 组件的 GitHub 页面承载了不同平台的版本库,包括用于网站开发的 [Material Web 组件MDC Web][5]。MDC Web 有超过 5700 个提交和 349 个贡献者。
![MDC Web GitHub][30]
### Pure
Bootstrap、Patternfly 和 MDC Web 都是非常强大的 CSS 框架,但是它们可能相当的笨重和复杂。如果你想要一个轻量级的 CSS 框架,它更接近于自己编写 CSS但又能帮助你建立一个漂亮的网页可以试试 [Pure.css][31]。Pure 是一个轻量级的 CSS 框架,它的体积很小。它是由 Yahoo 开发的,在 BSD 许可证下开源。
![Pure.css homepage][32]
尽管体积小,但 Pure 提供了建立一个漂亮网页的很多必要的组件。
![Pure.css components][33]
Pure 的 [GitHub][6] 页面显示它有超过 565 个提交和 59 个贡献者。
![Pure.css GitHub][34]
### Foundation
[Foundation][35] 号称是世界上最先进的响应式前端框架。它提供了先进的功能和教程,用于构建专业网站。
![Foundation homepage][36]
该框架被许多公司、组织甚至政客[使用][37],并且有大量的文档可用。
![Foundation documentation][38]
Foundation 的 [GitHub][7] 页面显示有近 17000 个提交和 1000 个贡献者。和这个列表中的大多数其他框架一样,它也是在 MIT 许可证下提供的。
![Foundation GitHub][39]
### Bulma
[Bulma][40] 是一个基于 Flexbox 的开源框架,在 MIT 许可证下提供。Bulma 是一个相当轻量级的框架,因为它只需要一个 CSS 文件。
![Bulma homepage][41]
Bulma 有简洁明快的文档,让你可以很容易地选择你想要探索的主题。它也有很多的网页组件,你可以直接拿起来在设计中使用。
![Bulma documentation][42]
Bulma 的 [GitHub][8] 页面列出了 1400 多个提交和 300 多个贡献者。
![Bulma GitHub][43]
### Skeleton
如果连 Pure 都觉得太重了,那么还有一个更轻量级的框架叫 [Skeleton][44]。Skeleton 库只有 400 行左右的长度,而且这个框架只提供了开始你的 CSS 框架之旅的基本组件。
![Skeleton homepage][45]
尽管它很简单但Skeleton提供了详细的文档可以帮助你马上上手。
![Skeleton documentation][46]
Skeleton 的 [GitHub][9] 列出了 167 个提交者和 22 个贡献者。然而,它不是很活跃,它的最后一次更新是在 2014 年,所以在使用之前可能需要一些维护。由于它是在 MIT 许可证下发布的,你可以自行维护。
![Skeleton GitHub][47]
### Materialize
[Materialize][48] 是一个基于 Google 的 Material Design 的响应式前端框架,带有由 Materialize 的贡献者开发的附加主题和组件。
![Materialize homepage][49]
Materialize 的文档页面非常全面,而且相当容易理解。它的组件页面包括按钮、卡片、导航等等。
![Materialize documentation][50]
Materialize 是 MIT 许可证下的开源项目,它的 [GitHub][10] 列出了超过 3800 个提交和 250 个贡献者。
![Materialize GitHub][51]
### Bootflat
[Bootflat][52] 是由 Twitter 的 Bootstrap 衍生出来的一个开源 CSS 框架。与 Bootstrap 相比, Bootflat 更简单,框架组件更轻量级。
![Bootflat homepage][53]
Bootflat 的[文档][54]几乎像是受到了宜家的启发 —— 它显示的是每个组件的图片,没有太多的文字。
![Bootflat docs][55]
Bootflat 是在 MIT 许可下提供的,其 [GitHub][11] 页面包括 159 个提交和 8 个贡献者。
![Bootflat GitHub][56]
### 你应该选择哪个 CSS 框架?
对于开源的 CSS 框架,你有很多选择,这取决于你想要的工具功能有多丰富或简单。就像所有的技术决定一样,没有任何一个正确的答案,只有在给定的时间和项目中才有正确的选择。
尝试一下其中的一些,看看要在下一个项目中使用哪个。另外,我有没有错过任何有趣的开源 CSS 框架?请在下面的评论中分享你的反馈和想法。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/open-source-css-frameworks
作者:[Bryant Son][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/brson
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets
[3]: https://github.com/twbs/bootstrap
[4]: https://github.com/patternfly/patternfly
[5]: https://github.com/material-components/material-components-web
[6]: https://github.com/pure-css/pure
[7]: https://github.com/foundation/foundation-sites
[8]: https://github.com/jgthms/bulma
[9]: https://github.com/dhg/Skeleton
[10]: https://github.com/Dogfalo/materialize
[11]: https://github.com/bootflat/bootflat.github.io
[12]: https://getbootstrap.com
[13]: https://opensource.com/sites/default/files/uploads/2_bootstrapscreenshot.jpg (Bootstrap homepage)
[14]: https://getbootstrap.com/docs/4.4/examples/
[15]: https://opensource.com/sites/default/files/uploads/3_bootstrapsamples.jpg (Bootstrap examples)
[16]: https://opensource.com/sites/default/files/uploads/4_bootstrapdocs.jpg (Bootstrap documentation)
[17]: https://opensource.com/sites/default/files/uploads/5_bootstrapgithub.jpg (Bootstrap GitHub)
[18]: https://www.patternfly.org
[19]: https://opensource.com/sites/default/files/uploads/6_patternflyhomepage.jpg (PatternFly homepage)
[20]: https://opensource.com/sites/default/files/uploads/7_patternflyreactjs.jpg (PatternFly ReactJS support)
[21]: https://en.wikipedia.org/wiki/Modal_window
[22]: https://opensource.com/sites/default/files/uploads/8_patternflycomponents.jpg (PatternFly chart component)
[23]: https://opensource.com/sites/default/files/uploads/9_patternflygithub.jpg (PatternFly GitHub)
[24]: https://material.io
[25]: https://opensource.com/sites/default/files/uploads/10_materialhome.jpg (Material Design homepage)
[26]: https://material.io/components/
[27]: https://opensource.com/sites/default/files/uploads/11_materialcomponents.jpg (Material Components webpage)
[28]: https://opensource.com/sites/default/files/uploads/12_materialdocs.jpg (Material Design documentation)
[29]: https://opensource.com/sites/default/files/uploads/13_materialtutorial.jpg (Material Design tutorial)
[30]: https://opensource.com/sites/default/files/uploads/15_materialgithub.jpg (MDC Web GitHub)
[31]: https://purecss.io
[32]: https://opensource.com/sites/default/files/uploads/16_purehome.jpg (Pure.css homepage)
[33]: https://opensource.com/sites/default/files/uploads/17_purecomponents.jpg (Pure.css components)
[34]: https://opensource.com/sites/default/files/uploads/18_puregithub.jpg (Pure.css GitHub)
[35]: https://get.foundation
[36]: https://opensource.com/sites/default/files/uploads/19_foundationhome.jpg (Foundation homepage)
[37]: https://zurb.com/responsive
[38]: https://opensource.com/sites/default/files/uploads/21_foundationdocs.jpg (Foundation documentation)
[39]: https://opensource.com/sites/default/files/uploads/22_foundationgithub.jpg (Foundation GitHub)
[40]: https://bulma.io
[41]: https://opensource.com/sites/default/files/uploads/23_bulmahome.jpg (Bulma homepage)
[42]: https://opensource.com/sites/default/files/uploads/24_bulmadoc.jpg (Bulma documentation)
[43]: https://opensource.com/sites/default/files/uploads/25_bulmagithub.jpg (Bulma GitHub)
[44]: http://getskeleton.com
[45]: https://opensource.com/sites/default/files/uploads/26_skeletonhome.jpg (Skeleton homepage)
[46]: https://opensource.com/sites/default/files/uploads/27_skeletondocs.jpg (Skeleton documentation)
[47]: https://opensource.com/sites/default/files/uploads/28_skeletongithub.jpg (Skeleton GitHub)
[48]: https://materializecss.com
[49]: https://opensource.com/sites/default/files/uploads/29_materializehome.jpg (Materialize homepage)
[50]: https://opensource.com/sites/default/files/uploads/30_materializedocs.jpg (Materialize documentation)
[51]: https://opensource.com/sites/default/files/uploads/31_materializegithub.jpg (Materialize GitHub)
[52]: http://bootflat.github.io
[53]: https://opensource.com/sites/default/files/uploads/32_bootflathome.jpg (Bootflat homepage)
[54]: http://bootflat.github.io/documentation.html
[55]: https://opensource.com/sites/default/files/uploads/33_bootflatdocs.jpg (Bootflat docs)
[56]: https://opensource.com/sites/default/files/uploads/34_bootflatgithub.jpg (Bootflat GitHub)

View File

@ -0,0 +1,161 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why strace doesn't work in Docker)
[#]: via: (https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/)
[#]: author: (Julia Evans https://jvns.ca/)
为什么 strace 在 Docker 中不起作用?
======
在编辑“容器如何工作”杂志的能力页面时,我想试着解释一下为什么 `strace` 在 Docker 容器中无法工作。
这里的问题是 —— 如果我在笔记本上的 Docker 容器中运行 `strace`,就会出现这种情况:
```
$ docker run -it ubuntu:18.04 /bin/bash
$ # ... install strace ...
[email protected]:/# strace ls
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
```
`strace` 通过 `ptrace` 系统调用起作用,所以如果不允许使用 `ptrace`,它肯定是不能工作的! 这个问题很容易解决 —— 在我的机器上,是这样解决的:
```
docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash
```
但我对如何修复它不感兴趣,我想知道为什么会出现这种情况。那么,为什么 `strace` 不能工作,为什么`--cap-add=SYS_PTRACE` 可以解决这个问题?
### 假设 1容器进程缺少 `CAP_SYS_PTRACE` 能力。
我一直以为原因是 Docker 容器进程默认不具备 `CAP_SYS_PTRACE` 能力。这和它可以被 `--cap-add=SYS_PTRACE` 修复是一回事,是吧?
但这实际上是不合理的,原因有两个。
原因 1在实验中作为一个普通用户我可以对我的用户运行的任何进程进行 `strace`。但如果我检查我的当前进程是否有 `CAP_SYS_PTRACE` 能力,则没有:
```
$ getpcaps $$
Capabilities for `11589': =
```
原因 2`capabilities` 的手册页对 `CAP_SYS_PTRACE` 的介绍是:
```
CAP_SYS_PTRACE
* Trace arbitrary processes using ptrace(2);
```
所以,`CAP_SYS_PTRACE` 的作用是让你像 root 一样,可以对任何用户拥有的**任意**进程进行 `ptrace` 。你不需要用它来只是对一个由你的用户拥有的普通进程进行 `ptrace `
我用第三种方法测试了一下 —— 我用 `docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash` 运行了一个 Docker 容器,去掉了 `CAP_SYS_PTRACE` 能力,但我仍然可以跟踪进程,虽然我已经没有这个能力了。什么?为什么?
### 假设 2关于用户命名空间的事情
我的下一个(没有那么充分的依据的)假设是“嗯,也许这个过程是在不同的用户命名空间里,而 `strace` 不能工作,因为某种原因而行不通?”这个问题其实并不连贯,但这是我观察时想到的。
容器进程是否在不同的用户命名空间中?嗯,在容器中:
```
root@e27f594da870:/# ls /proc/$$/ns/user -l
... /proc/1/ns/user -> 'user:[4026531837]'
```
在宿主机:
```
bork@kiwi:~$ ls /proc/$$/ns/user -l
... /proc/12177/ns/user -> 'user:[4026531837]'
```
因为用户命名空间 ID`4026531837`)是相同的,所以容器中的 root 用户和主机上的 root 用户是完全相同的用户。所以,绝对没有理由不能够对它创建的进程进行 `strace`!
这个假设并没有什么意义,但我(之前)没有意识到 Docker 容器中的 root 用户和主机上的 root 用户同一个,所以我觉得这很有意思。
### 假设 3ptrace 系统的调用被 seccomp-bpf 规则阻止了
我也知道 Docker 使用 seccomp-bpf 来阻止容器进程运行许多系统调用。而 `ptrace` 在[被 Docker 默认的 seccomp 配置文件阻止的系统调用列表][2]中!(实际上,允许的系统调用列表是一个白名单,所以只是`ptrace` 不在默认的白名单中。但得出的结果是一样的。)
这很容易解释为什么 `strace` 在 Docker 容器中不能工作 —— 如果 `ptrace` 系统调用完全被屏蔽了,那么你当然不能调用它,`strace` 就会失败。
让我们来验证一下这个假设 —— 如果我们禁用了所有的 seccomp 规则,`strace` 能在 Docker 容器中工作吗?
```
$ docker run --security-opt seccomp=unconfined -it ubuntu:18.04 /bin/bash
$ strace ls
execve("/bin/ls", ["ls"], 0x7ffc69a65580 /* 8 vars */) = 0
... it works fine ...
```
是的,很好用!很好。谜底解开了,除了.....
### 为什么 `--cap-add=SYS_PTRACE` 能解决问题?
我们还没有解释的是:为什么 `--cap-add=SYS_PTRACE` 可以解决这个问题?
`docker run` 的手册页是这样解释 `--cap-add` 参数的。
```
--cap-add=[]
Add Linux capabilities
```
这跟 seccomp 规则没有任何关系! 怎么回事?
### 我们来看看 Docker 源码
当文档没有帮助的时候,唯一要做的就是去看源码。
Go 语言的好处是,因为依赖关系通常是在一个 Go 仓库里,你可以通过 `grep` 来找出做某件事的代码在哪里。所以我克隆了 `github.com/moby/moby`,然后对一些东西进行 `grep`,比如 `rg CAP_SYS_PTRACE`
我认为是这样的。在 `containerd` 的 seccomp 实现中,在 [contrib/seccomp/seccomp/seccomp_default.go][3] 中,有一堆代码确保如果一个进程有一个能力,那么它也会(通过 seccomp 规则)获得访问权限,以使用与该能力相关的系统调用。
```
case "CAP_SYS_PTRACE":
s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
Names: []string{
"kcmp",
"process_vm_readv",
"process_vm_writev",
"ptrace",
},
Action: specs.ActAllow,
Args: []specs.LinuxSeccompArg{},
})
```
在 moby 中的 [profile/seccomp/seccomp.go][4] 和 [默认的 seccomp 配置文件][5]中,也有一些其他的代码似乎做了一些非常类似的事情,所以有可能就是这个代码在做这个事情。
所以我想我们有答案了!
### Docker 中的 `--cap-add` 做的事情比它说的要多
结果似乎是,`--cap-add` 并不像手册页里说的那样,它更像是 `--cap-add-and-also-whiteelist-some-extra-system-calls-if-required`。这很有意义! 如果你具有一个像 `--CAP_SYS_PTRACE` 这样的能力,可以让你使用 `process_vm_readv` 系统调用,但是该系统调用被 seccomp 配置文件阻止了,那对你没有什么帮助!
所以当你给容器 `CAP_SYS_PTRACE` 能力时,允许使用 `process_vm_readv``ptrace` 系统调用似乎是一个合理的选择。
### 就这样!
这是个有趣的小事情,我认为这是一个很好的例子,说明了容器是由许多移动的部件组成的,它们以不完全显而易见的方式一起工作。
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2020/04/29/why-strace-doesnt-work-in-docker/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://wizardzines.com/zines/containers
[2]: https://docs.docker.com/engine/security/seccomp/
[3]: https://github.com/containerd/containerd/blob/4be98fa28b62e8a012491d655a4d6818ef87b080/contrib/seccomp/seccomp_default.go#L527-L537
[4]: https://github.com/moby/moby/blob/cc0dfb6e7b22ad120c60a9ce770ea15415767cf9/profiles/seccomp/seccomp.go#L126-L132
[5]: https://github.com/moby/moby/blob/master/profiles/seccomp/default.json#L723-L739

View File

@ -1,67 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting started with FreeBSD as a desktop operating system)
[#]: via: (https://opensource.com/article/20/5/furybsd-linux)
[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja)
开始用 FreeBSD 作为桌面操作系统
======
FuryBSD 的 live 桌面环境能让你在实际使用之前先尝试。
![web development and design, desktop and browser][1]
[FreeBSD][2] 是一个很棒的操作系统,但是从设计上讲,它没有桌面环境。如果不从 FreeBSD 的 [ports 和软件包集][3]安装其他软件,那么 FreeBSD 仅能体验命令行。下面的截图显示了在安装过程中选择了每个“可选系统组件”后,登录 FreeBSD 12.1 的样子。
![FreeBSD][4]
可以将 FreeBSD 变成包含各种桌面环境的操作系统,但是这需要时间、精力和[遵循大量书面说明][5]。使用使用 **desktop-installer** 包(为用户提供基于文本的菜单并帮助自动执行大部分过程)仍然非常耗时。这两种方法的最大问题是,用户在花了很多时间进行设置之后,可能会发现他们的系统与 FreeBSD 不完全兼容。
[FuryBSD][6] 通过提供 live 桌面镜像来解决此问题用户可以在安装之前对其进行评估。目前FuryBSD 提供 Xfce 镜像和 KDE 镜像。每个镜像都提供已预安装桌面环境的 FreeBSD。如果用户试用镜像并发现其硬件工作正常那么他们可以安装 FuryBSD并拥有由 FreeBSD 提供支持的即用桌面操作系统。在本文中,我将使用 Xfce 镜像,但 KDE 镜像的使用完全一样。
对于任何安装过 Linux 发行版、BSD 或任何其他类 Unix 的开源操作系统的人,开始用 FuryBSD 都应该是一个熟悉的过程。从 FuryBSD 网站下载 ISO将它复制到闪存然后从闪存启动计算机。如果从闪存引导失败请确保安全引导已禁用。
![FuryBSD Live XFCE Desktop][7]
从闪存启动后桌面环境将自动加载。除了“家”、“文件系统”和“回收站”图标外live 桌面还有用于配置 Xorg 的工具、入门指南、FuryBSD 安装程序和系统信息程序的图标。除了这些额外功能以及一些自定义的 Xfce 设置和墙纸外,桌面环境除了基本的 Xfce 应用和 Firefox 之外并没有其他功能。
![FuryBSD Xorg Tool][8]
此时仅加载基本的图形驱动,但足以检查 FuryBSD 是否支持系统的有线和无线网络接口。如果没有网络接口自动工作,那么 **Getting Started.txt** 文件包含有关尝试配置网络接口和其他配置任务的说明。如果至少有一个网络接口有效,那么可以使用 **Configure Xorg** 应用安装 Intel、NVidia 或 VirtualBox 图形驱动。它将下载并安装驱动,并且需要重新启动 Xorg。如果系统未自动重新登录到 live 用户,那么密码为 **furybsd**。配置后,图形驱动将转移到已安装的系统中。
![FuryBSD Installer - ZFS Configuration][9]
如果一切都可以在 live 环境中正常运行,那么 FuryBSD 安装程序可以将 FuryBSD 配置并安装到计算机上。该安装程序在终端中运行,但提供与大多数其他 BSD 和 Linux 安装程序相同的选项。系统将要求用户设置系统的主机名、配置 ZFS 存储,设置 root 密码,添加至少一个非 root 用户以及配置时间和日期。完成后,系统可以引导到预装有 Xfce (或 KDE的 FreeBSD 中。FuryBSD 完成了所有困难的工作,甚至还花了很多精力使桌面看起来更漂亮。
![FuryBSD Post-Install XFCE Desktop][10]
如上所述,桌面环境没有大量预装软件,因此几乎肯定要安装额外的软件包。最快的方法是在终端中使用 **pkg** 命令。该命令的行为很像 dnf 和 apt因此来自 Linux 发行版的用户(使用其中之一)在查找和安装软件包时应该感到很熟悉。 FreeBSD的软件包集合很大因此大多数知名的开源软件包都可用。
在没有太多 FreeBSD 经验的情况下尝试 FuryBSD 的用户应查阅 [FreeBSD 手册][11],以了解有关如何以 FreeBSD 的方式做事。有任何 Linux 发行版或其他 BSD 使用经验的用户应该能弄清很多事情,但是手册可以帮助你弄清一些差异。进一步了解 FreeBSD 的一个很好的资源是 Michael W. Lucas 的 _[Absolute FreeBSD第三版][12]_
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/5/furybsd-linux
作者:[Joshua Allen Holm][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/holmja
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser)
[2]: https://www.freebsd.org
[3]: https://www.freebsd.org/ports/
[4]: https://opensource.com/sites/default/files/uploads/freebsd.png (FreeBSD)
[5]: https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-a-desktop-environment-on-freebsd/
[6]: https://www.furybsd.org
[7]: https://opensource.com/sites/default/files/uploads/furybsd_live_xfce_desktop.png (FuryBSD Live XFCE Desktop)
[8]: https://opensource.com/sites/default/files/uploads/furybsd_xorg_tool.png (FuryBSD Xorg Tool)
[9]: https://opensource.com/sites/default/files/uploads/furybsd_installer_-_zfs_configuration.png (FuryBSD Installer - ZFS Configuration)
[10]: https://opensource.com/sites/default/files/uploads/furybsd_post-install_xfce_desktop.png (FuryBSD Post-Install XFCE Desktop)
[11]: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/
[12]: https://nostarch.com/absfreebsd3