robot
最新文章(10)
Mqskit 和其它相關工具
CPython 的 GC 二、三事
寫 Mecurial Extension 是件快樂的事!
Mozilla 台灣辨公室徵人啟事
關於 Apple 的兩項專利
core dump 之前的 frame
怎麼發出 beep 聲?
先承認你要找的是奴才吧!
程式碼要清的多乾淨?
FreeBSD 的 Thread-Local Storage 實作
首頁
新編
最新留言
Entries RSS
重要關鍵字(10)
coding (122)
Python (93)
FreeBSD (71)
WEB (61)
URL (48)
hardware (46)
javascript (36)
Linux (34)
blog (30)
C++ (16)
所有關鍵字
新增 URL
安靜兮 FreeBSD box (未完成)
by thinker
2 Columns
關鍵字:
FreeBSD
* CF 轉 IDE 卡 * CF 卡 * ATA command * HD power off * read only root filesystem == buildworld == {{{ root@bull# cd /usr/src root@bull# make -DNO_KERBEROS -DNO_RESCUE -DNO_PROFILE -DNO_GAMES \ > -DNO_FORTRAN buildworld }}} 我是要作一個安靜兮 $FreeBSD$ 小系統,所以有真多功能並無需要。像是 Kerberos、rescue disk、profile 和 games 攏無需要。所以下 -DNO_KERBEROS ... 等參數,以免 buildworld 會去 make 這寡部分。 == installworld == {{{ root@bull# make -DNO_KERBEROS -DNO_RESCUE -DNO_PROFILE -DNO_GAMES \ > -DNO_FORTRAN DESTDIR=/path/to/newworld/ installworld root@bull# mergemaster -i -D /path/to/newworld/ }}} == buildkernel == {{{ root@bull# cd /usr/src root@bull# make buildkernel }}} == installkernel == {{{ root@bull# cd /usr/src root@bull# make DESTDIR=/path/to/newworld/ installkernel }}} == /etc/rc.conf == == /etc/resolv.conf == == /etc/diskless == == /etc/fstab == == make $ports$ == 由於,咱無法確定是毋是每一個 port 攏支援使用 DESTDIR 指定安裝兮目錄,所以尚安全兮作法是 chroot 到目的目錄。然,若是將 $ports$ 目錄 copy 一份到目的目錄,會佔真多空間,而且 copy 也需要開真多時間。為著避免 copy 所造成兮問題,咱可以透過 nullfs,將 /usr/$ports$ 對映到 /path/to/newworld/usr/$ports$,形成一個 loopback filesystem。所有對 /path/to/newworld/usr/$ports$ 兮檔案存取,攏會變成對 /usr/$ports$ 目錄兮存取。 {{{ root@bull# mkdir /path/to/newworld/usr/$ports$ root@bull# mount -t nullfs /usr/$ports$/ /path/to/newworld/usr/$ports$ }}} mount loopback filesystem 之後,你就可以發現 /path/to/newworld/usr/$ports$ 生的和 /usr/$ports$ 一模一樣。關於 nullfs 兮詳系功能,請 man mount_nullfs。 接落來,為新系統 mount devfs: {{{ root@bull# mount -t devfs /dev/null /path/to/newworld/dev }}} 有些程式會用著 device file,所以最好先將 devfs mount 好,以免執行無法順利執行。 然後,就可以 chroot 到 /path/to/newworld/ {{{ root@bull# SHELL=/bin/sh chroot /path/to/newworld }}} chroot 會用環境變數 SHELL 所設定兮 $shell$ 做為新兮 $shell$,除非沒設定,才使用 /bin/sh。一般兮 $shell$;如 bash 攏會設定 SHELL 成自己,所以要注意新系統是毋是己經有你慣用兮 $shell$。由於新兮系統一開始只有 sh 、 csh 等預定兮 $shell$。如果汝使用其它兮 $shell$,要會記兮設定 SHELL 環境變數為 /bin/sh。待汝慣用兮 $shell$ 安裝成功後,才改用慣用兮 $shell$。 make $ports$ 之前,要先為新系統設定 resolv.conf,以免 chroot 之後兮系統,找無 name server 設定,抹使查 DNS。 {{{ root@bull# echo "nameserver xxx.xxx.xxx.xxx" >> /etc/resolv.conf }}} 以上動作是佇 chroot 所開兮 $shell$ 下完成。 chroot 之後,就可以開始裝 $ports$。譬如: 安裝 bash {{{ root@bull# cd /usr/$ports$/$shell$/bash root@bull# make install }}} 以上兮動作也是佇 chroot 之後,所開兮 $shell$ 之下執行兮。 == meta-port == 將常用兮軟體做成 meta-port,方便每次兮安裝。 Makefile {{{ PORTNAME= SilenceBSD PORTVERSION= 0.1.1 CATEGORIES= misc MASTER_SITES= # empty DISTFILES= # empty EXTRACT_ONLY= # empty MAINTAINER= thinker@branda.to COMMENT= This is "meta-port" for SilenceBSD RUN_DEPENDS= bash:$${PORTSDIR}/shells/bash2 \ $portupgrade$:$${PORTSDIR}/sysutils/$portupgrade$ \ joe:$${PORTSDIR}/editors/joe2 \ $jed$:$${PORTSDIR}/editors/$jed$ \ httpd:$${PORTSDIR}/www/apache22 \ smbd:$${PORTSDIR}/net/samba3 \ python:$${PORTSDIR}/lang/python \ sqlite3:$${PORTSDIR}/databases/sqlite3 \ $${PYTHON_SITELIBDIR}/pysqlite2/__init__.py:$${PORTSDIR}/databases/py-PySQLite2 \ $${PYTHON_SITELIBDIR}/libxslt.py:$${PORTSDIR}/textproc/py-libxslt USE_PYTHON= yes # If you don't leave them empty, # they would be wrong when $ports$ system # tries to chdir to source root. do-build: # empty do-install: # empty .include <bsd.port.mk> }}} pkg-descr {{{ This is "meta-port" for SilenceBSD This metaport installs the entire SilenceBSD environment. thinker@branda.to }}} pkg-plist {{{ @comment this plist intentionally left empty }}} == data storage ==
最後更新時間: 2006-02-18 11:29:08 CST |
引用
查詢:
COMMENTS: