在Raspberry Pi上跑FreeBSD11,修改raspberry pi上安装的freebsd可用内存大小,定制Raspberry Pi网站。

jackxiang 2014-9-15 21:53 | |
FreeBSD 在 RPi 2上的用户名和密码:
默认的密码是 freebsd/freebsd 和 root/root

FreeBSD系统中无线网络连接无线网卡:
http://www.111cn.net/sys/freebsd/59534.htm
本篇文章来源于 Linux公社网站(www.linuxidc.com)  原文链接:http://www.linuxidc.com/Linux/2015-12/126724.htm

FreeBSD 11-CURRENT on Raspberry Pi Apache 2.4/MySQL 5.6/PHP 5.6, 如何在树莓派 2B 上安装 FreeBSD及网络配置:
http://jackxiang.com/post/8455/

定制Raspberry Pi网站:
http://www.embest-tech.cn/pi-customization/

FreeBSD has supported Raspberry Pi since November 2012, and the current production version (FreeBSD 10) is available as a pre-built image which can be copied onto a memory card.

Download the latest image file from the official FreeBSD ARM page. This page has images for other ARM-based boards like the Beaglebone and the Pandaboard. You need to download an image for the “RPI-B”: for example “FreeBSD-10.0-RELEASE-arm-armv6-RPI-B-20140131-r260789.img.bz2”
摘自 : https://www.maketecheasier.com/freebsd-on-raspberry-pi/

DRAM:  944 MiB
WARNING: Caches not enabled
RPI 2 Model B
MMC:   bcm2835_sdhci: 0
reading uboot.env

修改raspberry pi上安装的freebsd可用内存大小:
http://blog.sina.com.cn/s/blog_a0aacb430101mj69.html


background:Freebsd是真正的Unix血统的Os,其稳定性是顶级的,真正的坚如磐石。在树莓派下也有ARM版本了,最新稳定版本:
ftp://ftp6.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/10.0//FreeBSD-10.0-STABLE-arm-armv6-RPI-B-20140822-r270340.img.bz2  
CheckSum:
ftp://ftp6.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/10.0/CHECKSUM.SHA256-10.0-STABLE-arm-armv6-RPI-B-20140822-r270340




三、FreeBSD 11 on Raspberri pi 2(树莓派 2 安装 FreeBSD 11)  :
A note for my own installation.(树莓派 2 安装 FreeBSD 11)
I tried compiling the FreeBSD 11 by myself, but I found there are ready-to-use systems here.
1. Identify your SD card:
# df -h
you will see the result as
de>/dev/mmcblk0p1de> or de>/dev/sdb1de> or something is different from /sda.

2. Unmount the card
# umount de>/dev/mmcblk0p1de> or de>/dev/sdb1de>

3. Copy your image file to the card, (Very important! DO NOT add the partition number p1 or 1, just use the whole card de>mmcblk0 or sdbde>)
# dd bs=4M if=your-freebsd-rpi2-image.img of=/dev/de>mmcblk0de>

4. First boot
After the raspberry pi 2 is powered on, you need login using user name : root, you need also set the password
# passwd

5.Increase swap space
# dd if=/dev/zero of=/usr/swap0 bs=1m count=1024
# chmod 0600 /usr/swap0
# echo 'md99 none swap sw,file=/usr/swap0 0 0' >> /etc/fstab
# swapon -aq

*系统目前很卡,还是不建议安装。感觉Raspbian 还是最流畅的。
来自:http://rhuta.blog.163.com/blog/static/17757006220154129421478/

    进了Raspberry Pi之后,一直用它来做无线路由及网关,也自己写了一些辅助上网的服务在上面跑,稳定性很好。最近进了一个NETGEAR作路由,Raspberry Pi便闲了下来。于是决定在Raspberry Pi上玩些别的,最后决定玩FreeBSD。

和其他Raspberry Pi上使用的操作系统一样,安装FreeBSD的第一步还是用镜像读写工具将FreeBSD的Raspberry Pi镜像文件写入SD卡中。2012年的时候,FreeBSD就发布了支持Raspberry Pi的版本,直到现在还有不断发布新版。在官方网站上提供了最新版镜像的下载:FreeBSD-10.0FreeBSD-11.0

下载、解压、写入SD卡,步骤和所使用的工具与制件其他操作系统SD卡的方法一样。FreeBSD的镜像中只提供了基本的内核程序及ssh和dhcp客户端,以便尽可能地压缩镜像文件的大小。这点与Arch Linux ARM的理念差不多。第一次启动FreeBSD的时候,不像使用其他Linux发行版那样方便,FreeBSD默认是禁止root通过ssh远程登录,也就是必须接上USB键盘和显示器/电视机才能登录。

这里有一个小插曲:第一次启动的时候,是直接把键盘接到Raspberry Pi上,启动时会报告“无法获取USB设备名称”的错误。开始还以是键盘不兼容,便换了一个,但问题依旧。之后想到可能是供电的问题。因为之前玩的时候就遇到很多古怪的问题都与供电不足有关,于是就加了一个有源的USB HUB,这个错误就立即消除了。

首次登录用户名使用root,密码为空,直接敲回车即可。登录后别忘了第一时间使用passwd命令给root设置密码。如果想让root用户能够通过ssh登录,可以修改ssh的配置文件再重启ssh服务器。为了安全起见,还是不要直接使用root用户,而应用添加新用户,并把这个用户添加wheel组,这样这个新用户就可以通过su命令切换到root以获取管理员权限。具体做法是执行adduser命令,然后根据提示输入相关的信息。这里除了Username填写新用户的名字和invite the user into other groups填写wheel之外,其他项都可以直接按回车来使用默认值。直到最后提示确认信息时输入yes,就完成添加用户操作了。

此时执行ifconfig命令来查看Raspberry Pi自动获取的IP地址,就可以在ssh客户端上使用刚才添加的新用户登录了。

接下来要对新安装的FreeBSD进行一些配置。

首先是设置时钟。因为Raspberry Pi没有硬件时钟,所以设置时间是每次安装完操作系统以及每次启动之后第一个需要设置的项目。

找了一下FreeBSD的handbook,发现同步时间有两个工具:ntpd和ntpdate。区别在于:ntpd是一个服务,用于渐进修正时间;而ntpdate是通过指定的ntp服务器同步系统时钟的命令。无论使用哪一个,都得指定ntp服务器。ntp服务器可以在www.pool.ntp.org/找到,选择自己所在的区域就可以看到可用的ntp服务器了。可能不是每个都可用,需要尝试一下,如果连接不了就更换成其他的即可。ntpdate使用方法很简单,就是指定一个ntp服务器给它后,就会自动同步系统时间了:

ntpdate 0.asia.pool.ntp.org

而使用ntpd服务则先需要修改其配置文件/etc/ntp.conf,主要将里面的ntp服务更换成你所位置可用的,如:

server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org

然后就可以启动服务了:

ntpd -p /var/run/ntpd.pid

若还想在系统启动时自动启动该服务,则可在/etc/rc.conf文件中添加下面的配置:

ntpd_enable="YES"

同步时间后,可以使用date命令查看一下当前时间。

如果想显示出来的时间符合你所在的时区,则需要设置系统时区。/usr/share/zoneinfo目录里包含了各个时区的配置文件,只需将相应时区的配置文件复制到/etc/localtime:

cp /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime

或者也可以通过直接export环境变量来设置时区:

export TZ=Asia/Hong_Kong

将上面的命令写入~/.shrc即可以在每次登录shell时自动设置成你所在的时区了。

之后打算升级一下系统,但freebsd-update fetch一直是failed。查了一下Raspberry Pi论坛,原来Raspberry Pi分支的FreeBSD没有提供更新支持,也就是说连ports的使用或者手动更新都成问题。既然这样,就只能在有新版发布的时候再折腾了。

摘自:https://gutspot.com/2014/06/25/%E5%9C%A8raspberry-pi%E4%B8%8A%E8%B7%91freebsd/


————————————————————————————————————————————————————————————————
FreeBSD 10 on a Raspberry Pi - Notes
Feb 27th, 2014
As of FreeBSD 10 support for the Raspberry pi (B board only) has been added, and snapshots are also being generated regularly. To install, grab a snapshot from a mirror, I used this one and it’s checksum.
Verify that we downloaded the entire file with sha256sum
$ sha256sum -c CHECKSUM.SHA256-10.0-STABLE-arm-armv6-RPI-B-20140222-r262336
FreeBSD-10.0-STABLE-arm-armv6-RPI-B-20140222-r262336.img.bz2: OK

Uncompress the image
$ bunzip2 FreeBSD-10.0-STABLE-arm-armv6-RPI-B-20140222-r262336.img.bz2

Write the image to the SD card with dd
$ sudo dd if=/FreeBSD-10.0-STABLE-arm-armv6-RPI-B-20140222-r262336.img \
  of=/dev/sdf

From here we’re ready to boot the Raspberry Pi for the first time. You need to attach a monitor and keyboard to the raspberry pi since the root password is unset and there are no other users installed so you won’t be able to connect over ssh. So boot it and fix that and a few other things
Set a root password

# passwd

Add a user so we can ssh in (FreeBSD blocks root ssh login by default)

# useradd

Set a timezone (from /usr/share/zoneinfo)

# cp /usr/share/zoneinfo/UTC /etc/localtime

And sync our system clock with an ntpd server

# ntpdate -v -b in.pool.ntp.org

Next, reboot. This will grow your filesystem automatically and you can now connect to your pi via ssh with the user account you created. Now to install some software. FreeBSD 10 now uses the pkg tool for binary package installation and management, but the only packages generated are for amd64 and i386, so we’re going to have to use ports. Install ports with portsnap (be warned, even on a class 10 card this takes over an hour).

# portsnap fetch && portsnap extract

Other things to consider are, due to lack of support the binary package tools (pkg) and binary system updates (freebsd-update) are not available so you will be stuck using ports and following stable manually. This won’t be practical for most users, but if you want to use FreeBSD on a Raspberry pi it’s working! Keeping it updated is going to be a lot more difficult especially with slow SD and USB storage, but if you have additional resources it is possible to build packages for arm6 on a faster system via qemu armv6, a few patches, poudriere and some luck.

From:http://idontwatch.tv/blog/2014/02/27/freebsd-10-on-a-raspberry-pi-notes/

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/7492/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2016-2-20 20:53
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]