OpenBSD 簡介與安裝

1.0 – 介紹 OpenBSD


  • 1.1 – 什麼是OpenBSD?
  • 1.2 -? OpenBSD可以在什麼系統執行?
  • 1.3 -? OpenBSD 真的是免費的嗎?
  • 1.4 – 為何我要用到OpenBSD?
  • 1.5 – 誰在維持 OpenBSD的發展與運作?

?

1.1 – 何謂 OpenBSD?

OpenBSD 計劃產生一個自由有用地、跨平台4.4BSD的仿UNIX操作系統. 我們所重視的地方在輕便可攜帶性高,標準規格化,正確性以及它的安全性. OpenBSD 支援SVR4 (Solaris), FreeBSD, Linux, BSDI, SunOS, and HPUX 的二進位環境的原始系統.

?

1.2 - OpenBSD可以在什麼系統執行?

OpenBSD 2.7 可以在以下平台執行:

pmax, powerpc 的部份並未包含在2.7的光碟裡.不過它們可以從任何OpenBSD ftp 的網站中下戴.

bootable OpenBSD 可以從光碟中直接啟動. 這些啟動光碟可以數種硬體平台上啟動,(詳見第三節說明).

先前OpenBSD版本同時包含數種平台的版本:

  • arc2.4版以後移除, 但可以在OpenBSD 2.3版本中找到.
  • mvme88k
  • alpha可以在未來的版本中再出現.

詳見8.12說明多處理器的支援.

1.3 - OpenBSD 真的是免費的嗎?

OpenBSD 合部都是免費的。 OpenBSD的所有部分都有合理版權期限允許使用者自由分配。如此一來不管是個人或是商業用途,都可以有效地重複利用大部份OpenBSD原始碼。OpenBSD可以包含除了由原始BSD版本所許可範圍之外更多的限制。有版權的軟體並不能包括在正規發行的OpenBSD版本中。這是打算可以保障OpenBSD可以自由地使用。例如,OpenBSD可以在政府機關,非營利事業機構,商業組織中自由地讓個人或大專院校學生或老師使用。

欲讀取更多的公開許可證,可以到以下網站中閱讀:

http://www.openbsd.org/policy.html.

OpenBSD的維護者從他們自己所擁有的資源來支援發展計畫使其茁壯。例如程式設計所花的時間,架設多種平台設備,利用網路資源來發佈OpenBSD,使用者可以自由享用。他們並且花時間回答使用者所遇見的問題並研究解決使用者發現錯誤的報告。

OpenBSD 發展者並不是獨力完成,而是大家聚集自己一點小小的貢獻、時間、設備和資源來合力完成,因此造成各個版本間有很大的差異。

?

1.4 -為何要用到OpenBSD?

新手最常想知道OpenBSD 有沒有比其他免費UNIX-like 系統好用. 這個問題並沒有答案,而且有數不盡(無用)的主題被激烈地討論著。不管在任何情況之下,千萬不要在OpenBSD mailing list中問相關的問題。

以下列出一些我們認為OpenBSD是一個有用的作業系統的理由. OpenBSD 到底好不好只有你自己可以回答。

  • OpenBSD 可以在多種不同平台上作業.
  • OpenBSD 要考慮完成眾多UNIX-like作業系統的專業安全性,必須要花費長逹一年半的時間並具備超過十種的原始碼的篩選而成。
  • OpenBSD 系統原始碼就像UNIX-like的系統完全不收任何費用.
  • OpenBSD 在分散式環境中,整合了適合建立防火牆(firewalls)的先進技術與個人網路服務。
  • OpenBSD 的優勢來自於各個區域強大時時進行發展過程,在程式設計師與最終使用者的共同社區中,提供了新興的技術的工作機會。
  • OpenBSD 提供了一般人參與發展與測試這個產品的機會。

?

1.5 -誰在維持 OpenBSD的發展與運作?

OpenBSD的維護來自各地不同的國家的發展小組。這個計畫的協調來自於位於加拿大的Theo de Raadt

?



.- 磁碟安裝


如何在OpenBSD的安裝當中設定磁碟標籤

OpenBSD安裝的主要部分之一就是建立你最初的標籤。這會直接的發生在(對i386的使用者)格式化硬碟之後。在安裝期間你用磁碟標籤去建立含有不同的掛入點的磁碟。在安裝期間,你可以從磁碟標籤內部去設定你的掛入點,但這不是完全必要的考慮,因為以後你將會被提示去確認你所做的選擇。不過它會使你的安裝過程稍微順利一點。

既然在安裝期間,你不用有任何的標籤存在,但是它們將來還是要被設定。你所要建立的第一個標籤設定為a’。這個標籤將會是你要安裝的地方(/…)你可以看見電腦所提出的分割建議以及大小。建議你要成為伺服器主機至少要單獨的設定這些標籤。如果你只是要當一般的電腦使用者只要建立一的根目錄(/)就可以了。當你要建立分割你最初的root partition (`a` label ),記住要保持一些空間給你的swap標籤。現在這些基礎的說明已經介紹完畢,這裡有一個例子去示範如何在安裝過程中使用標籤。在這第一個例子中假設 OpenBSD 將是這台電腦上唯一的作業系統,以及將做完整安裝。

If this disk is shared with other operating systems, those operating systems
should have a BIOS partition entry that spans the space they occupy completely.
For safety, also make sure all OpenBSD file systems are within the offset and
size specified in the 'A6' BIOS partition table.? (By default, the disklabel
editor will try to enforce this).? If you are unsure of how to use multiple
partitions properly (ie. seperating /,? /usr, /tmp, /var, /usr/local, and other
things) just split the space into a root and swap partition for now.
這裡介紹了一堆就是要你開始分割磁區
# using MBR partition 3: type A6 off 63 (0x3f) size 4991553 (0x4c2a41) 
?
   
   
Treating sectors 63-16386300 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.
?
   
   
Initial label editor (enter '?' for help at any prompt)
> d a
> a a
offset: [63] 
    
    
size: [16386237] 64M
Rounding to nearest cylinder: 131040
FS type: [4.2BSD] 
    
    
mount point: [none] /
fragment size: [1024] 
    
    
block size: [8192] 
    
    
cpg: [16] 
    
    
> a b
offset: [131103] 
    
    
size: [16255197] 64M
Rounding to nearest cylinder: 131040
FS type: [swap] 
    
    

?

在這個掛入點,我們設定了64Mroot partition空間給/,以及64Mswap partition空間。注意!電腦內定的offset初始值是63,這就是你所要的值。當它設定為這個大小之後,磁碟標籤會將你的設定的大小顯示在這個區段。不管如何,你並不需要去輸入大小在相同的地方。在這個例子中你也可以注意到電腦會自動將swap的磁碟標籤設定為`b`。這個正確的假定就跟一般核心程式會在標示為`b`的磁碟上找到swap一樣,而且你也恰好可以跟著這個指導方針去設定`b`當你的swap partition

在下一的例子將會讓你略過剛剛那兩個設定去建立更多標籤。這代表著它並不會完整的安裝,像這些大小並不夠去安裝OpenBSD全部的東西。顯示建立所有的分割區只是會不斷的重覆而已。

?

> a d
offset: [262143] 
    
    
size: [16124157] 64M
Rounding to nearest cylinder: 131040
FS type: [4.2BSD] 
    
    
mount point: [none] /tmp
fragment size: [1024] 
    
    
block size: [8192] 
    
    
cpg: [16] 
    
    
> a e
offset: [393183] 
    
    
size: [15993117] 64M
Rounding to nearest cylinder: 131040
FS type: [4.2BSD] 
    
    
mount point: [none] /var
fragment size: [1024] 
    
    
block size: [8192] 
    
    
cpg: [16] 
    
    

在上面這個練習,有二件事情你要注意到。第一件,offset會自動幫你算出下一個適當的步驟。當做到這邊的安裝時,你根本不需要去改變它的offset;另外就是標籤`c`必須要跳過,因為標籤`c`是代表著所有的磁碟空間。因為這樣,所以你在任何時候都不能去設定它。

一旦你的標籤全部設定完成之後,要將所有設定的標籤寫入磁碟,而且離開這個設定磁碟標籤的程式。要將所有的東西寫入磁碟並離開(而且繼續安裝)就輸入下面的指令:

> w
> q
    
    
所有擁有很多驅動程式的人請注意!假如你的BIOS沒有辦法去支撐一個驅動程式的大小,OpenBSD也同樣無法去支援BIOS。不同的OpenBSD也許可以去控制你的驅動程式,使它剛剛好。如果你是在一個BIOS沒有支援你的驅動程式的環境之下,你可以試著去使用Maxtor EZ的驅動程式或者是其他類似的產品。
   
   

一旦你的系統被安裝,你就不需要太常去使用到磁碟標籤。但有時候你還是必須要去使用到,當你想要對磁碟作增加、移除或者是重新調整的時候。你必須要做的第一件事情就是先查看你的磁碟標籤的情況。去做這個簡單的輸入:

# disklabel wd0 <----- 不管任何的磁碟你都能去查看
?
   
   
# using MBR partition 3: type A6 off 64 (0x40) size 16777152 (0xffffc0)
# /dev/rwd0c:
type: ESDI
disk:
label: TOSHIBA MK2720FC
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 2633
total sectors: 2654064
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0?????????? # milliseconds
track-to-track seek: 0? # milliseconds
drivedata: 0 
?
   
   
16 partitions:
#??????? size?? offset??? fstype?? [fsize bsize?? cpg]
? a:? 2071440??? 65583??? 4.2BSD???? 1024? 8192?? ?16?? # (Cyl.?? 65*- 2120)
? b:??? 65520?????? 63????? swap??????????????????????? # (Cyl.??? 0*- 65)
? c:? 2654064??????? 0??? unused??????? 0???? 0???????? # (Cyl.??? 0 - 2632)
? j:?? 512001? 2137023??? 4.2BSD???? 1024? 8192??? 16?? # (Cyl. 2120*- 2627*)

上面的這些簡單的命令可以讓你去查看現存的磁碟標籤,而且保證你不會被任何事情弄亂。但是如果要去改變現存的標籤,你必須輸入下面的命令:

# disklabel -E wd0

如果要把你帶到提示, 與你在 OpenBSD 安裝期間使用的那個相同的。在這個提示最重要的指令就是`?`。這會給你一個可能的目錄有關於磁碟標籤。你甚至可以加上`M`的參數去查看所在的頁碼。從這個提示,你可以做所有相關於partition的增加、刪除還有變更。

?


3.0 – 取得OpenBSD


Table of Contents

  • 3.1 – 購買OpenBSD 光碟
  • 3.1.1 – 去那裡取得OpenBSD iso image檔案?
  • 3.2 – FTP or AFS的管道下戴
  • 3.3 – 取得目前的原始程式碼

?

3.1 – 購買OpenBSD 光碟

購買OpenBSD 光碟通常入門是最好的方法。參訪訂購的網頁來購買你的版權: http://www.openbsd.org/orders.html.

以下列出眾多擁有OpenBSD光碟的好理由:

  • 光碟同時支援正在進行的發展的OpenBSD版本。
  • 跨平台作業系統的發展需要經常性的設備投資。
  • 你在購買光碟的技術支援對未來的發展有著衝擊性的影響。
  • 光碟片中包含所有作業平台的原始程式與原始碼。
  • 在數種平台中,光碟是可開機的,而且能被用在已經安裝其他作業系統上來管理機器的啟動。
  • 光碟可用在bootstrapping安裝,即使你僅安裝了snapshot
  • 從光碟安裝會比較快!同時也保存了網路的連線資源。
  • OpenBSD光碟總是來自於非常好的愛好者。你的系統並不會完整地包含全部的資料,僅能利用購買的方式或是捐贈硬體的方式去從這些人身上取得程式。

假如你安裝了release版本的OpenBSD,你必須使用光碟。Snapshot releases 只能從網路上安裝。

3.1.1 - OpenBSD 是否提供ISO image 供人下戴?

沒有,OpenBSD CD-ROM 被標示成有版權的產品,並不能自由從網路下戴。但 OpenBSD 本身是免費。沒有條文可以限制使何人將OpenBSD製成自己適用的光碟。

3.2 – FTP AFS的管道下戴

有很多的國際鏡射網站(mirror sites)提供了FTP來下戴OpenBSD,同時也提供AFS 服務。你應該使用離你最近的站台來執行下戴的工作。在你開始下戴之前,你應先偵測離你最近的站台是否運作正常以獲得最佳的下戴時效。當然,若你使用你的OpenBSD 光碟片,那比從任何站台下戴來得好。可以從以下網址得到處理的資訊:

http://www.openbsd.org/ftp.html

3.3 – 取得目前的程式原始碼

OpenBSD的原始碼是免費地自由發佈與使用。一般來說入門最好的取得現行版本的方法來自最新的光碟片,然後再裝置AnonCVS 來昇級它。有關AnonCVS的資訊可以到:

http://www.openbsd.org/anoncvs.html.

或是到The OpenBSD FAQ 去查詢。

假如你沒有足夠的網路頻寬來支援AnonCVS,或者假如你的網際網路經由UUCP,你仍可以使用CTM來取代AnonCVS來保留你現有的原始程式。假如這是你所遇到的情形,那麼使用最新發行的光碟片對你而言就特別的重要,有關CTM的相關資料可以到以下網址查詢:

http://www.openbsd.org/ctm.html.


4.0 – 安裝指南


Table of Contents

  • 4.1 - OpenBSD安裝程序概觀
  • 4.2 - OpenBSD安裝時所需要的檔案
  • 4.3 - OpenBSD安裝時所需要的空間
  • 4.4 - OpenBSD多重啟動
  • 4.5 - OpenBSD安裝完成後的動作
  • My install halts at MAKEDEV all on my i386 system with 8meg of RAM.

4.1 - OpenBSD 安裝程序概觀

OpenBSD提供了利用不同的安裝平台來建立新系統的方法。這樣子可以使大多數的使用者在各種環境中可以安裝OpenBSD 系統。這種分離式安裝OpenBSD系統的方法如下:

  • 光碟機(CD-ROM - 利用這種方法,你必須要購買一片OpenBSD光碟。 你可以到http://www.openbsd.org/orders.html來訂購。 這也是安裝OpenBSD 最簡單的方法。
  • FTP利用FTP操作,你必須知道你的IP, Netmask, Gateway等等資訊。 假如一切沒有問題,那你會發現世界上有非常龐大的站台列表可以使你便快速地取得OpenBSD到你的系統上。
  • DHCP這一項操作就如同FTP 的操作方式一樣,除了你的IP, Netmask, Gateway and Nameservers 是由DHCP sever所指定的以外。
  • Local Filesystem這項操作允許你從一個已存在的檔案系統中來執行安裝工作。可以支援已包含安裝磁碟的DOS, EXT2FS and FFS等。
  • NFS允許你從位於nfs的伺服器上來執行安裝工作。請閱讀 mount_nfs(8) 來獲得更多的資訊。

這些安裝的方式都可以在一張磁碟片上執行。而這些磁片可以從任何FTP站台中直接下戴取得。各種平台的系統架構都各自擁有專屬的磁片以確定使用者所取得的是正確的平台架構磁片版本。各種平台的支援請參閱第一節。

這裡有一些給欲安裝在i386 sparc機器平台上詳細完整的手冊。別忘了去查閱INSTALL.i386 INSTALL.sparc 這兩份文件。

使用者若是使用其他架構來安裝,請參閱在發行光碟中的INSTALL.arch 文件。

Alpha架構安裝注意事項

若你使用alpha的架構安裝則必須使用SRM韌體,以防止ARC作怪。你必須利用第二片光碟啟動來安裝你的alpha機器。利用以下的指令來執行:

boot -fi 2.6/alpha/bsd.rd dkaX

使用show device 指令來找出你的光碟機代號。假使你無法從光碟機啟動,你可以利用第二片啟動光碟的2.6/alpha/floppy26.fs來做。而且也可以將這個方法詳細寫下來運用在i386 的機器上,再依循安裝手冊上的指示來進行安裝。

4.2 - OpenBSD安裝時所需要的檔案

有很多的套件包含著OpenBSD 程式碼,但是你到底需要那些呢?以下是每種套件的簡述:

  • base26.tar.gz基本的OpenBSD系統(必要安裝)
  • etc26.tar.gz - /etc目錄下所有的檔案(必要安裝)
  • comp26.tar.gz編譯的工具與函式庫(建議安裝)
  • man26.tar.gz保存主晝面操作程式(建議安裝)
  • misc26.tar.gz保存各類資訊與安裝文件
  • game26.tar.gz - OpenBSD系統上的遊戲
  • xbase26.tar.gz - X11的基本安裝
  • xfont26.tar.gz - X11的字型伺服器與字型
  • xlink26.tar.gz - X servers的連結套件
  • xserv26.tar.gz - X11X servers
  • xshare26.tar.gz –X的主畫面、個人設定值都含括在內。
  • bsd – OpenBSD的核心(必要安裝)

4.3 - OpenBSD安裝時所需要的空間

以下列出各類套件安裝時所需要磁碟空間,這包含足夠的額外空間來允許你執行連結至internet的典型主要系統。

  • 在多人使用的系統中,你可能需要三倍的空間來存放資料與執行程式。
  • 假使你想安裝其他種類的大型軟體,你必須將/usr 的分割區加上至少三倍大!
  • 系統掌控大量的電子郵件或是網頁(/var/mail /var/www)時,你也必須將你的/var 分割區設成適當的大小。
  • 在一個多人使用的系統中,同時也會產生大量的記錄檔案(logs)存放在/var/log中,因此也必須將/var 分割區設成適當的大小。.

讀到這裡,千萬記住 /usr /usr/X11R6 通常是兩個相同的檔案系統,/usr分割成獨立的檔案系統並沒有多大的用處。

?

SYSTEM
         
         
/
         
         
/usr
         
         
/var
         
         
/usr/X11R6
         
         
alpha
         
         
56M
         
         
540M
         
         
27M
         
         
161M
         
         
amiga
         
         
45M
         
         
399M
         
         
24M
         
         
36M
         
         
hp300
         
         
31M
         
         
234M
         
         
24M
         
         
47M
         
         
i386
         
         
35M
         
         
229M
         
         
24M
         
         
72M
         
         
mac68k
         
         
29M
         
         
232M
         
         
24M
         
         
36M
         
         
mvme68k
         
         
29M
         
         
232M
         
         
24M
         
         
-? (no Xserver)
         
         
pmax
         
         
50M
         
         
355M
         
         
24M
         
         
60M
         
         
sparc
         
         
40M
         
         
259M
         
         
24M
         
         
49M
         
         

當你使用磁碟標籤的編輯器時,你可以選擇將你全部的系統命名成'a' (主要檔案系統)'b' (交換暫存磁碟-swap)。當你用disklabel命名'a' 檔案系統時,它將變成你的啟動分割區,而它則必須包含三個主要部份 (/, /usr, and /var),另外再增加一些空間給/tmp。而你所分割的'b' 檔案系統則自動變成你的系統做swap的分割區,我們建議至少要有32MB的空間,假使情況允許的話,建議分割成64MB 如果你有更大的空間,最好可以分成256MB甚至512MB

有四點理由說明為何要使用分離的檔案系統來取代將所有東西都丟在同一個或兩個檔案系統裡:

  • 安全(Security):你可以將各個檔案系統標示成'nosuid', 'nodev', 'noexec', 'readonly',等等
  • 穩定(Stability):使用者或是不當的程式若有“寫入的權限”會將一些垃圾資料放入檔案系統裡去,你的主系統程式是放在其他檔案區裡執行,當然不會受到影響。
  • 快速(Speed):經常做寫入動作會造成完整的檔案分散儲存在硬碟中。 (所幸OpenBSD所使用的ffs檔案系統比較不容易造成大量分裂的情形。)
  • 健全(Integrity):假使其中一個檔案系統因某種原因造成損毀,系統裡其他的檔案磁區仍可正常運作。

4.4 - OpenBSD多重啟動(i386, alpha)

OpenBSD & NT

電腦可以啟動OpenBSD NT。你可以使用NT的啟動管理程式Ntloader來使NT運作。為使同時可以啟動NT,你必須再拷貝OpenBSDpbr。在執行安裝啟動之後,你再依以下指令拷貝一些東西:

?? # dd if=/dev/rsd0c of=openbsd.pbr bs=512 count=1
   
   

現在啟動NT並將openbsd.pbr放在c:槽中。再將以下指令加到c:/boot.ini最後一列:

?? c:/openbsd.pbr="OpenBSD"
   
   

再重新啟動電腦,你應該會發現在NT loader 的啟動選單中出現了OpenBSD,然後就可以開始使用NTOpenBSD了。

OpenBSD & Windows or DOS (i386)

要使電腦同時可以啟動OpenBSDWindows 3.1Windows95或是DOS,你必須找一個可以管理這些系統啟動的程式,如osbs20b8.zipThe Ranish Partition Manager。這兩者都適用於OpenBSD分割區。

OpenBSD & Linux (i386)

請參照INSTALL.linux的說明,裡頭關於OpenBSD Linux同時工作有做更深入的介紹。

?

4.5 - OpenBSD安裝完成後的動作

在這裡提醒使用者,OpenBSD的發展者非常重視並且追踪OpenBSD的使用狀況,他們要找出在各種機器平台上適用或不適用的原因,以求再改進系統的穩定性。

在此引用 /usr/src/etc/root/root.mail 中的敍述:

If you wish to ensure that OpenBSD runs better on your machines, please do us
   
   
a favor (after you have your mail system setup!) and type
   
   
??????? dmesg | mail dmesg@openbsd.org
   
   
so that we can see what kinds of configurations people are running.? We will
   
   
use this information to improve device driver support in future releases.
   
   
(We would be much happier if this information was for the supplied GENERIC
   
   
kernel; not for a custom compiled kernel).? The device driver information
   
   
we get from this helps us fix existing drivers.
   
   

?

你發電子郵件給發展小組時,請確定你的回信地址是可以確實收到的位址,如此一來系統的發展者才可以和你保持聯絡,若他們需要你幫忙測試或更改一些系統的設定,確保系統執行的正確性時,才方便聯絡。不過若是OpenBSD系統上發送測試結果而無法收到回信時,能不能收到回信就不是那麼重要了,可以利用

?dmesg | mail your-account@yourmail.dom
   
   

然後轉寄到

?dmesg@openbsd.org
   
   

加上你固定使用的email帳號如 your-account@yourmail.dom 就可以了。(或是利用傳送dmesg 輸出結果送到ftp/scp/floppydisk/carrier-pigeon/)

請傳送GENERIC kernel dmesg's的資料就可以,Custom kernels 包含裝置的趨動程式對發展小組並沒有幫助。



5.0 – 核心結構的配置


Table of Contents


?

5.1 – 為何要建立自訂的核心(kernel)?

儘管自訂核心是由對系統有通盤瞭解的進階使用者在進行。但有一些理由卻必須由一般使用者來進行:

  • 你的電腦只有很少的記憶體而你卻想儘可能保留那些你不用而準備要移除掉的裝置。
  • 移除內定的設定值或是增加內定值無法啟動的設定。
  • 設定一些測試的功能

在大部份的情況下,你不會需要編輯系統核心結構。一般性的核心結構已經包含你所需要的全部東西了。事實上,有一些原因說明了為何你不需要建立自己的核心程式,最主要的原因在於核心設定非常容易更動,看起來合乎邏輯但是卻無法作業,這是危險狀況之一。如果有一些東西不能夠適當的運作,就請你在送出錯誤報告之前,先試試核心結構的運作方式是否正常。

?

5.2 -核心結構的選項

核心結構的選項只是在代替某些在核心特定的功能。這可以讓你多了一些你想要的支援功能,而且不會有一些你不想用到的設備。有很多選擇可以設定核心功能。我們將會在下面提及這些常用的功能。去看一下第四個選項的主頁,或者可以看一下在你所設定好的結構中的範例結構檔案。

並不是全部的核心選項都已經伴隨其他選項經過完整的測試。別任意放置任何選項在你的核心中除非你確實非做不可的理由!經過多重測試的核心結構才能成為一般性的核心,這通常由/usr/src/sys/arch/ /conf/GENERIC /usr/src/sys/conf/GENERIC兩個地方的選項相結合。

  • Alpha Kernel 配置檔案
  • i386 Kernel配置檔案
  • mac68k Kernel 配置檔案
  • pmax Kernel配置檔案
  • sparc Kernel配置檔案
  • Other Arch's

請注意這些檔案中的結構,若你發現有如以下這列的敍述:
include "../../../conf/GENERIC"
表示尚未加入其他的配置檔案,而這檔案儲存了尚未確定的選項,因此當你在建立你自己的核心配置時,請先查看/sys/conf/GENERIC中的配置方式,並決定你所需要的配置方式。

在核心的配置檔案中,所有列出的選項必須依下列的標準格式放置:
option OPTION

例如要將debug放在核心中,所寫的指令為:
option DEBUG

OpenBSDOptions會被轉換成編譯器的Options,然而有些optionDEBUG則需要原始編譯器DDEBUG,就如同在核心中執行#define DEBUG一般。

OpenBSD有非常多相容的options可以讓你利用其他作業的程式碼。但並不是所有的options都可以適用在各種架構上,因此請讀取各個主要的說明以確定是否你的平台有無支援。

  • COMPAT_SVR4(8) – 適用於SVR4程式碼
  • COMPAT_BSDOS(8) – 適用於BSD/OS程式碼
  • COMPAT_LINUX(8) - 適用於Linux程式碼
  • COMPAT_SUNOS(8) - 適用於SunOS程式碼
  • COMPAT_ULTRIX(8) - 適用於Ultrix程式碼
  • COMPAT_FREEBSD(8) - 適用於FreeBSD程式碼
  • COMPAT_HPUX - 適用於HP-UX程式碼。僅在某些m68k機器上有效。
  • COMPAT_IBCS2(8) - 適用於執行ibcs2程式碼
  • COMPAT_OSF1 – 執行Digital Unix程式碼. 只在Alpha平台上有效。
  • COMPAT_43 - 適用於4.3BSD
  • COMPAT_11 - 適用於NetBSD 1.1

?

?

?

6.0 – 安裝過程


OpenBSD的安裝過程

openbsdCD片放入光碟機後,會自進入按裝畫面。如下:

在這裡它會問你要選擇使用安裝(install)、升級(upgrade)、還是shell 模式?

一般我們選擇安裝(I):

Enter pathname of shell or RETUN for sh:

Erase ^ ?,werase ^W, kill ^U, intr ^C

(I)nstall , (U)pgrade or (S)hell ?? I?? 進入歡迎畫面

?

Welcome to the OpenBSD/i386 2.5 installation program

?

This program is designed to help you put OpenBSD on your disk in a simple and

Rational way.

?

As with anything which modifies your disk`s contents, this program can cause

SIGNIFCANT data loss, and you are advised to make sure your data is backed

Up before beginning to installation process.

?

Default answers are displayed in brackets after the questions. You can hit Control –C at any time to quit, but if you do so at a prompt, you may have to hit return. Also, quitting in the middle of installation may leave your system in an inconsistent state. If you hit Control –C and restart the install, the install program will remember many of your old answers.

?

上面只是openbsd的一些聲明,並且告訴你安裝之後會遺失你原先的資料!所以你最好將原先重要的資料備份起來。然後再繼續下一個步驟:

?

Proceed with installation?[n]? y

這裡問你是否要繼續安裝?

?

Cool! Let`s get to it ….

Specify terminal type [pcvt25]:? [entet]

這裡在說明安裝顯示模式。

?

The installation program needs to know which disk to consider the root disk. Note the unit number may be different than the unit number you used in the boot program (especially on a PC with multiple disk controllers).

Available disks are:

電腦會自動幫你偵測到你的硬碟,並且給它們一個符號。

Wd0

Wd1

Sd0

Which disk is the root disk [wd0]? 〔enter

問你要將root disk安裝在那一顆硬碟?(Wd0為電腦的內定值)

Do you want to use the *entire* disk for OpenBSD? [no] yes

問你要不要使用整顆硬碟安裝?

?

[…]

?

Inside the BIOS `A6` (`OpenBSD`) partition you just created, there resides an OpenBSD partition table which defines how this BIOS partition is to be split space, and any other partitions you might create.? (NOTE: The OpenBSD disk label offsets are absolute, ie. Relative to the start of the disk … NOT relative to the start of the BIOS `A6` partition).

?

If this disk is shared with other operating systems, those operating systems should have a BIOS partition entry that spans the space they occupy completely.

For safety, also make sure all OpenBSD file systems are within the offset and size specified in the `A6` BIOS partition table.? (By default , the disklabel editor will try to enforce this ).? If you are unsure of how to use multiple partitions properly? (ie. Separating /,? /usr ,? /tmp? ,? /var? ,? /usr/local ,and other things ) just split the space into a root and swap partition for now.? 叫你開始分割硬碟

?

# using MBR partition 3: type A6 off 63 (0x3f) size 4991553 (0x4c2a41)

?

Treating sectors 63 – 16386300 as the OpenBSD portion of the disk. you can use the `b` command to change this.

?

Initial label editor (enter `?` for help at any prompt) 查看指令的用法

> _d a  刪除分割區A

> _a a  建立分割區A

offset: [63] _enter

size: [16386127] _64M

Rounding to nearest cylinder: 131040

FS type: [4.2BSD] _enter

Mount point: [none] _/

Fragment size: [1024] _enter

Block size: [8192] _enter

Cpg: [16] _enter

> _a b  建立分割區B

offset: [131103] _enter

size: [16255197] _64M

Rounding to nearest cylinder: 131040

FS type: [swap] _enter

> _a d  建立分割區D

offset: [262143] _enter

size: [16124157] _64M

Rounding to nearest cylinder: 131040

FS type: [4.2BSD] _enter

Mount point: [none] _/tmp

Fragment size: [1024] _enter

Block size: [8192] _enter

Cpg: [16] _enter

> _a e  建立分割區E

offset: [393183] _enter

size: [15993117] _64M

Rounding to nearest cylinder: 131040

FS type: [4.2BSD] _enter

Mount point: [none] _/var

Fragment size: [1024] _enter

Block size: [8192] _enter

Cpg: [16] _enter

> _a g  建立分割區G

offset: [524223] _enter

size: [15862077] _300M

Rounding to nearest cylinder: 614880

FS type: [4.2BSD] _enter

Mount point: [none] _/usr

Fragment size: [1024] _enter

Block size: [8192] _enter

Cpg: [16] _enter

> _a h  建立分割區H

offset: [1139103] _enter

size: [16386127] _*? 打*號的意思是要將剩下的空間全部用掉

FS type: [4.2BSD] _enter

Mount point: [none] _/home

Fragment size: [1024] _enter

Block size: [8192] _enter

Cpg: [16] _enter

> _w 寫入硬碟

> _q  離開分割硬碟程式

You will now have the opportunity to enter filesystem information information for wd0.

You will be prompted for the mount point (full path, including the prepending ‘/’ character) for each BSD partition on wd0.? Enter “none” to skip a partition or “done” when you are finished.

?

The following partitions will be used for the root filesystem and swap:

??????? Wd0a ???? /

??????? Wd0b????? swap

?

Mount point for wd0d (size=65520k) [/ tmp, RET, none, or done]? _ enter

Mount point for wd0e (size=65520k) [/ var, RET, none, or done]? _ enter

Mount point for wd0g (size=307440k) [/ usr, RET, none, or done]? _ enter

Mount point for wd0h (size=192656k) [/ home, RET, none, or done]? _ done

讓你檢查你的掛入點是否正確,沒有問題後再打入done就可以了!

?

Nowq you can select another disk to initialize.? ( Do not re-select a disk you have already entered information for).? Available disks are:

Wd0

Wd1

?

Which one? [ done]

問你要不要再選擇其它硬碟做分割。

You have configured the following devices and mount points:

Wd0a /

Wdod / tmp

Wd0e / var

Wd0e / usr

Wd0h / home

?

Filesystems will now be created on these devices.

If you made any mistakes, you way edit this now.

Edit using ed? [n]_ 問你要不要校正?如果沒錯就按enter略過

The next step will overwrite any existing data on :

跟你說再來的步驟會直接寫入現有的資料上。

??????????????? wd0a wd0d wd0e wd0g wd0h

Are you really sure that you’re ready to proceed? [n] _y 問你要不要繼續

[…]

?

you will now be given the opportunity to configure the network. This will be useful if you need to transfer the installation sets via FYP, HTTP, or NFS. Even if you choose not to transfer installation sets that way, this information will be preserved and copied into the new root filesystem.

接著進入網路設定的部分

Configure the network [y]

Enter system hostname (short form): [ ] _cad5   設定區網的主機名稱

Enter DNS domain name: [ ] _ net47.ee.oit.edu.tw 設定本身的主機名稱

?

If you have any devices being configured by a DHCP server

It is recommended that you do not enter a default route or any name server.

?

You may configure the following network interfaces (the interfaces marked with [X] have been successfully configured):

電腦會自動幫你偵測到你所擁有的網路卡,你只要作選擇就可以了!

??????? [ ] es3

??????? [ ] fxp0

Configure which interface? (or, enter ‘done’ ) [es3]

IP address (or ‘dhcp’)? [ ] _192.192.73.67

Symbolic (host) name? [ cad5]

Netmask ? [255.255.255.0]

Your network interface might require non-default media directives. The default media is :

?? Media: Ethernet 100baseTX half-duplex

This is a list of supported media:

??????? Media autoselect

Media 100baseTX mediaopt full-duplex

Media 100baseTX mediaopt half-duplex

Media 100baseTX

Media 100baseT mediaopt full-duplex

Media 100baseT

Media 100baseT mediaopt half-duplex

If the default is not satisfactory, and you wish to use another media, copy that line from above (ie. “media 100baseTX”)

Media directives? [ ] enter

?

You may configure the following network interfaces ( the interfaces marked with [X] have been successfully configured ) :

[X ] es3

[? ] fxp0

設定網路的IP位址

Configure which interface? (or, enter `done` ) [done] _enter

Enter IP address of default route: [none] _192.192.73.1

Enter IP address of primary nameserver: [none] _192.192.73.2

Would you like to use the nameserver now? [y] _enter

?

You will now be given the opportunity to escape to the command shell to do any additional network configuration you may need.? This may include adding additional routes, if needed.? In addition, you might take this opportunity to redo the default route in the event that it failed above.

Escape to shell? [n] _

問你要不要去改變現有的shell ?

?

/dev/wd0a on /mnt type ffs ( local )

/dev/wd0d on /mnt/tmp type ffs ( local )

/dev/wd0e on /mnt/var type ffs ( local )

/dev/wd0g on /mnt/usr type ffs ( local )

/dev/wd0h on /mnt/home type ffs ( local )

?

Please enter the initial password that the root account will have.

Password ( will not echo ): _0710

Password ( again ): _0710

設定密碼

?

It is now time to extract the installation sets onto the hard disk.? Make sure the sets are either on a local device ( i.e. tape ,CD-ROM ) or on a network server.? You will have the chance to repeat this step or to extract sets from several places, so you don`t have to try to load all the sets in one try and can recover from some errors.

選擇安裝路徑

Install from ( f )tp, ( h )ttp, ( t )ape, ( C )D-ROM, ( N )FS or local ( d )isk? _c

The following CD-ROM devices are installed on your system; please select the CD-ROM device containing the partition with the installation set:

acd0

cd0

Which is the CD-ROM with the installation media? [abort] acd0

電腦會自動幫你偵測到你的CD-ROM device。選擇你要的!

Partition? [ C ] _內定為C磁碟

?

There are two CD-ROM filesystem types currently supported by this program:

?Cd9660??????? ISO-9660

?Ffs??????????? Berkeley Fast Filesytem

?

Which filesystem type? [cd9660]

Enter the directory relative to the mount point that

Contains the file. [ /i386 ] _/i386  輸入擋案路徑

?

You will now be asked for files to extract. ?N addition to the files listed in the selector you may enter any file located in /i386.? you can also enter `all` to install all the standard sets, or `list` to list the files available in /i386.

When you are done selecting files, enter `done`.

Some of these sets are required for your install and some are optional ---

Consult the intallation notes if you are not sure which sets are required!

?

The following sets are available for extraction.

Enter filename, `list` , `all` , or `done`.

You nay de-select a set by prepending? a `_` to it`s name.

選擇你要的套件

[ X ] base25.tar.gz

[ X ] etc25.tar.gz

[? ] misc25.tar.gz

[? ] comp25.tar.gz

[? ] man25.tar.gz

[? ] game25.tar.gz

[? ] xbase25.tar.gz

[? ] xshare5.tar.gz

[? ] xfont25.tar.gz

[? ] xserv25.tar.gz

[ X ] bsd

File name [ ]? _* 輸入*號代表全選,會出現以下的劃面,告訴你已經全部選取了!

The following sets are available for extraction.

Enter filename, `list` , `all` , or `done`.

You nay de-select a set by prepending? a `_` to it`s name.

?

[ X ] base25.tar.gz

[ X ] etc25.tar.gz

[ X ] misc25.tar.gz

[ X ] comp25.tar.gz

[ X ] man25.tar.gz

[ X ] game25.tar.gz

[ X ] xbase25.tar.gz

[ X ] xshare5.tar.gz

[ X ] xfont25.tar.gz

[ X ] xserv25.tar.gz

[ X ] bsd

File name [ ]? _-game* 代表將已選取的`game`項目去除!會再出現一次你所要按裝的套件。

The following sets are available for extraction.

Enter filename, `list` , `all` , or `done`.

You nay de-select a set by prepending? a `_` to it`s name.

?

[ X ] base25.tar.gz

[ X ] etc25.tar.gz

[ X ] misc25.tar.gz

[ X ] comp25.tar.gz

[ X ] man25.tar.gz

[? ] game25.tar.gz

[ X ] xbase25.tar.gz

[ X ] xshare5.tar.gz

[ X ] xfont25.tar.gz

[ X ] xserv25.tar.gz

[ X ] bsd

File name [ ]? _done 如果沒問題就打入done,結束選取套件。

Ready to extract selected file sets? [y]? 準備好開始按裝剛剛所選取的套件?

?

?

/i386/base25.tar.gz:

100%?? |***************************************|? 17774KB? 00:00 E

TA

/i386/etc25.tar.gz:

100%?? |***************************************|??? 161KB? 00:00 E

TA

/i386/bsd:

100%?? |***************************************|?? 2281KB? 00:00 E

TA

/i386/misc25.tar.gz:

100%?? |***************************************|?? 1637KB? 00:00 E

TA

/i386/comp25.tar.gz:

100%?? |***************************************|?? 11481KB? 00:00 E

TA

/i386/man25.tar.gz:

100%?? |***************************************|??? 3543KB? 00:00 E

TA

/i386/xbase25.tar.gz:

100%?? |***************************************|??? 5376KB? 00:00 E

TA

/i386/xshare25.tar.gz:

100%?? |***************************************|??? 1482KB? 00:00 E

TA

/i386/xfont25.tar.gz:

100%?? |***************************************|??? 6017KB? 00:00 E

TA

/i386/xserv25.tar.gz:

100%?? |***************************************|?? 15188KB? 00:00 E

TA

?

Extract more sets? [ n ]? 問你要不要再作更多的設定

Copying fstab … done.

Copying hostname .x10…done

Copying hosts … done.

Copying myname … done.

Copying mygate … done.

Copying resolv .conf … done.

Select a time zone for your location.? Timezones are represented on the system by a directory structure rooted in “/usr/share/timezone”.? Most timezones can be selected by entering a token like “MET” or “GMT-6”.? Other zones are grounped by continent.? With detailed zone information.

Separated by a slash (“ / ”), e.g .? “US/Pacific” or “Canada/Mountain”.

?

To get a listing of what`s available in /usr/share/zoneinfo, enter “ ? ” at the prompts below.

?

What timezone are you in [ `?` for list ] [GMT]? _? ?打?查看有那些時區

Africa/???? Chile/??? GMT???? Jamaica???? Navajo????? UCT

America/?? Cuba???? GMT+0?? Japan?????? PRC??????? US/

Antarctica/?? .????????? .????????? .?????????? .????????? .

Arctic/?????? .???????? .????????? .?????????? .????????? .

Asia/?????? ?.???????? .????????? .?????????? .????????? .

? .????????? .???????? .????????? .?????????? .????????? .

.????????? .???????? .????????? .?????????? .????????? .

What timezone are you in [ `?` for list ] [GMT]? _Asai ?輸入亞洲(Asai

There are several timezones available with zone `Asai`

Select a sub-timezone [`?` for list]:_? 打?查看有那些地區可用

Atlantic??????? Eastern???????? Pacific

?? .????????????? .????????????? .

?? .????????????? .????????????? .

?? .????????????? .????????????? .

Select a sub-timezone [`?` for list]:_Taipei??? 輸入taipei,之後會進入一連串的說明畫面

You have selected timezone “Asai/Taipei” .

Installing timezone link…done

Installing boot block…

Boot:? /mnt/boot

Proto:? /usr/mdec/biosboot

Device: /dev/rwd0c

/usr/mdec/biosboot: entry point 0

proto bootblock size 512

room for 12 filesystem blocks at 0x16f

Will load 6 blocks of size 8192 each.

Using disk geometry of 63 sectors and 128 heads.

0: 19 @( 0? 93? 45 )? (5903-5921)

1: 63 @( 0? 94? 1 )? (5922-5984)

2: 14 @( 0? 95? 1 )? (5985-5998)

/mnt/boot:? 3? entries total

using MBR partition 3:? type 166? (0xa6) offset 63 (0x3f)

?

Do you expect to run X window on this machine? [ y or n ] _y

問你要不要在這台機器上執行X window

Enabling machdep.allowaperture.? Read xf86(4) for more information.

?

Making all device nodes (by running /dev/MAKEDEV) ……done

Unmounting filesystems… /mnt/usr /mnt/var /mnt/tmp /mnt … Done

Done.

接著會進入恭喜你完成安裝OpenBSD的畫面。

CONGRATULATIONS!? You have successfully installed OpenBSD!? To boot the installed system, enter halt at the command prompt.? Once the system has halted, reset the machine and boot from the disk.

?

#_reboot  執行重新開機

?

大功告成!!!

?

?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值