你好,游客 登录 注册 搜索
背景:
阅读新闻

FreeBSD10.1安装过程图解

[日期:2016-07-06] 来源:Linux社区  作者:Linux [字体:大 中 小]
8: 时区配置
 
 
 
 
 
 
9: 系统配置
 
 
10: 完成安装
 
 
 
 
 
虚拟机拍摄快照 >> start
1:  start
 
 
创建新用户
 
root@lsgxbsd:~ #  adduser 
Username:  lsgx
Full name:  lsgx
Uid (Leave empty for default): 
Login group [lsgx]: 
Login group is lsgx. Invite lsgx into other groups? []: 
Login class [default]: 
Shell (sh csh tcsh nologin) [sh]:  csh
Home directory [/home/lsgx]: 
Home directory permissions (Leave empty for default): 
Use password-based authentication? [yes]: 
Use an empty password? (yes/no) [no]: 
Use a random password? (yes/no) [no]: 
Enter password: 
Enter password again: 
Lock out the account after creation? [no]: 
Username   : lsgx
Password   : *****
Full Name  : lsgx
Uid        : 1001
Class      : 
Groups     : lsgx 
Home       : /home/lsgx
Home Mode  : 
Shell      : /bin/csh
Locked     : no
OK? (yes/no):  yes
adduser: INFO: Successfully added (lsgx) to the user database.
Add another user? (yes/no):  no
Goodbye!
 
 
root@lsgxbsd :~ #  pw groupmod wheel -m lsgx
root@lsgxbsd :~ #  pw user mod lsgx -g wheel
root@lsgxbsd :~ #  su -l lsgx
 
lsgx@lsgxbsd:~ % id
uid=1001(lsgx) gid=0(wheel) groups=0(wheel)
lsgx@lsgxbsd:~ % exit
logout
root@lsgxbsd:~ # 
root@lsgxbsd:~ # rmuser 
Please enter one or more usernames: lsgx
Matching password entry:
 
lsgx:*:1001:1001::0:0:lsgx:/home/lsgx:/bin/csh
 
Is this the entry you wish to remove? y
Remove user's home directory (/home/lsgx)? y
Removing user (lsgx): mailspool home passwd.
 
 
 
配置网络
root@lsgxbsd:~ #  bsdinstall
root@lsgxbsd:~ # bsdconfig
选择 networking management
 
 
hostname/domain
 
network interfaces
 
 
default router/gateway
 
dns nameservers
 
root@lsgxbsd:~ # /etc/netstart restart
Setting hostuuid: 564de1d5-90ad-3a49-97ef-b97d0ba7a48b.
Setting hostid: 0xc7b783ff.
Starting Network: lo0 em0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128 
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
inet 127.0.0.1 netmask 0xff000000 
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:0c:29:42:45:34
inet6 fe80::20c:29ff:fe42:4534%em0 prefixlen 64 scopeid 0x1 
inet 192.168.195.137 netmask 0xffffff00 broadcast 192.168.195.255 
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
route: writing to routing socket: File exists
add net default: gateway 192.168.195.2 fib 0: route already in table
route: writing to routing socket: File exists
add net fe80::: gateway ::1 fib 0: route already in table
route: writing to routing socket: File exists
add net ff02::: gateway ::1 fib 0: route already in table
route: writing to routing socket: File exists
add net ::ffff:0.0.0.0: gateway ::1 fib 0: route already in table
route: writing to routing socket: File exists
add net ::0.0.0.0: gateway ::1 fib 0: route already in table
 
 
root@lsgxbsd:~ # ee /etc/resolv.conf
--------------------------------------
# Generated by resolvconf
search localdomain
# nameserver 192.168.195.2
# nameserver fe80::861b:5eff:fe6a:58fe%em0
 
nameserver 127.0.0.1
nameserver 192.168.195.2
nameserver 192.168.1.1
nameserver 192.168.2.1
nameserver 192.168.185.201
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
options edns0
 
------------------------------------
 
root@lsgxbsd:~ # hostname -f
lsebsd.lsgxeva
 
root@lsgxbsd:~ # ee /etc/hosts
----------------------------------------------------------
::1                     localhost localhost.my.domain
127.0.0.1               localhost localhost.my.domain
 
# Beginning of the block added by the lsgx - DO NOT EDIT
 
::1                     lsebsd.lsgxeva lsebsd        
127.0.0.1               lsebsd.lsgxeva lsebsd          
 
192.168.195.165         lsebsd.lsgxeva lsebsd          
 
# End of the block added by the lsgx
 
----------------------------------------------------------
 
 
root@lsgxbsd:~ # ee /etc/rc.conf
----------------------------------------------------------------
hostname="lsebsd.lsgxeva"
keymap="us.iso"
#ifconfig_em0="DHCP"
ifconfig_em0="inet 192.168.195.166 netmask 255.255.255.0"
ifconfig_em0_ipv6="inet6 accept_rtadv"
#ifconfig_em1="DHCP"
ifconfig_em1="inet 192.168.1.166 netmask 255.255.255.0"
ifconfig_em1_ipv6="inet6 accept_rtadv"
#ifconfig_em2="DHCP"
ifconfig_em2="inet 192.168.2.166 netmask 255.255.255.0"
ifconfig_em2_ipv6="inet6 accept_rtadv"
#ifconfig_em3="DHCP"
ifconfig_em3="inet 192.168.185.166 netmask 255.255.255.0"
ifconfig_em3_ipv6="inet6 accept_rtadv"
defaultrouter="192.168.195.2"
static_routes="net1 net2 net3 net4" 
route_net1="-net 192.168.195.0/24 192.168.195.2" 
route_net2="-net 192.168.1.0/24 192.168.1.1"
route_net3="-net 192.168.2.0/24 192.168.2.1"
route_net4="-net 192.168.185.0/24 192.168.185.201"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
snd_hda_load="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
 
-------------------------------------------------------------------------------------
root@lsgxbsd:~ #  sh /etc/rc 
 
root@lsgxbsd:~ #  /etc/rc.d/routing restart
root@lsgxbsd:~ #  /etc/rc.d/netif restart
root@lsgxbsd:~ #  /etc/netstart restart
 
 
配置NTPD
root@lsgxbsd:~ # ee /etc/ntp.conf
------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
server 61.129.42.44 prefer
server 218.75.4.130 iburst
server 115.181.34.4 iburst
server 127.127.1.0 iburst
fudge 127.127.0.1 stratum 5
 
restrict default ignore
restrict 127.0.0.0 mask 255.0.0.0
restrict 192.168.195.0 mask 255.255.255.0 noquery nopeer notrust
restrict 61.129.42.44 noquery
restrict 218.75.4.130 noquery
restrict 115.181.34.4 noquery
 
driftfile /var/db/ntpd.drift
 
# End of the block added by the lsgx
------------------------------------------------
 
root@lsgxbsd:~ # /etc/rc.d/ntpd restart
Stopping ntpd.
Waiting for PIDS: 611.
Starting ntpd.
 
 
 
配置SSH
root@lsgxfb:~ # ee /etc/ssh/ssh_config
----------------------------------------------------
PasswordAuthentication yes
----------------------------------------------------
root@lsgxfb:~ # ee /etc/ssh/sshd_config
----------------------------------------------------
PermitRootLogin yes
PasswordAuthentication yes
----------------------------------------------------
root@lsgxfb:~ # ee /etc/rc.conf
----------------------------------------------------
sshd_enable="YES"  
----------------------------------------------------
root@lsgxbsd:~ #  sh /etc/rc 
 
root@lsgxfb:~ # /etc/rc.d/sshd restart
ls: /rc.d/sshd: No such file or directory
ls: restart: No such file or directory
root@lsgxfb:~ # /etc/rc.d/sshd restart
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 882.
Performing sanity check on sshd configuration.
Starting sshd.
 
root@lsgxfb:~ # killall -HUP sshd
 
 
更新系统
root@lsgxfb:~ #  freebsd-update fetch
root@lsgxfb:~ #  freebsd-update install
 
 
root@lsgxfb:~ # ee ~/.cshrc
----------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
 
 
setenv PACKAGEROOT "ftp://ftp.freebsd.org"
#setenv PACKAGEROOT "ftp://ftp.freebsdchina.org"
#setenv PACKAGEROOT "ftp://ftp.tw.freebsd.org"
#setenv PACKAGEROOT "ftp://ftp.cn.freebsd.org"
 
# End of the block added by the lsgx
 
----------------------------------------------
 
2、安装Ports源
root@lsgxfb:~ #   portsnap fetch -s portsnap.freebsd.org      #安装ports
root@lsgxfb:~ #   ee /etc/portsnap.conf   #编辑文件
------------------------------------------------------------------------
 
SERVERNAME=portsnap.FreeBSD.org
#SERVERNAME=portsnap.tw.FreeBSD.org 
#SERVERNAME=portsnap.cn.FreeBSD.org 
 
------------------------------------------------------------------------
root@lsgxfb:~ #   portsnap fetch extract   #连续下载ports快照
root@lsgxfb:~ #   portsnap update  #更新
root@lsgxfb:~ #   portsnap fetch update  #连续更新
root@lsgxfb:~ # cp /usr/share/examples/etc/make.conf /etc/
root@lsgxfb:~ # chmod u+w /etc/make.conf 
root@lsgxfb:~ #   ee /etc/make.conf  #编辑文件,添加下面代码
-------------------------------------------------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
 
MASTER_SITE_BACKUP?=\
ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}\
ftp://ftp.tw.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}\
ftp://ftp.cn.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}\
ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}
 
MASTER_SITE_OVERRIDE?=${MASTER_SITE_BACKUP}
 
WITH_PKGNG=YES
 
# End of the block added by the lsgx
 
-------------------------------------------------------------------------------------------
root@lsgxfb:~ #   cd  /usr/ports
root@lsgxfb:~ #   make fetchindex
root@lsgxfb:~ #   make search name=tree    #查找ports中是否有tree这个软件
root@lsgxfb:~ #   cd  / usr/ports/sysutils/tree   #进入软件包目录
root@lsgxfb:~ #   make install clean    #安装
root@lsgxfb:~ #   make deinstall clean   #卸载
root@lsgxfb:~ #   make deinstall reinstall clean  #升级
 
利用 ports 來安裝軟體
FreeBSD 的 ports 就是別人已經編譯過,安裝測試沒問題了,他們將軟體編譯時所需的組態設定、編譯程序及安裝程序,都依照固定的格式擺在一起,當這些東西經由維護小組認可後即加入軟體蒐集中,對一般使用者而言, 我們只要先將某個軟體 ports 目錄下的檔案抓回來,然後很輕鬆的下:
make
make install
即可自動完成軟體的編譯和安裝 (也可以只用一行 make all install 來代替)。
用過 FreeBSD 的 ports 後,大部份的人都會被它這個完美的機制給吸引了, 這也是很多人喜歡用 FreeBSD 的主因之一哦。
 
一般 ports 在編譯時的運作流程:
fetch 抓取軟體的原始碼(source code),它會依下面的順序搜尋:
先找 /usr/ports/distfiles
找 /etc/make.conf 中設定的網站
找 Makefile 中 MASTER_SITES 設定的網站
checksum 檢查原始檔的 checksum 吻不吻合
depends 檢查並自動安裝須先安裝的相關軟體
extract 檢查 source,並將它解開到 works 的目錄中
patch 對 source 做 patch,修改以符合 FreeBSD 的環境需求
configure 產生設定檔
build 開始編譯
install 將編譯好的東西安裝到系統中
 
 
1.生成配置文件
make config
2.删除配置文件
make rmconfig
3.抓取源码包
make fetch
4.抓取所有源码包(包括需要到的所有包)
make fetch-recursive
5.校验源码包
make checksum
6.编译、安装并删除临时文件
make install clean
7.编译、安装、将所有需要的port打包、安装、并删除临时文件
make depends_target=package package clean 
mkdir -p /usr/ports/packages/All/
生成的package会自动放到里面,否则放在port的当前目录
8.仅解开源码包
make extract
9.仅解开并打上patch
 make patch
10.删除临时文件及源码包
make distclean
11.查询port的依赖关系
make all-depends-list #显示所有相关的套件
make pretty-print-build-depends-list #显示编译期间所需要的套件
make pretty-print-run-depends-list #显示此套件要执行时所需要的套件
12.删除已经安装的port
 make deinstall
13.删除已经安装的port及其依赖
make deinstall-depends
14.重新安装port
 make reinstall
15.搜索port
 make search key=keyword
 make search name=nameword
16.指定port安装目录
make PREFIX=path install
17.更新port MK
 cd /usr/src/share/mk
 make install
18.解决安装时的sed -i 错误
make -DUSE_REINPLACE install
19.更新port index对照表
cd /usr/ports/
 make index
20.更新index html
 cd /usr/ports/
 make readmes
 
port的make命令参数信息
fetch - Retrieves $ (and $ if defined) into $ as necessary. 
fetch-list - Show list of files that would be retrieved by fetch. 
fetch-recursive - Retrieves $ (and $ if defined), for port and dependencies into $ as necessary. 
fetch-recursive-list - Show list of files that would be retrieved by fetch-recursive. 
fetch-required-list - Show list of files that would be retrieved by fetch-required. 
fetch-required - Retrieves $ (and $ if defined), for port and dependencies that are not already installed into $. 
all-depends-list - Show all directories which are dependencies for this port. 
build-depends-list - Show all directories which are build-dependencies for this port. 
package-depends-list - Show all directories which are package-dependencies for this port. 
run-depends-list - Show all directories which are run-dependencies for this port. extract - Unpacks $ into $. 
patch - Apply any provided patches to the source. 
configure - Runs either GNU configure, one or more local configure scripts or nothing, depending on what's available. 
build - Actually compile the sources. 
install - Install the results of a build. 
reinstall - Install the results of a build, ignoring "already installed" flag. 
deinstall - Remove the installation. 
deinstall-all - Remove all installations with the same PKGORIGIN. package - Create a package from an _installed_ port. 
package-recursive - Create a package for a port and _all_ of its dependancies. 
describe - Try to generate a one-line description for each port for use in INDEX files and the like. 
checkpatch - Do a "patch -C" instead of a "patch". Note that it may give incorrect results if multiple patches deal with the same file. 
checksum - Use distinfo to ensure that your distfiles are valid. 
checksum-recursive - Run checksum in this port and all dependencies. 
makesum - Generate distinfo (only do this for your own ports!). 
clean - Remove $ and other temporary files used for building. 
clean-depends - Do a "make clean" for all dependencies. 
config - Configure options for this port (using $). Automatically run prior to extract, patch, configure, build, install, and package. 
showconfig - Display options config for this port 
rmconfig - Remove the options config for this port
 
 
 
root@lsgxbsd:~ # ee /etc/pkg/FreeBSD.conf
-------------------------------------------------------------------------------------------------
# $FreeBSD: releng/10.1/etc/pkg/FreeBSD.conf 263938 2014-03-30 15:29:54Z bdrewery $
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#
 
FreeBSD: {
  #url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
  url: "pkg+http://pkg.tw.FreeBSD.org/${ABI}/quarterly",
  #url: "pkg+http://pkg.cn.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
 
-------------------------------------------------------------------------------------
root@lsgxbsd:~ #   mkdir -p /usr/local/etc/pkg/repos
root@lsgxbsd:~ #   cat /etc/pkg/FreeBSD.conf > /usr/local/etc/pkg/repos/FreeBSD.conf 
 
 
root@lsgxbsd:~ # cat /usr/local/etc/pkg.conf
----------------------------------------------------------------
# System-wide configuration file for pkg(8)
# For more information on the file format and
# options please refer to the pkg.conf(5) man page
 
# Note: you don't need to have a pkg.conf file.  Many installations
# will work well with no pkg.conf at all or with an empty pkg.conf
# (other than comment lines).  You can also override any of these
# settings from the environment.
 
# Configuration options -- default values.
 
#PKG_DBDIR = "/var/db/pkg";
#PKG_CACHEDIR = "/var/cache/pkg";
#PORTSDIR = "/usr/ports";
#INDEXDIR = "";
#INDEXFILE = "INDEX-10";        # Autogenerated
#HANDLE_RC_SCRIPTS = false;
#DEFAULT_ALWAYS_YES = false;
#ASSUME_ALWAYS_YES = false;
#REPOS_DIR [
#    "/etc/pkg/",
#    "/usr/local/etc/pkg/repos/",
#]
#PLIST_KEYWORDS_DIR = "";
#SYSLOG = true;
#ABI = "freebsd:10:x86:64";     # Autogenerated
#DEVELOPER_MODE = false;
#VULNXML_SITE = "http://vuxml.freebsd.org/freebsd/vuln.xml.bz2";
#FETCH_RETRY = 3;
#PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
#PKG_ENABLE_PLUGINS = true;
#PLUGINS [
#]
#DEBUG_SCRIPTS = false;
#PLUGINS_CONF_DIR = "/usr/local/etc/pkg/";
#PERMISSIVE = false;
#REPO_AUTOUPDATE = true;
#NAMESERVER = "";
#HTTP_USER_AGENT = "Custom_User_Manager";
#EVENT_PIPE = "";
#FETCH_TIMEOUT = 30;
#UNSET_TIMESTAMP = false;
#SSH_RESTRICT_DIR = "";
#PKG_ENV {
#}
#PKG_SSH_ARGS = "";
#DEBUG_LEVEL = 0;
#ALIAS {
#}
#CUDF_SOLVER = "";
#SAT_SOLVER = "";
#RUN_SCRIPTS = true;
#CASE_SENSITIVE_MATCH = false;
#IP_VERSION = 0
 
# Sample alias settings
ALIAS              : {
  all-depends: query %dn-%dv,
  annotations: info -A,
  build-depends: info -qd,
  cinfo: info -Cx,
  comment: query -i "%c",
  csearch: search -Cx,
  desc: query -i "%e",
  download: fetch,
  iinfo: info -ix,
  isearch: search -ix,
  prime-list: "query -e '%a = 0' '%n'",
  leaf: "query -e '%#r == 0' '%n-%v'",
  list: info -ql,
  noauto = "query -e '%a == 0' '%n-%v'",
  options: query -i "%n - %Ok: %Ov",
  origin: info -qo,
  provided-depends: info -qb,
  raw: info -R,
  required-depends: info -qr,
  roptions: rquery -i "%n - %Ok: %Ov",
  shared-depends: info -qB,
  show: info -f -k,
  size: info -sq,
  }
 
-------------------------------------------------------
 
查找软件包
# pkg search subversion // 查找软件包
# pkg search -o subversion // 查找软件包并输出路径名
# whereis lsof // 查找此名称的文件
# make fetchindex // 更新port索引
# cd /usr/ports // 进入ports目录
# make search name=lsof // 在port中搜索软件包
# make quicksearch name=lsof // 在port中快速搜索软件包
 
安装pkg
1: 安装pkg
# cd /usr/ports/ports-mgmt/pkg
# make
# make install clean
2: 转换port
# pkg2ng
3: 设置兼容port
# vi /etc/make.conf
-------------------------
WITH_PKGNG=YES
-------------------------
 
安装pkg帮助文档并查看文档
# pkg help install
# man pkg-install
 
# pkg search        // 搜索软件包
# pkg update      // 更新本地pkg数据库
# pkg info pkg     // pkg安装版本信息
# pkg install packagename     // 安装软件包
# pkg info     // 已安装软件列表信息
# pkg delete curl     // 删除指定的软件包
# pkg audit -F     // 查看日志信息
# pkg autoremove     //  删除已经不需要的依赖包
# pkg backup -d pkgng.db       // 备份软件包
# pkg backup -r /path/to/pkgng.db      // 删除备份软件包
# pkg clean     // 清除多余的软件缓存包
# pkg set -o lang/php5:lang/php53       // 修改软件源
# pkg install -Rf graphics/freeglut     // 安装指定的软件源
 
 
# pkg install sudo
# pkg install tree
# pkg install vim
# pkg install emacs24
# pkg install xterm
# pkg install xorg
#  pkg install wqy
#  pkg install Ubuntu-font
# pkg install tmux
# pkg install moc
# pkg install dbus
# pkg install bash
# pkg install bash-completion
# pkg install zsh
# pkg install gcc48
# pkg install gmake
# pkg install gdb
# pkg install cgdb
# pkg install cmake
# pkg install automake
# pkg install autoconf
# pkg install m4
# pkg install gawk
# pkg install bison
# pkg install nano
# pkg install perl5.20
# pkg install exfat-utils
# pkg  install  fusefs-exfat
# pkg  install  fusefs-ext4fuse 
# pkg install libiconv
# pkg install valgrind
# pkg install ncurses
# pkg install p7zip
# pkg install  vsftpd-ssl-3.0.2
# pkg install dmidecode
# pkg install smartmontools
# pkg install openjdk6
# pkg install curl
# pkg install wget
# pkg install racket
# pkg install mit-scheme
# pkg install git
# pkg install svn
# pkg install expect
 
# pkg install xf86-video-fbdev mate-desktop mate xorg
# pkg install slim
 
 
Linux兼容性设置
# pkg install linux-c6
# pkg install nspluginwrapper
 
root@lsebsd:~ # vi /etc/rc.conf
------------------------------------------
# kldunload linux
# options COMPAT_LINUX
linux_enable="YES"
------------------------------------------
 
root@lsebsd:~ #  vi /etc/fstab
----------------------------------------------------------------------
proc            /proc           procfs  rw              0       0
linproc         /compat/linux/proc      linprocfs       rw      0       0
----------------------------------------------------------------------
 
root@lsebsd:~ # vi /etc/sysctl.conf
------------------------------------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
 
compat.linux.osrelease=2.6.18
 
# End of the block added by the lsgx
------------------------------------------------------------------------------
 
root@lsebsd:~ # vi /etc/devfs.conf
------------------------------------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
 
#link /tmp shm
 
# End of the block added by the lsgx
------------------------------------------------------------------------------
 
安装adobe flash插件
1. pkg install nspluginwrapper
nspluginwrapper 是一个辅助安装配置 NetScape Plugin的工具。
 可以为NetScape家族的浏览器安装在其它系统上构建的插件,比如安装在Linux上编译的flash plugin。
 
2.通过ports安装 linux-f10-flashplugin11。 f10表示Fedora 10。
# cd /usr/ports/www/linux-c6-flashplugin11/
# make install clean
 
3.安装flash plugin.
nspluginwrapper -v -a -i,-v表示输出详细信息, -a表示自动探测可用插件, -i表示安装。
 这将会把 flash-player-plugin.so 安装到 ~/.mozilla/plugins 目录下。
 如果你日后更新了flash player的插件,要执行一次 nspluginwrapper -v -a -u, -u表示update。
 
4.测试是否安装成功: 在firefox地址栏输入 about:plugins,回车,会看见flash player在插件列表中,并且是enabled。
 
5.如果插件不能激活,应该是没有加载linux模块,sudo kldload linux。
 如果想让系统开机自动加载linux模块,编辑 /etc/rc.conf,加入 linux_enable="YES"。
 
 
构建 NanoBSD 映像所需的命令是:
# cd /usr/src/tools/tools/nanobsd
# sh nanobsd.sh
# cd /usr/obj/nanobsd.full
# sysctl kern.geom.debugflags=16
# dd if=_.disk.full of=/dev/da0 bs=64k
进入 NanoBSD 构建脚本的主目录。
开始构建过程。
进入构建好的映像文件所在的目录。
在存储介质上安装 NanoBSD。
 
 
烧写启动镜像到可移动设备
准备记忆棒
警告:  下面的例子中, 目标记忆棒对应的设备名是 /dev/da0。
请小心地确认这是希望覆盖的设备, 否则可能会损坏您的现有数据。
设置 kern.geom.debugflags sysctl 为允许写入目标设备的主引导记录。
# sysctl kern.geom.debugflags=16
3. 将映像文件写入记忆棒
.img 文件 不是 直接复制到记忆棒中的那种普通文件。 这个映像是一份包含启
动盘全部内容的映像。 这意味着简单地从一个地方复制到另一个地方是 不能
赋予其引导系统的能力的。 您必须使用 dd(1) 将映像文件直接写入磁盘:
# dd if=FreeBSD-10.1-RELEASE-i386-memstick.img of=/dev/da0 bs=64k
 
 
gcc编译器的配置
提示:
To ensure binaries built with this toolchain find appropriate versions
of the necessary run-time libraries, you may want to link using
 
  -Wl,-rpath=/usr/local/lib/gcc48
 
For ports leveraging USE_GCC, USES=compiler, or USES=fortran this happens
 
gcc编译链接动态库时,很有可能编译通过,但是执行时,找不到动态链接库,那是
因为-L选项指定的路径只在编译时有效,编译出来的可执行文件不知道-L选项后面的值,
当然找不到。可以用ldd <your_execute>看看是不有 ‘not found’在你链接的库后面,
解决方法是通过-Wl,rpath=<your_lib_dir>,使得execute记住链接库的位置
-----------------------------------------------------------------------------------
root@lsgxbsd:~ # ln -s /usr/local/lib/gcc48 /usr/lib/gcc
 
ln -s /usr/local/bin/g++48 /usr/bin/g++
ln -s /usr/local/bin/gappletviewer48 /usr/bin/gappletviewer
ln -s /usr/local/bin/gc-analyze48 /usr/bin/gc-analyze
ln -s /usr/local/bin/gcc48 /usr/bin/gcc
ln -s /usr/local/bin/gcc-ar48 /usr/bin/gcc-ar
ln -s /usr/local/bin/gcc-nm48 /usr/bin/gcc-nm
ln -s /usr/local/bin/gcc-ranlib48 /usr/bin/gcc-ranlib
ln -s /usr/local/bin/gcj48 /usr/bin/gcj48
ln -s /usr/local/bin/gcj-dbtool48 /usr/bin/gcj-dbtool
ln -s /usr/local/bin/gcjh48 /usr/bin/gcjh
ln -s /usr/local/bin/gcov48 /usr/bin/gcov
ln -s /usr/local/bin/gfortran48 /usr/bin/gfortran
ln -s /usr/local/bin/gij48 /usr/bin/gij
ln -s /usr/local/bin/gjar48 /usr/bin/gjar
ln -s /usr/local/bin/gjarsigner48 /usr/bin/gjarsigner
ln -s /usr/local/bin/gjavah48 /usr/bin/gjavah
ln -s /usr/local/bin/gkeytool48 /usr/bin/gkeytool
ln -s /usr/local/bin/gnative2ascii48 /usr/bin/gnative2ascii
ln -s /usr/local/bin/gorbd48 /usr/bin/gorbd
ln -s /usr/local/bin/grmic48 /usr/bin/grmic
ln -s /usr/local/bin/grmid48 /usr/bin/grmid
ln -s /usr/local/bin/grmiregistry48 /usr/bin/grmiregistry
ln -s /usr/local/bin/gserialver48 /usr/bin/gserialver
ln -s /usr/local/bin/gtnameserv48 /usr/bin/gtnameserv
 
 
设置软链接
lrwxr-xr-x   1 root  wheel    20B  4 28 13:21 /usr/bin/g++ -> /usr/local/bin/g++48
lrwxr-xr-x   1 root  wheel    30B  4 28 13:22 /usr/bin/gappletviewer -> /usr/local/bin/gappletviewer48
lrwxr-xr-x   1 root  wheel    27B  4 28 13:22 /usr/bin/gc-analyze -> /usr/local/bin/gc-analyze48
lrwxr-xr-x   1 root  wheel    20B  4 28 13:23 /usr/bin/gcc -> /usr/local/bin/gcc48
lrwxr-xr-x   1 root  wheel    23B  4 28 13:22 /usr/bin/gcc-ar -> /usr/local/bin/gcc-ar48
lrwxr-xr-x   1 root  wheel    23B  4 28 13:23 /usr/bin/gcc-nm -> /usr/local/bin/gcc-nm48
lrwxr-xr-x   1 root  wheel    27B  4 28 13:23 /usr/bin/gcc-ranlib -> /usr/local/bin/gcc-ranlib48
lrwxr-xr-x   1 root  wheel    20B  4 28 13:24 /usr/bin/gcj -> /usr/local/bin/gcj48
lrwxr-xr-x   1 root  wheel    27B  4 28 13:24 /usr/bin/gcj-dbtool -> /usr/local/bin/gcj-dbtool48
lrwxr-xr-x   1 root  wheel    21B  4 28 13:24 /usr/bin/gcjh -> /usr/local/bin/gcjh48
lrwxr-xr-x   1 root  wheel    21B  4 28 13:24 /usr/bin/gcov -> /usr/local/bin/gcov48
lrwxr-xr-x   1 root  wheel    25B  4 28 13:25 /usr/bin/gfortran -> /usr/local/bin/gfortran48
lrwxr-xr-x   1 root  wheel    20B  4 28 13:25 /usr/bin/gij -> /usr/local/bin/gij48
lrwxr-xr-x   1 root  wheel    21B  4 28 13:26 /usr/bin/gjar -> /usr/local/bin/gjar48
lrwxr-xr-x   1 root  wheel    27B  4 28 13:27 /usr/bin/gjarsigner -> /usr/local/bin/gjarsigner48
lrwxr-xr-x   1 root  wheel    23B  4 28 13:27 /usr/bin/gjavah -> /usr/local/bin/gjavah48
lrwxr-xr-x   1 root  wheel    25B  4 28 13:27 /usr/bin/gkeytool -> /usr/local/bin/gkeytool48
lrwxr-xr-x   1 root  wheel    30B  4 28 13:28 /usr/bin/gnative2ascii -> /usr/local/bin/gnative2ascii48
lrwxr-xr-x   1 root  wheel    22B  4 28 13:28 /usr/bin/gorbd -> /usr/local/bin/gorbd48
lrwxr-xr-x   1 root  wheel    22B  4 28 13:28 /usr/bin/grmic -> /usr/local/bin/grmic48
lrwxr-xr-x   1 root  wheel    22B  4 28 13:29 /usr/bin/grmid -> /usr/local/bin/grmid48
lrwxr-xr-x   1 root  wheel    29B  4 28 13:29 /usr/bin/grmiregistry -> /usr/local/bin/grmiregistry48
lrwxr-xr-x   1 root  wheel    27B  4 28 13:29 /usr/bin/gserialver -> /usr/local/bin/gserialver48
lrwxr-xr-x   1 root  wheel    27B  4 28 13:30 /usr/bin/gtnameserv -> /usr/local/bin/gtnameserv48
 
-----------------------------------------------------------------------------------
 
gmake相关的软链接设置
ln -s /usr/local/bin/gmake /usr/bin/gmake
ln -s /usr/local/bin/automake /usr/bin/automake
ln -s /usr/local/bin/autoconf /usr/bin/autoconf
 
gdb相关软链接设置
cp /usr/bin/gdb /usr/bin/gdb611
cp /usr/bin/gdbtui /usr/bin/gdbtui611
rm -rf /usr/bin/gdb
rm -rf /usr/bin/gdbtui
ln -s /usr/local/bin/gdb791 /usr/bin/gdb
ln -s /usr/local/bin/gdbtui791  /usr/bin/gdbtui
 
perl相关的软链接设置
ln -s /usr/local/bin/perl /usr/bin/perl
ln -s /usr/local/bin/perl5 /usr/bin/perl5
ln -s /usr/local/bin/perl5.20.2 /usr/bin/perl5.20.2
ln -s /usr/local/bin/perlbug /usr/bin/perlbug
ln -s /usr/local/bin/perldoc /usr/bin/perldoc
ln -s /usr/local/bin/perlivp /usr/bin/perlivp
ln -s /usr/local/bin/perlthanks /usr/bin/perlthanks
 
 
openjdk环境变量设置
# vi .profile 或者 # vi .bashrc 或者 # vi .cshrc
------------------------------------------------------
# openjdk env setting by bash
export JAVA_HOME=/usr/local/openjdk6
export JRE_HOME=/usr/local/openjdk6/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH 
 
 
# openjdk env setting by csh
setenv JAVA_HOME /usr/local/openjdk6
setenv JRE_HOME /usr/local/openjdk6/jre
setenv CLASSPATH .:$JAVA_HOME/lib:$JRE_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin $JAVA_HOME/bin $JRE_HOME/bin)
 
------------------------------------------------------------
 
root@lsebsd:~ #  vi /etc/fstab
----------------------------------------------------------------------
fdesc/dev/fdfdescfsrw00
proc/procprocfsrw00
----------------------------------------------------------------------
 
openjdk软链接设置
ln -s /usr/local/bin/java /usr/bin/java 
ln -s /usr/local/bin/caja /usr/bin/caja
ln -s /usr/local/bin/caja-autorun-software /usr/bin/caja-autorun-software
ln -s /usr/local/bin/caja-connect-server /usr/bin/caja-connect-server
ln -s /usr/local/bin/caja-file-management-properties /usr/bin/caja-file-management-properties
ln -s /usr/local/bin/jar/usr/bin/jar
ln -s /usr/local/bin/jasper/usr/bin/jasper
ln -s /usr/local/bin/javac /usr/bin/javac 
ln -s /usr/local/bin/javadoc  /usr/bin/javadoc 
ln -s /usr/local/bin/javah /usr/bin/javah 
ln -s /usr/local/bin/javap /usr/bin/javap 
ln -s /usr/local/bin/javavm/usr/bin/javavm
 
 
# java -version    // 显示openjdk版本
# javac     // 显示javac是否可用
 
 
root@lsgxbsd:~ # vi /usr/local/etc/sudoers
root@lsgxbsd:~ # cat /usr/local/etc/sudoers
--------------------------------------------------------------
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
-------------------------------------------------------
 
libgtop相关设置
vim /etc/devfs.conf
-------------------------------------------------------------------
# Beginning of the block added by the lsgx - DO NOT EDIT
 
#link /tmp shm
perm    devstat 0444
 
# End of the block added by the lsgx
-----------------------------------------------------------------
 
 
root@lsgxbsd:~ #   Xorg -configure
root@lsgxbsd:~ #  vi  xorg.conf.new
------------------------------------------------
      Section "Files"
             ModulePath   "/usr/local/lib/xorg/modules"
             FontPath     "/usr/local/share/fonts/misc/"
             FontPath     "/usr/local/share/fonts/TTF/"
             FontPath     "/usr/local/share/fonts/OTF/"
             FontPath     "/usr/local/share/fonts/Type1/"
             FontPath     "/usr/local/share/fonts/100dpi/"
             FontPath     "/usr/local/share/fonts/75dpi/"
              FontPath     "/usr/local/share/fonts/wqy/"
              FontPath     "/usr/local/share/fonts/ubuntu-font/"
     EndSection
      # 添加文泉驿字体库路径
 
 
       Section "Monitor"
               Identifier "Monitor0"
               VendorName "Monitor Vendor"
               ModelName "Monitor Model"
                HorizSync 30-107
               VertRefresh 48-120
               Option "DPMS"
       EndSection
       # 在其中加入 HorizSync(水平刷新率)、VertRefresh(垂直刷新率)和 Option(启用能源之星)三项。
 
      Section "Screen"
              Identifier "Screen0"
              Device "Card0"
              Monitor "Monitor0"
              DefaultDepth 24
              SubSection "Display"
                         Viewport 0 0
                         Depth 24
                          Modes "1024x768"
              EndSubSection
      EndSection
      # 在其中加入DefaultDepth(缺省颜色深度) 和 Modes(分辨率)。注意,这里你看到有多个SubSection向,不用理会,FreeBSD会自动根据DefaultDepth指定的值去找对应的SubSection项。
 
      # 注意:有一个图形工具xorgcfg,通过它可以选择合适的驱动和设置交互式地定义配置。这个程序可以从控制台通过命名xorgcfg -textmode来直接启动。
------------------------------------------------
 
root@lsebsd:~ # Xorg -config /root/xorg.conf.new -retro
root@lsebsd:~ # cp /root/xorg.conf.new /etc/X11/xorg.conf
 
root@lsgxbsd:~ # vi /etc/rc.conf
-----------------------------------------
hald_enable="YES"
dbus_enable="YES"
avahi_daemon_enable="YES"
avahi_dnsconfd_enable="YES"
slim_enable="YES"
 
-----------------------------------------
 
root@lsebsd:~ # vi ~/.xinitrc
-----------------------------------------
#exec ck-launch-session dbus-launch mate-session
exec mate-session
-----------------------------------------
root@lsebsd:~ # xinit mate-session
 
 
rc.conf文件配置状况
root@lsgxbsd:~ # cat /etc/rc.conf
----------------------------------------------------------
hostname="lsebsd.lsgxeva"
keymap="us.iso"
#ifconfig_em0="DHCP"
ifconfig_em0="inet 192.168.195.166 netmask 255.255.255.0"
ifconfig_em0_ipv6="inet6 accept_rtadv"
#ifconfig_em1="DHCP"
ifconfig_em1="inet 192.168.1.166 netmask 255.255.255.0"
ifconfig_em1_ipv6="inet6 accept_rtadv"
#ifconfig_em2="DHCP"
ifconfig_em2="inet 192.168.2.166 netmask 255.255.255.0"
ifconfig_em2_ipv6="inet6 accept_rtadv"
#ifconfig_em3="DHCP"
ifconfig_em3="inet 192.168.185.166 netmask 255.255.255.0"
ifconfig_em3_ipv6="inet6 accept_rtadv"
defaultrouter="192.168.195.2"
static_routes="net1 net2 net3 net4" 
route_net1="-net 192.168.195.0/24 192.168.195.2" 
route_net2="-net 192.168.1.0/24 192.168.1.1"
route_net3="-net 192.168.2.0/24 192.168.2.1"
route_net4="-net 192.168.185.0/24 192.168.185.201"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
snd_hda_load="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
 
# Beginning of the block added by the lsgx - DO NOT EDIT
 
hald_enable="YES" 
dbus_enable="YES"
avahi_daemon_enable="YES"
avahi_dnsconfd_enable="YES"
slim_enable="YES"
 
saver="YES"
allscreens_flags="MODE_332"
blanktime="10"
 
# kldunload linux 
# options COMPAT_LINUX 
linux_enable="YES"
 
# smartmontools configure
smartd_enable="YES"
 
# End of the block added by the lsgx
 
--------------------------------------------------------------------
root@lsgxbsd:~ # sh /etc/rc 
linux
相关资讯       FreeBSD安装  FreeBSD10.1