MarsCN 2015-12-24
在树莓派 2B 上如何安装 FreeBSD 10 或 FreeBSD 11(current)?怎么在 Linux,OS X,FreeBSD 或类 Unix 操作系统上烧录 SD 卡?
在树莓派 2B 上安装 FreeBSD 10 或 FreeBSD 11(current)很容易。使用 FreeBSD 操作系统可以打造一个非常易用的 Unix 服务器。FreeBSD-CURRENT 自2012年十一月以来一直支持树莓派,2015年三月份后也开始支持树莓派2了。在这个快速教程中我将介绍如何在树莓派 2B 上安装 FreeBSD 11 current arm 版。
你可以 访问这个页面来下载 树莓派2的镜像。使用 wget 或 curl 命令来下载镜像:
<span class="pln">$ </span><span class="kwd">wget</span><span class="pln"> ftp</span><span class="pun">:</span><span class="com">//ftp.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/11.0/FreeBSD-11.0-CURRENT-arm-armv6-RPI2-20151016-r289420.img.xz</span>
或
<span class="pln">$ curl </span><span class="pun">-</span><span class="pln">O ftp</span><span class="pun">:</span><span class="com">//ftp.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/11.0/FreeBSD-11.0-CURRENT-arm-armv6-RPI2-20151016-r289420.img.xz</span>
执行以下命令中的任何一个:
<span class="pln">$ unxz </span><span class="typ">FreeBSD</span><span class="pun">-</span><span class="lit">11.0</span><span class="pun">-</span><span class="pln">CURRENT</span><span class="pun">-</span><span class="pln">arm</span><span class="pun">-</span><span class="pln">armv6</span><span class="pun">-</span><span class="pln">RPI2</span><span class="pun">-</span><span class="lit">20151016</span><span class="pun">-</span><span class="pln">r289420</span><span class="pun">.</span><span class="pln">img</span><span class="pun">.</span><span class="pln">xz</span>
或
<span class="pln">$ xz </span><span class="pun">--</span><span class="pln">decompress </span><span class="typ">FreeBSD</span><span class="pun">-</span><span class="lit">11.0</span><span class="pun">-</span><span class="pln">CURRENT</span><span class="pun">-</span><span class="pln">arm</span><span class="pun">-</span><span class="pln">armv6</span><span class="pun">-</span><span class="pln">RPI2</span><span class="pun">-</span><span class="lit">20151016</span><span class="pun">-</span><span class="pln">r289420</span><span class="pun">.</span><span class="pln">img</span><span class="pun">.</span><span class="pln">xz</span>
你可以在 OS X,Linux,FreeBSD,MS-Windows 和类 Unix 系统来烧录 SD 卡。
使用下面的 dd 命令:
<span class="pln">$ diskutil </span><span class="kwd">list</span>
<span class="pln">$ diskutil unmountDisk </span><span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">diskN</span>
<span class="pln">$ </span><span class="kwd">sudo</span><span class="kwd">dd</span><span class="kwd">if</span><span class="pun">=</span><span class="typ">FreeBSD</span><span class="pun">-</span><span class="lit">11.0</span><span class="pun">-</span><span class="pln">CURRENT</span><span class="pun">-</span><span class="pln">arm</span><span class="pun">-</span><span class="pln">armv6</span><span class="pun">-</span><span class="pln">RPI2</span><span class="pun">-</span><span class="lit">20151016</span><span class="pun">-</span><span class="pln">r289420</span><span class="pun">.</span><span class="pln">img of</span><span class="pun">=</span><span class="str">/dev/</span><span class="pln">disk2 bs</span><span class="pun">=</span><span class="lit">64k</span>
示例输出:
<span class="lit">1024</span><span class="pun">+</span><span class="lit">0</span><span class="pln"> records </span><span class="kwd">in</span>
<span class="lit">1024</span><span class="pun">+</span><span class="lit">0</span><span class="pln"> records out</span>
<span class="lit">1073741824</span><span class="pln"> bytes transferred </span><span class="kwd">in</span><span class="lit">661.669584</span><span class="pln"> secs </span><span class="pun">(</span><span class="lit">1622776</span><span class="pln"> bytes</span><span class="pun">/</span><span class="pln">sec</span><span class="pun">)</span>
语法是这样:
<span class="pln">$ </span><span class="kwd">dd</span><span class="kwd">if</span><span class="pun">=</span><span class="typ">FreeBSD</span><span class="pun">-</span><span class="lit">11.0</span><span class="pun">-</span><span class="pln">CURRENT</span><span class="pun">-</span><span class="pln">arm</span><span class="pun">-</span><span class="pln">armv6</span><span class="pun">-</span><span class="pln">RPI2</span><span class="pun">-</span><span class="lit">20151016</span><span class="pun">-</span><span class="pln">r289420</span><span class="pun">.</span><span class="pln">img of</span><span class="pun">=</span><span class="str">/dev/</span><span class="pln">sdb bs</span><span class="pun">=</span><span class="lit">1M</span>
确保使用实际的 SD 卡的设备名称来替换 /dev/sdb(LCTT 译注:千万注意不要写错了)。
在树莓派 2B 上插入 SD 卡。你需要连接键盘,鼠标和显示器。我使用的是 USB 转串口线来连接显示器的:
图01 基于树莓派 USB 的串行连接
在下面的例子中,我使用 screen 命令来连接我的 RPI:
<span class="com">##</span><span class="typ">Linux</span><span class="pun">上</span><span class="com">##</span>
<span class="kwd">screen</span><span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="kwd">tty</span><span class="pun">.</span><span class="pln">USB0 </span><span class="lit">115200</span>
<span class="com">##</span><span class="pln"> OS X </span><span class="pun">上</span><span class="com">##</span>
<span class="kwd">screen</span><span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">cu</span><span class="pun">.</span><span class="pln">usbserial </span><span class="lit">115200</span>
<span class="com">##</span><span class="typ">Windows</span><span class="pun">请使用</span><span class="typ">Putty</span><span class="pun">.</span><span class="pln">exe </span><span class="com">##</span>
FreeBSD RPI 启动输出样例:
图02: 在树莓派 2上引导 FreeBSD-current
默认的密码是 freebsd/freebsd 和 root/root。
到此为止, FreeBSD-current 已经安装并运行在树莓派 2上。
via: http://www.cyberciti.biz/faq/how-to-install-freebsd-on-raspberry-pi-2-model-b/
作者:Vivek Gite 译者:strugglingyouth 校对:wxy