diff --git a/zh_TW.Big5/books/Makefile b/zh_TW.Big5/books/Makefile index a86cac71e9..3918e85f5f 100644 --- a/zh_TW.Big5/books/Makefile +++ b/zh_TW.Big5/books/Makefile @@ -1,11 +1,12 @@ # $FreeBSD$ SUBDIR = faq -#SUBDIR+= handbook -#SUBDIR+= porters-handbook +SUBDIR+= fdp-primer +SUBDIR+= handbook +SUBDIR+= porters-handbook #SUBDIR+= zh-tut ROOT_SYMLINKS = faq DOC_PREFIX?= ${.CURDIR}/../.. .include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.Big5/books/faq/book.sgml b/zh_TW.Big5/books/faq/book.sgml index 06dfa40db3..129e7f6153 100644 --- a/zh_TW.Big5/books/faq/book.sgml +++ b/zh_TW.Big5/books/faq/book.sgml @@ -1,11285 +1,11157 @@ %man; %freebsd; %authors; %teams; %bookinfo; %mailing-lists; %books.ent; ]> FreeBSD 4.X¡A5.X ¤Î 6.X ±`¨£°Ýµª¶° FreeBSD ¤å¥ó­pµe $FreeBSD$ 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 + 2006 FreeBSD ¤å¥ó­pµe &bookinfo.legalnotice; &tm-attrib.freebsd; &tm-attrib.3com; &tm-attrib.adobe; &tm-attrib.creative; &tm-attrib.cvsup; &tm-attrib.ibm; &tm-attrib.ieee; &tm-attrib.intel; &tm-attrib.iomega; &tm-attrib.linux; &tm-attrib.microsoft; &tm-attrib.mips; &tm-attrib.netscape; &tm-attrib.opengroup; &tm-attrib.oracle; &tm-attrib.sgi; &tm-attrib.sparc; &tm-attrib.sun; &tm-attrib.usrobotics; &tm-attrib.xfree86; &tm-attrib.general; ³o¥÷¤å¥ó¬O FreeBSD 4.X¡A5.X ¤Î 6.X ªº±`¨£°Ýµª¶°¡C °£«D¦³¯S§O¥[µù¡A§_«h³o¨Ç¶µ¥Ø³£¾A¥Î©ó FreeBSD 4.0 ¤Î¥H«áªºª©¥»¡C (¦pªG±ø¥Ø¤º®e¤¤¦³ <XXX> «h¬O©|¥¼§¹¦¨¤¤Ä¶ªº³¡¥÷¡C) ¦pªG±z¹ï¨ó§U¥»­pµe ªº¶i¦æ¦³¿³½ìªº¸Ü¡A½Ð±H e-mail ¨ì &a.doc;¡C¦¹¥~¡AÀH®É¥i±q FreeBSD ºô¯¸ ®³¨ì³o¥÷¤å¥óªº³Ì·sª©¥»¡C ¤]¥i¥H§Q¥Î HTTP ¨Ó¤U¸ü¤@¥÷Ãe¤jªº HTML ¤å¥ó¡A©Î¬O¸g¥Ñ FreeBSD FTP ¯¸ ¤U¸ü¯Â¤å¦r¡B&postscript;¡B©Î PDF ª©¥»ªºÀɮסC ±z¤]¥i¥H¦b³o¸Ì¨Ï¥Î ·j´M¸ê®Æ ªº¥\¯à¡C Ying-Chieh Liao
ijliao@FreeBSD.org
«e¨¥ Åwªï¨Ï¥Î FreeBSD 4.X-6.X FAQ! ¸ò¨ä¥L Usenet ¤Wªº FAQ ¤@¼Ë¡A³o¥÷¤å¥ó²[»\¤F¦³Ãö FreeBSD ³o®M§@·~ ¨t²Î³Ì±`³Q°Ý¨ìªº°ÝÃD (·íµM¥]¬A¤F¦^µª¡I)¡CÁöµM»¡§Ú­Ì¥»¨Óªº¥Øªº¬O¬°¤F ´î¤Öºô¸ôÀW¼eªº®ö¶O¥H¤ÎÁ×§K¦P¼Ëªº°ÝÃD¤@¦A¥X²{¡A¦ý¨Æ¹ê¤W FAQ ¤w¸g³Qµø ¬°¬O¤@ºØ­È±o¾\Ūªº¤å¥ó¸ê·½¡C - §Ú­Ì¤w¸g¾¨¥i¯à¦a¨Ï³o¥÷ FAQ §óÂ×´I¤F¡C¦pªG±z¹ï¦p¦ó¨Ï¨ä§ó¶i¨B¦³¥ô + §Ú­Ì¤w¸g¾¨¥i¯à¦a¨Ï³o¥÷ FAQ §óÂ×´I¤F¡C¦pªG±z¹ï¦p¦ó§ïµ½¡B¶i¨B¤è­±¦³¥ô ¦ó«ØÄ³¡A½ÐÀH®É±H¹q¤l¶l¥óµ¹ &a.doc;¡C ¤°»ò¬O FreeBSD¡H ²³æ¦a¨Ó»¡¡AFreeBSD ¬O¤@®M¥i¥H¦b Alpha/AXP, AMD64 ¤Î &intel; EM64T, &i386; IA-64, PC-98, &ultrasparc; ¤W°õ¦æªº UN*X-like §@·~¨t²Î¡A¥¦¬O®Ú¾Ú U.C. Berkeley ©Ò¶}µo¥X¨Óªº 4.4BSD-Lite¡A¨Ã¥[¤W¤F³\¦h 4.4BSD-Lite2 ªº¼W±j¥\¯à¡C¥¦¦P®É¤]¶¡±µ¨Ï¥Î¤F U.C. Berkeley ©Ò¶}µo¥X¨Ó¨Ã¥Ñ William Jolitz ²¾´Ó¨ì i386 ªº Net/2¡A¤]´N¬O 386BSD¡A¤£¹L²{¦b 386BSD ªºµ{¦¡½X¥u³Ñ¤U·¥¤Ö¼ÆÁÙ¯d ¦s¦b FreeBSD ¤¤¡C±z¥i¥H¦b FreeBSD ­º­¶§ä¨ì¦³Ãö ¤°»ò¬O FreeBSD ¥H¤Î¥¦¥i¥HÀ°±z°µ¨Ç¤°»òªº¬ÛÃö¸ê°T¡C FreeBSD ¤w³Q¼sªx¦a³Q¥@¬É¦U¦aªº¤½¥q¦æ¸¹¡BISP¡B¬ã¨s¤H­û¡B¹q¸£ ±M®a¡B¾Ç¥Í¡A¥H¤Î®a®x¥Î¤á©Ò¨Ï¥Î¡A¥Î¦b¤u§@¡B±Ð¨|¥H¤Î®T¼Ö¤W¡C ¦pªG·Q¬ÝÃö©ó FreeBSD §ó²`¤Jªº¸ê®Æ¡A½Ð¬Ý FreeBSD ¨Ï¥Î¤â¥U¡C µo®i FreeBSD ªº¥Øªº¬O¤°»ò¡H FreeBSD ­pµeªº¥Øªº¬O´£¨Ñ¥i¥H¥ô·N¨Ï¥Î¥B¨S¦³­­¨îªº³nÅé¡C§Ú­Ì¦b µ{¦¡½X (¥H¤Î­p±Þ¥»¨­) ¤W¥I¥X¤F¤j¶q¤ß¦å¡A·íµM¤£·|¤¶·N¨ÓÂIª÷¿ú¤Wªº ¦^õX¡A¤£¹L§Ú­Ìµ´¹ï¤£·|¦p¦¹°í«ù¡C§Ú­Ì¬Û«H§Ú­Ì­º­nªº ¥ô°È ´N¬O´£¨Ñµ{¦¡½Xµ¹¨C¤@­Ó¨Ï¥ÎªÌ¡A¤£ºÞ¥L­Ì¥´ºâ¥Î ¨Ó·F¹À¡F³o»ò¤@¨Ó¡A³o¨Çµ{¦¡½X¤~¯à³Q¥Î¦b³Ì¦h¦a¤è¡A¤]¤~¯àµo´§¥¦­Ì³Ì ¤jªº§Q¯q¡C§Ú­Ì¬Û«H³o´N¬O¦Û¥Ñ³nÅé³Ì°ò¥»ªº¥Ø¼Ð¤§¤@¡A¦Ó¥B§Ú­Ì·|ºÉ¥þ ¤O¥h¤ä«ù¥¦¡C ¦b§Ú­Ì source tree ¤¤¦³³¡¥÷ªºµ{¦¡½X¬O±Ä¥Î©Ò¿×ªºGPL©Î¬O LGPL ª©Åv«Å§i¡AÁöµM³o¨Çª©Åv«Å§i¬O¥Î¨Ó«O»Ù¦Ó«D­­¨î¨Ï¥ÎªÌªºÅv §Q¡A²¦³º¬O¤£¨º»ò¦Û¥Ñ¤F¨Ç¡C¥Ñ©ó³o¨Ç GPL ªº³nÅé¦b°Ó·~¨Ï¥Î¤W·|¤Þ°_ «D±`½ÆÂøªºª©Åv°ÝÃD¡A¦]¦¹¥u­n¦³¾÷·|¡A§Ú­Ì·|ºÉ¶q¥H±Ä¥Î¤ñ¸ûÃPªº FreeBSD ª©Åvªº³nÅé¨Ó¨ú¥N³o¨Ç GPL ª©Åv«Å§iªº³nÅé¡C FreeBSD ª©Åv¦³¥ô¦ó­­¨î¶Ü¡H ¦³ªº¡C¦ý¬O³o¨Ã¤£¬O­­¨î§A«ç»ò¥h¨Ï¥Î³o¨Çµ{¦¡½X¡A¦Ó¬O§A«ç»ò¬Ý«Ý FreeBSD ³o­Ó­pµe¡C¦pªG§A¦³ª©ÅvµJ¼{¯gªº¸Ü¡A½Ð¾\Ū ª©Åv¥»¤å¡C²³æ¦a¨Ó»¡¡A³o¥÷ª©Åvªº­«ÂI¥i¥H±ø¦C¦p¤U¡C ½Ð¤Å«ÅºÙ¬O±z¼g¤F³o­Óµ{¦¡¡C ¦pªG¥¦¥X°ÝÃD¤F¡A¤£­n±±§i§Ú­Ì¡C FreeBSD ¥i¥H¨ú¥N§Ú²{¦b¦b¥Îªº§@·~¨t²Î¶Ü¡H ¹ï¤j³¡¥÷ªº¤H¨Ó»¡¬O³o¼Ë¨S¿ù¡A¦ý¨Æ¹ê¤W³o°ÝÃD¨Ã¨S¦³³o»ò¦n¦^ µª¡C ¤j³¡¥÷ªº¤H¨Ã¤£¬O¯u¥¿¦b¨Ï¥Î¤@­Ó§@·~¨t²Î¡C¥L­Ì¨Ï¥Îªº¬OÀ³¥Îµ{¦¡ ¡F¦Ó¨º¨ÇÀ³¥Îµ{¦¡¤~¬O¯u¥¿¥Î¨ì§@·~¨t²ÎªºªF¦è¡CFreeBSD ¬O³]­p¥Î¨Ó´£ ¨Ñ¤@­Ó±j¶´¥B¥\¯à§¹¾ãªº§@·~Àô¹Òµ¹À³¥Îµ{¦¡¨Ó°õ¦æ¡C¥¦¤ä´©¤F¦hºØÂsÄý ¾¹¡A¿ì¤½«Ç®M¥ó³nÅé¡A¹q¤l¶l¥ó¾\Ū³nÅé¡Aø¹Ïµ{¦¡¡Aµ{¦¡³]­pÀô¹Ò¡Aºô ¸ô¦øªA¾¹³nÅé¡A¥H¤Î´X¥G©Ò¦³§A·Q­nªºªF¦è¡C¤j³¡¥÷ªºµ{¦¡³£¥i¥H¾aPorts Collection¨ÓºÞ ²z¡C ¦ý¬O¦pªG§A·Q­n¨Ï¥ÎªºÀ³¥Îµ{¦¡¥u¯à¦b¬Y­Ó¯S©wªº§@·~¨t²Î¤W­±°õ¦æ ªº¸Ü¡A§A´N¤£¯à»´©ö¦a§â¥¦´«±¼¡A©ÎªÌ«ü±æ¦b FreeBSD ¤W¦³«Ü¬Û¦üªºÀ³¥Î µ{¦¡¤~¦³¾÷·|¡C¦pªG§A·Q­nªº¬O¤@­Ó±j°·ªº¿ì¤½«Ç©Î¬Oºô¸ô¦øªA¾¹¡A©Î¬O ¤@³¡Ã­©wªº¤u§@¯¸¡A©Î¬O·Q¦b¤£³Q¤¤Â_ªºÀô¹Ò¤U¤u§@ªº¸Ü¡AFreeBSD µLºÃ ¬O±zªº³Ì¨Î¿ï¾Ü¡C¥@¬É¦U¦a¦³«Ü¦h¨Ï¥ÎªÌ¡A¥]¬Aªì¾Ç©Î¸ê²`ªº &unix; ºÞ²z ¤H­û³£¿ï¥Î FreeBSD ·í¥L­Ì°ß¤@ªº®à¤W§@·~¨t²Î¡C ¦pªG§A¬O±q¨ä¥Lªº &unix; Àô¹ÒÂà´«¨ì FreeBSD ªº¸Ü¡A°ò¥»¤W¬O¤j¦P¤p ²§ªº¡C¦ý¬O¦pªG§A¤§«e¥Îªº¬O¹Ï§Î¬É­±ªº§@·~¨t²Î¡A¨Ò¦p»¡¬O &windows; ©Î¬O ¤ñ¸û¥j¦Ñªº &macos; ªº¸Ü¡A¥i¯à´N­n¦hªá¤@ÂI®É¶¡¨Ó¾Ç²ß«ç»ò¥Î &unix; ªº ¤èªk¨Ó°µ¨Æ¡C§A¥i¥H±q³o¥÷ FAQ ©M FreeBSD ¨Ï¥Î¤â¥U ¨Ó¤Jªù¡C ¬°¤°»ò­n¥s°µ FreeBSD¡H ±z¥i¥H§K¶O¨Ï¥Î¥¦¡A§Y¨Ï¬O¥Î©ó°Ó·~¥Î³~¡C ¾ã­Ó FreeBSD §@·~¨t²Î§¹¾ãªº­ì©lµ{¦¡³£¥i¥H§K¶O¨ú±o¡A¦Ó¥B¤£ ºÞ¬O¦b¨Ï¥Î¡A´²§G©Î¬O¾ã¦X¶i¨ä¥Lµ{¦¡µ¥¦U¤è­±¤]¥u¨ü¨ì³Ì¤pªº­­ ¨î (¤£½×¬O§_¥Î©ó°Ó·~¥Î³~)¡C ¥ô¦ó¤H³£¥i¥H¦Û¥Ñ¦a§â¥L¹ï¨t²Îªº§ï¨}©Î¿ù»~­×¥¿ªºµ{¦¡½X¥[¤J source tree ¤§¤¤ (·íµM­n²Å¦X´X­Ó¥ý¨M±ø¥ó)¡C ¯S§O­È±oª`·Nªº¬O³o¸Ìªº free ¥X²{¤F¨â¦¸¡A¦Ó¥B¥¦­Ì ªº·N«ä¬O¤£¤@¼Ëªº¡G¤@ºØ¥Nªí §K¶O¡A¥t¤@ºØ¥Nªí ¦Û¥Ñ¡C±z¥i¥H®³ FreeBSD ¥h°µ¥ô¦ó±z·Q­n°µªº¨Æ¡A°£¤F¤@¨Ç ¨Ò¥~¡A¨Ò¦p±z«ÅºÙ FreeBSD ¬O±z¼gªº¡C FreeBSD ¤Î NetBSD, OpenBSD ¥H¤Î¨ä¥L open source BSD §@·~¨t²Î¤§¶¡¦³¦ó¤£¦P¤§³B©O¡H James Howard ¦b DaemonNews ¤W¼g¤F The BSD Family Tree ªº¤å¥ó¡A¸Ì­±»¡©ú¤F³o¨Ç¾ú¥v²W·½¤Î³o¨Ç *BSD ®a±Ú­pµe¤§¶¡ªº®t²§¡C ³Ì·sª©ªº FreeBSD ¬O¨º¤@ª©¡H ´N FreeBSD ¥Ø«eªºµo®i¦Ó¨¥¡A¦³¥|­Ó¥D­nµo®i¤À¤ä(¨ä¤¤¤T­Ó¤w¦³ RELEASE)¡G ¥Ñ 4-STABLE ©Òµo¦æ(release)ªº 4.X ¨t¦C¡B ¥Ñ 5-STABLE ©Òµo¦æ(release)ªº 5.X ¨t¦C¡B ¥Ñ 6-STABLE ©Òµo¦æ(release)ªº 6.X ¨t¦C¡A ¥H¤Î 7-CURRENT ¤À¤ä¡C - ¦b 5.3 release ¤§«e¡A4.X ¨t¦C¤´³Qµø¬°¬O -STABLE ¤§¤@¡C - ¦Û±q 5.3 ¶}©l¡A5.X ¶}©l³W¹º·sªº -STABLE µo®i­«ÂI¡A + ¦b 5.3 release ¤§«e¡A4.X ¨t¦C¤´ÄÝ -STABLE ¤À¤ä¡C + ¦Û±q 5.3 ¶}©l¡A5.X ¨t¦C¶}©l³W¹º·sªº -STABLE ¤À¤äµo®i­«ÂI¡A ¦Ó 4.X ±N¥uµÛ­«¦b­«¤j°ÝÃD¤W(¤ñ¦p¡Gº|¬}­×¸É¡B¦w¥þºûÅ@)¥H¤Î "extended support" ¡A¤£¦A·|¦³·sªº¬ð¯}©Êµo®i¡C - ©ó &rel.current.date; ©Òµo¦æªº©ó &rel.current.date; ©Òµo¦æªº &rel.current; - ª©¬O¥Ø«e³Ì·sªº 6-STABLE ª©¡F - ¦Ó©ó &rel2.current.date; ©Òµo¦æªº6-STABLE ¤À¤ä¡F + ¦Ó©ó &rel2.current.date; ©Òµo¦æªº &rel2.current; - ª©«h¬O¥Ø«e³Ì·sªº 5-STABLE ª©¡C + ª©«h¬O¥Ø«e³Ì·sªº 5-STABLE ¤À¤ä¡C ²³æªº»¡¡A-STABLE ªº¥D­n¶D¨D¹ï¶H¬O¹ï©ó í©w©Ê¤Î§CÅܲ§©Êªº»Ý¨D»·³Ó¹L¹ï³Ì·s -CURRENT snapshot ¤¤¯S§O·s¥\¯àªº»Ý¨D¡A¨Ò¦p ISP ©Î¤½¥q¦æ¸¹ªº¨Ï¥ÎªÌ¡C³o¨â­Ó branch ³£¦³¥i¯à·|²£¥Í release ª©¡A¦ý¥u¦³·í§A¯à±µ¨ü -CURRENT »·¤ñ -STABLE ®e©ö§ó°Ê³o¤@ÂI¡A¤~À³¸Ó¥Î -CURRENT¡C Release ª©¨C´X­Ó¤ë¤~·|µo ¦æ¤@¦¸¡CÁöµM¦p¦¹¡A¦³«Ü¦h¤H©M FreeBSD ­ì©l½X¦P¨B§ó·s¡]¸Ô¨£ FreeBSD-CURRENT ©M FreeBSD-STABLE ªº¬ÛÃö°ÝÃD)¡A¦ý¦]¬°­ì©l½X ¬O¤@ª½¤£Â_¦a¦bÅܰʪº¡A©Ò¥H¦pªG­n³o»ò°µªº¸Ü±o­nªá¤W§ó¦hªººë ¤O¡C ¨ä¥L§ó¦h¬ÛÃö FreeBSD µo¦æ±¡³ø¡A¥i¥Ñ FreeBSD ºô¯¸¤Wªº Release Engineering ±oª¾ ¤°»ò¬O FreeBSD-CURRENT¡H FreeBSD-CURRENT «üªº¬O¥¿¦bµo®i¤¤ªº§@·~¨t²Îª©¥»¡A¥¦²×±N¦b¾A·íªº®É¾÷¦¨¬° &os.stable; ¤À¤ä¡C¥¦¹ê¦b¬O¥u¾A¦Xµ¹¨t²Îµo®iªÌ¥H¤Î¦³¼Ý¤Oªº·~¾l·R¦nªÌ¨Ï¥Î ¡C¦pªG·Q­n±o¨ì¦³Ãö¦p¦ó¨Ï¥Î -CURRENT ªº²`¤J¸ê°T¡A½Ð°Ñ¦Ò ¨Ï¥Î¤â¥U ªº ¬ÛÃö³¡¥÷¡C ¦pªG±z¹ï§@·~¨t²Î¥»¨­¨Ã¤£¬O«Ü¼ô±x¡A©Î¬O±z¨S¿ìªk¤À¿ë±z¹J¨ìªº°Ý ÃD¬O¯uªºµo¥Í¤F°ÝÃD¥ç©Î¬O¼È®É©Êªº¤pª¬ªp¡A¨º»ò±z´N¤£À³¸Ó¨Ï¥Î FreeBSD-CURRENT¡C³o­Ó¤À¤äªºµ{¦¡½X¦³®É­ÔÅܰʱo«Ü§Ö¡A¦Ó¥B¥i¯à·|¦]¦¹ ¦Ó¨Ï±z¦³¦n´X¤Ñªº®É¶¡µLªk§ó·s±zªº¨t²Î¡C§Ú­Ì°²³]¨Ï¥Î FreeBSD-CURRENT ªº¨Ï¥ÎªÌ³£¦³¯à¤O¥h¤ÀªR¥L­Ì©Ò¹J¨ìªº°ÝÃD¨Ã¥B¥u¦^³ø ¯u¥¿ªº°ÝÃD¦Ó«D¤pª¬ªp¡C¦pªG±z¦b -CURRENT mailing list ¤¤´£¨ìÃþ¦ümake world ³y¦¨¤@¨Ç¦³Ãö groups ªº¿ù »~¤§Ãþªº°ÝÃDªº¸Ü¡A¤]³\·|³Q¨ä¥L¤H»´µø¡C §Ú­Ì¨C¤Ñ³£·|®Ú¾Ú¥Ø«e -CURRENT ©M -STABLE ªºª¬ªp¹ï³o¨â­Ó¤À¤ä¦U µo¦æ¤@­Ósnapshot ª©¡C¦³ªº®É­Ô¬Æ¦ÜÁÙ·|µo¦æ¥i¨Ñ¨ú±oªºª©¥»¡Cµoªí³o¨Ç snapshot ªº¥Øªº¦b©ó¡G ´ú¸Õ³Ì·sª©ªº¦w¸Ëµ{¦¡¡C ´£¨Ñ¤@­Ó²³æªº¤èªkµ¹¨º¨Ç³ßÅw¨Ï¥Î -CURRENT ©Î¬O -STABLE ¦ý ¬O¨S¦³®É¶¡©MÀW¼e¥h¨C¤Ñª@¯Åªº¨Ï¥ÎªÌ¡C ¬°¤F´À§Ú­Ìµo®i¤¤ªºµ{¦¡«O¯d¤@­Ó©T©wªº°Ñ¦ÒÂI¡A¥H¨¾¤î§Ú­Ì¥¼ ¨Ó³y¦¨¤£©¯¡C(ÁöµM¤@¯ë¦Ó¨¥ CVS ¥i¥H¨¾¤îÃþ¦ü³oºØªº¥i©È¨Æ¥ó :) ¬°¤F½T«O©Ò¦³»Ý­n´ú¸Õªº·s¥\¯à³£¥i¥H±o¨ì³Ì¦hªº´ú¸Õ¡C §Ú­Ì¤£¹ï -CURRENT snapshot °µ¥ô¦ó§Î¦¡ªº«~½è«O ÃÒ¡C¦pªG§A·Q­nªº¬O¤@­Óí©w¥B¸g¹L¥R¤À´ú¸Õ¹Lªº¨t²Îªº¸Ü¡A ³Ì¦n¿ï¾Ü¨Ï¥Î§¹¾ã release ªºª©¥»¡A©Î¬O¨Ï¥Î -STABLE snapshots¡C ±z¥i¥Hª½±µ±q ftp://current.FreeBSD.org/pub/FreeBSD/snapshots/ ¨ú±o -CURRENT ªº snapshot release ¹ï¨C­Ó¦³¦b¬¡°Êªº¤À¤ä¦Ó¨¥¡A¥­§¡¨C¤Ñ³£·|²£¥Í¤@¦¸ snapshots¡C ¤°»ò¬O FreeBSD-STABLE¡H ¦^·¹¨ì FreeBSD 2.0.5 ­èµoªíªº®É­Ô¡A§Ú­Ì¨M©w§â FreeBSD ªºµo®i ¤À¦¨¨â¤ä¡C¤@¤ä¥s°µ -STABLE ¡A§Ú­Ì¥u¹ï¥¦°µ¿ù»~­×¥¿¤Î¤p´T«×ªº­×§ï (³o¬Oµ¹ ISP ©M°Ó·~¤½¥qµ¥¡A¹ï¹êÅ礤¥\¯à¤£·P¿³½ìªº³æ¦ì©Ò¨Ï¥Îªº)¡C ¥t¥~¤@¤ä¥s°µ -CURRENT¡A±q 2.0 ª©µo¦æ¥H«á¡A´N¤£Â_¦a´ÂµÛ 6.0-RELEASE (§t«áÄòªºª©¥»)«e¶iµÛ¡C 6-STABLE ¤À¤ä¬O±q 6.0-RELEASE ¶}©l(5-STABLE ¤À¤äºâ¬O 5.3-RELEASE ¤§«á¤~¶}©lªº)¡A µM«á­ì¥»ªº &os.current; ´N·|¦¨¬° 7-CURRENT¡C ¤U­±´N¬Oª©¥»ºt¶iªº¥Ü·N¹Ï¡G 2.0 | | | [2.1-STABLE] *BRANCH* 2.0.5 -> 2.1 -> 2.1.5 -> 2.1.6 -> 2.1.7.1 [2.1-STABLE ends] | (Mar 1997) | | | [2.2-STABLE] *BRANCH* 2.2.1 -> 2.2.2-RELEASE -> 2.2.5 -> 2.2.6 -> 2.2.7 -> 2.2.8 [end] | (Mar 1997) (Oct 97) (Apr 98) (Jul 98) (Dec 98) | | 3.0-SNAPs (started Q1 1997) | | 3.0-RELEASE (Oct 1998) | | [3.0-STABLE] *BRANCH* 3.1-RELEASE (Feb 1999) -> 3.2 -> 3.3 -> 3.4 -> 3.5 -> 3.5.1 | (May 1999) (Sep 1999) (Dec 1999) (June 2000) (July 2000) | | [4.0-STABLE] *BRANCH* 4.0 (Mar 2000) -> 4.1 -> 4.1.1 -> 4.2 -> 4.3 -> 4.4 -> ... -> 4.11 | | (July 2000) (Sep 2000) (Nov 2000) (Jan 2005) | | [5.0-STABLE] *BRANCH* 5.0 (2001) -> 5.1 -> 5.2 -> 5.3 -> 5.4 -> ... future 5.x releases... | | ( 2001) (Nov 2004) (May 2005) | | [6.0-STABLE] *BRANCH* 6.0 (Nov 2005) ... future 6.x releases... | \|/ + [7.0-CURRENT continues] 2.2-STABLE ³o­Ó¤À¤äÀHµÛ 2.2.8 ªºµoªí¦Ó¥\¦¨¨­°h¡C3-STABLE ³o­Ó ¤À¤ä«h¬Oµ²§ô¦b 3.5.1 µoªí¤§«á¡A¥¦¤]¬O 3.X ªº³Ì«á¤@¦¸µoªí¡C¤§«á°£¤F ¦w¥þ¬ÛÃöªº­×¥¿¤§¥~¡A³o¨â­Ó¤À¤ä´N´X¥G¨S¦³¦A§ó°Ê¹L¡C4-STABLE ¤À¤äªº¤ä´© ·|«ùÄò¨ì 2007/01/31¡A¦ý¥D­nµJÂI¦b©ó¦w¥þ¤è­±ªºº|¬}¡B¯äÂΤΨä¥LÄY­«°ÝÃDªº­×¸É¡C 5-STABLE ¬O¥Ø«e¥¿¦bµo®i¤¤ªº -STABLE ¤À¤ä¡C5-STABLE ªº³Ì·sªº¤@ ¦¸µoªí¬O¦b &rel2.current.date; µo¦æªº &rel2.current;-RELEASE¡C 6-STABLE ¬O¥Ø«e¥¿¦bµo®i¤¤ªº -STABLE ¤À¤ä¡C6-STABLE ªº³Ì·sªº¤@ ¦¸µoªí¬O¦b &rel.current.date; µo¦æªº &rel.current;-RELEASE¡C 7-CURRENT ³o­Ó¤À¤ä¬O &os; ªº -CURRENT ¤À¤ä¡A¤´µM¤£Â_¦a¦bµo®i·í¤¤¡C ¦pªG·Q­nª¾¹D§ó¦hÃö©ó³o­Ó¤À¤äªº¸ê°Tªº¸Ü¡A½Ð°Ñ¦Ò ¤°»ò¬O &os;-CURRENT¡H¡C ¨C¦¸·sªº FreeBSD ±N©ó¤°»ò®É­Ô±À¥X¡H ¤@¯ë¦Ó¨¥¡A&a.re; ¥­§¡¨C¥|­Ó¤ëµo¦æ¤@¦¸ release¡A¨C¦¸·sª©¥»ªºµoªí®Éµ{³£·|¨Æ¥ý¤½§i¡A ¬ÛÃöªº¶}µo¤H­û´N·|ª¾¹D¡A¤°»ò®É­Ô¸Ó¥ý§â¤âÃ䪺­p¹º§¹¦¨¨Ã¥B´ú¸Õ¹L¡A ¦¹¥~¡A³o¨Ç§ó°Ê³£¤w¸g§¹¾ã¦a´ú¸Õ¹L¡A¥B¤£·|¼vÅT¨t²Îí©w«×¡C ÁöµM¡Aµ¥³o¨Ç¦nªF¦è¶i¤J -STABLE ªº®É¶¡¥O¤Hµ¥±o¦³¨Ç¤£­@·Ð¡A ¦ý¬O¤j¦h¼Æªº¨Ï¥ÎªÌ³£»{¬°³oºØÂÔ·VªººA«×¬O FreeBSD ³Ì¦nªºÀuÂI¤§¤@¡C ¦³Ãöµo¦æ±¡³øªº§ó¦h²Ó¸`³¡¤À(¥]¬A release ªº¦æµ{ªí¡B¶i«×)¡A³£¥i¦b FreeBSD ºô¯¸¤Wªº µo¦æ±¡³ø ¤W­±Àò±o¡C ¬°¤Fº¡¨¬¨º¨Ç»Ý­n (©Î·Q­n) ·sÂA¨ë¿E·Pªº¨Ï¥ÎªÌ¡A ¤W­±(-CURRENTªº³¡¤À)¤w¸g´£¨ì§Ú­Ì¨C¤Ñ³£·|µo¦æ snapshots ª©¥i¨Ñ¨Ï¥Î¡C ½Ö­t³d FreeBSD ªºµo®i¡H ¦pªG¬O¤@¨Ç¦³Ãö FreeBSD ­pµeªºÃöÁä©Ê¨M©w¡A¹³¬O¾ã­Ó­pµeªº¨«¦V ©Î¬O¨M©w½Ö¥i¥H§ï source tree ¸Ìªºµ{¦¡½X³oÃþªº¨Æ¡A¬O¥Ñ¤@­Ó¥Ñ 9 ­Ó ¤H©Ò²Õ¦¨ªº core team ¨Ó¨M©w¡C¦Ó¦³¥t¤@¸s¶W¹L 300 ­Ó¤Hªº commiters ¦³Åv§Q¥i¥Hª½±µ­×§ï FreeBSD ªº source tree¡C µL½×¦p¦ó¡A¤j¦h¼Æªº§ïÅܳ£·|¨Æ«e¦b mailing lists ¥ý°Q½×¹L¡A¦Ó¥B¤£¤À¨¤¦â¡A¨C­Ó¤H³£¥i¥H°Ñ»P°Q½×¡C §Ú­n¦p¦ó¨ú±o FreeBSD¡H ¨C­Ó FreeBSD ªº­«­nª©¥»³£¥i¥H¸g¥Ñ°Î¦W ftp ±q FreeBSD FTP ¯¸¨ú±o¡G ¦pªG»Ý­n 6-STABLE ªº³Ì·sª©¡A¤]´N¬O &rel.current;-RELEASE¡A½Ð¨ì &rel.current;-RELEASE ³o­Ó¥Ø¿ý 7-CURRENT Snapshot ³q±`¤]¬O¨C¤Ñ³£·|°µ¤@¥÷¡A³o¬O±q -CURRENT ¤À¤ä°µ¥X¨Óªº¡A ¥D­n¬O¬°¤F´£¨Ñµ¹¨º¨Ç¼ö¤ßªº´ú¸ÕªÌ©M¶}µo¤H­û¡C ¦pªG»Ý­n 5-STABLE ªº³Ì·sª©¡A¤]´N¬O &rel2.current;-RELEASE¡A½Ð¨ì &rel2.current;-RELEASE ³o­Ó¥Ø¿ý ¦pªG»Ý­n 4-STABLE ªº³Ì·sª©¡A¤]´N¬O 4.11-RELEASE¡A½Ð¨ì 4.11-RELEASE ³o­Ó¥Ø¿ý 4.X¡B5.X¡B6X snapshots ³q±`¨C¤Ñ³£·|°µ¤@¥÷¡C FreeBSD ªº CD¡BDVD¡AÁÙ¦³¨ä¥L¨ú±o¤è¦¡¥i¥H¦b ¨Ï¥Î¤â¥U ¤¤§ä¨ì¸Ñµª¡C - - - «ç»ò«Ø¥ß FreeBSD ªº¬M®g(mirror)¯¸¥x¡H - - - - ¦³Ãö¦p¦ó«Ø¥ß FreeBSD ¬M®g¯¸(mirror)ªº¸ê®Æ¡A¥i¥H°Ñ¦Ò Mirroring FreeBSD ¤å³¹ - - - §Ú­n¦p¦ó¥h¬d¸ß¡B´£¥æ°ÝÃD¦^³ø(Problem Report¡A²ºÙPR)¸ê®Æ®w©O¡H ©Ò¦³¨Ï¥ÎªÌªºÅܧó­n¨D³£¥i¥H¸g¥Ñºô­¶¤¶­±ªº PR¬d¸ß¤¶­± ¨Ó¹î¬Ý (©Î¬O¦^³ø) §Ú­Ìªº¿ù»~¦^³ø¸ê®Æ®w¡C ¤]¥i¥H¨Ï¥Î &man.send-pr.1; ³o­Ó«ü¥O³z¹L¹q¤l¶l¥ó¨Ó¦^³ø°ÝÃD¡B­n¨DÅܧó¡C ©ÎªÌ¬O¸g¥Ñ ºô­¶¤¶­±ªº PR ¨Ó°e¥X°ÝÃD¦^³ø¡C µM¦Ó¡A¦b±z¦^³ø°ÝÃD¤§«e¡A½Ð¥ý¾\Ū ¦p¦ó¼¶¼g FreeBSD ªº°ÝÃD¦^³ø³æ¡A³o¬O¤@½g§i¶D§A«ç¼Ë¤~¯à¼g¥X¤@½g¯u¥¿¦³¥Îªº °ÝÃD¦^³ø³æ¡C - - - ­n«ç¼Ë¤~¯à¦¨¬° FreeBSD ªººô­¶¬M®g(mirror)¯¸¥x¡H - - - - ¦³«Ü¦h¤èªk¥i¥H¬M®g(mirror)§Ú­Ìªººô­¶¡C - - - - ±z¥i¥H§Q¥Î net/cvsup - ±q cvsup.FreeBSD.org ¨ú±o®æ¦¡¤Æ¹LªºÀɮסC - /usr/share/examples/cvsup/www-supfile - ³oÀÉ´N¬O¤@­Ó±Ð§A«ç¼Ë°µºô­¶¬M®gªº CVSup ³]©w½d¨Ò¡C - - - - - ±z¥i¥H§Q¥Î±z³ßÅwªº ftp mirror ¤u¨ã±q FreeBSD ªº FTP ¯¸»O - ¤¤¨ú±oºô­¶ªº­ì©l½X¡C¦ý¬O­nª`·Nªº¬O¦b§A¥´ºâ´£¨Ñ¤½¶}ªA°È¤§«e¡A - °O±o­n¥ý§Q¥Î³o¨Ç­ì©l½X§âºô­¶­««Ø°_¨Ó¡C½Ð±q ¶}©l§ì¨ú¡C - - - - - ÁÙ¦³¨ä¥L¦³Ãö FreeBSD ªº¸ê°T¶Ü¡H ¸Ô¨£ FreeBSD ºô¯¸¤Wªº ¤å¥ó ¦Cªí¡C
Chin-San Huang
chinsan.tw@gmail.com
¤å¥ó»P¤ä´© Ãö©ó FreeBSD ¦³­þ¨Ç¦n®Ñ¥i¥H±ÀÂ˾\Ūªº¶Ü¡H FreeBSD ¤å¥ó­pµe¤w³°Äòµoªí¤F¬Û·í¼sªx½d³òªº¤å¥ó¡A¥i¦b ¨ú±o¡C¥t¥~¡A FreeBSD ¥»¨­ªº manual(¤@¯ë³qºÙªºman)¡Bdoc¤]¦p¦P®M¥ó³nÅé¤@¼Ë¡A¥i¥H»´ÃP¦a¸Ë¦b±z¨t²Î¤W¡C ¦¹¥~¡A¤]«ØÄ³°Ñ¾\¥»¥÷ FAQ ³Ì«á©Ò¦Cªº°Ñ¦Ò®Ñ¥Øªí(Bibliography)»P FreeBSD ¨Ï¥Î¤â¥U¡C ³o¨Ç¤å¥ó¦³¨ä¥L®æ¦¡ªº¶Ü¡H¹³¬O¡G¯Â¤å¦r(ASCII)©Î &postscript; ¤§Ãþªº®æ¦¡¡H ¦³ªº¡C³o¨Ç¤å¥ó³£¤À§O¥H¤£¦P®æ¦¡Àx¦s¥H¤ÎÀ£ÁY³B²z¡A©ñ¦b FTP ¤W­±¡A¥i¥H±q¦U FreeBSD FTP ¯¸ªº /pub/FreeBSD/doc/ ¥Ø¿ý¤º§ä¨ì§A­nªº¡C ¤å¥óªº¤ÀÃþ¤è­±¥D­n¬O¤@¨Ç¤£¦P©Ê½è©Ò²Õ¦¨¡G ¤å¥ó¦WºÙ¡A¤ñ¦p¡Gfaq(±`¨£°Ýµª¶°)©Î¬O handbook(FreeBSD ¨Ï¥Î¤â¥U)µ¥µ¥¡C ¦U°ê½Ķªºªº¤å¥ó¡G³o¥D­n¬O¥Ñ locale ¦WºÙ¨Ó¨M©wªº (¤£²M·¡ªº¸Ü¡A¥i°Ñ¦Ò±zªº FreeBSD §@·~¨t²Î¤Wªº /usr/share/locale) ¥Ø«e¤å¥óÁ`¦@¦³¤U¦C´XºØ»y¨¥(¤Î½s½X)¦³Â½Ä¶¡G Locale ¦WºÙ »¡©ú(©Ò¥Nªíªº»y¨t¡B½s½X) en_US.ISO8859-1 ¬ü¦¡­^¤å(US English) de_DE.ISO8859-1 ¼w¤å(German) es_ES.ISO8859-1 ¦è¯Z¤ú¤å(Spanish) fr_FR.ISO8859-1 ªk¤å(French) it_IT.ISO8859-15 ¸q¤j§Q¤å(Italian) ja_JP.eucJP ¤é¤å(Japanese¡A½s½X¤è¦¡¡GEUC) ru_RU.KOI8-R «X¤å(Russian¡A½s½X¤è¦¡¡GKOI8-R) zh_TW.Big5 ¥¿Å餤¤å(Chinese¡A½s½X¤è¦¡¡GBig5) ¤W¦Cªº¦U°ê½Ķ»y¨t¤å¥ó¤¤¡A¨Ã«D©Ò¦³¤å¥ó³£¦³Â½Ä¶¡C ¤å¥óªº®æ¦¡¡G¨C¥÷¤å¥ó³£¥H¦UºØ¤£¦P®æ¦¡Àx¦s¡A¨CºØ®æ¦¡³£¦U¦³¦nÃa¡A ¦³¨Ç®æ¦¡¾A¦X½u¤W¾\Ū¡A¦Ó¦³¨Ç«h¾A¦X¦C¦L¥X¬üÆ[ªº¤å¥ó¡C §Ú­Ì³£´£¨Ñ³o¨Ç¤£¦P®æ¦¡ªº¤å¥ó¡A¨Ó½T«OµL½×¬O¿Ã¹õ¤W¡B¦C¦L¯È¥»¡A¨C­Ó¤H³£¥i¥H¥¿±`¦a¾\Ū¤º®e¡A ¥Ø«e¥i¨Ñ¨Ï¥Îªº®æ¦¡¦p¤U: ®æ¦¡ »¡©ú html-split ³¹¸`¼Ò¦¡ html §¹¾ã¼Ò¦¡ pdb Palm Pilot ¸ê®Æ®æ¦¡¡A¨Ï¥Î iSilo µ{¦¡¨Ó¾\Ū pdf Adobe's PDF ®æ¦¡ ps &postscript; ®æ¦¡ rtf Microsoft's RTF®æ¦¡ ·í¨Ï¥Î MS Word ¨Ó¶}±Ò RTF ®æ¦¡ªº¸Ü¡A­¶¼ÆÅã¥Ü¨Ã¤£·|¦Û°Ê§ó·s¡C (¦b¶}±Ò¤å¥ó«á¡A­n«ö CTRLA, CTRLEND, F9¡A³o¼Ë¤l¤~·|§ó·s­¶¼ÆªºÅã¥Ü¡C) txt ¯Â¤å¦r(ASCII) ¤å¥óªºÀ£ÁY¡B¥´¥]¤è¦¡¡G¥Ø«e¦³¤TºØ¤è¦¡¡G ·í±Ä¥Î ³¹¸`¼Ò¦¡(html-split)¡A³¹¸`¼Ò¦¡©Ò²£¥Íªº¦UÀÉ®×·|¥ý¨Ï¥Î &man.tar.1; ¨ÓÀ£ÁY¡CÀɦWµ²§À¦³ .tar ªºÀÉ®×´N¬O tar ®æ¦¡¡C ±µµÛ¡A·|¦A¥H¤U¦C¤è¦¡¦AÀ£ÁY¡C ¨ä¥L®æ¦¡ªºÀɮ׳£·|¬O³æ¤@ÀɮסAÀɦW³q±`·|¬O¡G book.®æ¦¡ (Á|¨Ò¡G book.pdb¡A book.html µ¥µ¥..«á­±³q±`¥[¤W¡y.®æ¦¡¡z). ¦Ó³o¨ÇÀÉ®×·|¤À§O¥H¨âºØÀ£ÁY«¬ºA¶i¦æÀ£ÁY¡A¦Ó¦s¦¨¨âºØÀ£ÁY«¬ºA¡C ®æ¦¡ »¡©ú zip Zip ®æ¦¡¡A­Y­n¦b FreeBSD ¤W¸ÑÀ£ zip ÀÉ¡A«h¥²¶·¥ý¦w¸Ë chinese/unzip ©Î archivers/unzip¡C bz2 BZip2 ®æ¦¡¡AÁöµM¤£¦p zip ®æ¦¡ªº¼sªx¨Ï¥Î¡A¦ý¬O¦n³B¦b©ó¥iÀ£ÁY¦¨§ó¤pªºÀɮסC ­n¸ÑÀ£ bz2 ®æ¦¡ªº¸Ü¡A»Ý¥ý¦w¸Ë archivers/bzip2 ¡C ©Ò¥H¹³¬O Handbook ªº &postscript; ª©®æ¦¡¡A·|¥H BZip2 ®æ¦¡À£ÁY¡A ¦s©ñ¦b handbook/ ¥Ø¿ý¤º¡A ÀɦW´N¬Obook.ps.bz2¡C ¿ï¾Ü·Q­n¤U¸üªº¤å¥ó®æ¦¡»PÀ£ÁY«¬ºA¤§«á¡A«h­n¨M©w¬O§_¥H FreeBSD ®M¥ó(package) «¬ºA¨Ó¤U¸ü¡C ¤U¸ü¡B¦w¸Ë¡ypackage¡zªº¦n³B¦b©ó¡G¥i¥H³z¹L¤@¯ë FreeBSD ®M¥óºÞ²z¤è¦¡¨Ó¶i¦æºÞ²z¡A¤ñ¦p &man.pkg.add.1; ¤Î &man.pkg.delete.1;¡C ­Y¨M©w¦n­n¤U¸ü¡B¦w¸Ë¡ypackage¡zªº¸Ü¡A¥²¶·­n½T»{©Ò­n¤U¸üªºÀɦW¡C ¤å¥ó­pµeªº®M¥ó(package)³q±`¬O©ñ¦b¬O packages ªº¥Ø¿ý¤º¡A ¨C­Ó¤å¥ó­pµeªº®M¥óÀɦW³q±`¬O¡G ¤å¥ó¦WºÙ.»y¨t.½s½X.®æ¦¡.tgz ¡C Á|­Ó¨Ò¤l¡A­^¤åª©ªº FAQ (®æ¦¡¿ï¾Ü PDF)¦b package ´N¥s°µ faq.en_US.ISO8859-1.pdf.tgz¡C ¦AÁ|­Ó¨Ò¤l¡A¤¤¤åª©ªº FAQ (®æ¦¡¿ï¾Ü PDF)¦b package ´N¥s°µ faq.zh_TW.Big5.pdf.tgz¡C ª¾¹D³oÂI¤§«á¡A´N¥i¥H¥Î¤U­±«ü¥O¨Ó¦w¸Ë¤¤¤åª© FAQ ®M¥ó¡G &prompt.root; pkg_add ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/packages/faq.zh_TW.Big5.pdf.tgz §¹¦¨¤§«á¡A¥i¥H¥Î &man.pkg.info.1; ¨Ó§ä¥XÀɮ׸˦b­þÃä¡G &prompt.root; pkg_info -f faq.zh_TW.Big5.pdf Information for faq.zh_TW.Big5.pdf: Packing list: Package name: faq.zh_TW.Big5.pdf CWD to /usr/share/doc/zh_TW.Big5/books/faq File: book.pdf CWD to . File: +COMMENT (ignored) File: +DESC (ignored) ¦p¦P±z©Ò¬Ý¨ìªº book.pdf ·|³Q¦w¸Ë¨ì /usr/share/doc/zh_TW.Big5/books/faq ¤º¡C ­Y¤£·Q¥Î package ¤è¦¡¦w¸Ë¡A¨º»ò´N»Ý¤â°Ê¤U¸ü¡B¸ÑÀ£ÁY¡B½Æ»s¨ì§A·Q­nÂ\©ñªº¦ì¸m¥h¡C Á|¨Ò¡A³¹¸`¼Ò¦¡(split HTML)ª©ªº­^¤å FAQ (À£ÁY¬° &man.bzip2.1;)·|©ñ¦b doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2 ­n¤U¸ü¡B¸ÑÀ£ªº¸Ü¡A«h­n¥´¡G &prompt.root; fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2 &prompt.root; bzip2 -d book.html-split.tar.bz2 &prompt.root; tar xvf book.html-split.tar ³o®É§A·|¬Ý¨ì¤@°ï .html ªºÀɮסA ¥D­nªº¥Ø¿ýÀɬ° index.html ¤º§t¥D¥Ø¿ý¤Î³sµ²¨ì¨ä¥L¤å¥ó¡C(­Y¦³»Ý­nªº¸Ü¡A¤]¥i¥H½Æ»s©Î·h²¾³o¨ÇÀɮרì¦P¤@¥Ø¿ý¤U) ­þ¸Ì¦³Ãö©ó FreeBSD ªº¶l»¼½×¾Â(mailing lists)©O¡H ³o­Ó°ÝÃD¡A¥i¥H±q FreeBSD ¨Ï¥Î¤â¥U¤W­±ªº ¶l»¼½×¾Â(mailing-lists) ³¡¤ÀÀò±oµª®×¡C - - - §Ú¸Ó±q­þÃä±o¨ì¦³Ãö FreeBSD ¦b¤dÁHÂÎ(Y2K)¤è­±ªº¸ê®Æ©O? - - - - ³oµª®×¥i¥H¦b FreeBSD ¤dÁHÂÎ(Y2K)¤W­±Àò±o - - - ¦³­þ¨Ç¥i¥H¨Ï¥Îªº FreeBSD ·s»D¸s²Õ(news groups)©O? ³oµª®×¥i¥H±q FreeBSD ¨Ï¥Î¤â¥U¤W­±ªº ·s»D¸s²Õ(newsgroups) ³¡¤ÀÀò±oµª®×¡C ¦³­þ¨Ç FreeBSD IRC (Internet Relay Chat)ÀW¹D©O¡H ¦³ªº¡A¤j³¡¤Àªº IRC ¥D¾÷³£¦³ FreeBSD ²á¤ÑÀW¹D¡G EFNet ªº - #FreeBSD ÀW¹D - is a FreeBSD forum, but do not go there for tech - support or try to get folks there to help you avoid - the pain of reading manual pages or doing your own research. - It is a chat channel, first and foremost, and topics there - are just as likely to involve sex, sports or nuclear - weapons as they are FreeBSD. You Have Been Warned! - Available at server irc.chat.org. + #FreeBSD ÀW¹D¬O­Ó FreeBSD ½×¾Â¡A + ¦ý¥i¤£¾A¦X¨º¨Ç·Q¤£³Ò¦ÓÀò©ÎªÌ·h±Ï§L¥Îªº¡C + ³o¸Ì¬O²á¤Ñ¥ÎªºÀW¹D¡A¸ÜÃD½d³ò¬Æ¦Ü¯A¤Î¡y©Ê¡B¹B°Ê¡B®ÖªZ¡zµ¥¡A + ½Ðª`·N¡G§Ú­Ì¤w¸gĵ§i¹L§A¤F¡I¥»ÀW¹D¥i¸g¥Ñ irc.chat.org ¶i¤J¡C - Channel #FreeBSDhelp on - EFNet - is a channel dedicated to helping FreeBSD users. They - are much more sympathetic to questions than - #FreeBSD is. + EFNet ªº + #FreeBSDhelp ÀW¹D ¤D¬Oµ¹ FreeBSD ¨Ï¥ÎªÌ¤§¶¡¥æ¬yªº¡A + ¨Ó³o¸Ì´£°Ý·|¤ñ #FreeBSD ¦n¤@¨Ç¡A·íµM½Ð¤£­n¤@ªÑ¸£ÀH«K¶Ã°Ý¡C - Channel #FreeBSD on - DALNET - is available at irc.dal.net in the - US and irc.eu.dal.net in Europe. + DALNET ªº + #FreeBSD ÀW¹D¡A¥i¥Ñ irc.dal.net(¦ì©ó¬ü°ê)¤Î + irc.eu.dal.net(¦ì©ó¼Ú¬w)¶i¤J¡C - Channel #FreeBSDHelp on - DALNET - is available at irc.dal.net in the - US and irc.eu.dal.net in Europe. - The channel owners also have a web page with useful - information about the channel and &os;, available at + DALNET ªº + #FreeBSDHelp ÀW¹D¡A¥i¥Ñ irc.dal.net(¦ì©ó¬ü°ê)¤Î + irc.eu.dal.net(¦ì©ó¼Ú¬w)¶i¤J¡C + ¥»ÀW¹Dªº¥D«ùªÌ¦³«Ø¥ß¦³Ãö¸ÓÀW¹D»P &os; ªººô­¶¡A¦b . - Channel #FreeBSD on - UNDERNET - is available at us.undernet.org - in the US and eu.undernet.org in Europe. - Since it is a help channel, be prepared to read the - documents you are referred to. + UNDERNET ªº + #FreeBSD ÀW¹D¡A¥i¥Ñ us.undernet.org(¦ì©ó¬ü°ê)¤Î + eu.undernet.org(¦ì©ó¼Ú¬w)¶i¤J¡C¥Ñ©ó³o¬O­Ó»²§U·s¤â¥ÎªºÀW¹D¡A + ½Ð°O±o¾\Ū§O¤H¦V§A´£¤Îªº³sµ²©ÎÀɮסC - Channel #FreeBSD on - RUSNET - is a russian-language oriented channel dedicated - to helping &os; users. This is also good place - for non-technical discussions. + RUSNET ªº + #FreeBSD ÀW¹D¬O«X»y°ê®aªº &os; ¨Ï¥ÎªÌÀW¹D¡C + ³o¸Ì¦P®É¤]¬O¤@¯ë¥æ¬yªº°Q½×¦n¥h³B¡C + + + + freebsd-gnome ªº + #FreeBSD ÀW¹D¡A¥i¥Ñ irc.freenode.net ¶i¤J¡A + ³o¬O Gnome ªº &os; ¨Ï¥ÎªÌÀW¹D¡C + + + + IRCNet ªº + #BSDChat ÀW¹D¡A¥i¥Ñ irc.seed.net.tw ©Î + irc.csie.nctu.edu.tw ©Î irc.tw.freebsd.org ¶i¤J + ³o¬O¥xÆWªº &os; ¨Ï¥ÎªÌÀW¹D¡C - Each of these channels are distinct and are not - connected to each other. Their chat styles also differ, - so you may need to try each to find one suited to your - chat style. As with all types of IRC - traffic, if you are easily offended or cannot deal with - lots of young people (and more than a few older ones) - doing the verbal equivalent of jello wrestling, do not - even bother with it. + ¤W­z¨C­ÓÀW¹D³£¤£¤@¼Ë¡A­·®æ­~²§¦Ó¦U¨ã¯S¦â¡A¥B¨Ã¨S¦³¬Û³s¡A + ¦]¦¹¡A§A±o¦h¤è¹Á¸Õ¤~¯à§ä¨ì¾A¦X¦Û¤vªºÀW¹D¡C¦Ó¦³¨Ç¦a¤è»P©Ò¦³ªº IRC ¤å¤ÆÃþ¦ü¡A + ´N¬O½Ðª`·N¦Û¤v¨¥¦æ¬O§_«ê·í¡A¥t¥~¥i¯à¸òÀW¹D¤º¤@¨Ç¦~»´/¦Ñ¤@½úªº¡A·|¦³¨Ç¥N·¾»Ý­n¾AÀ³¡C ¥i¥H±q­þÃäÀò±o FreeBSD ªº°Ó·~½Òµ{°V½m¤Î§Þ³N¤ä´©©O¡H DaemonNews ¦³±Mªù´£¨Ñ FreeBSD ªº°Ó·~½Òµ{°V½m¤Î§Þ³N¤ä´©¡C ¸Ô±¡½Ð¨ì BSD Mall ¹î¬Ý¡AÁÂÁ¡C FreeBSD Mall ¦³´£¨Ñ°Ó·~¤Æªº BSD §Þ³N¤ä´©¡A ¸Ô±¡½Ð¨ì FreeBSD Mall ¹î¬Ý¡AÁÂÁ¡C ¨ä¥L¥ô¦ó¦³´£¨Ñ½Òµ{°V½m¤Î§Þ³N¤ä´©ªº²Õ´¡B³æ¦ì¡A­Y¤]·Q¦Cªí©ó¦¹ªº¸Ü¡A ½Ð»P &a.doc; Ápµ¸¡AÁÂÁ¡C
Nik Clayton
nik@FreeBSD.org
¦w¸Ë ­Y­n¥Î³nºÐ¤ù¶}¾÷¨Ó¦w¸Ë FreeBSD ªº¸Ü¡A­n¤U¸ü­þ¨ÇÀɮשO¡H &os; 4.X ªº¸Ü¡A»Ý­n¨â­Ó image ÀÉ¡G floppies/kernel.flp ¤Î floppies/mfsroot.flp¡Cimage ÀÉ¥²¶·¥Î¤u¨ã¹³¬O fdimage ©Î &man.dd.1; ¨Ó¶Ç°e¨ìºÏ¤ù¤W¡C ­Y¬O¦b &os; 5.3 (¤Î¤§«áª©¥»)¦³­«·s³W¹º¶}¾÷¤ù¬[ºc¡A©Ò¥H­n§ìªº¬O floppies/boot.flp ¥H¤Î floppies/kernX ÀÉ®×(¥Ø«e X ¬° 1 ¸ò 2 ¨â­Ó¡A¥[¤W floppies/boot.flp¡AÁ`¦@¬O 3 ­ÓÀÉ®×)¡C ­Y·Q¦Û¤v¤U¸ü distributions ªº¸Ü(¤ñ¦p¥H &ms-dos; Àɮרt²Î®æ¦¡¦w¸Ë)¡A ¥H¤U¬O«ØÄ³­n§ìªº distributions ¡G base/ (4.X ª©¥»«h¬° bin/) manpages/ compat*/ doc/ src/ssys.* §¹¾ã¦w¸Ë¨BÆJ¥H¤Î¤j³¡¤Àªº¦w¸Ë°ÝÃD¡A½Ð°Ñ¾\ FreeBSD ¨Ï¥Î¤â¥Uªº ¦w¸Ë FreeBSD ³¹¸` ­YºÏ¤ù¸Ë¤£¤U image Àɪº¸Ü¡A¸Ó«ç»ò¿ì©O¡H ¤@±i 3.5 ­^¦T(1.44MB) ªººÏºÐ¤ù¬O¥i¥H¸Ë¤W 1474560 bytes ªº¸ê®Æ ¡A¦Ó¶}¾÷¤ùªº image Àɮפj¤p¹ê»Ú¤W¤]¬O 1474560 bytes¡C ¦b»s§@¶}¾÷¤ù®É¡A±`¨£¿ù»~¦³¡G ¨Ï¥Î FTP ¨Ó¤U¸üÀɮ׮ɡA ¥¼¿ï¾Ü binary ¶Ç¿é¼Ò¦¡¨Ó¤U¸ü¡C ¦³¨Ç FTP clientºÝµ{¦¡¡A¬O¹w³]±N¶Ç¿é¼Ò¦¡³]©w¬° ascii ¼Ò¦¡¡A¦Ó¥B·|­×§ï±µ¦¬¨ìªºÀɮצæ§À¦r¦ê¬° client ºÝªº§@·~¨t²Î¤è¦¡ ¡A¤ñ¦p newline(&unix;®æ¦¡) ¨ì¤F§@·~¨t²Î¬° &windows; ªº client ºÝ·|³Q§ï¬° CR-LF(&ms-dos;®æ¦¡)¡A ³o·|¨Ï±o image ÀÉ¥»¨­¾D¨ì­×§ï¦ÓµLªk¥¿±`¨Ï¥Î¡C¦]¦¹¡A¦pªG¤U¸üªº image Àɮפj¤p­Y»P FTP ¥D¾÷¤W­±ªºÀɮסy¤£¤@­P¡z ªº¸Ü¡A½Ð­«·s¨Ï¥Î binary ¶Ç¿é¼Ò¦¡¤U¸ü§Y¥i¡C FTP «ü¥O: ¶i¤J FTP ¤§«á¡A¥´ binary «ü¥O¡A§Y¥i¤Á´«¨ì binary ¶Ç¿é¼Ò¦¡¡AµM«á¦A¤U¸ü¬ÛÃö image ÀɮסC ª½±µ¥Î &ms-dos; ªº copy «ü¥O(©ÎÃþ¦ü ªº GUI µ{¦¡¡B©Î¬Oµøµ¡¤Wª½±µ½Æ»s)¨Ó½Æ»s¶}¾÷¥Îªº image ÀɨìºÏ¤ù¤W¡C ¤£¥i¥H¥Î¹³¬O copy ³oÃþµ{¦¡ª½±µ±N image Àɽƻs¨ìºÏ¤ù¤W¡A¦]¬° image ÀÉ¥»¨­¥]§t¤F§¹¾ãªººÏ­y¸ê®Æ¡A©Ò¥H¤£¯à³æ¯Â¥Î½Æ»s¤è¦¡¡A ¦Ó¥²¶·¨Ï¥Î§C¶¥¤u¨ãµ{¦¡(¹³¬O fdimage ©Î rawrite)¡A ¥H raw ¤è¦¡¶Ç°e¨ìºÏ¤ù¤W¡C(³o³¡¤À¥i°Ñ¾\ FreeBSD ¨Ï¥Î¤â¥U¤Wªº ¦w¸Ë FreeBSD) ¥i¥H¦b­þÃä§ä¨ì¦w¸Ë FreeBSD ªº¸Ñ»¡¨BÆJ©O¡H ¦w¸Ë¨BÆJªº¸Ñ»¡¡A½Ð°Ñ¾\ FreeBSD ¨Ï¥Î¤â¥U¤Wªº ¦w¸Ë FreeBSD ³¹¸`³¡¤À¡C ­n¶] FreeBSD »Ý­n¤°»òªº°t³Æ©O¡H &os; 4.X ¤§«eªºª©¥»¡AµwÅé»Ý¨D¬° 386 ©Î§ó°ª¯Åªº PC ¡A°O¾ÐÅé(RAM)¦Ü¤Ö­n 5 MB ©Î§ó¦h¡AµwºÐªÅ¶¡¦Ü¤Ö­n 60 MB ©Î§ó¦h¡C ¤£¹L¡A&os; ¡y¨t²Î¦w¸Ëµ{¦¡¡zªº°O¾ÐÅé(RAM)»Ý¨D¬°¦Ü¤Ö 16 MB¡C ±q &os; 5.X °_¡AµwÅé»Ý¨D¬° 486 ©Î§ó°ª¯Åªº PC ¡A°O¾ÐÅé(RAM)¦Ü¤Ö­n 24 MB ©Î§ó¦h¡AµwºÐªÅ¶¡¦Ü¤Ö­n 150 MB ©Î§ó¦h¡C &os; ªº©Ò¦³ª©¥»³£¥i¥H¥u¥Î§C¶¥ªº MDA ³W®æÅã¥Ü¥d¡A¤£¹L...­n¶] X11R6 µøµ¡ªº¸Ü¡A ÁÙ¬O¦Ü¤Ö¥Î VGA ©Î§ó¦n³W®æªºÅã¥Ü¥d¨Ó¥Î§a¡C ³o³¡¤À¤]¥i°Ñ¾\ ¡C §Ú¹q¸£ RAM ¥u¦³ 4MB ¦Ó¤w¡A¥i¥H¸Ë FreeBSD ¶Ü¡H ¦w¸Ë &os; 4.X ªº°O¾ÐÅé»Ý¨D¬°¦Ü¤Ö 5 MB ¡A¦Ó ¦w¸Ë &os; 5.X (§t¤§«áª©¥») «h¬O¦Ü¤Ö­n 8 MB ¡C ¦b 5.X ¤§«eªº©Ò¦³ &os; ª©¥»¡A³£¥i¥H¥u¥Î 4 MB ªº°O¾ÐÅé¨Ó ¡y¹B§@¡z¡A¤£¹L¡A«e­±¨º¸`§Ú­Ì»¡¹L¤F¡y¨t²Î¦w¸Ëµ{¦¡¡zªº¸Ü¡A «hµLªk¥u¥Î 4 MB ªº°O¾ÐÅé¨Ó°õ¦æ¡C¦]¦¹¡A§A¥i¥H¥ý¦b¡y¨t²Î¦w¸Ëµ{¦¡¡z³o¨BÆJ¤§«e¡A ¥ý±N°O¾ÐÅé¥[¨ì 16 MB ¥H¤W¡A¦w¸Ë§¹ FreeBSD ¤§«á¡A´N¥i¥H§â¦h¾lªº°O¾ÐÅ鮳¤U¨Ó¡C ©ÎªÌ¬O¡A¥ý§â­n¦w¸ËªºµwºÐ®³¨ì¦³¨¬°÷°O¾ÐÅ骺¾÷¾¹¤W¥ý¸Ë¦n¡A µM«á¦A§âµwºÐ©ñ¦^­ì¾÷¾¹¡C ¦¹¥~¡A¥u¥Î 4 MB ªº°O¾ÐÅé¨Ó¹B§@ªº¸Ü¡A¥²¶·­n¦Û»s kernel(®³±¼¤£¥²­nªº¥H¤ÎÄ묹¤@¨ÇªF¦è)¡C ¤]¦³¤H¦¨¥\¥u¥Î 2 MB ªº°O¾ÐÅé¥H &os; ¶}¾÷(ÁöµM³o¼Ëªº¨t²Î´X¥Gµ¥©ó¼o¤F..) ­n«ç¼Ë¤~¯à¦Û¦æ¥´³y±M¥Îªº¶}¾÷¡B¦w¸ËºÏ¤ù©O¡H ¥Ø«e¡AÁÙ¨S¦³¿ìªk¡y¥u¡z¦Û»s±M¥Îªº¶}¾÷¡B¦w¸ËºÏ¤ù¡C ¥²¶·³z¹L¦Û¦æ¥´³y§¹¾ã§@·~¨t²Îªº release(µo¦æ)¡A³o¼Ë¸Ì­±¤~·|¥]¬A¦Û¤vªº¶}¾÷¡B¦w¸ËºÏ¤ù¡C ­Y·Q¦Û¦æ¥´³y¡Bµo¦æ(release)¤@­Ó§¹¾ãªº§@·~¨t²Î¡A½Ð°Ñ¾\³o½g Release Engineering ¤å³¹¡C §Ú¹q¸£¤W¥i¥H¦³¦h­«§@·~¨t²Î¶Ü¡H ¥i¥H§r¡A½Ð°Ñ¾\ ¦h­«§@·~¨t²Î ³o½g¤å³¹¡C &windows; ¥i¥H»P FreeBSD ¦@¦s©ó¹q¸£¤W¶Ü¡H ¥ý¸Ë &windows; ¦A¸Ë FreeBSD¡C ¨º»ò FreeBSD ¦h­«¶}¾÷ºÞ²z­û(boot manager)´N·|¥X²{¿ï³æÅý§A¿ï¾Ü­n¥H &windows; ©Î FreeBSD ¨Ó¶}¾÷¡C¤£¹L¡A­Y§A¬O¥ý¸Ë FreeBSD ¦A¸Ë &windows; ªº¸Ü¡A ¨º»ò &windows; ±N·|¤£°Ý¥ý®_¡A§â FreeBSD ªº¦h­«¶}¾÷ºÞ²z­û(boot manager)»\±¼¡A ·í§A¹J¤W³oºØ±¡ªp®É¡A½Ð°Ñ¦Ò¤U¤@¸`»¡©ú¡C ¶ã.. &windows; §â§Úªº¦h­«¶}¾÷ºÞ²z­û(boot manager)®³±¼¤F¡I­n«ç»ò±Ï¦^¨Ó©O¡H ¥i¥H¥Î¥H¤U¤TºØ¤è¦¡¤§¤@¡A¨Ó±Ï¦^§Aªº FreeBSD ¦h­«¶}¾÷ºÞ²z­û(boot manager)¡G ¥i¥H±q¦U FreeBSD FTP ¯¸ªº /pub/FreeBSD/tools/ §ä¨ì bootinst.exe ¤Î boot.bin ³o¨â­ÓÀÉ¡A ¥H binary ¶Ç¿é¼Ò¦¡¤U¸ü«á¡A½Æ»s¨ìºÏ¤ù¤W¡A¦A¥Î DOS ¶}¾÷¤ù¶}¾÷¡A ±µµÛ¥´Ãþ¦ü¤U­±ªº«ü¥O¡G > bootinst.exe boot.bin ³o¼Ë¡A¦h­«¶}¾÷ºÞ²z­û(boot manager)´N·|­«¸Ë§¹²¦¤F¡C ¥Î FreeBSD ¶}¾÷¤ù¶}¾÷¡AµM«á¿ï³æ¨ºÃä¿ï Custom installation(¦Û­q¦w¸Ë)¡A ¦A¿ï Partition¡A±µµÛ¿ï¾Ü§A­n¸Ë¦h­«¶}¾÷ºÞ²z­û(boot manager)ªºµwºÐ(³q±`¬O²Ä¤@Áû)¡A µM«á·|¥X²{ partition editor ªºµe­±¡A³o®É½Ð¤£­n°µ¥ô¦ó­×§ï¡Aª½±µ«ö W Àx¦s¡A ³o®Éµ{¦¡´N·|°Ý¬O§_­n½T©w Write ¡A³Ì«á¥X²{ Boot Manager ¿ï¾Üµe­±¡A °O±o­n¿ï Boot Manager ¡A³o¼Ë´N·|­«·s±N¦h­«¶}¾÷ºÞ²z­û(boot manager) ¦w¸Ë¨ìµwºÐ¤W¡C²{¦b¡A´N¤j¥\§i¦¨¥i¥HÂ÷¶}¦w¸Ë¿ï³æ¨Ã­«¶}¾÷¤F¡C ¥Î FreeBSD ¶}¾÷¤ù©Î¬O¶}¾÷¥úºÐ¶}¾÷¡AµM«á¿ï³æ¨ºÃä¿ï Fixit ¡A©Î¬O¥H Fixit ¶}¾÷¤ù©Î¬O¥úºÐ¦w¸Ëªº²Ä¤G¤ù(¿ï¾Ü live filesystem ¿ï¶µ)µM«á´N·|¶i¤J fixit shell ¤F¡A±µµÛ¥´¤U¦C«ü¥O¡G Fixit# fdisk -B -b /boot/boot0 bootdevice ½Ð±N¤W­±ªº bootdevice ­×§ï¬°±z¹ê»Úªº¶}¾÷µwºÐ¥N¸¹ ¤ñ¦p ad0 (²Ä¤@Áû IDE µwºÐ) ¡A©Î¬Oad4 (first IDE disk on auxiliary controller), da0 (²Ä¤@Áû SCSI µwºÐ)µ¥µ¥¡C IBM Thinkpad A¨t¦C¡BT¨t¦C©Î X¨t¦Cªºµ§°O«¬¹q¸£¸Ë§¹ FreeBSD ¤§«á­«¶}¾÷¡A´N·í¤F¡A¸Ó«ç»ò¿ì©O¡H (¥»°ÝÃD¥D­n¬Oµo¥Í¦b 2000 ~ 2001 ¥|¤ë¶¡®É)³o¨Ç IBM ¾÷¾¹¤Wªº BIOS ¦­´Áª©¥»¦³­Ó¯äÂÎ(bug)·|§â FreeBSD ¤À³Î°Ï»~»{¬°¬O FAT ®æ¦¡¤À³Î°Ï¡AµM«á·í BIOS ¸ÕµÛ°»´ú FreeBSD ¤À³Î°Ï®É¡A´N·|·í¤F¡C ®Ú¾Ú IBM ¤è­±ªº»¡ªk¤@«Ê¨Ó¦Û Keith Frechette ªº e-mail kfrechet@us.ibm.com¡C ¡A¥H¤U«¬¸¹/BIOSª©¥»ªº¾÷ºØ¡A¤w¸g³£¦³­×¥¿¡G «¬¸¹ BIOS ª©¥» T20 IYET49WW(§t¤§«á) T21 KZET22WW(§t¤§«á) A20p IVET62WW(§t¤§«á) A20m IWET54WW(§t¤§«á) A21p KYET27WW(§t¤§«á) A21m KXET24WW(§t¤§«á) A21e KUET30WW ³o¨Ç«á´Áªº IBM BIOS ­×­qª©¤j¦h¤w¸g­×¥¿¦¹¤@¯äÂΡCJacques Vidrine ¼gµ¹ &a.mobile; ªº ³o«Ê«H ¤W­±»¡©ú¤F­Y§A·sªº IBM µ§°O«¬¹q¸£µLªk¶¶§Q¥H FreeBSD ¶}¾÷ªº¸Ñªk¨BÆJ (°²³]¥i¥H¤É¯Å©Î­°¯Å BIOS ª©¥»ªº¸Ü)¡C ¦pªG¾÷¾¹¥Îªº¬O¸û¥j¦­ª©¥»ªº BIOS¡A¦Ó¥B¤£¾A¦X§ó·s BIOS ªº¸Ü¡A¨º»ò¥H¤U§Ú­Ì·|¤¶²Ð¼È®É¸Ñªk¡A ±Ð§A¦p¦ó­×§ï FreeBSD ¤À³Î°Ï©Ò¨Ï¥Îªº ID ¡A¨Ã¦w¸Ë¬ÛÃö­×¸Éµ{¦¡¡C First, you will need to restore the machine to a state where it can get through its self-test screen. Doing this requires powering up the machine without letting it find a FreeBSD partition on its primary disk. One way is to remove the hard disk and temporarily move it to an older ThinkPad (such as a ThinkPad 600) or a desktop PC with an appropriate conversion cable. Once it is there, you can delete the FreeBSD partition and move the hard disk back. The ThinkPad should now be in a bootable state again. With the machine functional again, you can use the workaround procedure described here to get a working FreeBSD installation. ±q ¨Ó¤U¸ü boot1 ¤Î boot2 ³o¨â­ÓÀÉ¡C §â³o¨â­ÓÀɮשñ¦bºÏ¤ù¡B¥úºÐ©Î¨ä¥LµwºÐ¤W¡C ¥H¤@¯ë¦w¸Ë FreeBSD ¸Ë¨ì ThinkPad ¤W¡A°O±o ¡y¤£­n¥Î¡z Dangerously Dedicated ¼Ò¦¡¡C ¦¹¥~¡A¡y¤£­n¡z ¦b§¹¦¨¦w¸Ë¤§«á´N­«¶}¾÷¡C ¶i¤J shell¡G(«ö ALTF4) ¤Á´«¨ìEmergency Holographic Shell ©Î¬O¿ï³æ¤W­±¿ï¾Ü fixit shell¡C ¥Î &man.fdisk.8; §â FreeBSD ¤À³Î°Ï ID ¥Ñ 165 §ï¬° 166(OpenBSD©Ò¨Ï¥ÎªºID)¡C §â­è­è´£ªº boot1 ¸ò boot2 ³o¨â­ÓÀɮשñ¨ì¥Ø«eªºµwºÐÀɮרt²Î¤W¡C ¥H &man.disklabel.8; §â boot1 ¤Î boot2 ¦s¨ì§Aªº FreeBSD slice ¤W­±¡C &prompt.root; disklabel -B -b boot1 -s boot2 ad0sn ¡un¡v ¬O§A¸Ë FreeBSD ªº slice¡A ½Ð±N ¡un¡v §ï¬°²Å¦X§A¨t²Î²{ªpªº slice¡C ­«¶}¾÷¡A¦b boot prompt ·|¬Ý¨ì¦³ OpenBSD ªº¿ï¶µ¡A ¿ï¥¦¡A³o¼Ë´N·|¥H FreeBSD ¶}¾÷¡C ¥t¥~¡A¦Ü©ó¦p¦óÅý OpenBSD ¤Î FreeBSD ¨Ã¦s¦b¦P¤@¥x IBM ThinkPad ¤W... ³o­Ó°ÝÃD´N¥æµ¹¦U¦ì¬Ý­¾­Ì¥h¹Á¸Õ¤F :p ¦³Ãa­yªºµwºÐ¥i¥H®³¨Ó¸Ë FreeBSD ¹À¡H (¦pªG«Ü°í«ùªº¸Ü)¤]¬O¥i¥H¡A¤£¹L³o·QªkÅãµM¤£¤Ó©ú´¼¡C:( ¦pªG¦b¤@¯ë¸û·sªº IDE µwºÐ¤W¬Ý¨ì¦³Ãa­y¡A«Ü¦³¥i¯à¥Nªí¡G³oÁûµwºÐ§Y±N±¾ÂI¤F¡C (¦]¬°¥Ø«e©Ò¦³¸û·sªº IDE µwºÐ¡A¤º³¡³£¦³¦Û°Ê remapping Ãa­yªº¯à¤O¡C ¦pªG¬Ý¨ì¦³Ãa­y¡A«hªí¥Ü¥¦¤º³¡¦Û°Ê remapping ¥\¯à¥¢®Ä¡AµLªk³B²zÃa­y¡A ¤]´N¬O»¡³oÁûµwºÐ¤w¸g¬OÄY­«·lÃaµ{«×¤F¡C)§Ú­Ì«ØÄ³¶RÁû·sµwºÐ¤ñ¸û°®¯Ü¨Ç­ò¡C ¦pªG¬O SCSI µwºÐ¦³Ãa­yªº¸Ü¡A½Ð¸ÕµÛ°Ñ¦Ò³o­Ó ¸Ñªk¡C ¥Î¦w¸ËºÏ¤ù¶}¾÷®É¡A«o¦³¨Ç©Ç²{¶Hµo¥Í¡I³o¬O¤°»ò±¡ªp©O¡H ­Y¬Ý¨ì¤@¨Ç©Ç²§²{¶H¡A¹³¬O¶}¾÷¤ù¶}¾÷¶}¨ì¤@¥b´N·í¤F¡AºÏºÐ¾÷§¹¥þ¨S¥ô¦ó°Ê§@¡B ©Î¬O¤£Â_¤ÏÂЭ«¶}¾÷¡A½Ð¥ýÀˬd¥H¤U´X­Ó½u¯Á¡G ½Ð½T©w¬O§_¬°¥þ·s¡B¨S¦³ºÏ­y¿ù»~ªººÏ¤ù¡H (³Ì¦n¨Ï¥Î·s¶Rªº¡A¦Ó«DÂø»x¡B®Ñ¥»ªþÃØªº¡A¬Æ¦ÜÁÙ©ñ¦b§É©³¤U¤T¦~¤F...=_="") ½Ð½T©w¬O§_¦³¥Î binary(©Îimage)¶Ç¿é¼Ò¦¡¨Ó¤U¸ü image ÀÉ¡H (¤£¥Îı±o¤£¦n·N«ä¡A§Y¨Ï¬O§Ú­Ì¤]´¿·N¥~¥H ASCII ¶Ç¿é¼Ò¦¡¨Ó¤U¸ü binary ÀɮסI) ­Y§A¬O &windows; 95/98/ME/NT/2000/XP/2003 ¨Ó¤U¸ü¡B»s§@¶}¾÷ºÏ¤ùªº¸Ü¡A ½Ð½T©w¬O§_¦³¦b DOS ¼Ò¦¡¨Ï¥Î fdimage ©Î rawrite ³o¨â­Ó¤u¨ãµ{¦¡¡H­èÁ¿ªº³o¨Ç§@·~¨t²Î¡A ³£·|¼vÅTµ{¦¡¥hª½±µ¼g¤JµwÅé¡A¹³¬O»s§@¶}¾÷¤ù¤§Ãþªº°Ê§@¡C ¦³®É­Ô¡A¦b GUI ¤¶­±¤Wªº DOS shell ¤]¥i¯à·|µo¥Í³o¼Ëªº°ÝÃD¡C ¦¹¥~¡Aª½±µ³z¹L &netscape; ÂsÄý¾¹¤U¸ü image Àɪº¸Ü¡A¤]¦³Ãþ¦ü²{¶H¡C ©Ò¥H¡A¦pªG¥i¥Hªº¸Ü¡A½Ð§ï¥Î¨ä¥L¥i¥H½Õ¾ã³]©wªº FTP clientºÝµ{¦¡¨Ó¶i¦æ¤U¸ü¡C (·íµM¡A­n°O±o½Õ binary ¶Ç¿é¼Ò¦¡) ¥Î¥úºÐ¶}¾÷¤ù¨Ó¦w¸Ë¡A¦ý¥úºÐ¶}¾÷«á¡A¦w¸Ëµ{¦¡»¡§ä¤£¨ì¥úºÐ...³o¬O«ç»ò¤F¡H ³q±`°ÝÃD¦b©ó¥úºÐ¾÷³]©w¿ù»~¡C¥Ø«e«Ü¦h¹q¸£ªº¥X¼t¼Ð·Ç°t³Æ³£¦³¥úºÐ¾÷¡A¨Ã¥B ·|¹w¥ý³]©w¬° IDE ³q¹D¤W­± Secondary ªº Slave ³]³Æ¡A¦Ó Secondary ¤W­±ªº «o¨S¦³ Master ³]³Æ¡C¥H ATAPI ªº³W®æ¦Ó¨¥¡A³o¬O¿ù»~ªº³]©w¡AµM¦Ó &windows; ªº§@ªk ¬O¤£²z·|³o¨Ç³W®æ¤Wªº³]©w°ÝÃD¡A¦Ó¥B¶}¾÷®É BIOS °»´ú¤]·|²¤¹L³oÂI¡C ³o¤]´N¬O¬°¤°»ò BIOS ¥i¥H¬Ý¨ì¥úºÐ¡A¨Ã¥B¥i¥Î¥úºÐ¶}¾÷¡A¦ý FreeBSD µLªk¥¿±`§ì¨ì¥úºÐ¥H¶¶§Q¶i¦æ¦w¸Ë¡C ¸Ñªk¡G­«·s³]©w¨t²Î¡AÅý¥úºÐ¦¨¬°¥¦©Ò³s±µ¨º±ø IDE ³q¹Dªº Master¡A ©ÎªÌ¥u¦³¤@±ø IDE ³q¹Dªº¸Ü¡A¨º´NÅý¥úºÐ¾÷¦¨¬° Slave ¡A·íµM¸Ó IDE ³q¹D¤W¦Ü¤Ö­n¦³ Master ³]³Æ¡C §Ú¥i¥H¥Î PLIP(Parallel Line IP)¤è¦¡¨Ó¦w¸Ë FreeBSD ¨ìµ§°O«¬¹q¸£¤W¶Ü¡H ¥i¥H¡A¥Î¤@±ø´¶³qªº Laplink ½u´N¥i¥HÅo¡C­Y¦³³o¤è­±»Ý¨Dªº¸Ü¡A½Ð°Ñ¾\ FreeBSD ¨Ï¥Î¤â¥U¤¤ªº PLIP ³¹¸` ªº²Ó³¡³]©w ¸Ó¥Î­þ¤@ºØµwºÐ³]©w°Ñ¼Æ(geometry)©O¡H ³o¸Ìªº¡yµwºÐ³]©w°Ñ¼Æ(geometry)¡z¡A«üªº¬OµwºÐ¤Wªº ¡ucylinders¡v¡B¡uheads¡v¡B¡usectors/track¡v ³o¤T­Ó³]©w°Ñ¼Æ¡C ±µ¤U¨Óªº¤å³¹¤º¡A¬°¤F¤è«K¤¶²Ð¡A±N²ºÙ¬°¡yC/H/S¡z¡C ³o¨Ç³]©w°Ñ¼Æ¬OÅý PC ¤Wªº BIOS ¯à¶¶§Q¦a¥¿±`§P§OµwºÐ¡A »PµwºÐ¥»¨­Åª¼gªº­«­n¦]¯À¡C ¹ï­è±µ¤âªº¨t²ÎºÞ²zªÌ·s¤â¦Ó¨¥¡A³o¨Ç³]©w°Ñ¼Æ±`³y¦¨¤@¨Ç§xÂZ¡C ­º¥ý¡ASCSI µwºÐ¤Wªº physical geometry ¸ò FreeBSD ¤Wªº disk blocks ¬O§¹¥þµLÃöªº¡C¨Æ¹ê¤W¡A ´NµwºÐ¤WºÏ°Ï±K«×ªºÅܤƦӨ¥¡A¨Ã¨S¦³©Ò¿×¡yphysical geometry¡z³oºØªF¦è¡C µwºÐ»s³y°Ó©Ò»¡ªº¡yphysical geometry¡z³q±`¬O«ü¡G µwºÐ¤W©Ò¨Ï¥Î³Ì¤pªÅ¶¡¨Ó¦s©ñ¸ê®Æªº³]©w°Ñ¼Æ(geometry)¡C ¥H IDE µwºÐ¦Ó¨¥¡AFreeBSD ¥Î¥H¦s¨úµwºÐ³]©wªº¤è¦¡¬O C/H/S ¡A µM¦Ó¡A¥Ø«e¥«­±¤WªºµwºÐ¦­´N¦b¤º³¡¹B§@®É¡A´N¦Û°ÊÂà´«¬° block ¤è¦¡ ¤F¡C ¯u¥¿ÃöÁ䪺¦a¤è¡A¨ä¹ê¬O¦b©ó ¡ylogical geometry¡z¡X ³o¬O BIOS °»´úµwºÐ®É©Ò±o¨ìªº³]©w¡A¨Ã¥B¥Î¨Ó¨M©wµwºÐ¦s¨ú¤è¦¡¡C ¥Ñ©ó FreeBSD ¬O±Ä¥Î BIOS ªº°»´ú³]©w­È¡A©Ò¥H¦p¦ó¨ÓÅý BIOS °»´ú¨ìªº³]©w­È«O«ù¥¿½T¡A ¬O¤Q¤À­«­n¡C¤×¨ä¬O¦P¤@ÁûµwºÐ¤W¦³¦h­Ó§@·~¨t²Îªº±¡ªp¡A ¥¦­Ì³£¥²¶·±Ä¥Î¤@­PªºµwºÐ³]©w°Ñ¼Æ(geometry)¡A §_«h´N·|¦³¶}¾÷¶i¤£¥h§@·~¨t²ÎªºÄY­«°ÝÃD¤F¡C ¥H SCSI µwºÐ¦Ó¨¥¡AµwºÐ³]©w°Ñ¼Æ(geometry)¬O¥Ñ SCSI ¥d¤Wªº extended translation(³q±`«üªº¬O¦³¼Ð¥Ü support >1GB(¤ä´© 1GB ¥H¤W®e¶q¡A©ÎÃþ¦ü¦Wµü) ¤ä´©»P§_¨Ó§@¨M©w¡C ¦pªG¤£¤ä´©¡A¨º»ò´N·|±Ä¥Î N cylinders¡B 64 heads¡B 32 sectors/track §@¬°µwºÐ³]©w°Ñ¼Æ(geometry)¡A³o¸ÌÁ¿ªº¡yN¡z ¬O«üµwºÐªº®e¶q(³æ¦ì¡GMB)¡CÁ|­Ó¨Ò¤l¨Ó»¡¡A¤@Áû 2GB µwºÐÀ³¸Ó¬O 2048 cylinders¡B64 heads¡B32 sectors/track¡C ¦pªG¸Ó SCSI ¦³¤ä´©¨Ï¥Î extended translation ªº¸Ü¡A (³q±`³o­Ó¤è¦¡¦b &ms-dos; ¨Ï¥Î¤W¦³¬Y¨Ç­­¨î)¡A¨Ã¥BµwºÐ®e¶q¤j©ó 1GB¡A ¨º»òµwºÐ³]©w°Ñ¼Æ(geometry)´N·|¨Ï¥Î¹³¬O¡G M cylinders¡B255 heads¡B¨CºÏ­y 63 sectors(½Ðª`·N¡G¤£¬O¡y64¡z®@)¡A ³o¸ÌÁ¿ªº¡yM¡z¬O«üµwºÐªº®e¶q(³æ¦ì¡GMB)¦A°£¥H 7.844238 ©Ò±o¥Xªº¼Æ­È³á¡I©Ò¥H¡A³o­Ó¨Ò¤lªº¸Ü¡A¦P¼Ë¬O 2GB µwºÐÀ³¸Ó¬O 261 cylinders¡B255 heads¡B¨CºÏ­y 63 sectors¡C ­Y¹ï¤W­±Á¿ªº¤£ÁA¸Ñ¡A©Î¬O FreeBSD ¦b¦w¸Ë®É©Ò°»´ú¨ìªºµwºÐ³]©w°Ñ¼Æ(geometry) ¦³°ÝÃDªº¸Ü¡A³Ì²³æªº¸Ñªk³q±`¬O¦bµwºÐ¤W«Ø¥ß¤@¶ô¤p¤pªº DOS ¤À³Î°Ï(partition)¡C ³o¼Ë¤@¨Ó¡A´N¥i¥H°»´ú¨ì¥¿½TªºµwºÐ³]©w°Ñ¼Æ¤F¡A¦Ó¥B¡A ¦pªG¤£·QÄ~Äò¯dµÛ¨º¤p¶ô DOS ¤À³Î°Ïªº¸Ü¡A¥i¥HÀH®É¥Î partition editor ¨Ó®³±¼¥¦¡C©ÎªÌ§â¥¦¯dµÛ·í§@ºô¸ô¥dÅX°Êµ{¦¡¨Ï¥Î¡A©ÎÀH§A°ª¿³«ç»ò¥Î¥¦¡C ¦¹¥~©O¡A¦³­Ó§K¶O¦n¥Îªº¤u¨ãµ{¦¡¥s°µ¡ypfdisk.exe¡z¡A ³o­Óµ{¦¡©ñ¦b¦U FreeBSD FTP ¯¸©Î¥úºÐªº tools ¥Ø¿ý¤U¡A ¥¦¥i¥H¥Î¨Ó§ä¥XµwºÐ¤W¨ä¥L§@·~¨t²Î©Ò¨Ï¥ÎªºµwºÐ³]©w°Ñ¼Æ¡A µM«á´N¥i¥H¦b partition editor ¤º¿é¤J­è­è§ä¨ìªº¨º¨Ç³]©w°Ñ¼Æ´N¥i¥H¤F¡C ¤À³ÎºÏºÐ¾÷®É¦³¥ô¦ó­­¨î¶Ü¡S ¦³¡A§A¥²¶·½T»{§Aªº root ¤À³Î°Ï¬O¦b 1024 cylinders ¤§¤º¡AÅý BIOS ¥i¥H±q¨ä¤¤±Ò°Ê®Ö¤ß¡C(ª`·N¡G³o¬O PC ªº BIOS ¥\¯à­­¨î¡A¦Ó¤£ ¬O FreeBSD ªº) ¥H SCSI µwºÐ¦Ó¨¥¡A³q±`¬O§â root (/) ¤À³Î°Ï©ñ¨ìµwºÐ³Ì«e­±ªº 1024MB (¦pªG¦³¤ä´© extended translation ªº¸Ü¡A ¨º»ò¬O³Ì«e­±ªº 4096MB ¡X ³oÂI½Ð°Ñ¦Ò¤W¤@¤p¸`)¡C¦Ó IDE µwºÐªº¸Ü¡A¬Û¹ïÀ³ªº«h¬O 504MB¡C ¥i¥H¨Ï¥Î­þ¨ÇºÏºÐºÞ²zµ{¦¡(disk managers)©O¡H FreeBSD ¥i¥H¥Î Ontrack Disk Manager ¨Ã¥B¹B§@¥¿±`¡A ¦Ü©ó¨ä¥Lªº disk manager «h¤£¦b¥¿¦¡¤ä´©¤§¦C¡C ­Y¾ãÁûµwºÐ¥u¸Ë FreeBSD ¡A¨º»ò´N¤£¥Î¦A¸Ë disk manager ¤F¡C ¥u­n§âµwºÐ³]©w¬° BIOS ©Ò¯à§ì¨ìªº³Ì¤jªÅ¶¡¡A¨º»ò FreeBSD ´N¥iºâ¥X¹ê»Ú¤W¥i¨Ï¥ÎªºªÅ¶¡¤F¡C ¦pªG¡A¥¿¦b¨Ï¥Îªº¬O¥j¦­ MFM ±±¨î¥dªºÂ¦¡µwºÐ¡A ¨º»ò´N»Ý­n¦b FreeBSD¤º§@ cylinders ¬ÛÃö³]©w¤F¡C ¦pªG·Q¦bºÏºÐ¤W¨Ï¥Î FreeBSD ©M¥t¥~ªº§@·~¨t²Î¡A¤]¥i¥H¤£¸Ë disk manager¡A ¥u­n½T©w FreeBSD ªº±Ò°Ê¤À³Î°Ï¸ò¨ä¥L§@·~¨t²Îªº slice ³£¦ì©ó¶}©lªº 1024 cylinders ¤º´N¥i¥H¤F¡C¦pªG§A¬Û·í¦a°ª©úªº¸Ü¡A¤@­Ó 20MB ªº±Ò°Ê¤À³Î°ÏÀ³¸Ó´N°÷¥Î¤F¡C FreeBSD ¦w¸Ë§¹²¦«á­«¶}¾÷¡A¦ý¬O¹q¸£«o»¡ Missing Operating System³o¬O«ç»ò¤F¡H ³q±`­ì¦]¥X¦b FreeBSD ¤Î DOS ©Î¨ä¥L§@·~¨t²Î¦bµwºÐªº ³]©w°Ñ¼Æ(geometry)¤Wªº³W¹º¦³¬Û½Ä¡C¸Ñªk¬O­«¸Ë¡A¦ý¬O½Ð·Ó ¤W­zªº¬ÛÃö³¹¸`¨BÆJ¨Ó°µ¡C ¬°¤°»ò¾÷¾¹¤W¦h­«¶}¾÷ºÞ²z­û(boot manager)¥X²{¤F F? ³o­Ó¿ï³æµe­±¡A ¦ý«o¤£·|¦Û°Ê¸õ¹L¦ÓÄ~Äò¶}¾÷©O¡H ³o­Ó¯gª¬¬O¥»¤å¤W­±©Ò´£ªº¥t¥~¤@­Ó°ÝÃD¤F¡A­ì¦]¦b©ó BIOS ¤W¸ò FreeBSD ¤W­±¨âÃ䪺µwºÐªº ³]©w°Ñ¼Æ(geometry) ¨Ã¤£¤@­P¡C ­Y§AµwºÐ©Î BIOS ¤ä´© cylinder translation (³q±`·|³Q¼Ð¬° support >1GB(¤ä´© 1 GB¥H¤W®e¶q)ªº¸Ü¡A ¸Õ¸Õ¬Ý§ó§ï¬ÛÃö³]©w¡A¨Ã­«¸Ë FreeBSD¡C ¦w¸Ë FreeBSD ®É¡A»Ý­n¦w¸Ë§¹¾ãªº sources ¶Ü¡H ¤@¯ë¨Ó»¡¡A³o¬O¥Î¤£µÛªº¡CµM¦Ó¡A§Ú­Ì±j¯P«ØÄ³±zªº source ¦Ü¤Ö­n¸Ë base(¥]§t¤F¥»¤å¤¤©Ò´£ªº¤@¨ÇÀÉ®×)¡B¥H¤Î sys (kernel ªº source ÀÉ)¡C ÁöµM¡A§@·~¨t²Î¥»¨­¹B¬O¤£»Ý­n¸Ë source ÀÉ¡A¦ý¬O &man.config.8; ³o­Ó kernel³]©wµ{¦¡«h»Ý­n src ¡C ­Y¨S¸Ë kernel ªº source ÀÉ¡A¤´µM¥i¥H¥Î¨ä¥L¦a¤è³z¹L NFS ±¾¸üªº°ßŪÀɮרt²Î¡A ¨Ó½s͵{¦¡¡C ¦ý¥Ñ©ó kernel-source ¥»¨­ªº­­¨î¡A§Ú­Ì«ØÄ³¤£­nª½±µ mount ¦b /usr/src¡A ³Ì¦n¬O¥Î symbolic link(°Ñ¾\ &man.ln.1;) ±N±¾¸üªº¸ô®|¡A³]©w³sµ²¨ì/usr/src ¥Ø¿ý¡C ¦b¾÷¾¹¤Wª½±µ¸Ë¦³ source ¨Ã¥BÁA¸Ñ¬ÛÃö½s͹Lµ{¡A³o¼Ë¤l¤é«á¤É¯Å FreeBSD ·|¨Ó±o¤è«K¦h¡C ­Y§Ñ¤F¸Ë¬ÛÃö source ªº¸Ü¡A¥i¥H¨Æ«á¥Î sysinstalll (&os; 6.X ¤§«e¬° /stand/sysinstall) ¨Ó¸É¸Ë¡A¿ï³æ¡GConfigure ¡÷ Distributions ¡÷ src¡C »Ý­n­«·s build kernel ¶Ü¡H ¦b«Ü¤[«Ü¤[¥H«e¡A­ì¥»­«·s build kernel ¦b FreeBSD ¦w¸Ë¹Lµ{¤¤¡A ¬Oµ´¹ï¥²»Ýªº¨BÆJ¤§¤@¡C¦ý¥Ø«e¦­´N¤£¥Î³o»ò³Â·Ð¤F¡A ¥Ø«e¥D­n±`¨£ªºª©¥»³£¨Ï¥Î§ó¤Íµ½ªº kernel ³]©w«ü¥O¡C &os; 4.X(§t¤§«eª©¥»)¡A¦b FreeBSD ±Ò°Ê´£¥Ü¸¹(boot:)®É¡A¨Ï¥Î flag ´N·|¶i¤J³]©wµe­±¡A¨Ó¹ï kernel §@±`¨£ªº ISA ¥d²Ó¸`³]©w¡C ¦Ó &os; 5.X(§t¤§«áª©¥»)ªº¸Ü¡A«h¬O¥H§ó¨ã¼u©Êªº "hints" ³]©w¤è¦¡¡C ¦pªG·Q§ó¸`¬Ù RAM ªº¨Ï¥Î¡BÁYµu¶}¾÷¬yµ{¡A¨º»ò«ØÄ³¡G·sªº kernel ³]©wÀÉ¥u­n¥]§t§A»Ý­nªºÅX°Êµ{¦¡¡A µM«á­«·s½sĶ¡B¦w¸Ë kernel ¨Ã­«¶}¾÷¡CµM¦Ó©O¡A³oÂI¹ï¤j¦h¼Æªº¨t²Î¨Ó»¡¡A ³o¤£¤@©w¬O¥²­nªº¡C ±K½X½s½X¸Ó±Ä¥Î DES¡BBlowfish ©Î MD5 ªº­þ¤@ºØ¡H¸Ó«ç»ò³]©w©O¡H FreeBSD ¹w³]ªº±K½X½s½X¤è¦¡¬O±Ä MD5¡C ´N±K½X½s½X¤è¦¡¦Ó¨¥¡AMD5 ¤è¦¡¤@¯ë³Qµø¬°¤ñ¶Ç²Î &unix; ªº DES ¤è¦¡¸û¬°¦w¥þ¡C µM¦Ó¡A­Y¦³»Ý­n¦b¨Ï¥ÎÂÂÀô¹Ò(¸û¤£¦w¥þªº±K½X½s½X¤è¦¡ªº)¡ADES ±K½X½s½X¤è¦¡¤@¼Ë¥i¥H¨Ï¥Î¡C (­Y¨Ï¥Î sysinstall ®É¦³¿ï¾Ü crypto ®M¥ó¡A©Î¬O±q source ¤º½sͦw¸Ë) ¦³¸Ë crypto ªº¸Ü¡Acrypto libraries ¤]¤ä´©§ó¦w¥þªº Blowfish ½s½X¤è¦¡¡C ±K½X½s½Xªº¤è¦¡¬O¥Ñ /etc/login.conf ¤ºªº passwd_format Äæ¦ì¨Ó¨M©wªº¡C¸ÓÄæ³]©w­È¡A(­Y¦³¸Ë crypto ªº¸Ü)¥i¥H¬O des ©Î blf ©Î¬O­ì¥»ªº md5¡C ¸Ô±¡½Ð°Ñ¾\ &man.login.conf.5; »¡©ú¡C ¬°¤°»ò¶}¾÷ºÏ¤ù¶}¨ì¤@¥b¡A´N¥X²{ Probing Devices... ªºµe­±°T®§¡AµM«á´N°±¦í¤F¡H ­Y¾÷¾¹¤W¦³¸Ë IDE ¤¶­±ªº Iomega &iomegazip; ©Î¬O &jaz; ªº¸Ü¡A ¦]¬°³o¨Ç³]³Æ¥i¯à¸ò¶}¾÷¤ù¦³¬Û½Ä¡A½Ð¥ý®³±¼³o¨Ç³]³Æ¦A­«¸Õ¡C ·í¾ã­Ó§@·~¨t²Î¸Ë¦n«á¡A´N¥i¥H§â³o¨Ç³]³Æ±µ¦^¥h¨Ï¥Î¤F¡C §Æ±æ³oÂI¦b¤é«á release ªº FreeBSD ¥i¥HÀò±o¹ý©³¸Ñ¨M¡C ¨t²Î¸Ë§¹¨Ã­«¶}¾÷«á¡A¬°¤°»ò«o¥X²{ panic: can't mount root¡H ³o­Ó¿ù»~¬O¦]¬°±Ò°ÊºÏ°Ï¸ò kernel ¨âªÌ¹ïºÏºÐ¸Ë¸mªº»{ª¾¤£¬Û¦P¡C ³q±`³o°ÝÃD·|µo¥Í¦b¦³¨âÁû IDE µwºÐªº¨t²Î¡A¤ñ¦p¡GµwºÐ Jumper ³]©w¬° Master¡B ©Î¬O¨â±ø IDE ±Æ½u¦U¥u³s±µ¤@ÁûµwºÐ¡A¦ý¬O¸Ë FreeBSD ¨ºÁû¶}¾÷µwºÐ¡A «o±µ¦b Secondary IDE ±Æ½u¤W¡C ¦p¦¹¤@¨Ó¡A¦b¶}¾÷®É·í kernel «ü©w²Ä¤G­Ó IDE ±±¨î¾¹ªº²Ä¤@­ÓºÏºÐ¾÷ ad2¡A ±Ò°ÊºÏ°Ï«o»{¬°¨t²Î¬O¸Ë¦b ad0(BIOS°»´úªº²Ä¤GÁûµwºÐ)¡I °»´ú§¹¸Ë¸m«á¡Akernel ¸ÕµÛ§â±Ò°ÊºÏ°Ï©Ò»{¬°ªº¶}¾÷µwºÐ(ad0) mount °_¨Ó¡A¨Æ¹ê¤WÀ³¸Ó¬O ad2 ¤~¹ï¡A©Ò¥H´N·|¥X²{¤W­±ªº¿ù»~°T®§¤F¡C ¸Ñªk¦p¤U¡A½Ð¿ï¾Ü¨ä¤¤¤@ºØ¤è¦¡´N¦n¡G ­«¶}¾÷¨Ã¦b¥X²{¡yBooting kernel in 10 seconds; hit [Enter] to interrupt¡z ´£¥Üªº®É­Ô¡A«ö¤U EnterÁä¡C ³o¼Ë¤l´N·|¶i¤J boot loader µe­±¡G ½Ð¿é¤J set root_disk_unit="disk_number" ³o¸Ìªº¡ydisk_number¡z½Ð¨Ì¾Ú±¡ªp´«¦¨¬ÛÃö¥N¸¹¡G ­Y FreeBSD µwºÐ¬O³]©w¸Ë¦b Primary IDE ±µ½uªº Master¡A´N³]¬° 0 ¡F ­Y¬O Primary IDE ±µ½uªº Slave¡A´N³]¬° 1¡F ­Y¬O Secondary IDE ±µ½uªº Master¡A´N³]¬° 2¡F ­Y¬O Secondary IDE ±µ½uªº Slave¡A´N³]¬° 3¡C ±µµÛ½Ð¦A¿é¤J boot¡AµM«á¨t²ÎÀ³¸Ó´N¥i¥H¥¿±`¶}¾÷¤F¡C ­Y­n¨C¦¸¶}¾÷³£¦Û°Ê³]©w¡A¦Ó¤£¥²¨C¦¸³£¥´¤@¦¸¡A¨º»ò´N¦b /boot/loader.conf.local Àɮפº¥[¤W root_disk_unit="disk_number" ³o¦æ (·íµM¡A¡ydisk_number¡z­n§ï¦¨¬ÛÃö¥N¸¹) §â FreeBSD µwºÐ§ï±µ¨ì Primary IDE ±µ½u¤W¡A¦p¦¹¤@¨Ó´N¥i¶¶§Q¨Ï¥Î¡C °O¾ÐÅé³Ì¤j­­¨î¬°¦h¤Ö¡H ¤@¯ë &i386; ¾÷¾¹¤W³Ì¦h¥i¤ä´©¨ì 4 GB(gigabytes)¡C ¦Ó¦Û &os; 4.9 ¤Î 5.1 ¥i¥H¶}©l¨Ï¥Î &man.pae.4; ¨Ó¤ä´©§ó¦hªº°O¾ÐÅé¡C ¦³Ãö³oÂI¡A»Ý­n¦b kernel ³]©wÀɤº¥[¤J¤U¦C¤º®e¨Ã­«·s½sĶ kernel¡A¤~¯à¨Ï¥Î PAE¡C options PAE &os; ¦b pc98 ¾÷¾¹¤W³Ì¦h«h¥u¤ä´© 4 GB ¡A¦Ó¥B¤£¯à¨Ï¥Î PAE¡C ¦b Alpha ¾÷¾¹¤W¡A°O¾ÐÅé­­¨î¤è­±­nµø©Ò¨Ï¥Îªº«¬¸¹¤ä´©µ{«×¦Ó©w¡A³oÂI½Ð°Ñ¾\ ©Ò¨Ï¥Îªº Alpha µwÅé³W®æªí¡C¦Ü©ó¨ä¥L¬[ºcªº &os; ²z½×¤W³Ì¦h¥i¨Ï¥Îªº°O¾ÐÅé¡A¦³¸û¦hªº­­¨î¡C Àɮרt²Î³Ì¤j­­¨î¬°¦h¤Ö¡H ´NÀɮרt²Î¤è­±¡A²z½×¤Wªº­­¨î¬O³Ì¦h¨ì 8TB(2G blocks)¡A ©Î¬O¨Ï¥Î¤º©w 8K block ¤j¤p®É¡A­­¨î¬O 16TB¡C ¹ê»Ú¤W¡A¥Ø«e³nÅé¨Ï¥Î¤W­­¨î¥u¯à¥Î¨ì 1 TB¡A µM¦Ó¦pªG¬O¦³¥t¦æ§ï³y¹LÀɮרt²Î¡A¨º»ò¹F¨ì 4TB ªº¥Ø¼Ð¬O¥i¦æªº (¤]¦³¤H¦¨¥\¹L)¡C ³æ¤@Àɮתº¤j¤p¤è­±¡A°²¦p block ¥H 4K §@³W¹ºªº¸Ü¡A «h³Ì¤j¬OÁͪñ 1G blocks(4TB)¡C Àɮפj¤pªº³Ì¤j­­¨î Àɮרt²Î block ¤j¤p works should work 4K 4T-1 >4T 8K >32G 32T-1 16K >128G 32T-1 32K >512G 64T-1 64K >2048G 128T-1
When the fs block size is 4K, triple indirect blocks work and everything should be limited by the maximum fs block number that can be represented using triple indirect blocks (approx. 1K^3 + 1K^2 + 1K), but everything is limited by a (wrong) limit of 1G-1 on fs block numbers. The limit on fs block numbers should be 2G-1. There are some bugs for fs block numbers near 2G-1, but such block numbers are unreachable when the fs block size is 4K. block ¤j¤p¦pªG¬O 8K ©Î§ó¤j¡AÀɮרt²Î block ¼Æ¥Ø·|³Q­­¨î¦b 2G-1 ¡A¦ý¹ê»Ú¤WÀ³¸Ó»¡­­¨î¬O 1G-1 ¤~¹ï¡A¦]¬°±Ä¥Î 2G-1 block ªºÀɮרt²Î·|¾É­P¤@¨Ç°ÝÃD¡C
¬°¦ó¦b±Ò°Ê·sªº kernel ®É¡A¬Ý¨ì archsw.readin.failed ¿ù»~°T®§¡H ­ì¦]¥X¦b§Aªº world ¥H¤Î kernel ¨Ã¤£¦P¨B¡AÁ|¨Ò¡Gkernel ¥Î 4.11¡A ¦Ó world «o¬O 4.8¡A³o¼Ë¬O·|¦³°ÝÃDªº¡C ½Ð¦A¦¸½T»{¡A¬O§_¦³¥H make buildworld ¤Î make buildkernel ¨Ó¥¿±`§ó·s kernel¡C ¦b±Ò°Ê loader ¤§«e¡A·|¬Ý¨ì "|" ³o­Ó²Å¸¹¦bÂà°Ê¡A³o®É¥i¥H«ö¥ô¦óÁ䤤Â_¡A µM«á¦A«ü©w­n¸ü¤J­þ­Ó kernel ¨Ó¶}¾÷¡C security profiles ¬O«ü¤°»ò¡H A security profile is a set of configuration options that attempts to achieve the desired ratio of security to convenience by enabling and disabling certain programs and other settings. For full details, see the Security Profile section of the Handbook's post-install chapter. ¦b¶}¾÷®É¡A¿ï¾Ü¨Ï¥Î ACPI «h¦b¦w¸Ë¹Lµ{´N±¾¤F¡A¸Ó«ç»ò¿ì¡H ¸Õ¸Õ¬ÝÃö³¬ ACPI support¡C ·í¦b¸ü¤J bootloader®É¡A«ö¤UªÅ¥ÕÁä¡C ¨t²Î·|Åã¥Ü OK ³o®É¿é¤J unset acpi_load ±µµÛ¥´ boot ¥HÄ~Äò¶}¾÷¡A³o¼Ë¤lÀ³¸Ó´N¥i¥H¤F¡C
µwÅé¤ä´©¤è­± ¤@¯ë°ÝÃD §Ú·Q²Õ¸Ë¦Û¤vªº FreeBSD ¾÷¾¹¡A¦³­þ¨Ç«¬¸¹¡B«~µP¡B³W®æ¬O¤ä´©µ{«×³Ì¦nªº©O¡H ¦³Ãö³oÂI¡A¦b FreeBSD °Q½×°Ï¤W®É±`¦³¤H°Q½×¡CÁöµMµwÅé¨O´«³t«×«Ü§Ö¡A ¥i¯àÀH®É¦³·s³W®æ¡B·s²£«~¥X²{¡AµM¦Ó³o¨Ç³£¦b§Ú­Ì·N®Æ¤§¤¤¡A §Ú­Ì ¤´µM ±j¯P«ØÄ³¡G¦b¸ß°Ý¦³Ãö³Ì·s³W®æµwÅ骺¤ä´©°ÝÃD¤§«e¡A ½Ð¥ý°Ñ¾\ &os &rel.current; ©Î &rel2.current;ªº¤ä´©µwÅé¦Cªí¡A ©Î¬O·j´M°Q½×°ÏªºÂ¤峹¡A ¤]³\¡A¤W¶g¤~­è«ê¥©¦³¤H°Q½×¹L§A©Ò­n°ÝªºµwÅé¡C ¦pªG­n§ä¦³Ãöµ§°O«¬¹q¸£¤è­±¡A½Ð¨ì FreeBSD-mobile µ§°O«¬¹q¸£°Q½×°Ï¡C ¤£µM¡A´N¨ì FreeBSD-questions °Q½×°Ï¡A©Î¬O¯S©wµwÅé³W®æ(¤ñ¦p pc98, Alpha)ªº±MÄݰQ½×°Ï§a¡C µwÅé¬[ºc¤Î CPU FreeBSD ¦³¤ä´© x86 ¤§¥~ªºµwÅé¬[ºc¥­¥x¶Ü¡H ¦³ªº¡AFreeBSD ¥Ø«e¥i¥H¦b Intel x86 and DEC (²{¦bªº HP-Compaq) Alpha ¬[ºc¤W­±¹B§@¡C¦Û FreeBSD 5.0 ¤§«áªºª©¥»¡A«h ¥i¤ä´© AMD64 ¤Î Intel EM64T, IA-64 ¥H¤Î &sparc64; ¬[ºc¡C ¥¼¨Ó¥­¥x¤ä´©¤WÁÙ·|¦³ &mips; ¤Î &powerpc;¡A²Ó¸`½Ð¤À§O°Ñ¾\ &a.mips; ©Î &a.ppc;¡C ¤@¯ë¦Ó¨¥¡A·sªºµwÅé¬[ºc¥­¥x¤è­±¡A³£¬O¨ì &a.platforms; °Q½×¡C ­Y§A¾÷¾¹¤£¬O¥H¤W¬[ºc©Î¬O¤ñ¸û©_¯Sªº¡A¦Ó·Q¥ß¨è¸Õ¸Õ¬Ý BSD ªºÅ]¤O¡A §Ú­Ì«ØÄ³§A¥i¥H¦Ò¼{¨Ï¥Î NetBSD ©Î OpenBSD¡C FreeBSD ¤ä´© CPU ¹ïºÙ¦h¤u³B²z(SMP, Symmetric Multiprocessing)¶Ü¡H ¦³ªº¡C SMP ¦b &os; 5.2 ¹w³]ªº kernel(GENERIC)¤w¦³±Ò°Ê¡C ¦b &os; 5.3 ­n release ®É¡ASMP¬ÛÃö³]©w¤]¬O¹w³]´N¦³±Ò°Ê¡C µM¦Ó¡A¦b¤@¨Ç¸û·s«¬ªº¾÷¾¹(¹³¬O emt64)¤W«o¤S¦³¨Ç°ÝÃD¡A ©Ò¥HÁÙ¬O¨M©w¦b¬ÛÃö°ÝÃD¡B¦w¥þijÃD¥¼Àò¸Ñ¨M«e¡A¥ýÃö³¬ SMP ªº¬ÛÃö±Ò°Ê¡C ³oÂI¡A¥¿¬O &os; 5.4 ©ÒÀu¥ý¦Ò¼{ªº¤è¦V¡C &os; 4.X ªº¸Ü¡A¹w³]ªº kernel ¨Ã¨S¦³±Ò°Ê SMP¡A ¦]¦¹¡A¥²¶·­n§â options SMP ¥[¤J kernel ³]©wÀɨí«·s½sͤ~¯à±Ò°Ê¡C ¦Ü©óÁÙ¦³­þ¨Ç¬ÛÃö³]©w­n©ñ¤J kernel ³]©wÀÉ¡A½Ð°Ñ¾\/sys/i386/conf/LINT¡C µwºÐ¡BºÏ±a¾÷¥H¤Î¥úºÐ¡BDVD¡B¿N¿ý¾÷ FreeBSD ¥i¤ä´©­þ¨ÇºØÃþªºµwºÐ©O¡H FreeBSD ³£¤ä´© EIDE ¤Î SCSI ¤¶­±ªºµwºÐ(¥H¤Î SCSI ¥d¡A½Ð¬Ý¤U¤@¸`»¡©ú) ¥H¤Î Western Digital ¤¶­±ªºµwºÐ (MFM¡B RLL¡B ESDI¡A·íµM¥]§t IDE)¡A¤£¹L¦³¤@¨Ç¤Ö¼Æªº ESDI ´¹¤ù²Õªº(«¬¸¹¡GWD1002/3/6/7) ¥i¯àµLªk¥¿±`¹B§@¡C ¤ä´©­þ¨Ç SCSI ¥d¡B³]³Æ©O¡H ½Ð°Ñ¾\ &os; ªºµwÅé¤ä´©ªí( &rel.current; ©Î &rel2.current;) ¤ä´©­þ¨ÇºÏ±a¾÷©O¡H FreeBSD ¤ä´© SCSI ¤Î QIC-36 (QIC-02 ¤¶­±) ³W®æªººÏ±a¾÷¡C ¦P®É¥]§t¤F 8-mm (¤]´N¬O Exabyte) ¤Î DAT ºÏ±a¾÷¡C ¦³¨Ç¦­´Áª©¥»ªº 8-mm ºÏ±a¾÷¨Ã¤£¬O§¹¥þ¬Û®e©ó SCSI-2 ³W®æ¡A ©Ò¥H¥i¯à¦b FreeBSD ¤Wªí²{¤£¬O«Ü¦n¡C FreeBSD ¤ä´©ºÏ±a¦Û°Ê´«±a¾÷¶Ü¡H FreeBSD ¥i¥H¥Î &man.ch.4; ¤W­±©Ò¦Cªº¾÷ºØ¡A·f°t &man.chio.1; «ü¥O¡A ¨Ó¨Ï¥Î SCSI ºØÃþªº¦Û°Ê´«±a¾÷¡A²Ó¸`³¡¤À½Ð°Ñ¾\ &man.chio.1; »¡©ú¡C If you are not using AMANDA or some other product that already understands changers, remember that they only know how to move a tape from one point to another, so you need to keep track of which slot a tape is in, and which slot the tape currently in the drive needs to go back to. FreeBSD ¥i¤ä´©­þ¨ÇºØÃþªº¥úºÐ¾÷©O¡H ¥u­n¬O¦³¤ä´©ªº SCSI ¥d¤W©Ò±µªº¥ô¤@ SCSI ¥úºÐ¾÷³£¦³¤ä´©¡C ¦¹¥~¡A¤]¤ä´©¤U¦Cªº¥úºÐ¾÷¡G Mitsumi LU002 (8bit), LU005 (16bit) ¤Î FX001D (16bit 2x Speed) Sony CDU 31/33A Sound Blaster «D SCSI ¤¶­±ªº¥úºÐ¾÷ Matsushita/Panasonic ¥úºÐ¾÷ ¬Û®e ATAPI ³W®æªº IDE CDROMs ¬Û¹ï©ó SCSI ¾÷ºØ¦Ó¨¥¡A¨ä¥L«D SCSI ªº¥úºÐ¾÷³£¬O¤ñ¸ûºC¡A ¦¹¥~¡A¦³¨Ç ATAPI ºØÃþªº¥úºÐ¾÷¥i¯àµLªk¶¶§Q¹B§@ Daemon News ¥H¤Î FreeBSD Mall ©Òµo¦æªº¥¿¦¡ FreeBSD ¥úºÐ¥H¤Î¿N¿ý¥Îªº¼v¹³ÀÉ(ISO)¡A ³£¥i¥Hª½±µ¥Î©ó¶}¾÷¥úºÐ¨Ï¥Î¡C FreeBSD ¤ä´©­þ¨Ç¥úºÐ¿N¿ý¾÷ªºÅX°Êµ{¦¡©O¡H FreeBSD ¤ä´©¥ô¦ó¬Û®e ATAPI ¼Ð·Çªº IDE CD-R ©Î CD-RW ¥úºÐ¿N¿ý¾÷¡A ²Ó¸`½Ð°Ñ¾\ &man.burncd.8; »¡©ú¡C FreeBSD ¤]¤ä´©¥ô¦ó SCSI CD-R ©Î CD-RW ¥úºÐ¿N¿ý¾÷¡C ½Ð¥Î port ©Î packag ¾÷¨î¨Ó¦w¸Ë¡B¨Ï¥Î cdrecord ¡A ¨Ã½T©w±zªº kernel ¤º¦³±N pass³]³Æ¤@¨Ö½sͦb¤º¡C (¹w³]ªº kernel.GENERIC ³£·|¦³ device pass ³o¬q) FreeBSD ¤ä´© Iomega &iomegazip; ¶Ü? FreeBSD ¤ä´©¥~±µ¦¡ªº SCSI ¤Î ATAPI(IDE) ¤¶­±ªº Iomega &iomegazip;¡C ¤£¹L SCSI ZIP ¥u¯à³Q³]¬° SCSI ID 5 ©Î¬O 6 ¤~¥i¥H¹B§@¡A¦ý¦pªG SCSI ¥d¤Wªº BIOS ¤ä´©¥¦¡A§A¬Æ¦Ü¥i¥H¥Î¥¦¨Ó¶}¾÷¡C §Ú­Ì¤£¾å±o­þ¤@¶ô¥d¥i¥H§â¥dªº ID ³]¦b°£¤F 0 ©Î 1 ¥H¥~ªº¦a¤è¦Ó¶}¾÷¦¨¥\¡A ¦]¦¹¡A¦pªG·Q§ï SCSI ID ªº¸Ü¡A½Ð°È¥²°Ñ¾\¸Ó«¬¸¹ªº»¡©ú¤â¥U¡C FreeBSD ¦P®É¤]¤ä´© Parallel Port ZipºÏºÐ¾÷¡C½ÐÀˬd kernel ³]©wÀɬO§_¦³¡G scbus0¡B da0¡B ppbus0¡A¥H¤Î vp0 ³o¨ÇÅX°Êµ{¦¡ (¹w³]ªº GENERIC kernel °£¤F vp0 ¨S¥]¶i¥h¡A¨ä¥L¤TªÌ³£·|¦³)¡C ¥[¤F³o´X­ÓÅX°Êµ{¦¡¤§«á¡AParallel Port Zip ´N·|¦¨¬° /dev/da0s4¡C ³o®É¡A´N¥i¥H¥Î¹³¬O mount /dev/da0s4 /mnt ©Î (DOS Àɮרt²Î)mount_msdos /dev/da0s4 /mnt ¤§Ãþªº«ü¥O¨Ó±¾¸ü¡BŪ¼g¡C ¤]¥i¥H°Ñ¾\¤U­±¦³ÃöÀH¨­ºÏ¤ù ³¡¤À¡A¥H¤Î©â¨úºÐ¡BÀH¨­ºÐªº¡y®æ¦¡¤Æ¡z°Q½× ªº³¡¤À FreeBSD ¦³¤ä´© &jaz;¡BEZ ¤Î¨ä¥LÃþ¦üªºÀH¨­ºÏ¤ù¶Ü¡H ¥i¥H°Ú¡A°£¤F IDE ªº EZ drive ¥~¡A¨ä¥LªºÀ³¸Ó³£¬O SCSI ¤¶­±¡A ©Ò¥H¦b FreeBSD ¤W³£·|¥H SCSI µwºÐ¨Ó³B²z¡C ·íµM¡A§A¥²¶·½T©w¦b¶}¾÷®É¡A³o¨Ç³]³Æªº¹q·½¬O¥´¶}ªº¡A ¥H«KÅý FreeBSD ¥i¥H°»´ú¨ì¡C ¦pªG¦bºÏºÐ¹B¤¤ª¬ºA¤¤¡A­n§ó´«ºÏ¤ùªº¸Ü¡A °O±o¥ý¬Ý¤@¤U &man.mount.8;¡B&man.umount.8;¡B ¥H¤Î(SCSIªº¸Ü)&man.camcontrol.8; ©Î &man.atacontrol.8; ÁÙ¦³ FAQ «á­±¦³Ãö ¨Ï¥Î©â¨úºÐ¡BÀH¨­ºÐªº°Q½× ¡C Áä½L¡B·Æ¹« FreeBSD ¦³¤ä´© USB Áä½L¶Ü¡H FreeBSD (¤×¨ä¬O¦³¤ä´© USB keyboards¡C Enable USB support in /etc/rc.conf. ­Y¦³¶} USB Áä½L¤ä´©¦Ó¥B¦P®É±µ¤W AT ¸ò USB Áä½Lªº¸Ü¡A¨º»ò AT Áä½L·|Åܦ¨ /dev/kbd0¡A¦Ó USB Áä½L«h¬O /dev/kbd1¡C¦pªG¥u±µ USB Áä½L¡A¨º»ò¥¦´N¬O /dev/ukbd0 Åo¡C ¦pªG·Q¦b console ¤W¨Ï¥Î USB Áä½Lªº¸Ü¡A¨º»ò¥²¶·³]©w console «ü©w¥Î USB Áä½L¡C ¥i¥H¦b¨t²Î¶}¾÷µ{§Ç®É¡A¥[¤W¤U¦C«ü¥O¡G &prompt.root; kbdcontrol -k /dev/kbd1 < /dev/ttyv0 > /dev/null ª`·N¡G­Y¥u¦³ USB Áä½Lªº¸Ü¡A¤]´N¬O /dev/ukbd0¡A ¨º»ò½Ð§ï¥Î¤U¦C«ü¥O¡G &prompt.root; kbdcontrol -k /dev/ukbd0 < /dev/ttyv0 > /dev/null «ØÄ³¡G¥i¥H§â¤W­z«ü¥O©ñ¤J /etc/rc.i386 ¡C ³]©w¦¨¥\¤§«á¡AUSB Áä½L¤£¥Î§@¥ô¦ó¯S§O³]©w¡A´N¥i¥H¦b X µøµ¡Àô¹Ò¤W¥¿±`¹B§@Åo¡C USB Áä½Lªº¼ö´¡©Þ(Hot-plugging and unplugging)¦b &os; ¥i¯àÁÙµLªk§¹¥þ¥¿±`¹B§@¡A «ØÄ³¡G¦b¨t²Î¶}¾÷«e´N¥ý±µ¤WÁä½L¡Aª½¨ìÃö¾÷¬°¤î¡A¥HÁ×§K¤£¥²­nªº§xÂZ¡C ¬ÛÃö²Ó¸`½Ð°Ñ¾\ &man.ukbd.4; ªº»¡©ú¡C ¥j¦­ªº bus ·Æ¹«¡A­n«ç»ò³]©w©O¡H FreeBSD ¤ä´©¤@¨Ç¼t°Ó(¹³¬O¡GMicrosoft¡BLogitech¡BATI)©Ò°µªº bus ¤Î InPort bus ¤¶­±ªº·Æ¹«¡C µM¦Ó¡A¹w³]ªº kernel(GENERIC)¤w¸g¤£¤º§t¥¦­ÌªºÅX°Êµ{¦¡¡C ¦]¦¹¡A­n¥[¤J¤U¦C¨ì kernel ³]©wÀɨí«·s½sĶ¡B¦w¸Ë¡A¤~¯à±Ò¥Î¡G device mse0 at isa? port 0x23c irq5 Bus ·Æ¹«³q±`­n·f°t±M¥Îªº¤¶­±¥d¤~¯à¨Ï¥Î¡C ³o¨Ç¥d¥i¥H³]©w port address ¤Î IRQ ­È¡A³o¨Ç²Ó¸`½Ð°Ñ¾\§Aªº·Æ¹«»¡©ú¤â¥U¤Î &man.mse.4; »¡©ú¡C PS/2 (mouse port ©Î keyboard)ªº·Æ¹«­n«ç»ò³]©w¤~¦n©O¡H PS/2 ·Æ¹«³£¦³¤ä´©¡A©Ò»Ý­n¥Î¨ìªºÅX°Êµ{¦¡ psm ¦b¹w³]ªº kernel(GENERIC)¤w¦³¤º§t¤F¡C ­Y§A¦Û­qªº kernel ¤ºº|¤F psm ªº¸Ü¡A¨º»ò´N¦A§â¤U¦C¤º®e¥[¨ì kernel ³]©wÀɨí«·s½sĶ¡B¦w¸Ë¡G device psm0 at atkbdc? irq 12 ·í¶}¾÷®É kernel ¦³¥¿½T°»´ú¨ì psm0 ¡A½Ð°È¥²½T»{¦b /dev ¤º¦³ psm0 ¡C ¦pªG¨S¦³ªº¸Ü¡A¨º»ò´N¥Î root ¨Ó¥´¤U¦C«ü¥O¨Ó«Ø¥ß§a¡G &prompt.root; cd /dev; sh MAKEDEV psm0 ¦pªG¬O &os; 5.0-RELEASE(§t¤§«áª©¥»)ªº¸Ü¡A¦]¬°±Ä¥Î &man.devfs.5; ¾÷¨îªº¦]¯À¡A ©Ò¥H·|¦Û°Ê¦b /dev ¤U«Ø¥ß¬ÛÃö³]³Æªº¸`ÂI¡A¦]¦¹´N¥i¥H²¤¹L¤W­±³o¤@¨B¡C ¦pªG¤£¥Î X Window Àô¹Òªº¸Ü¡A¤]¥i¥H¥Î·Æ¹«¶Ü¡H ­Y¨Ï¥Î console ªº¹w³]ÅX°Êµ{¦¡(¤]´N¬O &man.syscons.4;)¡A ¨º»ò´N¥i¥H¦b¤å¦r¤¶­±ªº console ¤W­±¥Î·Æ¹«¨Ó°Å¶K¤å¦r¤F¡C ¨º»ò­n±Ò°Ê &man.moused.8; ¨Ã¶}±Ò´å¼ÐÅã¥Ü¡A ½Ð¥´¤U¦C«ü¥O¡G &prompt.root; moused -p /dev/xxxx -t yyyy &prompt.root; vidcontrol -m on ¨ä¤¤¡yxxxx¡z¬O·Æ¹«ªº³]³Æ¦WºÙ¡A¦Ó ¡yyyyy¡z«h¬O·Æ¹«©Ò¨Ï¥Îªº protocol ºØÃþ¡C ¥Ø«eªº moused ¥i¥H¦Û°Ê°»´ú(°£¤F¦¡ªº serial ·Æ¹«¤§¥~)¤j¦h¼Æ·Æ¹«©Ò¨Ï¥Îªº protocol ºØÃþ¡A¦Ó¤£¥Î¨è·N¥h«ü©w¡C ¡yprotocol ºØÃþ¡z³]©w¥Î auto ´N·|¦Û°Ê°»´ú¤F¡C­Y¦Û°Ê°»´ú¥¢±Ñªº¸Ü¡A½Ð°Ñ¾\ &man.moused.8; ¸Ì­±ªº type ¨º¬q»¡©ú¡C ¦pªG¥Îªº¬O PS/2 ·Æ¹«¡A¥u­n§â moused_enable="YES" ¥[¨ì /etc/rc.conf ¡A³o¼Ë¨C¦¸¶}¾÷´N·|¦Û°Ê±Ò°Ê¤F¡C ¦¹¥~¡A¦pªG­n¦b©Ò¦³ virtual terminals ¤W¤]¯à¨Ï¥Î·Æ¹«¡A ¦Ó¤£­­©w¥u¦³ console ªº¸Ü¡A¨º»ò½Ð¦A§â allscreens_flags="-m on" ¥[¨ì /etc/rc.conf ¸Ì­±§Y¥i¡C moused ¦b°õ¦æ¤¤ªº®É­Ô¡A¦pªG­n¨Ï¥Î·Æ¹«¬ÛÃö¥\¯à¡A³£¥²¶·³z¹L moused ©Î¨ä¥Lµ{¦¡¹³¬O X µøµ¡¨Ó¶i¦æ¡C½Ð°Ñ¾\ FAQ ¤¤¦³Ãö¡y¬°¤°»ò¤£¯à¦b X µøµ¡¸Ì¨Ï¥Î·Æ¹«¡H¡z¥HÁA¸Ñ¬ÛÃö²Ó¸`¡C ¦b¤å¦r¼Ò¦¡ªº console Àô¹Ò­n«ç»ò¥Î·Æ¹«¨Ó°Å¶K¤å¦r©O¡H ·í°õ¦æ moused «á¡A(°Ñ¾\«e¤@¸`) «ö¦í¥ªÁä¡A±µµÛ²¾°Ê·Æ¹«¨Ó¿ï¾Ü¤@­Ó°Ï°ì¤§«á©ñ¶}¡A³o¼Ë´N§¹¦¨¡y½Æ»s¡z¡C ­n¡y¶K¤W¡zªº¸Ü¡A«ö·Æ¹«¤¤Áä´N¥i¥H¤F¡C ­n¡y©µ¦ù¿ï¨ú°Ï¡zªº¸Ü¡A«ö·Æ¹«¥kÁä ¦pªG§Aªº·Æ¹«¨S¦³¤¤Áä¡A§A¥i¥H¥Î¼ÒÀÀªº¤è¦¡¡A©Î¬O­«·s©w¸q·Æ¹««öÁ䪺¤è¦¡¡A ¨Ó¹F¦¨¡u©µ¦ù¡vªº¥\¯à¡C¸Ô±¡½Ð°Ñ¾\ &man.moused.8; »¡©ú¡C §Ú·Æ¹«¤W­±ªººu½ü¡Bºu½ü«ö¶s¡A¥i¥H¦b console ¤W¨Ï¥Î¶Ü¡H ³o­Óµª®×¹À...¡A«Ü¤£©¯¦a¡A¦b¤j¦h¼Æªº±¡ªp¤U¤£¦æ¡C ³o¨Ç¦³ºu½üªº·Æ¹«»Ý­n¥Î¯S®íÅX°Êµ{¦¡¤~¦æ¡A °£«D¡A·Æ¹«ÅX°Êµ{¦¡©Î¨Ï¥ÎªÌ¦Û¤vªºÀ³¥Îµ{¦¡¦³¤ä´©¡A ¤£µM¡A³o¨Ç·Æ¹«¥u¯à°÷·í¦¨¬O´¶³qªº¨âÁä©Î¤TÁ䪺·Æ¹«¨Ó¥Î¦Ó¤w¡C ¦pªG­n¦b X µøµ¡Àô¹Ò¤W¨Ï¥Îºu½üªº¸Ü¡A½Ð°Ñ¾\ X µøµ¡¤Wªººu½ü¨Ï¥Î »¡©ú¡C ­n«ç»ò¦bµ§°O«¬¹q¸£¤W¨Ï¥Î·Æ¹«¡B­y¸ñ²y¡BIJ±±ªO©O¡H ½Ð°Ñ¾\«e­±ªº PS/2 ·Æ¹«ªº°Ýµª ¡C ºô¸ô¸ò serial ³]³Æ FreeBSD ¤ä´©­þ¨Çºô¸ô¥d©O¡H ½Ð°Ñ¦Ò &os; ¦Uª©¥»ªºµwÅé¤ä´©¦Cªí¡C ¬°¤°»ò FreeBSD §ä¤£¨ì PnP(ÀH´¡ÀH¥Î¡APlug & Play)³W®æªº modem? ­ì¦]¦b©ó¡G»Ý­n§â modem ªº PnP ID ¥[¨ì serial ÅX°Êµ{¦¡ªº PnP ID ªí¡A§@ªk¦p¤U¡G ­º¥ý¡A¦b kernel ³]©wÀɤº¥[¤J controller pnp0¡A ¨Ã­«·s½sĶ¡B¦w¸Ë kernel¡A³Ì«á­«¶}¾÷´N·|±Ò°Ê PnP ¤ä´©¡C µM«á¡Akernel ·|§â°»´ú¨ì©Ò¦³³]³Æ¤Wªº PnP ID ³£¦C¥X¡C ³o®É¡A­×§ï /usr/src/sys/isa/sio.c(¤j¬ù²Ä752¦æ¥ª¥kªº¦a¤è)¡A ¥i¥H·j´M SUP1310 ·íÃöÁä¦r(¦ì©ó sio_ids[] ªí¤º)¡A ½Ð±N­è¤~ kernel Åã¥Üªº modem ªº PnP ID ½Æ»s¨ì¬ÛÃö¦ì¸m¡C ³o®É¡A¦A­«·s½sĶ¡B¦w¸Ë kernel¡A³Ì«á­«¶}¾÷À³¸Ó´N·|¥¿½T°»´ú¨ì modem ¤F¡C ¦¹¥~¡A¤]¥i¥H¦b¶}¾÷®É¥H pnp «ü¥O¨Ó¤â°Ê³]©w PnP ³]³Æ¡A ¨ÓÅý kernel ±o¥H¥¿½T°»´ú¡AÁ|¨Ò¡G pnp 1 0 enable os irq0 3 drq0 0 port0 0x2f8 FreeBSD ¤ä´©¹³¬O Winmodems ¤§Ãþªº³nÅé modem ¶Ü¡H FreeBSD ¥i¥H¦w¸ËÃB¥~ªº³nÅé¨Ó¤ä´©³nÅé modem¡C ¹³¬O comms/ltmdm ¥i¤ä´©±`¨£ªº Lucent LT ´¹¤ù¡A comms/mwavem «h¥i¤ä´© IBM Thinkpad 600 ¤Î 700 µ§°O«¬¹q¸£¤W­±ªº modem¡C µM¦Ó¡A¨Ã¤£¯à¥Î³nÅé modem ¨Ó¦w¸Ë FreeBSD¡A ¦]¬°¡G³oÃþ³nÅ饲¶·¦b§@·~¨t²Î¦w¸Ë§¹²¦¤§«á¡A¤~¯à¦w¸Ë¡C ¦³ Broadcom 43xx µL½uºô¥dªº­ì¥ÍÅX°Êµ{¦¡(Native driver)¶Ü¡H ¨S¦³¡A¦Ó¥B¤]¤£¤Ó¥i¯à·|¦³¡C Broadcom ©Úµ´¤½¶}¦³ÃöµL½uºô¥d´¹¤ùªºÅX°Êµ{¦¡¬ÛÃö»¡©ú¡A ¥D¦]¤j·§¬O¥L­Ì¥Î³nÅé¨Ó±±¨îµL½u¶Ç¿é¤è¦¡¡C ¨Æ¹ê¤W¡A¦]¬°­n¯à³q¹L¬ü°êÁp¨¹¹q«H©e­û·|(FCC)À˺Ϧw³Wªº¸Ü¡A ¥²¶·½T«O²£«~¤£¯àÅý¨Ï¥ÎªÌ¤£¯àÀH·N§ó°Ê¬ÛÃö³]©w¡A¤ñ¦p¡G¹qºÏªiÀW²v¡B¬ÛÃö¼Ò²Õ°Ñ¼Æ¡B¿é¥X¹q·½µ¥¡C ¦ý¬O¡A¦pªG§Ú­Ì¤£ª¾¹D¦p¦ó¥h±±¨î´¹¤ùªº¸Ü¡A¨º»ò¼¶¼gÅX°Êµ{¦¡¤§¸ô®£©È¤£¤Ó¥i¦æ¡C FreeBSD ¤ä´©­þ¨Ç multi-port serial¥d©O¡H ½Ð°Ñ¾\¨Ï¥Î¤â¥U¤Wªº ¦w¸Ë½g¡X¨ä¥LµwÅé ¦Cªí¡C ÁöµM¦³¨Ç¥d¬O¨SµPªº(¤×¨ä¬O¦³¼Ð©ú¡G¬Û®e AST ³W®æ)¦ý¤]¥i¥H¥¿±`¨Ï¥Î¡C ¦Ü©ó¥dªº³]©w¤è­±¡A½Ð°Ñ¾\ &man.sio.4; ªº»¡©ú¡C ¦b serial console ¤W­n¦p¦ó¤~·|¥X²{ boot: ´£¥Ü©O¡H kernel ³]©wÀÉ¥[¤J options COMCONSOLE «Ø¥ß /boot.config ÀÉ¡A¨Ã¥B¸ÓÀɸ̭±¤º®e¥u¶ñ¤W §âÁä½L±q¾÷¾¹¤W©Þ±¼ ²Ó¸`½Ð¬Ý /usr/src/sys/i386/boot/biosboot/README.serial ­µ®Ä¥d FreeBSD ¤ä´©­þ¨Ç­µ®Ä¥d¡H &os; ¤ä´©¦UºØ­µ®Ä¥d¡A¥]¬A¤F &soundblaster;¡B &soundblaster; Pro¡B&soundblaster; 16¡BPro Audio Spectrum 16¡B AdLib¡B¤Î Gravis UltraSound sound cards (²Ó¸`½Ð°Ñ¾\ &os; µo¦æ±¡³ø ¥H¤Î &man.snd.4; ªº»¡©ú)¡C ¦¹¥~¡A¹ï MPU-401 ¤Î MIDI ¬Û®e³W®æªº¤]¦³¤@©wµ{«×ªº¤ä´©¡A¦Ó µsoft; Sound System ³W®æ¤]¦³¤ä´©¡C ÅX°Êµ{¦¡¶È¾A¥Î©ó¡y­µ®Ä¡z³¡¤À¡I °£¤F &soundblaster; ¤§¥~¡A ¥Ø«e­µ®ÄÅX°Êµ{¦¡¨Ã¤£¤ä´©³o¨Ç­µ®Ä¥d¤Wªº¥úºÐ¾÷, SCSI³]³Æ©Î·n±ì¡C &soundblaster; ªº SCSI ¤¶­±¤Î¬Y¨Ç«D SCSI ªº¥úºÐ¾÷¬O¦³¤ä´©¡A¦ýµLªk¥Î¨Ó¶}¾÷¡C &man.pcm.4; ©Ò¤ä´©ªº­µ®Ä¥d¨S¦³Án­µ¡A¦³¤°»ò¼È®É¸Ñ¨M¤è¦¡¶Ü¡H ¦]¬°¦³¨Ç¹³¬O es1370 ´¹¤ùªº­µ®Ä¥d·|¦b¨C¦¸¶}¾÷®É§â­µ¶q½Õ¬°¹s¡C ¼È®É¸Ñªk¬O¦b¨C¦¸¶}¾÷®É°õ¦æ¤U­±«ü¥O¡A©Î¬O¥[¨ì /etc/rc.local ¤º¡G &prompt.root; mixer pcm 100 vol 100 cd 100 ¨ä¥LµwÅé FreeBSD Á٤䴩¨ä¥L­þ¨ÇµwÅé©O¡H ½Ð°Ñ¾\¨Ï¥Î¤â¥U¤Wªº ¦w¸Ë½g¡X¨ä¥LµwÅé ¡C FreeBSD ¤ä´©µ§°O«¬¹q¸£ªº¬Ù¹qºÞ²z¥\¯à¶Ü¡H FreeBSD 4.X(§t¤§«áª©¥»)¦b¬Y¨Ç¾÷ºØ¤W³£¦³¤ä´© APM¡C ²Ó¸`½Ð°Ñ¾\ &man.apm.4; ªº»¡©ú¡C FreeBSD 5.X(§t¤§«áª©¥»)¤ä´©¦b¥Ø«e¤j³¡¤À¾÷ºØ¤W³£¦³ªº ACPI ¥\¯à¡C ²Ó¸`½Ð°Ñ¾\ &man.acpi.4; ªº»¡©ú¡C­Y¾÷¾¹¤W¦P®É³£¦³ APM ¤Î ACPI ¥\¯àªº¸Ü¡A§Ú­Ì«ØÄ³§A¥i¥H¨âªÌ³£¸Õ¸Õ¬Ý¡A ¬Ý¬Ý­þ¤@ºØ¤ñ¸û²Å¦X§Aªº»Ý¨D¡C ¸Ó¦p¦óÃö³¬ ACPI¡H §â hint.acpi.0.disabled="1" ³o¬q¥[¨ì /boot/device.hints §Y¥i¡C Micron ¹q¸£Á`¬O¦b &os; ±Ò°Ê®É´N±¾±¼¡A¸Ó«ç»ò¿ì©O¡H ¦³¨Ç Micron ¥D¾÷ªO¤Wªº BIOS ¦b PCI ¤è­±·|¦³°ÝÃD¡A ³o·|¾É­P PCI ³]³Æ·|³Q BIOS °»´ú¬°¤£¥¿½T³]©w¡A¦Ó¶i¤J FreeBSD ´N±¾±¼¡C ¼È®É¸Ñ¨M¤è¦¡¡GÃö³¬ BIOS ¤º Plug and Play Operating System ªº³]©w¡C &tm.3com; PCI ¤¶­±ºô¸ô¥dµLªk¦b Micron ¹q¸£¤W¨Ï¥Î¡A¸Ó«ç»ò¿ì¡H ³o°ÝÃD¸ò«e­±ªº°ÝÃD¦]¯À¤@¼Ë¡AÁ`¤§¡A´N¬OÃö³¬ BIOS ¤¤¦³Ãö OS PnP ªº³]©w¡C ¼È®É¸Ñ¨M¤è¦¡¡GÃö³¬ BIOS ¤º Plug and Play Operating System ªº³]©w¡C ¥D¾÷ªO¬O¥ÎµØºÓ(ASUS) K7V¡A¥i¬O¥Î¶}¾÷¤ù¶}¨ì¤@¥b´N·í¤F¡A«ç»ò¿ì©O¡H ¶i¤J BIOS ³]©w¡A¨ÃÃö³¬ boot virus protection ³]©w§Y¥i¡C - My PCMCIA card does not work. I have a message: + PCMCIA ¥dµLªk¨Ï¥Î¡A¨Ã¥X²{¿ù»~°T®§ cbb0: unsupported card type detected. - What can I do? + ¸Ó«ç»ò¿ì¡H - You can try to use the original OLDCARD implementation. Edit - your kernel configuration file and remove the following lines: + ¥i¥H¸Õ¸Õ¬Ý§ï¥Îªº¤è¦¡¡A½Ð¥ý­×§ï kernel ³]©wÀÉ¡A®³±¼¤U­±³o´X¦æ¡G device cbb device pccard device cardbus - Then add: + µM«á¥[¤W¡G device pcic device card 1 - Rebuild and install the new kernel as described in - Configuring - the FreeBSD Kernel. + ³Ì«á½Ð°Ñ¾\ Handbook ¤¤ + ½Õ¾ã FreeBSD Kernel + ³¹¸`¡A¥H­«·s½sĶ¡B¦w¸Ë·sªº kernel¡C ¬°¤°»ò &dell; &poweredge; 2850 ¸Ë§¹ FreeBSD ¤§«á¡A­«¶}¾÷±µµÛÁä½L´N±¾¤F¡H (¥»ÃD¥Ñ cdsheen ´£¨Ñ)À|¸Õ¦b &dell; &poweredge; 2850 ¤W­±¦w¸Ë &os; 6.0¡A ¤£¹L¦w¸Ë§¹¦¨¡B¨Ã­«·s¶}¾÷¤§«á¡Aµo²{ console ªºÁä½L¤£¯à°Ê¤F¡A ¦P¼Ëªº±¡ªp¦ü¥G¤]¦s¦b©ó &os; 5.3 ¤Î &os; 5.4¡A ¸g¹L¤@µf·j´M¡Aµoı¬O¦]¬°³o¥x¾÷¾¹¤W­±¦³¤@­Ó Dell Remote Access Controller (DRAC)¡A ³o­Ó¸Ë¸m·|³Q¨t²Î¿ëÃѦ¨¤@­Ó USB Keyboard¡A©Ò¥H¾É­P¶}§¹¾÷¤§«á¡A¥¿±`ªº PS/2 Áä½L¤Ï¦Ó¤£¯à°Ê¤F¡I ¼È®É¸Ñ¨M¤è¦¡¦p¤U¡G ¥ý¥H Single User Mode ¶i¤J¨t²Î ¦b©R¥O¦C¼Ò¦¡¤U¡A¥ý°õ¦æ¤U¦C©R¥O¡G &prompt.root; fsck -y / &prompt.root; mount -u / µM«á½s¿è /etc/devd.conf¡A§â¹ï©ó USB Keyboard ªº¤ä´©¼È®É®³±¼¡A ¤]´N¬O§â¤U­±´X¦æ¶}ÀY¥[¤W # # When a USB keyboard arrives, attach it as the console keyboard. #attach 100 { # device-name "ukbd0"; # action "kbdcontrol -k /dev/ukbd0 < /dev/console && /etc/rc.d/syscons restart"; #}; #detach 100 { # device-name "ukbd0"; # action "kbdcontrol -k /dev/kbd0 < /dev/console"; #}; µM«á¿é¤J exitÂ÷¶} Single User Mode ¤§«á¡A ´N¥i¥H¶¶§Q¶i¤J¨t²Î¡B¦Ó¥BÁä½L¤]¥i¥H¥¿±`¹B§@¡A¤U¦¸¶}¾÷¤]¤£·|¦³°ÝÃD¡I ¥t¥~¡A&dell; ªº DRAC/BMC ¬Ý°_¨Ó¦³ÆZ¦h¤£¿ùªº»·ºÝ¦s¨ú¥\¯à¡A¦³¿³½ìªº¤H¥i¥Hª±ª±¬Ý... William Liao
chliao@tpts4.seed.net.tw
±`¨£°ÝÃD¸Ñ¨M - §ÚªºµwºÐ¦³Ãa­y®É¸Ó«ç»ò¿ì? + µwºÐ¦³Ãa­y®É¸Ó«ç»ò¿ì? ­Y¬O SCSI µwºÐªº¸Ü¡A¨º»òºÏºÐ¾÷À³¸Ó¦³¯à¤O¦Û°Ê§@ re-mapping ªº°Ê§@¡CµM¦Ó¡A¦]¬°¤@¨Ç¥¼ª¾ªº¦]¯À¡A¦b¥X¼t®É¡A«Ü¦hµwºÐªº³o¶µ ¥\¯à¬OÃö³¬ªº... ­n±N¨ä­«·s¶}±Ò¡A±z»Ý­n½s¿è¸Ë¸mªº²Ä¤@­Ó page ¼Ò¦¡ ¡]first device page mode¡^¡A¦b FreeBSD ¤W¥i¥H¥Î¤U­±ªº«ü¥O¿ì¨ì ¡]¥H root¨­¤À°õ¦æ¡^ &prompt.root; scsi -f /dev/rsd0c -m 1 -e -P 3 µM«á±N AWRE ©M ARRE ªº¼Æ­È±q 0 Åܦ¨ 1:- AWRE¡]Auto Write Reallocation Enbld¡^¡G 1 ARRE¡]Auto Read Reallocation Enbld¡^¡G 1 ¥H¤U³o¬q¬O¥Ñ Ted Mittelstaedt tedm@toybox.placo.com©Ò´£¨Ñ¡G ­Y¬° IDE µwºÐ¡A¥ô¦óªºÃa­y³q±`³£¬O³Â·Ðªº¹w¥ü¡C¥Ø«e©Ò¦³¸û·sªº IDE µwºÐ¡A¤º³¡³£¦³¦Û°Ê remapping Ãa­yªº¯à¤O¡C¥Ø«e©Ò¦³ IDE µwºÐ »s³y°Ó¡A³£´£¨Ñ¤F§ó¤[ªº«OÃÒ¡A¦Ó¥B·|À°±z§ó´«¥X²{Ãa­yªºµwºÐ¡C ¦pªG±z¤´·Q­n­×´_²£¥ÍÃa­yªº IDE µwºÐ¡A±z¤´¥i¥H¸ÕµÛ¥h¤U¸ü IDE µwºÐ»s³y°Ó©Ò´£¨ÑªºÀË´úµ{¦¡¡A¨Ã¥Î¥¦¨ÓÀˬd±zªºµwºÐ¡C¦³®É³o¨Ç³nÅé¥i ¥H±j­¢­«·sÀˬdµwºÐªºÃa­y¡A¨Ã±N¥¦­Ì¼Ð¥Ü¥X¨Ó¡C ¹ï ESDI¡ARLL ¤Î MFM ªºµwºÐ¨Ó»¡¡A³q±`Ãa­y¬O¥¿±`²{¶H¡A¤]¤£¬O¤° »ò³Â·Ðªº«e¥ü¡C¦b PC ¤W¡AºÏºÐ±±¨î¥d©M BIOS ­t³d¼Ð¥ÜÃa­yªº¥ô°È¡C³o ¹ï¤@¨Ç¨Ï¥Î BIOS¨Ó¦s¨úºÏºÐªº§@·~Àô¹Ò¡]¦p DOS¡^¬O¨S¦³°ÝÃDªº¡CµM¦Ó¡A FreeBSD ªººÏºÐÅX°Êµ{¦¡¨Ã¤£¸g¹L BIOS ¨Ó¦s¨úºÏºÐ¡A©Ò¥H¡A¦³­Ó bad144 ªº¾÷¨î¥Î¨Ó¨ú¥N³o¶µ¥\¯à¡Cbad144 ¥u¯à¥Î¦b wd ³o­ÓºÏºÐÅX°Êµ{¦¡¤W¡]³o ­Ó¥Nªí¤F FreeBSD 4.0 ¨Ã¤£¤ä´©¥¦¡^¡A¥¦¤]µLªk¥Î¦b SCSI µwºÐ¤W¡C bad144ªº¤u§@¤èªk¬O±N©Ò¦³§ä¨ìªºÃa­y¸ê®Æ¦s¨ì¤@­Ó¯S§OªºÀÉ®×ùØ¡C ¨Ï¥Î bad144 ªºÄµ§i - ¦sµÛÃa­y¸ê®Æªº¯S§OÀɮ׬O©ñ¦bµwºÐªº³Ì«á ¤@­y¤W¡C¦]¬°³o­ÓÀÉ®×Àx¦sªºÃa­y¸ê®Æ¤¤¡A¦³¥i¯à¦³¨Ç¸ê®Æ¬O«ü¦VµwºÐ³Ì «eºÝ©Òµo¥ÍªºÃa­y±¡§Î¡A´N¬O¥i¯àÀx¦s /kernel ³o­ÓÀɪº¦a¤è¡A©Ò¥H¥¦ ¤@©w­n¯à³Q¶}¾÷µ{¦¡©ÒŪ¨ú¡A¦Ó¶}¾÷µ{¦¡¬O³z¹L BIOS ¨ÓŪ¨ú kernel ÀÉ¡C³oªí¥Ü¤F¨Ï¥Î bad144 ªºµwºÐµ´¤£¯à¾Ö¦³¶W¹L 1024 ­Ó cylinder¡A 16 ­Ó head ¤Î 63 ­Ó sector¡C¦Ó³o¨Ï±o±ý¨Ï¥Î bad144 ªºµwºÐªº¤j¤p¤£ ¯à¤j©ó 500 MB¡C ­n¨Ï¥Î bad144 «Ü²³æ¡A¥u­n¦b¶}©l¦w¸Ë®É¡A¦b FreeBSD fdisk µe­± §âBad Block ±½ºË³]¬° ON §Y¥i¡C¦b FreeBSD 2.2.7 ¥H «á³£¥i¥H¨Ï¥Î¦¹¤èªk¡C¦ý³o­ÓµwºÐªº cylinder ¤@©w­n¦b 1024 ¥H¤U¡C¨Ï ¥Î«e¡A§Ú­Ì«ØÄ³³o­ÓµwºÐ­n¦Ü¤Ö¥ý¨Ï¥Î¥|­Ó¤p®É¡A¥H«K¼ö¿±µÈ»PºÏ­y°¾²¾ ¹F¤@¯ëª¬ºA¡C ¦pªG³o­ÓµwºÐ¾Ö¦³¶W¹L 1024 ­Ó cylinder¡]¹³¤j®e¶qªº ESDI µwºÐ¡^ ¡AESDI ±±¨î¥d§Q¥Î¤@­Ó¯S§OªºÂà´«¼Ò¦¡¨Ï¥¦¯à¦b DOS ¤U¤u§@¡C¦Ó¦pªG±z ¦b fdisk ùتº set geometry ¤¤¿é¤J Âà´«¹L ªº geometry¡Awd ³o­ÓÅX°Êµ{¦¡¯à¤F¸Ñ³o¨ÇÂà´« ¼Ò¦¡¡C±z¤]µ´¹ï¤£¯à¨Ï¥Î dangerously dedicated ¼Ò¦¡¨Ó«Ø¥ß FreeBSD ªº¤À³Î°Ï¡A¦]¬°¥¦·|©¿²¤ geometry ³o­Ó°Ñ¼Æ¡C¦¹¥~¡A´Nºâ fdisk ¨Ï¥Î ±z©Ò¿é¤Jªº geometry °Ñ¼Æ¡A¥¦¨ÌµM·|¥hŪ¨ú³oµwºÐªº¯u¥¿¸ê®Æ¡A¦Ó·|¹Á ¸Õ¥h«Ø¥ß¤@­Ó¹L¤jªº FreeBSD ¤À³Î°Ï¡C¦pªGºÏºÐªº geometry ¤w¸g³Q Âà´« ¹L¤F¡A¨º»ò ³o­Ó¤À³Î°Ï ¥²¶· ¥H¤â°Ê¿é¤J block ¼Æ¥Øªº¤èªk¨Ó«Ø¥ß¡C ¤@­Ó§Ö³tªº¤p§Þ¥©¬O§Q¥Î ESDI ±±¨î¥d¨Ó³]©w¤j®e¶qªº ESDI µwºÐ¡A ¥Î DOS ¶}¾÷¤ù¶}¾÷¡A¦A±N¥¦ format ¬° DOS ªº¤À³Î°Ï¡CµM«á­«¶}¾÷¶i¤J FreeBSD ¦w¸Ëµ{§Ç¡A¦b fdisk µe­±¡A§âDOS ¤À³Î°Ïªº blocksize ©M block number §Û¤U¨Ó¡CµM«á­«·s³]©w geometry ¨Ï¨ä¸ò DOS ¨Ï¥Îªº¤@¼Ë¡C §R°£ DOS ¤À³Î°Ï¡AµM«á¨Ï¥Î±z­è­è§Û¤Uªº blocksize ¨Ó«Ø¥ß¤@­Ó cooperative FreeBSD ¤À³Î°Ï¡CµM«á³]©w³o­Ó¤À³Î°Ï¬°¥i ¶}¾÷¡A¦A¥´¶}Ãa­y±½ºË¡C¦b¯u¥¿ªº¦w¸Ë¹Lµ{¤¤¡Abad144 ·|¦b¥ô¦óÀɮרt²Î ³Q«Ø¥ß«e¥ý³Q°õ¦æ¡C¡]±z¥i¥H«ö Alt-F2 ¨ÓºÊ¬Ý³o¤@¤Á¡^¦pªG¦b«Ø¥ßÃa­y¸ê ®ÆÀɮɵo¥Í¤F°ÝÃD¡A±z·|»Ý­n³]©w¤@­Ó¸û¤jªººÏºÐ geometry - ³oªí¥Ü±z »Ý­n­«¶}¾÷¡AµM«á¥þ³¡¦A­«·s¶}©l¡]¥]¬A­«·s¤À³Î¥H¤Î¦b DOS ¤U­«·s format¡^¡C ¦pªG remapping ªº¥\¯à¤w¸g±Ò°Ê¤F¡A¦Ó±z¨ÌµM¤@ª½¬Ý¨ìÃa­y²£¥Í¡A ¨º»ò¦Ò¼{´«¤@¥xµwºÐ§a¡CÃa­yªº±¡§Î¥u·|ÀH®É¶¡¼W¥[¦Ó§ó¬°ÄY­«¡C - - - ¬°¤°»ò FreeBSD §ì¤£¨ì§Úªº Bustek 742a EISA SCSI ¥d¡H - - - - ¤U­±ªº¸ê°T¬Oµ¹ 742a ³o±i¥d¥Îªº¡A¦ý¬O¨ä¥L Buslogic ªº¥d©Î³\¤] - ¥i¥H¾A¥Î¡C¡]Bustek ´N¬O Buslogic¡^ - - 742a ³o±i¥d¦³¨â­Ó¥D­nªºª©¥»¡C¤@­Ó¬Oª©¥» A-G¡A - ¥t¤@­Ó¬Oª©¥» H ¤Î¨ä¥H«á¡Cª©¥»¸ê°T¥i¥H±q¤¶­±¥dÃä½tªº¬y¤ô¸¹³Ì«á­± - ±oª¾¡C742a ³o±i¥d¦³¨â­Ó°ßŪ´¹¤ù¦b¥¦¤W­±¡A¤@­Ó¬O BIOS ´¹¤ù¡A¦Ó¥t - ¤@­Ó¬O¶´Åé´¹¤ù¡C FreeBSD ¨Ã¤£¦b¥G±z¥d¤Wªº BIOS ª©¥»¡A¦ý¬O¶´Å骺 - ª©¥»´N«Ü­«­n¤F¡C¦pªG§A¥´¹q¸Üµ¹¥L­Ì§Þ³N¤ä´©±M½uªº¸Ü¡A¥L­Ì·|±Hµ¹ - ±z³Ì·sªºª©¥»¨Ñ±z¤É¯Å¡C BIOS ©M¶´Åé´¹¤ù¬O¤@°_°e¨Óªº¡C ±z»Ý­n±N¥d - ¤W BIOS ©M¶´Å骩¥»¡A¨Ì±z¥dª©¥»ªº¤£¦P¡A¤É¯Å¨ì³Ì·sªº¤@ª©¡C - - ª©¥» A-G ªº¥d³Ì°ª¥u¯à±N BIOS/¶´Åé ¤É¯Å¨ì 2.41/2.21 ª©¡A¦Ó H - ¤Î¨ä¤§«áªºª©¥»¡A¥Ø«e BIOS/¶´Å骺³Ì·sª©¥»¬O 4.70/3.37¡C³o¨â­Ó¶´Åé - ª©¥»¶¡ªº®t²§¦b©ó¡A3.37 ³oª©¤ä´© round robin - - Buslogic ªº¥d¤W­±¤]³£¦³§Ç¸¹¡C¦pªG±z¥dªºª©¥»¸û¡A±z¥i¥H¸ÕµÛ¥´ - ¹q¸Üµ¹ Buslogic ªºRMA ³¡ªù¡AµM«áµ¹¥L­Ì±zªº§Ç¸¹¡A¬Ý¯à¤£¯à¸ò¥L­Ì¥æ - ´«¤@±i¸û·sª©¥»ªº¥d¡C¦pªG¨º±i¥d°÷ªº¸Ü¡A¥L­Ì·|´«µ¹§A¡C - - FreeBSD 2.1 ¥u¤ä´©¶´Åé 2.21 ª©¥H«áªºª©¥»¡C¦pªG±z¶´Å骩¥»¤ñ³o - ­ÓÁÙªº¸Ü¡A¨º»ò±zªº¥d´N¤£¯à³Q¿ëÃÑ¥X¬O Buslogic ªº¥d¡C¥¦¦³¥i¯à·| - ³Q¿ëÃѦ¨ Adaptec 1540¡C¸û¦­ªº Buslogic ¥d¤Wªº¶´Å馳¤@­Ó AHA1540 - ¼ÒÀÀ ¼Ò¦¡¡A³o¹ï¤@±i EISA ¥d¨Ó»¡¨Ã¤£¬O¥ó¦n¨Æ¡C - - ¦pªG±z¦³¤@±i¸ûª©¥»ªº¥d¡A¦Ó±z¨ú±o 2.21 ª©¶´Å骺¸Ü¡A±z»Ý­nÀË - ¬d¤@¤U jumper W1 ªº¦ì¸m¡A±N¥¦½Õ¦Ü B-C¡A­ì©l³]©w¬O A-B¡C - - - - ¬°¤°»ò FreeBSD §ì¤£¨ì§Úªº HP Netserver ªº SCSI ±±¨î¥d¡H + ¬°¤°»ò FreeBSD §ì¤£¨ì HP Netserver ªº SCSI ±±¨î¥d¡H °ò¥»¤W³o­Ó¬O¤@­Ó¤wª¾ªº°ÝÃD¡C¦b HP Netserver ¾÷¾¹¤Wªº on-board EISA ¤¶­± SCSI ±±¨î¥d¥e¾Ú¤F©w§}¬°²Ä 11 ªº EISA ¼Ñ¡A¦]¦¹©Ò¦³ªº ¯u¹ê EISA ¼Ñ³£¦b¥¦¤§«e¡C¥i¬O¡A¦b EISA ©w§}ªÅ¶¡ >= 10 ®É¡A·|»P«ü©wµ¹ PCI ¥Îªº©w§}ªÅ¶¡¬Û½Ä¬ð¡A¥B FreeBSD ªº auto-configuration µLªk¥¿½Tªº³B²z³o­Ó±¡§Î¡C ¦]¦¹¡A²{¦b§A¯à°µªº³Ì¦n¨Æ±¡´N¬O¦b kernel ùس]©w EISA_SLOTS ³o­Ó¿ï¶µ¬° 12 ¡AµM«á·í§@¨S¦³³o­Ó °ÝÃD :)¡C½Ð¨Ì·Ó Handbook ¤¤¦³Ãö kernel ªº³]©w ùةһ¡ªº¤èªk¨Ó³]©w»P½sĶ ±zªº kernel¡C ·íµM¡A¦b¦w¸Ë FreeBSD ¨ì³oºØ¾÷¾¹¤W®É¡A³o¬O¤@­ÓÂû¥Í³J³J¥ÍÂûªº °ÝÃD¡C¬°¤F¸Ñ¨M³o­Ó°ÝÃD¡A¦b UserConfig ¤¤¦³ ¤@­Ó¯S§Oªº¤èªk¡A¦w¸Ë®É¤£­n¶i¤J visual ¤¶­±¡A¬Û¤Ï ªº¡A¦b©R¥O¦C¼Ò¦¡¤¤¡AÁä¤J eisa 12 quit µM«á´N¦p¥H©¹¤@¼Ë¦w¸Ë±zªº¨t²Î¡C¤£¹L§Ú­Ì«ØÄ³±z½sĶ»P¦w¸Ë¤@­Ó ÄÝ©ó¦Û¤vªº kernel¡A¦ý §Æ±æ¦b¥¼¨Óªºª©¥»¤¤¯à¹ï³o­Ó°ÝÃD¦³¤@­Ó¦nªº¸Ñ¨M¤èªk¡C ±zµLªk¦b HP Netserver ¤W¨Ï¥Î dangerously dedicated ºÏºÐ¼Ò¦¡¡C±z¥i¥H°Ñ¦Ò ³o¥÷µù¸Ñ ¥HÀò±o§ó¦h¸ê°T¡C - - - CMD640 IDE ±±¨î´¹¤ù¥X¤F¤°»ò°ÝÃD¡H - - - - ¥¦ªº°ÝÃD¦b©óµLªk¦P®É³B²z¨â­Ó channel ªº«ü¥O¡C - - ²{¦b¤w¸g¦³­Ó¸Ñ¨M¤èªk¤F¡A¦Ó¥B¦b±zªº¨t²Î¤¤¦³³o¶ô´¹¤ù®É·|¦Û°Ê - ±Ò°Ê¡C¦pªG»Ý­n§ó¸ÔºÉªº¸ê°T¡A½Ð¬d¾\¦³ÃöºÏºÐÅX°Êµ{¦¡ªº»¡©ú - ¡]man 4 wd¡^¡C - - ¦pªG±z¥Ø«e¬O¨Ï¥Î CMD640 IDE ±±¨î´¹¤ù¡A¥[¤W FreeBSD 2.2.1 ©Î - 2.2.2¡A¦Ó¥B±z¤S·Q­n¨Ï¥Î¨ì²Ä¤G­Ó channel ®É¡A½Ð¦b±zªº kernel ³] - ©w¤¤¥[¤J options "CMD640" µM«á­«·s½sͤ@­Ó·s - ªº kernel¡C³o­Ó option ¦b 2.2.5 ª©¥H«á¬O¤º©w±Ò°Êªº¡C - - - - §Ú¤@ª½¬Ý¨ìÃþ¦ü + ¤@ª½¬Ý¨ìÃþ¦ü ed1: timeout ªº°T®§¡C¥¦­Ì¬O¤°»ò·N«ä©O¡H ³o­Ó³q±`¬O¥Ñ©ó¤¤Â_½Ä¬ð¡]interrupt conflict¡^©Ò³y¦¨ªº¡]¨Ò¦p¡A ¨â¶ô¥d¨Ï¥Î¨ì¤F¬Û¦Pªº IRQ¡^¡C FreeBSD ¦b 2.0.5 ª©¥H«e³£®e³\³o­Ó ±¡§Î¡A´Nºâ¦³ IRQ ½Ä¬ð±¡§Î¡Aºô¸ô¥d¤]À³¸Ó¤´¥i¥¿±`¹B§@¡CµM¦Ó¡A¦b 2.0.5 ª©¤Î¨ä¥H«á¡A¤w¤£¦A®e³\¦³ IRQ ½Ä¬ðªº±¡§Î¤F¡C½Ð©ó¶}¾÷®É¨Ï ¥Î -c ³o­Ó¿ï¶µ¡AµM«á§ó§ï ed0/de0/..¡Cµ¥ªº³]©w¡A¨Ï¨ä©M±zºô¸ô¥d ¥»¨­ªº³]©w¤@­P¡C ¦pªG±z¬O¨Ï¥Î±zºô¸ô¥d¤Wªº BNC ±µÀY¡A±z©Î³\¤]·|¦]¤£¨}ªº²×ºÝ¹q ªý³]©w¡A¦Óµo¥Í¸Ë¸m (device) timeout ªº±¡§Î¡C­nÀˬd¬O§_¦³³oºØ±¡ §Î¡A±z¥i¥H¦bºô¸ô¥d¤Wª½±µ±µ¤W²×ºÝ¹qªý¡]¤£­n±µºô¸ô½u¡^¡AµM«á¬Ý¬Ý³o ­Ó¿ù»~°T®§¬O¤£¬O´N®ø¥¢¤F¡C ¦³¨Ç NE2000 ªº¬Û®e¥d¡A¦pªG¥¦ªº UTP °ð¨S¦³±µºô¸ô½u¡A©Î¬O¸Óºô ¸ô½u¨Ã¨S³Q¨Ï¥Îªº¸Ü¡A¤]·|¥X²{³o­Ó¿ù»~°T®§¡C - ¬°¤°»ò§Úªº 3COM 3C509 ³o¶ôºô¸ô¥d¦b¨S¦³¥ô¦ó©úÅã­ì¦]¤U°±¤î¤u§@ + &tm.3com; 3C509 ºô¸ô¥d¦b¨S¦³¥ô¦ó©úÅã­ì¦]¤U°±¤î¤u§@ ¤F©O¡H ³o¶ô¥d¦³­Ó¤£¦nªº¦a¤è¦b©ó¥¦±`±`·|¿ò¥¢¥»¨­ªº³]©w¸ê®Æ¡C½Ð¨Ï¥Î¸Ó ¥dªº DOS ¤u¨ã 3c5x9.exe ¨Ó§ó·s¥d¤W³]©w¡C - §Úªº¥­¦æ°ð¦Lªí³t«×¯}¤Ñ¯îªººC¡C§Ú¸Ó«ç»ò°µ¡H + ¥­¦æ°ð¦Lªí³t«×¯}¤Ñ¯îªººC¡A§Ú¸Ó«ç»ò°µ¡H ¦pªG°ß¤@ªº°ÝÃD´N¬O³t«×«ÜºCªº¸Ü¡A¸ÕµÛ§ïÅܱzªº ¦Lªí¾÷³s±µ°ð³]©w ³o­Ó¦b¤â¥U¤¤ªº ¦Lªí¾÷³]©w ³o­Ó³¹¸`¦³¥[¥H°Q½×¡C - §Úªºµ{¦¡¦³®É·|¦] + µ{¦¡¦³®É·|¦] Signal 11 ³o­Ó¿ù»~¦Ó°±¤î¡H Signal 11 ³o­Ó¿ù»~¬O¦]¬°§Aªº process ¹Á¸Õ­n¦s¨ú¤@¶ô°O¾ÐÅé¡A ¦Ó§Aªº§@·~¨t²Î¨Ã¤£¤¹³\¥¦°µ³o­Ó°Ê§@¦Óµo¥Íªº¡C¦pªG³oºØ±¡§Î±`±`¤£ ©w®Éµo¥Í¡A¨º»ò§AÀ³¸Ó­n¶}©l¬Ý¬Ý¬O¤£¬O­þ¸Ì¥X°ÝÃD¤F¡C ³o¨Ç°ÝÃD¥i¯à¬O»P¤U¦C±¡§Î¦³Ãö¡G ¦pªG³o­Ó°ÝÃD¥u¦b¬Y¤@­Ó±z¦Û¤v¼gªº¬Y­Ó¯S©wµ{¦¡µo¥Í¡A¨º »ò«Ü¦³¥i¯à¬O±zªºµ{¦¡½X¦³°ÝÃD¡C ¦pªG³o­Ó°ÝÃD¬O¦b FreeBSD ªº¬Y¨Ç¨t²ÎÀÉ®×µo¥Í¡A¦³¥i¯à¬O ¦]¬°µ{¦¡¦³°ÝÃD¡A¦ý³q±`¦b§Ú­Ì³o¸sŪ FAQ ªº¨Ï¥ÎªÌ¥h¶]³o¨Ç¦³ °ÝÃDªºµ{¦¡½X«e¡A¥¦­Ì¦­´N´N¤w¸g³Q¸Ñ¨M¤F¡]³o¬O -current ¦b°µ ªº¨Æ¡^¡C ¤×¨ä¦pªG§A¦b½sͤ@­Óµ{¦¡¡A¦ý¬O¨C¦¸½s;¹¶]¥X¨Óªºµ²ªG³£¤£¤@¼Ë ªº¸Ü¡A³o¬O¤@­ÓµL¸Ñªº°ÝÃD¡A¦Ó¤£¬O FreeBSD ¯äÂΡC Á|¨Ò¨Ó»¡¡A°²³]±z¥¿¦b¶] make buildworld¡A ¦Ó compiler ¦b±N ls.c ½sͦ¨ ls.o ®Éµo¥Í¿ù»~¡A³o®É½Ð¦A¶]¤@¦¸ make buildworld¡A¦pªG compiler ¨ÌµM¦b¦P¼Ëªº¦a¤èµo ¥Í°ÝÃD¡A¨º»ò´N¬Oµ{¦¡½X¦³°ÝÃD¡Ð¡Ð½Ð§ó·s­ì©l½XµM«á¦A¸Õ¸Õ¬Ý¡C¦Ó¦pªG compiler ¬O¦b¨ä¥Lªº¦a¤èµo¥Í¿ù»~¡A¨º»ò´X¥G¥i¥H½T©w¬OµwÅ骺°ÝÃD¤F¡C ±z³o®ÉÀ³¸Ó°µ¤°»ò¡G ¦pªG¬O²Ä¤@ºØ±¡§Î¡A¥i¥H¨Ï¥Î¤@¨Ç debugger¡A¦p¡Ggdb¡A¨Ó§ä¥Xµ{¦¡ ¬O¦b¨º¨à·|¥h¹Á¸Õ¦s¨ú¿ù»~ªº°O¾ÐÅé¦ì§}¡AµM«á¦A­×¥¿¥¦¡C ¦pªG¬O²Ä¤GºØ±¡§Î¡A´N»Ý­nÀˬd¬Ý¬Ý¬O¤£¬OµwÅ骺°ÝÃD¤F¡C ¤@¨Ç³y¦¨µwÅ餣íªº­ì¦]¥]¬A¡G ¥i¯à¬OµwºÐ¹L¼ö¡G½ÐÀˬd¾÷´ß¤ºªº­·®°¬O§_¹B§@¥¿±`¡A¦]¬°±z ªºµwºÐ¡]©ÎªÌÁÙ¦³¨ä¥LªºµwÅé¸Ë¸m¡^¹L¼ö¤F¡C ³B²z¾¹¹L¼ö¡G³o­Ó¦³¥i¯à¬O¦]¬°¶WÀW¡A©ÎªÌ¬O³B²z¾¹ªº­·®°±¾¤F¡C ¤£½×¬O­þºØ­ì¦]¡A±z³£»Ý­n±N©Ò¦³ªº¤¸¥ó¦^´_¨ì¥¦­Ì­ì¥ý³]©wªº¤u§@ª¬ ºA¡A³o¼Ë¤~¯à¸Ñ¨M³o­Ó°ÝÃD¡CÁ|­Ó¨Ò¤l¨Ó»¡¡G±N³B²z¾¹½Õ¦^­ì¥ýªº¤u§@ ÀW²v¡C ¦pªG±zÁÙ¬O°í«ù­n¶WÀWªº¸Ü¡A½ÐÂÔ°O¡A»P¨ä¿NÃa¦Ó»Ý­n´«·sªº¤@¥x ¥D¾÷¡A¤£¦p±N³t«×½ÕºC¤@ÂI¡I°£¦¹¤§¥~¡A¤£ºÞ§Aı±o¥¦¦w¤£¦w¥þ¡A¤@¯ë ¤H¹ï©ó±z¦]¬°¶WÀW¦Óµo¥Íªº°ÝÃD¡A¬O¤£·|¦³¤°»ò¦P±¡¤ßªº¡C ¤£Ã­©wªº°O¾ÐÅé¡G¦pªG¥D¾÷¤W¦³¦w¸Ë¼Æ®Ú SIMM/DIMM °O¾ÐÅé¡A ¸ÕµÛ§â¥¦­Ì¥þ©î¤U¨Ó¡AµM«á¤@®Ú¤@®Ú´¡¤W¥h°µ´ú¸Õ¡AÂǦ¹ÁY¤p½d³ò¡A ¥H«K§ä¥X¦³°ÝÃDªº¬Y®Ú°O¾ÐÅé©Î¬O¬YºØ°O¾ÐÅé²Õ¦X¡C ³Ì¨Î¤Æ¹LÀYªº¥D¾÷ªO³]©w¡G¦b BIOS ùةάO¦³¨Ç¥D¾÷ªOªº jumper ¤W¡A¦³®É¥i¥H§ó§ï¤@¨Ç timing¡A¦ý¦b¤j¦h¼Æªº±¡§ÎùØ¡A¨Ï¥Î¹w³]­È´N ¤w¸g¨¬°÷¤F¡Cªp¥B¦³®É­Ô§â RAM ªº wait states ³]¤Ó¤p¡A©Î¬O¦b BIOS ùØ¡A§â RAM Speed: Turbo ³o­Ó©Î¬O¨ä¥LÃþ¦ü ªº¿ï¶µ¥´¶}³£¦³¥i¯à·|³y¦¨¤@¨Ç¤£¥¿±`ªº²{¶H¡C¤@­Ó¸Ñ¨Mªº¤èªk¬O§â BIOS ³]¦^¹w³]­È¡A¤£¹L¦b³o¤§«e°O±o¥ý°O¤U¥Ø«eªº³]©w¡I ¨Ñµ¹¥D¾÷ªOªº¹q¤O¤£°®²b©Î¬O¤£¨¬¡C¸ÕµÛ§â¨t²Î¤º¨S¦³¥Î¨ìªº I/O ¥d¡DµwºÐ©Î¬O CDROM ¼È®É©î±¼©Î¬O©Þ±¼¹q·½½u¡A¬Ý¬Ý§Aªº¹q·½ ¨ÑÀ³¾¹¬O¤£¬O¯à°÷¦b¤p¤@ÂIªº­t²ü¤U¥¿±`¤u§@¡C¤£µM´N¬O´«¤W¥t¤@ ­Ó·sªº¹q·½¨ÑÀ³¾¹¡A³Ì¦n¬O¥Ë¼Æ°ª¤@ÂIªº¡]¥´­Ó¤ñ¤è¨Ó»¡¡A¦pªG­ì ¥ýªº¹q·½¨ÑÀ³¾¹¬O 250 ¥Ëªº¡A¨º»ò´N´«¤W 300 ¥Ëªº¸Õ¸Õ¡^¡C ½Ð¶¶«K°Ñ¾\ SIG11 FAQ¡]³sµ²¦b¤U­±¡^¡AÁöµM¥¦¬O¯¸¦b Linux ªº¨¤ «×¼gªº¡A¥i¬O¸Ì­±¹ï³o¨Ç°ÝÃD¦³³\¦h«Ü´Îªº¸Ñ»¡¡C¥¦¸Ì­±¤]¦³°Q½×¬°¤°»ò ¦³°ÝÃDªº°O¾ÐÅé¯à³q¹L³nÅé©ÎµwÅ骺´ú¸Õªº­ì¦]¡C ³Ì«á¡A¦pªG¤W­±³o¨Ç­ì¦]³£±Æ°£¤F¡A¨º»ò¦³¥i¯à¬O¹J¨ì¤F FreeBSD ùتº¤@°¦¯äÂΡA½Ð°Ñ¾\«ü¥Ü°µ¤@­Ó°ÝÃD¦^³ø¡C ³o¨à¦³¤@­Ó§ó¸Ô²Óªº FAQ ¡Ð the SIG11 problem FAQ - §Úªº¨t²Î·í¾÷®É¥X²{¡GFatal + ·í¾÷®É¥X²{¡GFatal trap 12: page fault in kernel mode¡A©Î¬O - panic:¡A¦A¥[¤W¤@°ï¿ù»~°T®§¡A - §Ú¸Ó«ç»ò¿ì¡H + panic:¦A¥[¤W¤@°ï¿ù»~°T®§¡A + ¸Ó«ç»ò¿ì¡H FreeBSD ªº¶}µoªÌ¹ï©ó³o¨Ç¿ù»~°T®§¬Û·íªº¦³¿³½ì¡A¦ý¬O¥L­Ì»Ý­n §ó¸Ô²Óªº¤@¨Ç²Ó¸`¡C½Ð§â±zªº·í¾÷ªº°T®§¥þ³¡½Æ»s¤U¨Ó¡A±µµÛ¬d¾\ FAQ ùØ kernel panics ³o¸`¡A¨Ì»¡©ú½sͤ@­Ó§t°£¿ù½Xªº kernel¡A¥H¨ú±o¨ç¦¡ ©I¥s¶¶§Ç¡]backtrace¡^¡C³o­ÓÅ¥°_¨Ó«ÜÃø¡A¦ý¹ê»Ú¤W¨Ã¤£»Ý­n¥ô¦óµ{¦¡ ³]­pªº¯à¤O¡A±z¥u»Ý­n¨Ì·Ó«ü¥Ü°µ§Y¥i¡C ¬°¤°»ò·í§Ú¶}¾÷®É¡A¿Ã¹õÅܶ¡A¥B¤£°±°{°Ê¡H ³o­Ó°ÝÃD¡A¤wª¾¬O¥Ñ ATI Mach 64 Åã¥Ü¥d©Ò¤Þ°_ªº¡C¦]¬°³o¶ô¥d ¨Ï¥Î¨ì 2e8 ³o­Ó¦ì§}¡A¦Ó³o»P²Ä¥|­Ó§Ç¦C°ð ¡]serial port¡^©Ò¨Ï¥Îªº¦ì§}¬Û¦P¡C¦Ó¦b &man.sio.4; ³o­ÓÅX°Ê µ{¦¡ùØ¡A¤£ª¾¹D¬O bug ©Î¬O¥\¯à¡]feature¡^¡A´Nºâ±z¨S¦³²Ä¥|­Ó§Ç ¦C°ð¡A©Î¬O¤w¸g±N sio3¡]²Ä¥|­Ó§Ç¦C°ð¡^¨ú®ø¤F¡A¥¦ ¨ÌµM·|¥h¹Á¸ÕÅX°Ê¥¦¡C ª½¨ì³o­Ó°ÝÃD³Q¸Ñ¨M¥H«e¡A±z¥i¥H¨Ï¥Î³o­Ó¤èªk¡G ¦b¬Ý¨ì¶}¾÷´£¥Ü®É¿é¤J ¡]³o·|Åý kernel ¶i¤J³]©w¼Ò¦¡¡^¡C ¨ú®ø sio0 ¡A sio1 ¡A sio2 ©M sio3¡]¥þ³¡¡^¡C ³o¥i¥HÅý sio ÅX°Êµ{¦¡¤£°Ê§@ -> ©ó¬O°ÝÃD¸Ñ¨M¡C ¿é¤J exit ¥HÄ~Äò±Ò°Êµ{§Ç¡C ¦pªG±z·Q­n¨Ï¥Î±zªº§Ç¦C°ð¡A±z»Ý­n­×§ï /usr/src/sys/i386/isa/sio.c¡A¦b¸ÓÀɤ¤§ä¥X 0x2e8 ³o­Ó¦r¦ê¡A²¾°£³o­Ó¦r¦ê¤Î¥¦«e­±ªº³r¸¹ ¡]«O¯d«á­±ªº¡^¡AµM«á­«·s½sͤ@­Ó·sªº kernel¡C ´Nºâ¨Ï¥Î¤F¤W­±³o¨Ç¤èªk¡AX Window ¤´µM¦³¥i¯àµLªk¶¶§Q°õ¦æ¡C ¦pªGµo¥Í¤F³oºØ±¡§Î¡A½Ð½T©w§A¥Îªº XFree86 ªºª©¥»¬O³Ì·sªº XFree86 3.3.3 ©Î¬O¨ä«áªºª©¥»¡C¥¦­Ì¦³¤º«Ø¤ä´© Mach 64 ³o±i¥d¡A¬Æ¦Ü¬°¤F³o ¨Ç¥dÁÙªþ¦³¤@­Ó¯S§Oªº X Server ¬°¤°»ò§Úªº¨t²Î¸Ë¦³ 128 MB ªº RAM¡A¦Ó FreeBSD ¥u¥Î¤F¨ä¤¤ªº 64MB¡H ¦]¬° FreeBSD ¬O¨Ï¥Î©I¥s BIOS ¨Ó¨ú±o°O¾ÐÅé¤j¤pªº¤èªk¡A¦]¦¹¥¦ ¥u¯à°»´ú¨ì 16 bits ¦ì¤¸ªø«×ªº KByte ¤j¤p¡]65535 KBytes = 64MB¡^ ¡]©ÎªÌ§ó¤Ö..¡C¦³¨Ç BIOS ±N³Ì°ª°O¾ÐÅé¤j¤p­­¬°¥u¦³ 16MB¡^ ¦pªG±z¾Ö¦³ 64MB ¥H¤Wªº RAM¡AFreeBSD ·|¹Á¸Õ¥h°»´ú¥X¥¦¡A¦ý¬O¦³¥i¯à ·|¥¢±Ñ¡C ­n¸Ñ¨M³o­Ó°ÝÃD¡A±z»Ý­n¨Ï¥Î¤U­±©Ò´£ªº kernel ³]©w¿ï¶µ¡CÁöµM¦³ ¤èªk¥i¥H±q BIOS ¤¤¨ú±o°O¾ÐÅ骺§¹¾ã¸ê°T¡A¦ý¬O¥Ø«e§Ú­Ì¦b¶}¾÷°Ï¤¤¨Ã ¨S¦³¦h¾lªºªÅ¶¡¨Ó°µ³o¥ó¨Æ¡C·í¬Y¤Ñ¶}¾÷°ÏªÅ¶¡¤£¨¬ªº±¡§ÎÀò±o¸Ñ¨M®É¡A §Ú­Ì±N·|¨Ï¥Î BIOS ªº©µ¦ù¥\¯à¨Ó¨ú±o°O¾ÐÅ骺§¹¾ã¸ê°T...¦ý²{¦b§Ú­Ì ±N¥¦©ñ¦b kernel ³]©w¿ï¶µ¤¤¡C options "MAXMEM=n" n ¬O«ü±zªº°O¾ÐÅé¤j¤p¡A¥H KB ¬°³æ¦ì¡C¥H¤@¥x¦³ 128MB RAM ªº¾÷¾¹¨Ó»¡¡A±z¥i¨Ï¥Î 131072³o­Ó¼Æ¦r¡C - - ¬°¤°»ò FreeBSD 2.0 ¦]¬° - kmem_map too small!³o­Ó­ì¦]¦Óµo¥Í - panic ¡H - + + ¾÷¾¹¤Wªº RAM ¦³ 1GB ¥H¤W¡A¥i¬O¬°¦ó«o¦¬¨ì kmem_map too small + ªº panic ¿ù»~°T®§¡H + + + + + ³q±` FreeBSD ·|¨Ì¾Ú¾÷¾¹ª¬ªp¨Ó¦Û°Ê½Õ¾ã kernel ¬ÛÃö°Ñ¼Æ³]©w¡A¤ñ¦p¡G + ®Ú¾Ú¾÷¾¹©Ò¸Ëªº RAM ¤j¤p¨Ó¨M©w¦P®É¥i¶}±ÒªºÀɮ׼ƶq¦h¹è¡C + µM¦Ó¡A¦b 1GB RAM(§t¥H¤W) ªº¾÷¾¹¤W¡A³o­Ó¡y¦Û°Ê½Õ¾ã¡zªº¾÷¨î¥i¯à¦³®É·|°ª¦ô¡G + ¤ñ¤è»¡..¶}¾÷®É¡Akernel ·|¥ý°t¸m¦UºØ¤£¦P¥Î³~ªºªí®æ¤Î¨ä¥L¬[ºc©ñ¨ì°O¾ÐÅé¤W¡A + µM«á¡A·í¾ã­Ó§@·~¨t²Î³£¶}©l¹B§@¤§«á¡Akernel ´N·|¶}©l¤£°÷ªÅ¶¡¨Ó°µ°O¾ÐÅé°t¸mªº°ÊºA½Õ¾ã¡A + ©ó¬O´N panic ±¾¤F¡C + + ¸Ñªk¬O¡G§â ¥[¨ì kernel ³]©wÀɤº¡A + ¨Ã­«·s½sĶ kernel¡A¤ñ¦p¡G + + + + + ³o¼Ë·|³]©w 400 MB ¨Óµ¹ kernel ¨Ï¥Î¡A¦Ó¥B±Ä¥Î 400 MB ªº¸Ü¡A + ¥Ø«e¦b 6GB RAM ªº¾÷¾¹¤W³£¥i³Q¦³®Ä¹B¥Î¡C + + + + + + ¾÷¾¹¤W RAM ¤£¨ì 1GB ¡A¦ý¤´·|¥X²{ + kmem_map too small! ªº panic ¿ù»~°T®§ + + - - ³o­Ó°T®§¤]¦³¥i¯à¬O - mb_map too small! - + ¤§©Ò¥H panic ªº­ì¦]¦b©ó¨t²Î¥Î¥ú¤Fµ¹ network buffer ¥Î³~ªº virtual memory + (¤×¨ä¬O mbuf clusters)¡C¸Ñªk¬O¼W¥[µ¹ mbuf clusters ¥Îªº virtual memory + ¼Æ¶q¡A³o¨BÆJ½Ð°Ñ¾\ FreeBSD ¨Ï¥Î¤â¥Uªº + ºô¸ô­­¨î½g + ¡C + + + ¬°¤°»ò§Ú¤@ª½¬Ý¨ì /kernel: proc: table is full ³o­Ó¿ù»~°T®§¡H - FreeBSD ªº kernel ¥u·|¤¹³\¤@©w¼Æ¶qªº process ¦b¦P¤@®É¶¡¸Ì¦P + FreeBSD kernel ¥u¤¹³\¤@©w¼Æ¶qªº process ¦b¦P¤@®É¶¡¸Ì¦P ®É¹B§@¡C¦Ó³o­Ó¼Æ¥Ø¬O®Ú¾Ú kernel ³]©wÀɸ̭±ªº MAXUSERS ­È¨Ó¨M©wªº¡CMAXUSERS - ³o­Ó­È¤]·|¼vÅT¨ä¥Lªº kernel ¤º©w­È¡A¤ñ¦p»¡ºô¸ô½w½Ä°Ï - ¡]½Ð°Ñ¾\³o­Ó¤§«e°Q - ½×¹Lªº°ÝÃD¡^¡C¦pªG¾÷¾¹­t²ü¡]load¡^«Ü­«¡A±z¥i¯à»Ý­n¼W¥[ + ³o­Ó­È¤]·|¼vÅT¨ä¥Lªº kernel ¤º©w­È¡A¤ñ¦p»¡ network buffer + (½Ð°Ñ¾\³o­Ó¤§«e°Q + ½×¹Lªº°ÝÃD)¡C¦pªG¾÷¾¹­t²ü(load)«Ü­«¡A±z¥i¯à»Ý­n¼W¥[ MAXUSERS ³o­Ó­È¡C³o»ò§@·|¤@¨Ö´£°ª¨t²Îªº¨ä¥L¤º ©w­È¡A¥]¬A³Ì¤j¥i¾Ö¦³ªº process ¼Æµ¥¡C + ­Y­n½Õ¾ã MAXUSERS¡A½Ð°Ñ¾\ FreeBSD ¨Ï¥Î¤â¥U¤¤ªº + ÀÉ®×/Processªº­­¨î ³¹¸`¡C + (ÁöµM¸Ó³B«üªº¬O¡yÀɮתº¶}±Ò¼Æ¶q­­¨î¡z¡A¦ý¤]¾A¥Î©ó process³¡¤À¡C) + ¦b FreeBSD 4.4 ¤§«á¡AMAXUSERS ¤w¸gÅܦ¨¥i ¥H¾aµÛ§ó§ï /boot/loader.conf ùتº kern.maxusers ³o­Ó­È¦Ó½Õ¾ãªºÅܼƤF¡C¦Ó¦b¤§«e ªº FreeBSD ª©¥»¤¤¡A³o­Ó­È¥u¯à¦b kernel ³]©wÀÉùؽվã¡C ¦pªG¾÷¾¹­t²ü¨Ã¤£­«¡A¦Ó±z¥u¬O»Ý­n¦P®É¶]«Ü¦h«Ü¦h process¡A - ¨º»ò¤]¥i¥Hª½±µ¥Î sysctl ½Õ¾ã kern.maxproc - ³o­Ó­È¡C°²¦p³o¨Ç process ³£¬OÄÝ©ó¬Y­Ó¨Ï¥ÎªÌªº¡A¨º»ò±zÁٻݭn¥t + ¨º»ò¤]¥i¥Hª½±µ¥Î sysctl ½Õ¾ã kern.maxproc ­È¡C + °²¦p³o¨Ç process ³£¬OÄÝ©ó¬Y­Ó¨Ï¥ÎªÌªº¡A¨º»ò±zÁٻݭn¥t ¥~½Õ¾ã kern.maxprocperuid ³o­Ó­È¡A¨Ï¥¦¤ñ·s - ªº kern.maxproc ³o­Ó­È¤Ö¤@¡]¤@©w­n¤Ö¤@¡A - ¦]¬° &man.init.8; ³o­Ó¨t²Îµ{¦¡µ´¹ï­n«O«ù¦b¹B§@ª¬ºA¡^¡C + ªº kern.maxproc ³o­Ó­È¤Ö 1 (¤@©w­n¤Ö 1 ¡A + ¦]¬° &man.init.8; ³o­Ó¨t²Îµ{¦¡µ´¹ï­n«O«ù¦b¹B§@ª¬ºA)¡C ¦pªG·Q¦b¨C¦¸¶}¾÷³£­n§ó§ï sysctl ªº­È¡A¦Ó¥B±zªº FreeBSD ¬O ³Ìªñªºª©¥»ªº¸Ü¡A½Ð¦b /etc/sysctl.conf ³o ­ÓÀɤ¤³]©w¡A¦Ó¦pªG¬Oªºª©¥»¡A¥i¥H¦b /etc/rc.local ¤¤§@³]©w¡C ¬°¤°»ò¥Î·s kernel ¶}¾÷®É¡A¥X²{ CMAP busy ³o­Ó¿ù»~°T®§¡H ¥Î¨Ó°»´ú¹L®É /var/db/kvm_*.db Àɮתº¾÷¨î°¸º¸·| µo¥Í°ÝÃD¡A¦Ó¨Ï¥Î¨ì¤F¤@­Ó¤£¨ó½Õ¡]mismatch¡^ªºÀɮצ³®É´N·|¾É­P panic¡C ¦pªGµo¥Í¤F³o­Ó°ÝÃD¡A½Ð­«·s¶}¾÷¡A¶i¤J³æ¨Ï¥ÎªÌ¼Ò¦¡¡AµM«á°õ ¦æ¡G &prompt.root; rm /var/db/kvm_*.db ½Ð°Ý³o­Ó°T®§¡Gahc0: brkadrint, Illegal Host Access at seqaddr 0x0 ¬O¤°»ò·N«ä¡H ³o¬O¤@­Ó©M Ultrastor SCSI ±±¨î¥d¦³Ãöªº½Ä¬ð¡]conflict¡^¡C ¦b¶}¾÷®É¡A¶i¤J kernel ³]©w¿ï³æ¨ú®ø uha0¡A¥¦¬O³y¦¨³o­Ó°ÝÃDªº­ì¦]¡C ¦b¶}¾÷®É¡A§Ú¬Ý¨ì³o­Ó¿ù»~°T®§ ahc0: illegal cable configuration¡C §Úªº±Æ½u½T©w¦³±µ¹ï¡C ¬O¥X¤F¤°»ò°ÝÃD©O¡H ±zªº¥D¾÷ªO¥i¯à¤£¤ä´©¦Û°Ê²×ºÝ¹qªý³]©w¡C½Ð¶i¨ì SCSI ªº BIOS ¸Ì­±¤â°Ê«ü©w¥¿½Tªº²×ºÝ¹qªý¶¶§Ç¡A¦Ó¤£­n¨Ï¥Î¦Û°Ê³]©w¡CAIC7XXX ªº ÅX°Êµ{¦¡¨ÃµLªkª¾¹D¦³¨S¦³³o¨Ç±Æ½u°»´ú¡]¥H¤Î¦Û°Ê²×ºÝ¹qªý³]©w¡^ªº ¹q¸ô¡]external logic¡^¦s¦b¡C¦pªG EEPROM ¸Ì­±ªº³]©w¬O "automatic termination" ®É¡A¥¦¥u·|³æ¯Â°²©w³o¨Ç¹q¸ô·íµM¬O¦s¦bªº¡C ­Y¯Ê¤Ö¤F³o­Ó¹q¸ô¡AÅX°Êµ{¦¡¦b³]©w²×ºÝ¹qªý®É´N±`±`¥X°ÝÃD¡C ¦Ó³oºØ°ÝÃD±N¾É­P SCSI ¶×¬y±Æªº¥i¾a©Ê­°§C¡C ¬°¤°»ò Sendmail ¤@ª½¥X²{ mail loops back to myself ³o­Ó¿ù»~°T®§¡H ³o­Ó°ÝÃD¦b sendmail ªº FAQ ¤¤¬O³o¼Ë¦^µªªº:- * §Ú¤@ª½¦¬¨ì¦³Ãö "Local configuration error" ªº«H¥ó¡A¨Ò¦p¡G 553 relay.domain.net config error: mail loops back to myself 554 <user@domain.net>... Local configuration error §Ú­n¦p¦ó¸Ñ¨M³o­Ó°ÝÃD¡H ±z§Q¥Î MX ³]©w¡AÅý­n±H¨ì¬Y domain¡]¦p: domain.net¡^ªº«H¥ó¡A ±H¨ì±z©Ò«ü©wªº¾÷¾¹¡]¦b³o­Ó¨Ò¤l¤¤¬° relay.domain.net¡^¡A¦ý¬O³o ³¡¾÷¾¹¨Ã¥¼³Q³]©w±µ¨ü domain.net ªº«H¥ó¡C½Ð§â domain.net ¥[¨ì /etc/sendmail.cw ¤¤¡]¦pªG±z¦³¨Ï¥Î FEATURE(use_cw_file)) ©Î¬O ¦b sendmail.cf ¤¤¥[¤J "Cw domain.net" ³Ì·sª©¥»ªº sendmail FAQ ²{¦b¤w¤£¦AÀHµÛ sendmail ¥X³f¡C ¥¦¥Ø«e¬O³Q©w´Áªºµoªí¦b comp.mail.sendmail¡A comp.mail.misc¡Acomp.mail.smail¡Acomp.answers¡A©M news.answers. ±z¤]¥i¥H±H¤@«Ê Email ¨ì mail-server@rtfm.mit.edu¡AµM«á¦b«H¥ó¤º¤å ¤¤¼g¤W send usenet/news.answers/mail/sendmail-faq ¥H¨ú±o³o¥÷ FAQ ¤å¥ó¡C ¬°¤°»ò°õ¦æ»·ºÝ¾÷¾¹¡]remote machine¡^ªº¥þ¿Ã¹õªº³nÅé®É¡A ¦³¤£¥¿±`ªº±¡§Î¡H ©Î³\»·ºÝ¾÷¾¹¨Ã«D±N±zªº²×ºÝ¾÷¼Ò¦¡³]¬° FreeBSD console ©Ò¥Îªº cons25¡A¦Ó¬O³]¬°¨ä¥¦¼Ò¦¡¡C ³o¨à¦³´X­Ó¸Ñ¨M³o­Ó°ÝÃDªº¤èªk¡G ¦b logging ¶i»·ºÝ¾÷¾¹«á¡A§ó§ï±zªº shell ÅÜ¼Æ TERM ¬° ansi ©Î¬O sco ¡}¦pªG»·ºÝ¾÷¾¹¤ä´©³o¨Ç¼Ò¦¡ªº¸Ü¡^¡C ¨Ï¥Î¤ä´© VT100 ªº¼ÒÀÀ³nÅé¡A¦p FreeBSD console ¤Uªº screen ³nÅé¡C screen ´£¨Ñ±z¦b¤@­Ó terminal ùئP®É¶]¦n´X­Ó session ªº¯à¤O¡A¦Ó¥B¥¦¥»¨­¤]¬O¤@­Ó¬Û·í¦n ªº³nÅé¡C¨C­Ó screen ³£¹³¬O¤@­Ó VT100 ªº²×ºÝ¾÷¡A©Ò¥H»·ºÝ¾÷¾¹ªº TERM ÅܼÆÀ³¸Ó³]¬° vt100¡C ¦b»·ºÝ¾÷¾¹ªº²×ºÝ¾÷¸ê®Æ®w¡]terminal database¡^¤¤¥[¤J cons25 ªº¸ê®Æ¡C¥[¤Jªº¤èªkµø»·ºÝ¾÷¾¹ªº §@·~¨t²Î¤£¦P¦Ó¦³©Ò®t²§¡C½Ð°Ñ¾\»·ºÝ¾÷¾¹µ¹¨t²ÎºÞ²z­ûªº»¡©ú ®Ñ¡AÀ³¸Ó·|¦³©ÒÀ°§U¡C ±Ò°Ê FreeBSD ªº X ¦øªA¾¹¡AµM«á¨Ï¥Î¤@¨Ç X Window ¤Uªº ²×ºÝ¾÷¼ÒÀÀ¾¹¨Óµn¤J»·ºÝ¾÷¾¹¡A¨Ò¦p xterm ©Î rxvt¡C¦Ó»·ºÝ¾÷¾¹ªº TERM ÅܼÆÀ³¸Ó­n ³]¬° xterm ©Î vt100¡C ¬°¤°»ò§Úªº¾÷¾¹¤@ª½Åã¥Ü calcru: negative time...¡H ¸ò¤¤Â_¡]interrupt¡^¦³Ãöªº¤£¦PµwÅé »P/©Î ³nÅ骺·f°t³£¦³¥i¯à³y¦¨ ³o­Ó°ÝÃD¡C³o¦³¥i¯à¬O bug ©Î¬O¬Y­Ó¸Ë¸m¥»¨­ªº°ÝÃD¡C¦b¥­¦æ°ð¤W¨Ï¥Î ¤jªº MTU ¨Ó§@ TCP/IP ¶Ç¿é¥i¥H­«²{³o­Ó°ÝÃD¡C­Y¬O¹Ï§Î¥[³t¥d³y¦¨³o­Ó °ÝÃDªº¸Ü¡A±zÀ³¸Ó¥ýÀˬd¥dªº¤¤Â_³]©w¡C ³o­Ó°ÝÃDªºÃä»Ú®ÄÀ³¬O·|³y¦¨¦³¨Ç process ¥X²{ SIGXCPU exceeded cpu time limit ªº°T®§¡A¦Ó¤£¥¿±` °±¤î¡C ­Y¬O FreeBSD 3.0 ©Î¬O 1998 ¦~ 11 ¤ë 29 ¤é¥H«á¨ä¥Lª©¥»¡A¸U¤@ ³o­Ó°ÝÃD¤@ª½µLªk¥H¨ä¥L¤èªk¸Ñ¨M¡A´N¥u¯à³]©w sysctl ÅܼơG &prompt.root; sysctl -w kern.timecounter.method=1 ³o¼Ë·|¹ï®Ä¯à¦³¨Ç¼vÅT¡A¦ý¬O­Y¦Ò¼{¨ì³o­Ó°ÝÃD±a¨Óªº«áªG¡A³o¼Ë°µ ¬O­È±oªº¡C¦pªG³o­Ó°ÝÃDÁÙ¬O¦s¦bªº¸Ü¡AÅý sysctl ¨º­Ó­È¨ÌµM³]¬° 1¡A µM«á¼W¥[ kernel ³]©wÀɤ¤ NTIMECOUNTER ³o­Ó¿ï ¶µªº¼Æ­È¡C¦pªG±z±N NTIMECOUNTER ¼W¥[¨ì 20 ¨Ì µMµLªk¸Ñ¨M³o­Ó°ÝÃD¡A¨º»ò±z¾÷¾¹¤Wªº¤¤Â_¤w¸g¦h¨ìµLªkÅý­p¼Æ¾¹ºû«ù¦b ¥i¾aªºª¬ºA¤F¡C ¥X²{ pcm0 not found ³o­Ó°T®§¡A©ÎªÌ¬O §Úªº­µ®Ä¥dÅܦ¨¤F pcm1¡A¦ý¦b kernel ³]©w ÀÉùاڬO³] device pcm0 °Ú¡C³o¬O«ç»ò¦^¨Æ©O¡H ¦pªG±z¦b FreeBSD 3.x ¤W¨Ï¥Î PCI ­µ®Ä¥d´N·|µo¥Í³oºØ°ÝÃD¡C ¦]¬°pcm0 ³o­Ó device ¬O¤º©w«O¯dµ¹ ISA ªº­µ®Ä¥dªº¡A©Ò¥H¦pªG±z¦³¤@±i PCI ªº­µ®Ä¥d¡A±z´N·|¹J¨ì³o­Ó°ÝÃD¡A ¦Ó±zªº¥d·|Åܦ¨ pcm1¡C ¦pªG±z¥u§â kernel ³]©wÀɤ¤ªº³]©w§ï¦¨ device pcm1 ¬OµLªk°£¥h³o­Óĵ§i°T®§ªº¡A ³o¼Ë·|³y¦¨ pcm1 ³Q«O¯dµ¹ ISA ­µ®Ä¥d¡A ¦Ó PCI ­µ®Ä¥d«h·|Åܦ¨ pcm2 ¡]¥~¥[ pcm1 not found ªºÄµ§i°T®§¡^¡C ¦pªG±z¦³¤@±i PCI ªº­µ®Ä¥d¡A±z»Ý­n make snd1 ³o­Ó device¡A¦Ó¤£¬O snd0¡G &prompt.root; cd /dev &prompt.root; ./MAKEDEV snd1 ³o­Ó°ÝÃD¦b FreeBSD 4.x ¤W¨Ã¤£·|µo¥Í¡A¦]¬°«Ü¦h¤H§ë¤U¤F³\¦h¤ß ¤OÅý¥¦§óPnP ¾É¦V¡A¦Ó¥B pcm0 ³o­Ó device ¤]¤£¦A¬O¥u«O¯dµ¹ ISA ªº­µ®Ä¥d¤F¡C ¬°¤°»ò¦b§ó·s¨ì FreeBSD 4.X «á·|§ì¤£¨ì§Úªº PnP ¥d ¡]©ÎªÌ¬O§ì¦¨ unknown¡^¡H FreeBSD 4.X ²{¦b¤w¸g§ó PnP ¾É¦V¤F¡A ¦ÓÃä»Ú®ÄÀ³´N¬O·|µo¥Í¦³¨Ç¦b FreeBSD 3.X ¥i¥H¥Îªº PnP ¸Ë¸m ¡]¦p­µ®Ä¥d©Î¬O¤º´¡¦¡¼Æ¾Ú¾÷¡^Åܦ¨µLªk¨Ï¥Î¡C ³o­Ó­ì¦]¥i¥H¥Î¤@«Ê¥Ñ Peter Wemm µo¨ì freebsd-questions ³o­Ó mailing list ¤Wªº«H¨Ó¸ÑÄÀ¡A¥¦­ì¥»¬O¸ÑÄÀ¬°¤°»ò¦³¤@­Ó¤º ´¡¦¡¼Æ¾Ú¾÷¡A¦b¨t²Î¤É¯Å¨ì FreeBSD 4.x «á¡A´N¨Sªk³Q§ì¨ì¤F ¡]¦b [] ùتº¬O¥t¥~¥[ªºµù¸Ñ¡AÅý¤º®e§ó©öÀ´¡^¡C
The PNP bios preconfigured it [the modem] and left it laying around in port space¡Aso [in 3.x] the old-style ISA probes found it there. Under 4.0¡Athe ISA code is much more PnP-centric. It was possible [in 3.x] for an ISA probe to find a stray device and then for the PNP device id to match and then fail due to resource conflicts. So¡Ait disables the programmable cards first so this double probing cannot happen. It also means that it needs to know the PnP id's for supported PnP hardware. Making this more user tweakable is on the TODO list.
¦pªG­nÅý¸Ë¸m¯à¦A«×¹B§@¡A§Ú­Ì»Ý­n§ä¥X¥¦ªº PnP id¡AµM«á¦A±N¥¦ ¥[¤J¤@¥÷¦b°»´ú ISA ¸Ë¸m®É·|¨Ï¥Îªºªí¤¤¡C¥i¥H°õ¦æ &man.pnpinfo.8; ¨Ó°»´ú³o­Ó¸Ë¸m¡AÁ|¨Ò¨Ó»¡¡A¤U­±¬O &man.pnpinfo.8; §ì¨ìªº¤@­Ó¤º´¡ ¦¡¼Æ¾Ú¾÷ªº¸ê®Æ¡G &prompt.root; pnpinfo Checking for Plug-n-Play devices... Card assigned CSN #1 Vendor ID PMC2430 (0x3024a341)¡ASerial Number 0xffffffff PnP Version 1.0¡AVendor Version 0 Device Description: Pace 56 Voice Internal Plug & Play Modem Logical Device ID: PMC2430 0x3024a341 #0 Device supports I/O Range Check TAG Start DF I/O Range 0x3f8 .. 0x3f8¡Aalignment 0x8¡Alen 0x8 [16-bit addr] IRQ: 4 - only one type (true/edge) [more TAG lines elided] TAG End DF End Tag Successfully got 31 resources¡A1 logical fdevs -- card select # 0x0001 CSN PMC2430 (0x3024a341)¡ASerial Number 0xffffffff Logical device #0 IO: 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 IRQ 5 0 DMA 4 0 IO range check 0x00 activate 0x01 ±z©Ò»Ý­nªº¸ê°T¬O¤@¶}©l¬Ý¨ìªº Vendor ID ³o¤@¦æ¡C¬A¸¹¤¤ªº¤Q¤»¦ì¤¸½X¡]³o­Ó¨Ò¤l¤¤¬O 0x3024a341¡^´N¬O PnP id¡A¦Ó¦b³o¤§«eªº¦r¦ê¡]PMC2430¡^«h¬O¤@­Ó¿W¤@µL¤Gªº ASCII id¡C ¦Ó³o¨Ç¸ê®Æ»Ý­n³Q¥[¨ì /usr/src/sys/isa/sio.c ³o­ÓÀÉ®×ùØ¡C ¬°¤F¨¾¤î¥ô¦óªF¦è¥X¿ù¡A±zÀ³¸Ó­n¥ý³Æ¥÷¥Ø«eªº sio.c¡C¦Ó¥B±z­n submit PR ®É¤]»Ý­n³o­Ó ­ì©lÀɮרӰµ¥X patch¡]±zÀ³¸Ó·|±N¥¦ submit PR §a..¡G¡^..¡^¡C ±µµÛ´N½s¿è sio.c §ä´M¤U­±³o¦æ static struct isa_pnp_id sio_ids[] = { ±µµÛ©¹¤U±²°Ê¡A§ä­Ó¥¿½Tªº¦ì¸m¨Ó´¡¤J±zªº¸Ë¸m¸ê°T¡C±z¬Ý¨ìªº´N ¤U­±³o­Ó¼Ë¤l¡A¥¦­Ì¬O·Ó¥kÃäµù¸Ñ¸Ì­±ªº ASCII ³o­Ó Vender ID °µ±Æ §Çªº¡A©Î¬O &man.pnpinfo.8; ©Ò§ä¨ìªº¤@³¡¤À ¸Ë¸m´y­z¡G {0x0f804f3f¡ANULL}¡A /* OZO800f - Zoom 2812 (56k Modem) */ {0x39804f3f¡ANULL}¡A /* OZO8039 - Zoom 56k flex */ {0x3024a341¡ANULL}¡A /* PMC2430 - Pace 56 Voice Internal Modem */ {0x1000eb49¡ANULL}¡A /* ROK0010 - Rockwell ? */ {0x5002734a¡ANULL}¡A /* RSS0250 - 5614Jx3(G) Internal Modem */ §â±z³o­Ó¸Ë¸mªº¤Q¤»¶i¦ìªº Vender ID ¥[¨ì¥¿½Tªº¦a¤è¡A¦sÀÉ¡A µM«á­«·s½s¤@­Ó kernel¡A¦A­«¶}¾÷¡C¤§«á³o­Ó¸Ë¸mÀ³¸Ó´N·|¹³¦b FreeBSD 3.X ¤U¡A³Q°»´ú¬° sio ¸Ë¸m¤F¡C
¬°¤°»ò§Ú±`±`¦b¶]¤@¨Çµ{¦¡¡]¨Ò¦p top ©Î systat¡^ªº®É­Ô¥X²{ nlist failed ³o­Ó¿ù»~°T®§¡H ³o­Ó°ÝÃD¬O¦]¬°±z¶]ªºµ{¦¡»Ý­n¤@­Ó¯S§Oªº kernel symbol¡A¥i¬O ¤£ª¾¹D¤°»ò­ì¦]¦Ó§ä¤£¨ì¡Q¦Ó·|µo¥Í³o­Ó°ÝÃD¥i¯à¬O¦]¬°¤U­±¨â­Ó­ì¦]¡G ±zªº kernel ©M userland ªºÀɮת©¥»¨Ã¤£¤@­P¡]¨Ò¦p»¡¡A±z ½s¤F¤@­Ó·sªº kernel¡A¦ý¬O¨Ã¨S¦³°õ¦æ¹ïÀ³ªº installworld¡A©Î¬O¨ä¥LÃþ¦ü±¡§Î¡^¡A ¦]¦¹ symbol table ªº¤º®e´N©MÀ³¥Îµ{¦¡½sĶ®Éªº¤£¤Ó¤@¼Ë¤F¡C¦p ªG¬O³oºØ±¡§Î¡A½Ð°õ¦æ§¹¾ãªº¤É¯Å¨BÆJ¡]½Ð°Ñ¾\ /usr/src/UPDATING ¥H±oª¾¥¿½Tªº¬y µ{¡^¡C ±z¨S¦³¥Î /boot/loader ¨Ó¸ü¤J±zªº kernel¡A¦Ó¬Oª½±µ¥Ñ boot2 ¶}¾÷¡]½Ð°Ñ¾\ &man.boot.8;¡^¡C ÁöµM»¡¸õ¹L /boot/loader ¨Ã¨S¦³¤°»ò¿ù¡A ¦ý¬O¥¦¦b kernel symbols ¸òÀ³¥Îµ{¦¡ªº·¾³q¤è­±¦û¤F«Ü­«ªº¥÷¶q¡C ¬°¤°»ò§Ú¥Î ssh ©Î telnet ³s¨ì§Úªº¹q¸£®É¡A·|µ¥«Ý«Üªøªº¤@¬q®É¶¡¤~¯à³s¤W¡H ¯gª¬¡GTCP ³s½u«Ø¥ß¤§«á©M¸ß°Ý±K½X¤§«e¡]¦pªG¬O¦b»¡ &man.telnet.1; ªº¸Ü¡A«h¬O login ´£¥Ü²Å¸¹¸õ¥X¨Ó¤§«e¡^¡A­nµ¥«Ý«Üªøªº¤@¬q®É ¶¡¡C °ÝÃD©Ò¦b¡G³oºØ©µ¿ð±¡§Î±`±`¬O¦]¬°¦øªA³nÅé¡]server software¡^ ¹Á¸Õ­n±N«È¤áºÝ¡]client¡^ªº IP ¦ì§}Âà´«¦¨¥D¾÷¦WºÙ¡C¦]¬°«Ü¦h¦øªA ³nÅé¡A¥]¬A FreeBSD ¤º«Øªº Telnet ©M SSH¡A¬°¤F±N¥D¾÷¦WºÙ¼g¤J¬ö ¿ýÀɤ¤¥H¨ÑºÞ²zªÌ§@°Ñ¦Ò¡A¦Ó·|°µ³o¶µ°Ê§@¡C ¸Ñ¨M¤èªk¡G¦pªG³o­Ó°ÝÃD¦b±z³s±µ¤£¦Pªº¦øªA¾¹®É³£·|µo¥Í¡A¨º»ò °ÝÃD¬O¦b±z«È¤áºÝ³o¤@¤è¡Q¦P¼Ëªº¡A¦pªG§O¤H¥u¦³¦b³s¨ì±zªº¦øªA¾¹¤W ¤~·|µo¥Í³o­Ó±¡§Î¡A¨º»ò°ÝÃD´N¬O¦b¦øªA¾¹³oÃä¤F¡C ¦pªG¬O«È¤áºÝ³o¤è¦³°ÝÃD¡A°ß¤@ªº¤èªk´N¬O±N DNS ¦øªA¾¹­×¦n¡A ³o¼Ë¹ï¤è¦øªA¾¹¤~¯à¥¿½TªºÂà´«¦WºÙ¡C¦pªG°ÝÃD¬O¦b¤º³¡°Ï°ìºô¸ôµo ¥Íªº¡A³oÀ³¸Ó¬O¦øªA¾¹¦³°ÝÃD¡A½Ð¸Ô²ÓÀˬd¤@¤U¡Q¬Û¤Ïªº¡A¦pªG¬O±z ¦b¤W Internet ®Éµo¥Íªº¡A¨º»ò±z»Ý­n¸ò±zªº ISP Ápµ¸¡A½Ð¥L­Ì¸Ñ¨M ³o­Ó°ÝÃD¡C ¦pªG¬O¦øªA¾¹³oÃ䪺°ÝÃD¡A¦Ó¥B¬Oµo¥Í¦b¤º³¡°Ï°ìºô¸ô¡A¨º»ò±z»Ý ­n³]©w³o­Ó¦øªA¾¹¡A¨Ï¥¦¯à¥¿½T±N¤º³¡ºô¸ôªº IP ¦ì§}Âà´«¬°¥D¾÷¦WºÙ¡C ½Ð°Ñ¾\ &man.hosts.5; ©M &man.named.8; ªº»¡©ú¥HÀò±o§ó¦h¸ê°T¡C¦p ªG¬O¦b Internet ¤Wªº¦øªA¾¹µo¥Í³o­Ó°ÝÃD¡A¨º»ò¦³¥i¯à¬O±z¦øªA¾¹ªº Âà´«¥\¯à¥X°ÝÃD¡C±z¥i¥H¸Õ¸Õ¬d¸ß¥t¤@­Ó¥D¾÷¦WºÙ¡A¤ñ¦p¡G www.yahoo.com¡C¦pªG¬d¤£¨ì¡A¨º»ò¥i¥H½T©w¬O±z³o Ãä¥X°ÝÃD¤F¡C stray IRQ ³o­Ó¿ù»~°T®§¬O¤°»ò·N«ä¡H Stray IRQs ¬OµwÅé IRQ ¦³ÂI¤p°ÝÃDªº²{¶H¡A¤j¦h¬O¦]¬°µwÅ饻¨­ ¦bµo¥X¤¤Â_»Ý¨D«á¡A¤S¨ú®ø¤F¥¦¦Û¤vªº¤¤Â_­n¨D¡C ¦³¤T­Ó¤èªk¥i¥HÀ³¥I³o­Ó°ÝÃD¡G ¤£²z·|³o­Óĵ§i¡C¤Ï¥¿¤@­Ó irq ¥X²{¤­¦¸Äµ§i«á¨t²Î´N¤£·| ¦AÅã¥Ü¤F¡C §â isa_strayintr() ùتº­È¡A¥Ñ 5 §ï¦¨ 0¡A³o¼Ë©Ò¦³ªºÄµ§i°T®§³£¤£·|¥X²{¡C ¦w¸Ë¨Ï¥Î irq 7 ªº¥­¦æ°ðµwÅé³]³Æ¡A¥H¤Î¥¦ªº PPP ÅX°Êµ{¦¡ ¡]³o­Ó¤j³¡¤À¨t²Î³£¦³°µ¡^¡A±µµÛ¦w¸Ë ide µwºÐ©Î¬O¨ä¥L·|¨Ï¥Î irq 15 ªºµwÅé³]³Æ¥H¤Î¥¦ªºÅX°Êµ{¦¡¡C ¬°¤°»ò file: table is full ³o­Ó°T®§ ¤@ª½¦b dmesg ùØ­«½Æ¥X²{¡H ³o­Ó¿ù»~°T®§¥Nªí¤F±z¨t²Îªº file descriptors ¤w¸g¨Ï¥Î¥ú¤F¡C ½Ð°Ñ¾\¤â¥U¤º Tuning Kernel Limits ¸Ì­±ªº kern.maxfiles ³o­Ó³¹¸`¡A¸Ì­±¦³¤@¨Ç°Q½×¤Î¸Ñ¨M¤èªk¡C ¬°¤°»ò§Úµ§°O«¬¹q¸£¤Wªº®ÉÄÁ¤@ª½Åã¥Ü¿ù»~ªº®É¶¡¡H ±zªºµ§°O«¬¹q¸£¸Ì¦³¨â­Ó¥H¤Wªº®ÉÄÁ¡A¦Ó FreeBSD ¿ï¨ì¤F¿ùªº ¨º­Ó¡C °õ¦æ &man.dmesg.8;¡AÀˬd¤@¤U¦³ Timecounter ¦r¦êªº¨º´X¦æ¡C³Ì«á¤@¦æ¬O FreeBSD ¿ï¥Îªº¡A³q±`¬O TSC¡C &prompt.root; dmesg | grep Timecounter Timecounter "i8254" frequency 1193182 Hz Timecounter "TSC" frequency 595573479 Hz ±z¥i¥H°õ¦æ &man.sysctl.3; ¬Ý¤@¤U kern.timecounter.hardware ³o­Ó­È°µ½T»{¡C &prompt.root; sysctl kern.timecounter.hardware kern.timecounter.hardware: TSC BIOS ¥i¯à¦b¤@¨Ç±¡§Î¤U·|§ó§ï TSC ªº®É¯ß—¦³®É­Ô¬O¦]¬° ¦b¨Ï¥Î¹q¦À¤u§@®É·|§ó§ï³B²z¾¹ªº³t«×¡A¥t¥~¤]¦³¥i¯à¬O¶i¤J¤F¬Ù¹q¼Ò ¦¡¡A¥i¬O FreeBSD ¨Ã¤£·|¹îı¨ì³o¨Ç½Õ¾ã¡A¦Ó·|µo¥Í®É¶¡¼W¥[©Î¬O´î ¤Öªº±¡§Î¡C ¦b¤W­±ªº¨Ò¤l·í¤¤¡A§Ú­Ì¬Ý¨ìÁÙ¦³ i8254 ³o­Ó®ÉÄÁ¥i¥H¿ï¾Ü¡A°õ¦æ &man.sysctl.3; ¥Î¤â°Êªº¤è¦¡±N³o­Ó­È¼g¤J kern.timecounter.hardware ¤¤¡C &prompt.root; sysctl -w kern.timecounter.hardware=i8254 kern.timecounter.hardware: TSC -> i8254 ³o¼Ë±zªºµ§°O«¬¹q¸£À³¸Ó´N¥i¥H«O«ù¥¿½Tªº®É¶¡¤F¡C ¦pªG­nÅý³o­Ó§ó§ïªº°Ê§@¦A¨C¦¸¶}¾÷®É¦Û°Ê°õ¦æ¡A¦b /etc/sysctl.conf ùØ¥[¤J¤U­±³o¦æ¡C kern.timecounter.hardware=i8254 ¬°¤°»ò§Úªºµ§°O«¬¹q¸£µLªk¥¿½Tªº°»´ú¨ì PC card ¡H ³o­Ó°ÝÃD±`±`µo¥Í¦bÄé¤F¦h­Ó§@·~¨t²Îªºµ§°O«¬¹q¸£¤W¡C¦³¨Ç«D BSD ªº§@·~¨t²Î·|Åý PC card ªºµwÅé¸Ë¸m³B¦b¤@­Ó¤£¤@­Pªºª¬ºA¤U ¡]inconsistent state¡^¡C¨Ï±o pccardd ¦b°» ´ú³o¤ù¥d®É¡AµLªk§ì¨ì¥¿½Tªº«¬¸¹¡A¦Ó¬O "(null)""(null)"¡C ±z»Ý­n²¾°£ PC card ´¡¼Ñªº¹q·½¥H­«¸m³o­ÓµwÅé¸Ë¸m¡C¤@­Ó¤èªk¬O ±N±zªºµ§°O«¬¹q¸£Ãö¾÷¡]¤£¬O¥ð¯v¼Ò¦¡¡A¤]¤£¬O«Ý©R¼Ò¦¡¡Q­n§¹¥þªºÃö ¾÷¡^¡Cµ¥­Ó´X¬íÄÁ¦A­«¶}¾÷¡C³o¼Ë±zªº PC card À³¸Ó´N¥¿±`¤F¡C ¦³®É¦³¨Çµ§°O«¬¹q¸£ÁöµM¬Ý°_¨Ó¤w¸gÃö¾÷¤F¡A¦ý¹ê»Ú¤W¨Ã¨S¦³¡C ¦pªG±zµo²{¤W­±¨º­Ó¤èªk¨S¦³¥Î¡A½ÐÃö¾÷¡A²¾°£¹q¦À¡Aµ¥­Ó´X¬íÄÁ¡A §â¹q¦À¸Ë¤W¥hµM«á­«¶}¾÷¡C ¬°¤°»ò¦b BIOS µe­±¤§«á¡AFreeBSD ªº boot loader Åã¥Ü Read error µM«á´N°±¤î¤£°Ê¤F¡H ³o¬O¦]¬°FreeBSD ªº boot loader µLªk¥¿½Tªº§ä¥XµwºÐªº geometry¡C³o¼Ëªº¸Ü¡A´N»Ý­n¦b¥Î fdisk ¤À³Î©Î¬O­×§ï FreeBSD ªº slice ®É¡A¤â°Ê±N¥¿½Tªº­È¿é¤J¶i¥h¤F¡C ¥¿½TªºµwºÐ geometry ­È¦b BIOS ¸Ì­±¥i¥H¬dªº¨ì¡Cª`·N¸ÓµwºÐªº cylinders¡Aheads ¥H¤Î sectors ³o¨Ç¼Æ­È¡C ¦b°õ¦æ &man.sysinstall.8;ªº fdisk ®É¡A«ö¤U G ¥H«K¤â°Ê³]©wµwºÐªº geometry¡C ³o®É·|¦³¤@­Ó¹ï¸Ü®Ø¸õ¥X¨Ó¡A¸ß°Ý±z¦³Ãö cylinders¡Aheads ¥H¤Î sectors ³o¨ÇªF¦èªº­È¡C½Ð±N­è­è¦b BIOS ¬d¨ìªº¼Æ¦r¡A¥H / §@¤À¹j¿é ¤J¶i¥h¡C Á|¨Ò¨Ó»¡¡A¦pªG¬O 5000 cylinders¡A250 sectors ©M 60 sectors ´N¿é¤J 5000/250/60 ¿é¤J§¹«á½Ð«ö enter Áä½T»{¡A³Ì«á«ö¤U W Áä§â ·sªº¤À³Î°Ïªí¼g¤JµwºÐ·í¤¤¡C ¥t¤@­Ó§@·~¨t²ÎºR·´¤F§Úªº Boot Manager¡C§Ú­n«ç»ò¼Ë¤~¯à§â¥¦ÁÙ ­ì¦^¨Ó¡H °õ¦æ &man.sysinstall.8; ±µµÛ¿ï Configure¡AµM«á¿ï Fdisk¡C ¦A¨Ó¥ÎªÅ¥ÕÁä¿ï¾Ü­ì¥ý Boot Manager ©Ò¦bªºµwºÐ¡C «ö¤U W Áä¨Ó§@¼g¤Jªº°Ê§@¡C³o®É·|¸õ¥X¤@­Ó´£¥Ü °T®§¡A¸ß°Ý±z­n¦w¸Ë­þ¤@­Ó boot loader¡C½Ð¿ï¾Ü Boot Manager¡A ³o¼Ë´N¥i¥H±N¥¦ÁÙ­ì¤F¡C ³o­Ó¿ù»~°T®§¡Gswap_pager: indefinite wait buffer: ¬O¤°»ò·N«ä©O¡H ³o­Ó°T®§¬O»¡¦³¤@­Ó°õ¦æµ{§Ç¥¿¦b¹Á¸Õ±N¤À­¶°O¾ÐÅé¡]page memory¡^ ¼g¤JµwºÐ¤¤¡A¦Ó³o­Ó°Ê§@¹Á¸Õ¤F 20 ¬íÄÁ¤´µMµLªk¦¨¥\¡C³o­Ó¦³¥i¯à¬O¦]¬° µwºÐ¦³Ãa­y¡B¹q¸ô©Î±Æ½u¦³°ÝÃD¡B¥H¤Î¨ä¥L¸òµwºÐŪ¥X¼g¤J¦³ÃöªºµwÅé³]³Æ¡C ¦pªG¯uªº¬OµwºÐÃa­yªº°ÝÃD¡A±zÀ³¸Ó·|¦b /var/log/messages³o­ÓÀɮפ¤¡A©Î¬O¦b°õ¦æ dmesg³o­Ó«ü¥O«á¡A¬Ý¨ì¦³ÃöºÏºÐ¿ù»~ªº°T®§¡C ¦pªG¨S¦³¡A¨º»ò½ÐÀˬd±zªº±Æ½uÁÙ¦³±µÀY³s±µ¬O§_¨}¦n¡C - Why does buildworld/installworld die with the message - touch: not found? + ¬°¦ó¦b buildworld/installworld ®É¡A·|­w¦b + touch: not found ªº¿ù»~°T®§? - This error does not mean that the &man.touch.1; utility is - missing. The error is instead propably due to the dates of the - files being set sometime in the future. If your CMOS-clock is - set to local time you need to run the command - adjkerntz -i to adjust the kernel clock - when booting into single user mode. + ³o¿ù»~°T®§¨Ã¤£¬O«ü &man.touch.1; µ{¦¡¤£¨£¤F¡A¨Æ¹ê¤W¥i¯à¬O¸ÓÀÉÀɮ׮ɶ¡³Q³]¬°¥¼¨Óªº®É¶¡¡C + ­Y¾÷¾¹¤Wªº CMOS-clock ®ÉÄÁ³]©w¬°·í¦a®É¶¡ + («D®æªL«Âªv®É¶¡¡A¤ñ¦p¥xÆW®É¶¡¬° GMT +08:00 ¡A¤]´N¬O CST ¤¤­ì¼Ð·Ç®É¶¡)¡A + ¨º»ò½Ð¦b¶}¾÷®É¡A¥ý¿ï single user ¼Ò¦¡¶i¤J¡AµM«á¥´ + adjkerntz -i + ¨Ó½Õ¾ã kernel clock »P¾÷¾¹¤Wªº CMOS-clock ¨Ó¦P¨B¡C
Vanilla Shu
vanilla@FreeBSD.org
°Ó·~³nÅé ³o¤@¸`ªº¤º®eÁÙ¬O¬Û·í¤Ö¡A¤£¹L§Ú­Ì·íµM§Æ±æ¦U­Ó¤½¥q¯à¬°¥¦¥[ ÂI¤º®e :) FreeBSD ²Õ´©M¦C¦b³o¸Ìªº¥ô¦ó¤@®a¤½¥q³£¨S¦³ª÷¿ú¤Wªº§Q®` Ãö«Y¡A¦C¥X¨Ó¥u¬O¹ï¤j²³ªº¤½¶}ªA°È¡]¦P®É¤]»{¬°¦b FreeBSD ¤Wªº°Ó·~¿³ ½ì¡A·|¹ï FreeBSD ªø¤[¥Í¾÷¦³·¥¥¿­±ªº®Ä¯q¡^¡C§Ú­Ì¹ªÀy°Ó·~³nÅ骺¼t°Ó §â¥L­Ìªº²£«~¥]¬A¦b¤U­±ªº¦W³æ¤¤¡A¦b Vendors page ¥i¥H¬Ý¨ì¸ûªø¦Cªí¡C ¦b­þÃä§ä¨ìµ¹ FreeBSD ¥Îªº Office ®M¥ó©O¡H FreeBSD Mall ´£¨Ñ¤F VistaSource ªº ApplixWare 5 ªº FreeBSD ª©¥»¡C ApplixWare ¬O¤@®M°Ó·~ª©¥»ªº Office ®M¥ó¡A¥L´£¨Ñ¤F ¤å¥ó³B²z¡B¸Õºâªí¡B¦V¶qø¹Ïµ¥¬ÛÃöµ{¦¡¡C ApplixWare ¦P®É¤]¬O FreeBSD Mall's BSD Desktop Edition ªº¤@³¡¥÷¡C Linux ª©¥»ªº StarOffice ¥i¥H«Ü¥¿±`ªº¦b FreeBSD ¤U°õ¦æ¡A¥i¥H³z¹L FreeBSD Ports collection ¨Ó¦w¸Ë Linux ª©¥»ªº StarOffice¡C¦Ó open-source OpenOffice «Ü§Ö±o ¤]¥i¥H¦b FreeBSD ¤W¥¿±`ªº°õ¦æ¡C ¦b­þÃä§ä¨ìµ¹ FreeBSD ¥Îªº Motif¡H Open Group ÄÀ¥X¤F Motif 2.1.30 ªº­ì©l½X¡A¥i¥H³z¹L open-motif package ¦w¸Ë¡A©Î¬O¥Ñ ports ¦Û¦æ ½sĶ¡C¬ÛÃöªº¸ê°T¡A½Ð°Ñ¦Ò handbook ¤¤ªº ports ³¹¸`¡C Open Motif ¥u¯à¦b¦P¼Ë¤]¬O open source ªº§@·~¨t²Î©Î­p¹º¤¤¨Ï¥Î¡C ¥t¥~¡A¤]¬O¦³°Ó·~ª©¥»ªº Motif ¦s¦b¡C¤]³\³oºØª©¥»ªº Motif ¤£¬O§K¶Oªº¡A¦ý¬Oµ´¹ï¤¹³\¥Î¦b closed-source ªºÀô¹Ò¤U¡C Apps2go ´£¨Ñ¤F³Ì«K©yªº FreeBSD (¥]¬A i386 ¸ò alpha)ª©¥»ªº ELF Motif 2.1.20 ®M¥ó¡C ¥Ø«e´£¨Ñ¨âºØ¤£¦PÀô¹Òªºª©¥»¡A µo®i¥Îª©¥» ¤Î runtime ª©¥» ¡C³o¨âºØ®M¥ó³£¥]¬A¡G OSF/Motif manager, xmbind, panner, wsm. Development kit with uil, mrm, xm, xmcxx, include and Imake files. Static and dynamic ELF libraries (for use with FreeBSD 3.0 and above). Demonstration applets. ¦]¬° Apps2go ¤]¦³´£¨Ñ NetBSD ©M OpenBSD ªºª©¥»¡A©Ò¥H¦b­qÁʮɽЯS§O«ü©w¬O­n FreeBSD ª©¥»ªº Motif¡I ¥L­Ì¥Ø«e¥u´£¨Ñ¥H FTP ªº¤è¦¡¨ú±o³o¥÷®M¥ó¡C §ó¦h¸ê°T Apps2go WWW page ©Î sales@apps2go.com ©Î support@apps2go.com ©Î phone (817) 431 8775 or +1 817 431-8775 ¤]¥i¥HÁpµ¸ Metro Link ¨ú±oµ¹ FreeBSD ELF©Î a.out ª©¥»ªº Motif 2.1 ®M¥ó¡C ³o¥÷®M¥ó¥]¬A¡G OSF/Motif manager, xmbind, panner, wsm. Development kit with uil, mrm, xm, xmcxx, include and Imake files. Static and dynamic libraries (specify ELF for use with FreeBSD 3.0 and later; or a.out for use with FreeBSD 2.2.8 and earlier). Demonstration applets. Preformatted man pages. ¥Ñ©ó Metro Link ¤]¦³´£¨Ñ Linux ªºª©¥»¡A ©Ò¥H­qÁʮɭn¯S§O«ü©ú¬O FreeBSD ª©¥»ªº Motif¡I ¥i¥H¥Ñ¥úºÐ©Î±q FTP ¨Ó¨ú±o³o­Ó®M¥ó¡C Ápµ¸ Xi Graphics ¡A¥L­Ì´£¨Ñ¤F¤@­Ó FreeBSD a.out ®æ¦¡ªº Motif 2.0 ®M¥ó¡C ¦b³o®M¥ó¤¤¥]¬A¤F¡G OSF/Motif manager, xmbind, panner, wsm. Development kit with uil, mrm, xm, xmcxx, include and Imake files. Static and dynamic libraries (for use with FreeBSD 2.2.8 and earlier). Demonstration applets. Preformatted man pages. ¦b§A¸ò¥L­Ì­qÁÊ Motif ®É¡A½Ð¤@©wµù©ú§A­nªº¬O FreeBSD ªºª©¥»¡I ¦]¬° Xi Graphics ¤]¦P®É´£¨Ñ¤F BSDI ¸ò Linux ª©¥»ªº Motif¡C¥Ø«eµo¦æªºª©¥»¬O©ñ¦b¥|¶ôºÏ¤ù¤¤¡A±N¨Ó¥L­Ì·|±N©Ò¦³ªº ªF¦è³£©ñ¨ì¥úºÐ¸Ì¡A´N¹³¥L­Ì©Òµo¦æªº CDE ¤@¼Ë¡C ¦b­þÃä§ä¨ìµ¹ FreeBSD ¥Îªº CDE¡H Xi Graphics ¥H«e¦³½æ FreeBSD ¥Îªº CDE¡A¤£¹L²{¦b¤w¸g°±¤îµo°â¤F¡C KDE is an open source X11 desktop which is similar to CDE in many respects. You might also like the look and feel of xfce. KDE and xfce are both in the ports system. ¦³¨S¦³­n¿ú¡A¦ý¬O°ª®Ä²vªº X servers¡H ¦³¡A Xi Graphics ©M Metro Link ³£¦³´£¨Ñµ¹ FreeBSD¡]©Î¨ä¥L Intel ¥­¥x¤W¡^¥Îªº X µøµ¡¥[³t²£«~¡C Metro Link °ª®Ä¯à X Server ¨Ï¥Î¤F FreeBSD ¤º«Øªº package ¥]¸Ë¤è¦¡, ¦]¦¹³]©w¤Q¤À®e©ö¡A¤ä´©¥Ø«e¥«­±¤W¦U¤j¼tµPªºÅã¥Ü¥d¡C ¥Ø«e¥u´£¨Ñ binary ®æ¦¡ÀɮסA¥i¥H±q FTP ¯¸¬Û·í¤è«K¦aª½±µ¤U¸ü¡A ¨Ã¥B Metro Link ³o®M²£«~ªº»ù®æ¬O«D±`¦X²zªº $39¡C Metro Link ¦P®É´£¨Ñ FreeBSD ¤Wªº ELF ©M a.out ®æ¦¡ªº Motif ¡]©¹¤W­±¬Ý¬Ý¡^¡C §ó¦hªº¸ê°T Metro Link WWW page ©Î sales@metrolink.com ©Î tech@metrolink.com ©Î phone (954) 938-0283 or +1 954 938-0283 Xi Graphics ©Ò´£¨Ñªº°ª®Ä¯à X Server ¦³«D±`²³æªº³]©w¤è¦¡¡A ¨Ã¥B¤ä´©¤F¥Ø«e¥«­±¤W·í¬õªº¦U¤j¼tµPªºÅã¥Ü¥d¡C¥¦¥uµ¹§A Binary ÀɮסA ¬O¥ÎºÏ¤ùªº¤è¦¡µo¦æ¡AFreeBSD ¸ò Linux ª©¥»³£¬Û¦P¡CXi Graphics ¦P®É ¤]´£¨Ñ¤F±Mªùµ¹ laptop ¥Îªº°ª®Ä¯à X Server¡C 5.0 ª©¦³´£¨Ñ§K¶Oªº compatibility demo ª©¥» Xi Graphics ¤]¦³¦b½æ FreeBSD ¥Îªº Motif ¸ò CDE¡]©¹¤W­±¬Ý¬Ý¡^¡C §ó¦hªº¸ê°T Xi Graphics WWW page ©Î sales@xig.com ©Î support@xig.com ©Î phone (800) 946 7433 or +1 303 298-7478. ¦b FreeBSD ¤W¦³¥ô¦óªº¸ê®Æ®w¶Ü¡H ¦³! ½Ð¬Ý FreeBSD ºô¯¸¤W °Ó·~³nÅ餽¥q ³o¤@³¡¥÷¡C ÁÙ¦³½Ð°Ñ¦Ò ports ¤¤ Databases ¬ÛÃöªº¦¬¶°¡C ¥i¥H¦b FreeBSD ¤W°õ¦æ Oracle ¶Ü¡H ¥i¥H¡A¤U­±³o­Óºô­¶·|»¡©ú¦p¦ó¦b FreeBSD ¤W°õ¦æ Linux ª©ªº Oracle¡G http://www.scc.nl/~marcel/howto-oracle.html http://www.lf.net/lf/pi/oracle/install-linux-oracle-on-freebsd
Kang-min Liu
gugod@gugod.org
¤@¯ëÀ³¥Îµ{¦¡ ¶â..§Ú­n¦b­þ§ä¨ì§Ú­nªºµ{¦¡©O? ½Ð¬Ý¬Ý ports ¥Ø¿ý §a¡C³oÃ䦳¥÷¤w¸g port ¨ì FreeBSD ªº³nÅé¦Cªí¡C ¥Ø«e¦³¶W¹L &os.numports; ­Ó³nÅé¤w¸g³Qport ¨ì FreeBSD ¤W¡A¨Ã¥B¨C¤Ñ ³£¦b¼W¥[¤¤¡C©Ò¥H¦³ªÅ´N¦h¬Ý¬Ý³o¥÷¦Cªí¡A¤£µM§A¤]¥i¥H­q¾\ freebsd-announce ³o¥÷ mailing list¡A·|¦³¤H±N¨C­Ó¬P´Á³Ì·sªº³nÅé¦Cªí¶K¦b ¤W­±¡C ¤j³¡¥÷ªº ports À³¸Ó³£¥i¥H¦b 2.2¡A3.0 ¸ò 4.0 ªº¨t²Î¤W¨Ï ¥Î¡A¨Ã¥BÁÙ¦³³¡¥÷ªº ports ¥i¥H¦b 2.1.x ªº¨t²Î¤W¹B§@¡C¨C¦¸ ·í FreeBSD release ®É¡A³£·|¦³¤@¥÷ ports tree ³Q©ñ¦b³o¤@­Ó release cd ¸Ì­±ªº ports/ ¥Ø¿ý¸Ì¡C §Ú­Ì¤]¤ä´©¤@ºØ¥s package ªº·§©À¡A°ò¥»¤W ´N¬O gzip À£ÁY¡B¥i¥Î¨Óµo¦æªº binary ÀɮסA¦ý¬O¸Ì­±ÂäF¤@ ¨Ç¬Û·í¦³¥Îªº¸ê°T¡A¥i¥Hµ¹¦UºØ¦Û­q¦w¸Ë¨Ó¨Ï¥Î¡C¨Ï¥ÎªÌ¤£¥²ª¾ ¹D¬Y­Ó package ¸Ì¨s³º¦³¥]¬A­þ¨ÇÀɮסA´N¥i`¥H«Ü¤è«K¦a­«½Æ±N ¥¦¦w¸Ë/¤Ï¦w¸Ë¡C §A¥i¥H°õ¦æ /stand/sysinstall «á¡A ¦b post-configuration ¿ï³æ¤U¿ï¾Ü package ³o­Ó¦w¸Ë¿ï¶µ¡F©Î ¬O¹ï¬Y­Ó¦³¿³½ìªº package ÀÉ®×°õ¦æ &man.pkg.add.1; §â¥¦¸Ë°_¨Ó¡CPackage Àɮ׳q±`¥H .tgz §@¬°©µ¦ùÀɦW¡A¤â¤W¦³ FreeBSD CDROM ªº¤H¥i¥H¦b packages/All ³o­Ó¥Ø¿ý¤U§ä¨ì³oÃþÀɮסC ¹ï¤£¦Pªº FreeBSD ª©¥»¡A¤]¥i¥H±q¤U¦C¦ì§}¥Ñºô¸ô¤W¨ú±o¡G µ¹ 2.2.8-release/2.2.8-stable ¥Îªº ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-2.2.8/ µ¹ 3.2-release/3.2-stable ¥Îªº ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-3-stable/ µ¹ 4.X-RELEASE/4-STABLE ¥Îªº ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-current/ µ¹ 5.X-CURRENT ¥Îªº ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-5-current ©Î¬OÂ÷§A³Ìªñªº mirror ¯¸¡C ­nª`·Nªº¬O¡A¦]¬°·sªº port ¤@ª½¦b¼W¥[¤¤¡A©Ò¥H¨Ã¤£¬O©Ò¦³ port ³£¦³¬Û¹ïÀ³ªº package¡C³Ì¦n©w®ÉÀˬdftp.FreeBSD.org ¡A¬Ý¬Ý¦³­þ¨Ç package ¥i¥H¥Î¡C §Ú¥i¥H¦b­þÃä§ä¨ì libc.so.3.0? §A¥i¯à¦b¤@¥x 2.1.x ªº¾÷¾¹¤W¡A¶]µÛµ¹ 2.2/3.x/4.0 ªº³nÅé¡C ½Ð¦A©¹¤W­±¤@­Ó³¹¸`¬Ý¡A¥¿½Tªº¨ú±oµ¹§A¾÷¾¹¥Îªº port/package¡C ¬°¦ó§Ú±o¨ì¤F³o­Ó°T®§ ?Error: can't find libc.so.4.0? §A¤£¤p¤ß§ì¤Fµ¹ 4.X ¤Î 5.X ¨t²Î¥Îªº package¡A¨Ã¥B¹Á¸ÕµÛ ¥h¸Ë¦b§Aªº 2.X ©Î 3.X ªº¨t²Î¤W­±¡C½Ð¤U¸ü¥¿½Tª©¥»ªº package¡C ghostscript ¦b§Úªº 386/486SX ¤W¦³ÂI°ÝÃD©O¡I §A¨S¦³¯BÂI¹Bºâ¾¹¡A¹ï§a¡H§A¥²¶·¦b§Aªº kernel ¤¤¥[¤J¼Æ¾Ç ¹Bºâ¼ÒÀÀ¾¹¡A§A¥i¥H¸òµÛ¤U­±ªº¨BÆJ°µ¡A¨Ã¦b§ó§ï¹L§Aªº kernel ³]©w ÀÉ«á¡A­«·s½s͹L¤@¦¸¡C options GPL_MATH_EMULATE ·í§A¥[¤J¤W¤@¦æªº¦P®É¡A§A¥²¶·±N MATH_EMULATE ²¾°£±¼¡C ¬°¤°»ò·í§Ú°õ¦æ SCO/iBCS2 ªºµ{¦¡®É¡A¥¦¦b socksys ³o­Ó¦a¤è¥X¤F°ÝÃD¡H (FreeBSD 3.0 ¥H¤Î§ó¦­ªºª©¥»¤~¦³¦¹°ÝÃD¡C) §A¥²¶·¥ý­×§ï /etc/sysconfig (©Î¬O /etc/rc.conf, ½ÐŪ &man.rc.conf.5;) ³oÀɮ׳̫á¤@­Ó³¹¸`¡A±N¤U­±©ÒÁ¿¨ìªºÅܼƳ]¦¨ YES¡G # Set to YES if you want ibcs2 (SCO) emulation loaded at startup ibcs2=NO ³o·|¦b¶}¾÷®É±N ibcs2 ³o¤@­Ó kernel ¼Ò²Õ¸ü¤J¡C §AÁÙ­n±N§Aªº /compat/ibcs2/dev §ï¦¨¤U­±³o¼Ë¡G lrwxr-xr-x 1 root wheel 9 Oct 15 22:20 X0R@ -> /dev/null lrwxr-xr-x 1 root wheel 7 Oct 15 22:20 nfsd@ -> socksys -rw-rw-r-- 1 root wheel 0 Oct 28 12:02 null lrwxr-xr-x 1 root wheel 9 Oct 15 22:20 socksys@ -> /dev/null crw-rw-rw- 1 root wheel 41, 1 Oct 15 22:14 spx §A¥u»Ý­n±N socksys Âà¦V¨ì /dev/null (½ÐŪ &man.null.4;) ¥hÄF¹L open & close ªº°Ê§@¡C¦b -current ¸Ì­±ªº ibcs2 ¬ÛÃöµ{¦¡½X±N·|³B²z¨ä¾lªº³¡¥÷¡A³oºØ§@ªk¤ñ¥H«eªº¤è¦¡ °®²b¤Ó¦h¤F¡C°²¦p§A·Q­n¨Ï¥Î spx ¤è­±ªº µ{¦¡¡A¦b§Aªº®Ö¤ß³]©wÀɸ̭± ¥[¤WSPX_HACK¡C §Ú­n¦p¦ó¦b§Úªº¾÷¾¹¤W³]©w INN (Internet News)¡H ¦b§A¨Ï¥Î package ©ÎªÌ¬O port ¦w¸Ë§¹ inn ¤§«á¡ADave Barr's INN Page ¬O­Ó«D±`¦nªº¶}©l¡A§A¥i¥H¦b¨ºÃä§ä¨ìINN ªº FAQ¡C §Ú¸Ó¨Ï¥Î¨º­Óª©¥»ªº Microsoft FrontPage¡H Use the Port, Luke¡I¦b ports tree ¤¤¤w¸g¦³¤@­Ó¥]§t FrontPage ªº Apache ª©¥»¤F¡C FreeBSD ¤ä´© Java ¶Ü¡H ¦³¡A½Ð¬Ý http://www.FreeBSD.org/java. ¬°¤°»ò§ÚµLªk¦b 3.X-STABLE ¾÷¾¹¤W¶¶§Q½s¦n³o­Ó port? ¦pªG§Aªº FreeBSD ª©¥»¬Û¸û -CURRENT ©Î -STABLE ¤§¤U¬O«Ü¥j ¦­ªº¸Ü¡A©Î³\§A·|»Ý­n¤@­Ó¤É¯Å ports ªº¤u¨ã¡A¦b http://www.FreeBSD.org/ports/¡C¦pªG§A¥H±N¨ä§ó·s«o¤´µL¥Î¡A ¨º»ò¤@©w¬O¬Y¤H§ó°Ê¤§«á³y¦¨ -CURRENT ¤~¯à¥Î¡A-STABLE µLªk¥Îªº±¡ªp¡C ¥Ñ©ó ports ¤º©Ò¦¬¶°ªº³nÅé¦b -CURRENT ©Î¬O -STABLE ¤W³£­n¯à¥Î¡A ©Ò¥H½Ð¾¨³t°e¥XÃö©ó¦¹°ÝÃDªºÂγø§i¡F½Ð¨Ï¥Î &man.send-pr.1; ³o­Ó«ü ¥O¨Ó°eÂγø§i¡C ¨º¸Ì¥i¥H§ä±o¨ì ld.so¡H ¦³¨Ç a.out ®æ¦¡ªºÀ³¥Îµ{¦¡·|»Ý­n a.out ®æ¦¡ªº¨ç¦¡®w¡A Netscape Navigator ´N¬O¤@­Ó¨Ò¤l¡C¤£¹L¥Î ELF ¨ç¦¡®w½s°_¨Ó ªº FreeBSD ¹w³]¨Ã¤£·|¦w¸Ëªº a.out ¨ç¦¡®w¡A©Ò¥H±z¥i¯à·|±o ¨ìÃþ¦ü§ä¤£¨ì /usr/libexec/ld.so ªº©ê«è°T ®§¡C¦pªG»¡±zªº¨t²Î¦³³o¦w¸Ë a.out ¨ç¦¡®wªº¥²­n¡A³o¨Ç¨ç¦¡®w (compat22) ¤]¯à°÷§Q¥Î &man.sysinstall.8; ¨Ó¦w¸Ë¡C©ÎªÌ§Q¥Î FreeBSD ­ì©l½X¨Ó¦w¸Ë¡G &prompt.root; cd /usr/src/lib/compat/compat22&prompt.root; make install clean ¦pªG§A§Æ±æ¨C¦¸ make world ®É·|¦Û°Ê§ó·s compat22 ¨ç¦¡®w¡A¨º»ò­×§ï /etc/make.conf¡A ¥[¤J COMPAT22=YES¡C³o¨Ç¬Û®e©ó¥j¦Ñª©¥»ªº¨ç¦¡®w ¤w¸g¨S¤°»ò¦b§ó·s¤F¡A©Ò¥H¤@¯ë»¡¨Ó¬O¤£»Ý­n³o¼Ëªº¡C ¦P®É¤]½Ð±z¬Ý¤@¤U 3.1-RELEASE ©M 3.2-RELEASE ªº°É»~ªí(ERRATA)¡C §Ú§ó·s¤F¨t²Î­ì©l½X¡A²{¦b§Ú­n«ç¼Ë¤É¯Å¬Y­Ó¤w¸g¦w¸Ë¤W ªº ports ? FreeBSD ¥»¨­¨Ã¨S¦³¦Û°Ê¤É¯Å ports ªº¤u¨ã¡A¦ý¦³¤@¨Ç¥i¥HÅý¤É¯Å ²¤Æ¤@¨Çªº¤pµ{¦¡¡C§A¤]¥i¥H¦Û¤v¸Ë¤WÃB¥~ªº¤u¨ã¨Ó³B²z¡C &man.pkg.version.1; «ü¥O¥i¥H¦Û°Ê²£¥Í¥Î¨Ó¹F¨ì¦Û°Ê¤É¯Å¨ì ports tree ³Ì·sª©¥»ªº script¡C &prompt.root; pkg_version > /tmp/myscript ¤@©w­n¦b¤â°Ê­×§ï¤@¤U²£¥Í¥X¨Óªº script¡C ¥Ø«eªº &man.pkg.version.1; ¦b script ³Ì«e­±¥[¤J &man.exit.1; ±j ­¢§A¥h­×§ï¥¦¡C §AÀ³±N°õ¦æ script ©Ò²£¥Íªº¿é¥X°O¿ý¤U¨Ó¡A¦]¬°¸Ì­±·|¦³°O¸ü¬Y¨Ç ©|¥¼¤É¯Å¦ý¤w¸g§ó·sªº ports¡C¤£¹L§A¤£¤@©w­n¥h¤É¯Å¥¦­Ì¡C³q±`¬O¦]¬° ¦³¬Y­Ó¦@¥Îªº¨ç¦¡®w¤w¸g§ïÅܪ©¥»¸¹¤F¡A¤~­n¥h­«½s¤@¦¸¨º¨Ç¨Ï¥Î¨ì¸Ó¨ç ¦¡®wªº ports¡C ¦pªG§AªºµwºÐªÅ¶¡«Ü°÷¡A¨º»ò¥i¥H¥Î portupgrade ³o­Ó¤u¨ã¨Ó°µ¥þ¦Û°Ê³B¸Ì¡Cportupgrade ¸Ì­±¤]¦³ ¤@¨Ç¤pµ{¦¡¨Ó²¤Æ package ¤É¯Å¡A¥¦¦b sysutils/portupgrade¡C ³o­Ó¤u¨ã¬O¥Î Ruby ³o­Ó»y¨¥¼gªº¡A©Ò¥H¨Ã¤£¾A¦X¥[¤J¨ì FreeBSD ªº­ì ©l½X¤¤¡A¤£¹L¨Ã¤£·|¦]¦¹Åý¬Y¨Ç¤H¤£¥Î¥¦¡C ¦pªG§Aªº¨t²Î¤@ª½³£³B©ó¶}¾÷ª¬ºA¡A¥i§Q¥Î &man.periodic.8; ¨t²Î¡A ¨C­Ó¬P´Á²£¥Í¤@±i»Ý­n¤É¯Åªº²M³æ¡C¥u­n¦b /etc/periodic.conf ¥[¤J weekly_status_pkg_enable="YES" ´N¥i¥H¤F¡C ¬°¤°»ò /bin/sh³o»òªº¤p¡H¬°¤°»ò FreeBSD ¤£§ï¥Î bash ©ÎªÌ¬O¨ä¥L¤ñ¸û±j®«ªº shell¡H ¦]¬° POSIX »¡¡A¸Ó­n¦³³o»ò¼Ëªº¤@­Ó shell ¦b¤~¦æ¡C ¤ñ¸ûÁcº¾ªºµª®×¡G³\¦h¤H»Ý­n¼g¥i¥H¸ó«Ü¦h¥­¥xªº shell script ¡C ³o¤]¬O¬°¦ó POSIX ±N shell ¥H¤Î¤u¨ã©RºÙ³£©w¸qªº«D±`¸Ô²Óªº½t¬G¡C ¤j³¡¥÷ªº script ³£¾A¥Î©ó Bourne shell¡A¤S¦]¬°¦³´X­Ó­«­nªº ¼gµ{¦¡©Ò¥Î¨ìªºµ{¦¡©ÎªÌ¨ç¦¡ (&man.make.1; , &man.system.3;, &man.popen.3;, ÁÙ¦³¦b Perl ©ÎªÌ Tcl ¸Ì­±©I¥s¨t²Îµ{¦¡ªº¦a¤è) ³£«ü©w¥Î Bourne shell ¡C¨º»ò¦]¬° Bourne Shell ¦p¦¹ªº¼sªx±`¥Î¡A ¨º»ò¥¦ªº°õ¦æ®Ä²v«K«Ü­«­n¡A§Ö³t¬O¥¦¨M©w©Êªº­nÂI¤§¤@¡AÁÙ­n¤£¦û¤Ó¦h °O¾ÐÅé¡C ¥Ø«eªº /bin/sh ¤w¬O§Ú­Ì¹Ã¤ßÃw¦å¤§§@¡A¥¦¤w ¸gºÉ¶q¦a²Å¦X¼Ð·Ç³W©w¡C¬°¤FÅý¥¦«D±`¤p¡A§Ú­Ì®³±¼¤F¤@¨Ç¨ä¥L shell ¦³ªº¤è«K¥\¯à¡C³o¤]¬O¬°¤°»ò ports ¸Ì­±ÁÙ¦³«Ü¦h±j®«ªº shell ¡A¹³¬O bash, scsh, tcsh ¥H¤Î zsh ¡C (§A¥i¥H¦Û¤v¤ñ¸û¤@¤U³o¨Ç shell °õ¦æ ®É©Ò¦ûªº°O¾ÐÅé¤j¤p¡A¥h¬Ý¬Ý ps -u ¦C¥X¨Óªº VSZ ©M RSS ³o¨â­ÓÄæ¦ì´Nª¾¹D¤F¡C) ¬°¤°»ò Netscape ©M Opera ­nªá¦n¤[ªº®É¶¡¤~¯à±Ò°Ê¡H ³q±`¬O¦]¬°§Aªº DNS ¨S¦³³]©w¦n¡C Netscape ¸ò Opera ¦b±Ò°Êªº®É­Ô ³£·|¥hÀˬd¤@¤U DNS¡Cª½¨ì DNS ¦³¦^À³¡A©ÎªÌ¬OÂ_©wºô¸ô¥Ø«e¬OÂ_½u¤§«á¡A ¥¦­Ì¤~·|Åã¥Üµe­±¥X¨Ó¡C
Kang-min Liu
gugod@gugod.org
®Ö¤ß³]©w §Ú·Q¦Û­q®Ö¤ßµ{¦¡¡A³o·|«Ü§xÃø¶Ü¡H ¤£·|¡I½Ð¬d¾\ ¨Ï¥Î¤â¥U¤¤ªº®Ö¤ß³]©w¤@¸`¡C §Ú·|«ØÄ³§A¦b§AÅý®Ö¤ß¯à¥¿±`¤u§@«á¡A°µ¤@­Ó kernel.YYMMDD ¤é´Á§Î¦¡ªº³Æ¥÷¡A¦P®É¤]³Æ¥÷ /module³o­Ó¥Ø¿ý¦Ü /modules.YYMMDD¡C³o¼Ë¤U¦¸¦pªG§A«Ü¤£©¯ªºª± Ãa¤F³]©w¡A¦Ü¤Ö¥i¥H¤£»Ý­n¨Ï¥Î³Ì­ì©lªº kernel.GENERIC¡C¦p§A¥¿±q¤@­Ó GENERIC kernel ¸Ì­±¤£¤ä´©ªº±±¨î¾¹¸Ì±Ò°Ê®É¡A³o´NÅã±o¯S§O­«­n¡C §Úªº®Ö¤ß¦]¬° _hw_float¿ò¥¢¦Ó½sĶ¥¢±Ñ¡C ¸Ó«ç»ò­×¥¿©O¡H Åý§Ú²q¬Ý¬Ý¡A§A§â npx0 (¸Ô¨£ &man.npx.4;) ±q§Aªº®Ö¤ß³]©wÀɲ¾°£¤F¡A¦]¬°§A¨S¦³¼Æ¾Ç¹Bºâ¾¹¡A ¹ï¶Ü¡H¿ù¤F¡I:-) ³o­Ó npx0¬O ¥²¶·­n¦³ªº¡C´Nºâ§A¨S¦³¼Æ¾Ç¹Bºâ¾¹¡A§AÁÙ¬O ¥²¶· ¤Þ¤J npx0 ¸Ë¸m¡C ¬°¤°»ò³y¥X¨Óªº kernel ³o»ò¤j (10MB ¥H¤W) ¡H ³o«Ü¦³¥i¯à¬O¦]¬°¡A§A§â kernel ½s¦¨ °»¿ù¼Ò¦¡ ¤F¡C°»¿ù¼Ò¦¡¤§¤Uªº kernel ¸Ì­±·|¦sµÛ°»¿ù¥Îªº³\¦h²Å¸¹¡A¦]¦¹·|¤j´T ¼W¥[ kernel ªº¤j¤p¡C¦pªG»¡§Aªº FreeBSD ¬O 3.0 ¥H«áªºª©¥»¡A³o¹ï©ó ®Ä¯à¨Ó»¡¼vÅT¨Ã¤£¤j¡A´X¥G¬O¨S¦³¡C¦Ó¦b¨t²Î·|¦]¬Y¨Ç­ì¦] panic ®É¡A ¦³­Ó°»¿ù¼Ò¦¡ªº kernel ¦b¤]®¼¦³¥Îªº¡C ¤£¹L©O¡A¦pªG§AªººÏºÐªÅ¶¡«Ü¤p¡A©ÎªÌ§A´N¬O¤£·Q¥Î°»¿ù¼Ò¦¡ªº kernel ªº¸Ü¡A½Ð½T»{¥H¤U¨Æ±¡¡G kernel ³]©wÀɸ̭±¨S¦³³o¤@¦æ¡G makeoptions DEBUGS=-g °õ¦æ &man.config.8; ®É¨S¦³¥[¤W ³o­Ó¿ï¶µ¡C ¥H¤W¨â¥ó¨Æ±¡³£·|Åý§A½s¥X¤@­Ó°»¿ù¼Ò¦¡ªº kernel¡C¦ý¥u­nÁ×§K¤§¡A ´N¥i¥H½s¥X¤@­Ó¥¿±`ªº kernel¡A¦Ó§A¤]·|ª`·N¨ì¡Akernel ©úÅ㪺Åܤp¤F¡F ¤j³¡¥÷ªº kernel ³£®t¤£¦h¦b 1.5MB ¨ì 2MB ¤§¶¡¡C ¬°¦ó¥X²{¤F multi-port serial code ªº¤¤Â_½Ä¬ð¡H ·í§Ú½sͤ@­Ó multi-port serial code ªº®Ö¤ß®É¡A¥¦§i¶D§Ú¥u¦³ ²Ä¤@­Ó³Q°»´ú¨ì¡A¨ä¥Lªº«h¦]¤¤Â_½Ä¬ð¦Ó¸õ¹L¤F¡A§Ú¸Ó«ç»ò­×¥¿¥¦¡H ³o­Ó°ÝÃD¬O¦]¬° FreeBSD ¨Ï¥Î¤º«Øµ{¦¡½XÁ×§K¦]¬°µwÅé©Î³nÅé½Ä¬ð ¾É­P®Ö¤ßµ{¦¡¹L©óªÎ¤j©ÎµL¥Î¡C­n­×¥¿³oºØ±¡§Îªº¤èªk¬O°£¤F¤@­Ó port ¥~§â¨ä¥L©Ò¦³ªº IRQ ³]©w³£°µ«O¯d¡C³o¸Ì¦³¤@­Ó½d¨Ò¡G # # Multiport high-speed serial line - 16550 UARTS # device sio2 at isa? port 0x2a0 tty irq 5 flags 0x501 vector siointr device sio3 at isa? port 0x2a8 tty flags 0x501 vector siointr device sio4 at isa? port 0x2b0 tty flags 0x501 vector siointr device sio5 at isa? port 0x2b8 tty flags 0x501 vector siointr ¬°¤°»ò§Ú¤@­Ó kernel ³£½s¤£°_¨Ó¡H¬Æ¦Ü GENERIC ¤]¤£¦æ¡H ³o¦³«Ü¦hºØ¥i¯àªº­ì¦]¡G §A¨S¦³¥Î·sªº make buildkernel »P make installkernel ³o¨â­Ó¤èªk¨Ó½s¡A¦Ó¥¿¦n §Aªº¨t²Î­ì©l½Xªºª©¥»©M¥¿¦b°õ¦æªº¨t²Î®Ö¤ßª©¥»¤£¤@¼Ë (¹³¬O¡A ¦b¶] 4.0-RELEASE ªº¨t²Î¤W¹Á¸ÕµÛ½s 4.3-RELEASE)¡C¦pªG»¡§A­n¤É ¯Å¨t²Îªº¸Ü¡A½Ð°È¥²¥h¬Ý¬Ý /usr/src/UPDATING ³o­ÓÀɮסA¯S§Oª`·N³Ì«á­±ªº COMMON ITEMS ³o­Ó¤p¸`¡C §A¤w¸g¥Î¤W make buildkernel ¥H¤Î make installkernel ¤F¡A¦ý¬O¦b make buildworld ®É¥¢±Ñ¤F¡C¥i±¤ªº¬O¡A make buildkernel ­n¦¨¥\¡A»Ý­n¨Ì¿à make buildworld «á³y¥X¨Óªº¤@¨ÇÀɮסC ´Nºâ¬O§A¦b½s FreeBSD-STABLE¡A ÁÙ¬O¦³¥i¯à§A§ì¨ì¤F¥¿¦b­×§ï¤¤¡A©ÎµÛ¦]¬°¬Y¨Ç½t¬G¦Ó®Ú¥»ÁÙ¨S§ï¦n ªº­ì©l½X¡FÁöµM»¡ FreeBSD-STABLE ¤j³¡¥÷ªº®É­Ô³£¬O¥i¥H½sªº¡A¦ý¥u¦³ RELEASE ¤~¬O«OÃÒ¥i¥H½sªº¡C¸I ¨ì³o­Ó°ÝÃD®É¡A¦A¦¸§ó·s­ì©l½X¨Ã¥B¦A¸Õ¸Õ¬Ý¡C¤]¦³¥i¯à¬O©ñ­ì©l½Xªº ¦øªA¾¹¥X²{¬Y¨Ç°ÝÃD¡A©Ò¥H§ó·s­ì©l½X®É¤]¸Õ¸Õ±q¤£¦P¦øªA¾¹¨Ó§ó·s¬Ý ¬Ý¡C
Disks, Filesystems, and Boot Loaders How can I add my new hard disk to my FreeBSD system? See the Disk Formatting Tutorial at www.FreeBSD.org. How do I move my system over to my huge new disk? The best way is to reinstall the OS on the new disk, then move the user data over. This is highly recommended if you have been tracking -stable for more than one release, or have updated a release instead of installing a new one. You can install booteasy on both disks with &man.boot0cfg.8;, and dual boot them until you are happy with the new configuration. Skip the next paragraph to find out how to move the data after doing this. Should you decide not to do a fresh install, you need to partition and label the new disk with either /stand/sysinstall, or &man.fdisk.8; and &man.disklabel.8;. You should also install booteasy on both disks with &man.boot0cfg.8;, so that you can dual boot to the old or new system after the copying is done. See the formatting-media article for details on this process. Now you have the new disk set up, and are ready to move the data. Unfortunately, you cannot just blindly copy the data. Things like device files (in /dev), flags, and links tend to screw that up. You need to use tools that understand these things, which means &man.dump.8;. Although it is suggested that you move the data in single user mode, it is not required. You should never use anything but &man.dump.8; and &man.restore.8; to move the root file system. The &man.tar.1; command may work - then again, it may not. You should also use &man.dump.8; and &man.restore.8; if you are moving a single partition to another empty partition. The sequence of steps to use dump to move a partitions data to a new partition is: newfs the new partition. mount it on a temporary mount point. cd to that directory. dump the old partition, piping output to the new one. For example, if you are going to move root to /dev/ad1s1a, with /mnt as the temporary mount point, it is: &prompt.root; newfs /dev/ad1s1a &prompt.root; mount /dev/ad1s1a /mnt &prompt.root; cd /mnt &prompt.root; dump 0af - / | restore xf - Rearranging your partitions with dump takes a bit more work. To merge a partition like /var into its parent, create the new partition large enough for both, move the parent partition as described above, then move the child partition into the empty directory that the first move created: &prompt.root; newfs /dev/ad1s1a &prompt.root; mount /dev/ad1s1a /mnt &prompt.root; cd /mnt &prompt.root; dump 0af - / | restore xf - &prompt.root; cd var &prompt.root; dump 0af - /var | restore xf - To split a directory from its parent, say putting /var on its own partition when it was not before, create both partitions, then mount the child partition on the appropriate directory in the temporary mount point, then move the old single partition: &prompt.root; newfs /dev/ad1s1a &prompt.root; newfs /dev/ad1s1d &prompt.root; mount /dev/ad1s1a /mnt &prompt.root; mkdir /mnt/var &prompt.root; mount /dev/ad1s1d /mnt/var &prompt.root; cd /mnt &prompt.root; dump 0af - / | restore xf - You might prefer &man.cpio.1;, &man.pax.1;, &man.tar.1; to &man.dump.8; for user data. At the time of this writing, these are known to lose file flag information, so use them with caution. Will a dangerously dedicated disk endanger my health? The installation procedure allows you to chose two different methods in partitioning your hard disk(s). The default way makes it compatible with other operating systems on the same machine, by using fdisk table entries (called slices in FreeBSD), with a FreeBSD slice that employs partitions of its own. Optionally, one can chose to install a boot-selector to switch between the possible operating systems on the disk(s). The alternative uses the entire disk for FreeBSD, and makes no attempt to be compatible with other operating systems. So why it is called dangerous? A disk in this mode does not contain what normal PC utilities would consider a valid fdisk table. Depending on how well they have been designed, they might complain at you once they are getting in contact with such a disk, or even worse, they might damage the BSD bootstrap without even asking or notifying you. In addition, the dangerously dedicated disk's layout is known to confuse many BIOSes, including those from AWARD (e.g. as found in HP Netserver and Micronics systems as well as many others) and Symbios/NCR (for the popular 53C8xx range of SCSI controllers). This is not a complete list, there are more. Symptoms of this confusion include the read error message printed by the FreeBSD bootstrap when it cannot find itself, as well as system lockups when booting. Why have this mode at all then? It only saves a few kbytes of disk space, and it can cause real problems for a new installation. Dangerously dedicated mode's origins lie in a desire to avoid one of the most common problems plaguing new FreeBSD installers - matching the BIOS geometry numbers for a disk to the disk itself. Geometry is an outdated concept, but one still at the heart of the PC's BIOS and its interaction with disks. When the FreeBSD installer creates slices, it has to record the location of these slices on the disk in a fashion that corresponds with the way the BIOS expects to find them. If it gets it wrong, you will not be able to boot. Dangerously dedicated mode tries to work around this by making the problem simpler. In some cases, it gets it right. But it is meant to be used as a last-ditch alternative - there are better ways to solve the problem 99 times out of 100. So, how do you avoid the need for DD mode when you are installing? Start by making a note of the geometry that your BIOS claims to be using for your disks. You can arrange to have the kernel print this as it boots by specifying at the boot: prompt, or using boot -v in the loader. Just before the installer starts, the kernel will print a list of BIOS geometries. Do not panic - wait for the installer to start and then use scrollback to read the numbers. Typically the BIOS disk units will be in the same order that FreeBSD lists your disks, first IDE, then SCSI. When you are slicing up your disk, check that the disk geometry displayed in the FDISK screen is correct (ie. it matches the BIOS numbers); if it is wrong, use the g key to fix it. You may have to do this if there is absolutely nothing on the disk, or if the disk has been moved from another system. Note that this is only an issue with the disk that you are going to boot from; FreeBSD will sort itself out just fine with any other disks you may have. Once you have got the BIOS and FreeBSD agreeing about the geometry of the disk, your problems are almost guaranteed to be over, and with no need for DD mode at all. If, however, you are still greeted with the dreaded read error message when you try to boot, it is time to cross your fingers and go for it - there is nothing left to lose. To return a dangerously dedicated disk for normal PC use, there are basically two options. The first is, you write enough NULL bytes over the MBR to make any subsequent installation believe this to be a blank disk. You can do this for example with &prompt.root; dd if=/dev/zero of=/dev/rda0 count=15 Alternatively, the undocumented DOS feature C:\> fdisk /mbr will to install a new master boot record as well, thus clobbering the BSD bootstrap. Which partitions can safely use softupdates? I have heard that softupdates on / can cause problems. Short answer: you can usually use softupdates safely on all partitions. Long answer: There used to be some concern over using softupdates on the root partition. Softupdates has two characteristics that caused this. First, a softupdates partition has a small chance of losing data during a system crash. (The partition will not be corrupted; the data will simply be lost.) Also, softupdates can cause temporary space shortages. When using softupdates, the kernel can take up to thirty seconds to actually write changes to the physical disk. If you delete a large file, the file still resides on disk until the kernel actually performs the deletion. This can cause a very simple race condition. Suppose you delete one large file and immediately create another large file. The first large file is not yet actually removed from the physical disk, so the disk might not have enough room for the second large file. You get an error that the partition does not have enough space, although you know perfectly well that you just released a large chunk of space! When you try again mere seconds later, the file creation works as you expect. This has left more than one user scratching his head and doubting his sanity, the FreeBSD filesystem, or both. If a system should crash after the kernel accepts a chunk of data for writing to disk, but before that data is actually written out, data could be lost or corrupted. This risk is extremely small, but generally manageable. Use of IDE write caching greatly increases this risk; it is strongly recommended that you disable IDE write caching when using softupdates. These issues affect all partitions using softupdates. So, what does this mean for the root partition? Vital information on the root partition changes very rarely. Files such as /kernel and the contents of /etc only change during system maintenance, or when users change their passwords. If the system crashed during the thirty-second window after such a change is made, it is possible that data could be lost. This risk is negligible for most applications, but you should be aware that it exists. If your system cannot tolerate this much risk, do not use softupdates on the root filesystem! / is traditionally one of the smallest partitions. By default, FreeBSD puts the /tmp directory on /. If you have a busy /tmp, you might see intermittent space problems. Symlinking /tmp to /var/tmp will solve this problem. What is inappropriate about my ccd? The symptom of this is: &prompt.root; ccdconfig -C ccdconfig: ioctl (CCDIOCSET): /dev/ccd0c: Inappropriate file type or format This usually happens when you are trying to concatenate the c partitions, which default to type unused. The ccd driver requires the underlying partition type to be FS_BSDFFS. Edit the disklabel of the disks you are trying to concatenate and change the types of partitions to 4.2BSD. Why can I not edit the disklabel on my ccd? The symptom of this is: &prompt.root; disklabel ccd0 (it prints something sensible here, so let us try to edit it) &prompt.root; disklabel -e ccd0 (edit, save, quit) disklabel: ioctl DIOCWDINFO: No disk label on disk; use "disklabel -r" to install initial label This is because the disklabel returned by ccd is actually a fake one that is not really on the disk. You can solve this problem by writing it back explicitly, as in: &prompt.root; disklabel ccd0 > /tmp/disklabel.tmp &prompt.root; disklabel -Rr ccd0 /tmp/disklabel.tmp &prompt.root; disklabel -e ccd0 (this will work now) Can I mount other foreign filesystems under FreeBSD? Digital UNIX UFS CDROMs can be mounted directly on FreeBSD. Mounting disk partitions from Digital UNIX and other systems that support UFS may be more complex, depending on the details of the disk partitioning for the operating system in question. Linux As of 2.2, FreeBSD supports ext2fs partitions. See &man.mount.ext2fs.8; for more information. NT A read-only NTFS driver exists for FreeBSD. For more information, see this tutorial by Mark Ovens at http://ukug.uk.FreeBSD.org/~mark/ntfs_install.html. Any other information on this subject would be appreciated. How do I mount a secondary DOS partition? The secondary DOS partitions are found after ALL the primary partitions. For example, if you have an E partition as the second DOS partition on the second SCSI drive, you need to create the special files for slice 5 in /dev, then mount /dev/da1s5: &prompt.root; cd /dev &prompt.root; sh MAKEDEV da1s5 &prompt.root; mount -t msdos /dev/da1s5 /dos/e Is there a cryptographic filesystem for &os;? Yes; see the security/cfs port. How can I use the NT loader to boot FreeBSD? This procedure is slightly different for 2.2.x and 3.x (with the 3-stage boot) systems. The general idea is that you copy the first sector of your native root FreeBSD partition into a file in the DOS/NT partition. Assuming you name that file something like c:\bootsect.bsd (inspired by c:\bootsect.dos), you can then edit the c:\boot.ini file to come up with something like this: [boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows NT" C:\BOOTSECT.BSD="FreeBSD" C:\="DOS" For 2.2.x systems this procedure assumes that DOS, NT, FreeBSD, or whatever have been installed into their respective fdisk partitions on the same disk. This example was tested on a system where DOS & NT were on the first fdisk partition, and FreeBSD on the second. FreeBSD was also set up to boot from its native partition, not the disk's MBR. Mount a DOS-formatted floppy (if you have converted to NTFS) or the FAT partition, under, say, /mnt. &prompt.root; dd if=/dev/rda0a of=/mnt/bootsect.bsd bs=512 count=1 Reboot into DOS or NT. NTFS users copy the bootsect.bsd and/or the bootsect.lnx file from the floppy to C:\. Modify the attributes (permissions) on boot.ini with: C:\> attrib -s -r c:\boot.ini Edit to add the appropriate entries from the example boot.ini above, and restore the attributes: C:\> attrib +s +r c:\boot.ini If FreeBSD is booting from the MBR, restore it with the DOS fdisk command after you reconfigure them to boot from their native partitions. For FreeBSD 3.x systems the procedure is somewhat simpler. If FreeBSD is installed on the same disk as the NT boot partition simply copy /boot/boot1 to C:\BOOTSECT.BSD However, if FreeBSD is installed on a different disk /boot/boot1 will not work, /boot/boot0 is needed. DO NOT SIMPLY COPY /boot/boot0 INSTEAD OF /boot/boot1, YOU WILL OVERWRITE YOUR PARTITION TABLE AND RENDER YOUR COMPUTER UN-BOOTABLE! /boot/boot0 needs to be installed using sysinstall by selecting the FreeBSD boot manager on the screen which asks if you wish to use a boot manager. This is because /boot/boot0 has the partition table area filled with NULL characters but sysinstall copies the partition table before copying /boot/boot0 to the MBR. When the FreeBSD boot manager runs it records the last OS booted by setting the active flag on the partition table entry for that OS and then writes the whole 512-bytes of itself back to the MBR so if you just copy /boot/boot0 to C:\BOOTSECT.BSD then it writes an empty partition table, with the active flag set on one entry, to the MBR. How do I boot FreeBSD and Linux from LILO? If you have FreeBSD and Linux on the same disk, just follow LILO's installation instructions for booting a non-Linux operating system. Very briefly, these are: Boot Linux, and add the following lines to /etc/lilo.conf: other=/dev/hda2 table=/dev/hda label=FreeBSD (the above assumes that your FreeBSD slice is known to Linux as /dev/hda2; tailor to suit your setup). Then, run lilo as root and you should be done. If FreeBSD resides on another disk, you need to add loader=/boot/chain.b to the LILO entry. For example: other=/dev/dab4 table=/dev/dab loader=/boot/chain.b label=FreeBSD In some cases you may need to specify the BIOS drive number to the FreeBSD boot loader to successfully boot off the second disk. For example, if your FreeBSD SCSI disk is probed by BIOS as BIOS disk 1, at the FreeBSD boot loader prompt you need to specify: Boot: 1:da(0,a)/kernel On FreeBSD 2.2.5 and later, you can configure &man.boot.8; to automatically do this for you at boot time. The Linux+FreeBSD mini-HOWTO is a good reference for FreeBSD and Linux interoperability issues. How do I boot FreeBSD and Linux using BootEasy? Install LILO at the start of your Linux boot partition instead of in the Master Boot Record. You can then boot LILO from BootEasy. If you are running Windows-95 and Linux this is recommended anyway, to make it simpler to get Linux booting again if you should need to reinstall Windows95 (which is a Jealous Operating System, and will bear no other Operating Systems in the Master Boot Record). How do I change the boot prompt from ??? to something more meaningful? You can not do that with the standard boot manager without rewriting it. There are a number of other boot managers in the sysutils ports category that provide this functionality. I have a new removable drive, how do I use it? Whether it is a removable drive like a ZIP or an EZ drive (or even a floppy, if you want to use it that way), or a new hard disk, once it is installed and recognized by the system, and you have your cartridge/floppy/whatever slotted in, things are pretty much the same for all devices. (this section is based on Mark Mayo's ZIP FAQ) If it is a ZIP drive or a floppy, you have already got a DOS filesystem on it, you can use a command like this: &prompt.root; mount -t msdos /dev/fd0c /floppy if it is a floppy, or this: &prompt.root; mount -t msdos /dev/da2s4 /zip for a ZIP disk with the factory configuration. For other disks, see how they are laid out using &man.fdisk.8; or &man.sysinstall.8;. The rest of the examples will be for a ZIP drive on da2, the third SCSI disk. Unless it is a floppy, or a removable you plan on sharing with other people, it is probably a better idea to stick a BSD file system on it. You will get long filename support, at least a 2X improvement in performance, and a lot more stability. First, you need to redo the DOS-level partitions/filesystems. You can either use &man.fdisk.8; or /stand/sysinstall, or for a small drive that you do not want to bother with multiple operating system support on, just blow away the whole FAT partition table (slices) and just use the BSD partitioning: &prompt.root; dd if=/dev/zero of=/dev/rda2 count=2 &prompt.root; disklabel -Brw da2 auto You can use disklabel or /stand/sysinstall to create multiple BSD partitions. You will certainly want to do this if you are adding swap space on a fixed disk, but it is probably irrelevant on a removable drive like a ZIP. Finally, create a new file system, this one is on our ZIP drive using the whole disk: &prompt.root; newfs /dev/rda2c and mount it: &prompt.root; mount /dev/da2c /zip and it is probably a good idea to add a line like this to /etc/fstab (see &man.fstab.5;) so you can just type mount /zip in the future: /dev/da2c /zip ffs rw,noauto 0 0 Why do I get Incorrect super block when mounting a CDROM? You have to tell &man.mount.8; the type of the device that you want to mount. This is described in the Handbook section on optical media, specifically the section Using Data CDs. Why do I get Device not configured when mounting a CDROM? This generally means that there is no CDROM in the CDROM drive, or the drive is not visible on the bus. Please see the Using Data CDs section of the Handbook for a detailed discussion of this issue. Why do all non-English characters in filenames show up as ? on my CDs when mounted in FreeBSD? Your CDROM probably uses the Joliet extension for storing information about files and directories. This is discussed in the Handbook chapter on creating and using CDROMs, specifically the section on Using Data CDROMs. I burned a CD under FreeBSD and now I can not read it under any other operating system. Why? You most likely burned a raw file to your CD, rather than creating an ISO 9660 filesystem. Take a look at the Handbook chapter on creating CDROMs, particularly the section on burning raw data CDs. How can I create an image of a data CD? This is discussed in the Handbook section on duplicating data CDs. For more on working with CDROMs, see the Creating CDs Section in the Storage chapter in the Handbook. Why can I not mount an audio CD? If you try to mount an audio CD, you will get an error like cd9660: /dev/acd0c: Invalid argument. This is because mount only works on filesystems. Audio CDs do not have filesystems; they just have data. You need a program that reads audio CDs, such as the audio/xmcd port. How do I mount a multi-session CD? By default, &man.mount.8; will attempt to mount the last data track (session) of a CD. If you would like to load an earlier session, you must use the command line argument. Please see &man.mount.cd9660.8; for specific examples. How do I let ordinary users mount floppies, CDROMs and other removable media? Ordinary users can be permitted to mount devices. Here is how: As root set the sysctl variable vfs.usermount to 1. &prompt.root; sysctl -w vfs.usermount=1 As root assign the appropriate permissions to the block device associated with the removable media. For example, to allow users to mount the first floppy drive, use: &prompt.root; chmod 666 /dev/fd0 To allow users in the group operator to mount the CDROM drive, use: &prompt.root; chgrp operator /dev/cd0c &prompt.root; chmod 640 /dev/cd0c Finally, add the line vfs.usermount=1 to the file /etc/sysctl.conf so that it is reset at system boot time. All users can now mount the floppy /dev/fd0 onto a directory that they own: &prompt.user; mkdir ~/my-mount-point &prompt.user; mount -t msdos /dev/fd0 ~/my-mount-point Users in group operator can now mount the CDROM /dev/cd0c onto a directory that they own: &prompt.user; mkdir ~/my-mount-point &prompt.user; mount -t msdos /dev/cd0c ~/my-mount-point Unmounting the device is simple: &prompt.user; umount ~/my-mount-point Enabling vfs.usermount, however, has negative security implications. A better way to access MSDOS formatted media is to use the mtools package in the ports collection. The du and df commands show different amounts of disk space available. What is going on? You need to understand what du and df really do. du goes through the directory tree, measures how large each file is, and presents the totals. df just asks the filesystem how much space it has left. They seem to be the same thing, but a file without a directory entry will affect df but not du. When a program is using a file, and you delete the file, the file is not really removed from the filesystem until the program stops using it. The file is immediately deleted from the directory listing, however. You can see this easily enough with a program such as more. Assume you have a file large enough that its presence affects the output of du and df. (Since disks can be so large today, this might be a very large file!) If you delete this file while using more on it, more does not immediately choke and complain that it cannot view the file. The entry is simply removed from the directory so no other program or user can access it. du shows that it is gone — it has walked the directory tree and the file is not listed. df shows that it is still there, as the filesystem knows that more is still using that space. Once you end the more session, du and df will agree. Note that softupdates can delay the freeing of disk space; you might need to wait up to 30 seconds for the change to be visible! This situation is common on web servers. Many people set up a FreeBSD web server and forget to rotate the log files. The access log fills up /var. The new administrator deletes the file, but the system still complains that the partition is full. Stopping and restarting the web server program would free the file, allowing the system to release the disk space. To prevent this from happening, set up &man.newsyslog.8;. How can I add more swap space? In the Configuration and Tuning section of the Handbook, you will find a section describing how to do this. Wei-Hon Chen
plasmaball@pchome.com.tw
¨t²ÎºÞ²z ¨t²Î°_©l³]©wÀɦb­þ¡H ±q 2.0.5R ¨ì 2.2.1R¡A¥D­nªº³]©wÀɬO /etc/sysconfig¡C©Ò¦³ªº¿ï¶µ³£³Q«ü©w¦b³o­ÓÀÉ¡A ¦Ó¨ä¥L¹³ /etc/rc (°Ñ¨£ &man.rc.8;) ©M /etc/netstart ¥u¬O¤Þ¥Î¥¦¡C Æ[¹î /etc/sysconfig ³o­ÓÀɨíץ¿¨ä­È¥H ¾A¦X§Aªº¨t²Î¡C³o­ÓÀɥεù¸Ñ¶ñº¡¥Hªí¥Ü¦ó³B¸Ó©ñ¸m¤°»ò³]©w¡C ¦b post-2.2.1 ¥H«á¤Î 3.0¡A/etc/sysconfig ¥ç§ó¦W¬°¤@­Ó§ó®e©ö´y­zªºÀɦW¥s &man.rc.conf.5; ¡A¨Ã¥B»yªk²¤Æ¤F¨Ç¡C /etc/netstart ¥ç§ó¦W¬° /etc/rc.network ¦]¦¹©Ò¦³ªºÀɮ׳£¥i¥H¥Î cp /usr/src/etc/rc* /etc ¨Ó«þ¨©¡C ¦b 3.1 ¥H¤Î¡A/etc/rc.conf ³Q²¾¨ì /etc/defaults/rc.conf¡C ¤d¸U¤£­n½s¿è³o­ÓÀÉ¡I ¦pªG /etc/defaults/rc.conf ¤º¦³·Q­n§ó°Êªº¶µ¥Ø¡A §AÀ³¸Ó±N¨º¤@¦æªº¤º®e«þ¨©¨ì /etc/rc.conf¡A µM«á¦A­×§ï¥¦¡C ¨Ò¦p FreeBSD 3.1 ¤Î¥H«áªºª©¥»¤º¡A¦³¤@­Ó DNS ¦øªA¾¹ named¡A ¦Ó§A·Q­n±Ò°Ê¥¦¡C§A©Ò»Ý­n§@ªº¨Æ´N¬O¡G &prompt.root; echo named_enable="YES" >> /etc/rc.conf ·Q­n¦b FreeBSD 3.1 ¤Î¥H«áªºª©¥»¤¤¡A±Ò°Ê¥»¦aºÝªA°Èªº¸Ü¡A±N shell script ¸m©ó /usr/local/etc/rc.d ¥Ø¿ý ¤U¡C³o¨Ç shell script À³¸Ó³]©w¦¨¥i°õ¦æ¡A¨Ã¥BÀɦW¥H .sh µ²§ô¡C ¦b FreeBSD 3.0 ¤Î§ó¦­ªºª©¥»¤¤¡A§AÀ³¸Óª½±µ½s¿è /etc/rc.local ÀÉ¡C /etc/rc.serial¥Î¨Óªì©l¤Æ§Ç¦C°ð ¡]¹³¬OÂê©w°ðªº¯S©Êµ¥¡^¡C /etc/rc.i386 ¬O Intel ±M¥Î³]©w¡A ¹³¬O iBCS2 ¼ÒÀÀ©Î¬O PC ¨t²Î¥D±±¥x³]©w¡C §Ú¸Ó¦p¦ó²³æ¦a¥[¤J¨Ï¥ÎªÌ¡H ¨Ï¥Î &man.adduser.8; «ü¥O¡C¦pªG»Ý­n§ó½ÆÂøªº¨Ï¥Î¤è¦¡¡A ½Ð¥Î &man.pw.8; ³o­Ó«ü¥O¡C ­n¦A¦¸²¾°£¨Ï¥ÎªÌ¡A¨Ï¥Î &man.rmuser.8; «ü¥O¡CÁÙ¦³¡A &man.pw.8; ¤]¥i¥H¨Ï¥Î¡C ¦b§Ú½s¿è crontab Àɮפ§«á¡A¬°¤°»ò§Ú¦Ñ¬O¦¬¨ì³o¼Ëªº°T®§¡G root: not found¡H ³q±`³£¬O¦]¬°½s¿è¤F¨t²Îªº crontab (/etc/crontab) µM«á´N¥Î &man.crontab.1; ¥h¦w¸Ë¥¦¡G &prompt.root; crontab /etc/crontab ³o¼Ë§@¬O¤£¹ïªº¡C¨t²Îªº crontab ©M &man.crontab.1; ©Ò§ó·sªº¨Ï¥ÎªÌªº crontab ®æ¦¡¨Ã¤£¤@¼Ë (&man.crontab.5; »¡©ú¤å¥ó°w¹ï®t²§³B¦³¸Ô²Óªº»¡©ú)¡C ¦pªG§A¤w¸g¥Î³oºØ¤èªk¡AÃB¥~¦h¥Xªº crontab ¥u´N¬O /etc/crontab ªº«þ¨©¡A¥u¬O®æ¦¡¬O¿ù»~ªº¡C ¥i¥Î¥H¤Uªº©R¥O§R°£¡G &prompt.root; crontab -r ¤U¦¸§A½s¿è /etc/crontab Àɮתº®É­Ô¡A §A¤£¥Î§@¥ô¦ó°Ê§@¥h³qª¾ &man.cron.8; ¡A¥¦¦Û°Ê·|¥h°»´ú¬O§_¦³§ó°Ê¡C ¦pªG§A·Q­n¨C¤Ñ¡B¨C¶g¡B©Î¬O¨C¤ë©T©w°õ¦æ¬Y¨Ç°Ê§@¤@¦¸¡A¤]³\¥[­Ó shell script ¦b /usr/local/etc/periodic ¥Ø¿ý¤U·|§ó¦n¡A¨t²Îªº cron ·|©T©w°õ¦æ &man.periodic.8; ©R¥O¡A ¥¦¥i±N§Aªºµ{¦¡©M¨ä¥¦ªº¨t²Î¶g´Á©Ê¤u§@¤@°_°õ¦æ¡C ³o­Ó¿ù»~ªº¯u¥¿­ì¦]¡A¬O¦]¬°¨t²Îªº crontab ¦³¤@­ÓÃB¥~ªºÄæ¦ì¡A »¡©ú¸Ó©R¥O­n¥H¤°»ò¨Ï¥ÎªÌ¨­¥÷°õ¦æ¡C¦b FreeBSD ªº¹w³]¨t²Î crontab ¤¤¡A©Ò¦³ªº¶µ¥Ø³£¬O root¡C ·í³o­Ó crontab ³Q·í§@¬O root ªº¨Ï¥ÎªÌ crontab (¥¦©M¨t²Îªº crontab ¬O ¤£ ¤@¼Ëªº)¡A&man.cron.8; ·|¥H¬° root ¦r¦ê¬O±ý°õ¦æªº©R¥Oªº²Ä¤@­Ó¦r¡A¦ý¬O¹ê»Ú¤W ¨Ã¨S¦³³o¼Ëªº©R¥O¦s¦b¡C ¬°¤°»ò§Ú·Q­n¥Î su ¦¨¬° root ®É¡A·|±o¨ì you are not in the correct group to su root ªº¿ù»~°T®§¡H ³o¬O¤@­Ó¦w¥þ¯S©Ê¡C·Q­n§Q¥Î su ¦¨¬° root (©Î¨ä¥¦¦³ superuser Åv­­ªº±b¸¹)¡A§A¤@©w­n¦b wheel ¸s²Õ¤º¡C¦pªG¨S¦³³o­Ó¯S©Êªº¸Ü¡A ¥ô¦ó¤H¥u­n¦b¨t²Î¸Ì¦³±b¸¹¡A¨Ã¥B«ê¥©ª¾¹D root ªº±K½X¡A´N¥i¥H¨ú±o superuser µ¥¯ÅªºÅv­­¥H¦s¨ú¨t²Î¡C¦³¤F³o­Ó¯S©Ê¡A ³o¼Ëªº±¡ªp´N¤£·|µo¥Í¡F¦pªG¨Ï¥ÎªÌ¤£¦b wheel ¸s²Õ¤ºªº¸Ü¡A&man.su.1; ·|Åý¥L­Ì³s¸ÕµÛÁä¤J±K½Xªº¾÷·|³£¨S¦³¡C ­nÅý¬Y¤H¥i¥H§Q¥Î su ¦¨¬° root ªº¸Ü¡A ¥u­n§â¥L­Ì©ñ¤J wheel ¸s²Õ¤º§Y¥i¡C §Ú¦b rc.conf ÁÙ¬O¬Y­Ó°_°ÊÀɮ׸̥ǤF¿ù»~¡A ¦]¬°Àɮרt²ÎÅܦ¨°ßŪªº¡A§ÚµLªk¥h½s¿è¥¦¡C§Ú¸Ó«ç»ò¿ì¡H ·í¹q¸£°Ý§A shell §¹¾ã¸ô®|¦W®É¡A¥u­n«ö ENTER ¡AµM«á°õ¦æ mount / ¥HŪ¼g¼Ò¦¡ ­«·s±¾¸ü®ÚÀɮרt²Î¡C§A¤]³\»Ý­n°õ¦æ mount -a -t ufs ¡A±N§AºD¥Îªº¤å¦r½s¿è¾¹©Ò¦bªºÀɮרt²Î±¾¸ü¤W¨Ó¡C¦pªG §AºD¥Îªº¤å¦r½s¿è¾¹¦bºô¸ôÀɮרt²Î¤Wªº¸Ü¡A§A¥²¶·¥ý¤â°Ê±Nºô¸ô³]©w °_¨Ó¡A¥H«K±Nºô¸ôÀɮרt²Î±¾¸ü¤W¨Ó¡A©Î¬O¨Ï¥Î¥»¦aºÝÀɮרt²Î¤Wªº ½s¿è¾¹¡A¨Ò¦p &man.ed.1;¡C ¦pªG§A·Q­n¨Ï¥Î¹³ &man.vi.1; ©Î¬O &man.emacs.1; µ¥ªº¥þ¿Ã¹õ ¤å¦r½s¿è¾¹ªº¸Ü¡A§A¤]»Ý­n°õ¦æ export TERM=cons25 ¡A¥H«KÅý³o¨Ç½s¿è¾¹¯à°÷±q &man.termcap.5; ¸ê®Æ®w¸ÌŪ¨ú¥¿½Tªº¸ê®Æ¡C ·í§A¤w¸g§¹¦¨¤F³o¨Ç¨BÆJ«á¡A§A¥i¥H·Ó§A¥­±`­×§ï¤åªk¿ù»~ªº¤è¦¡ ¥h½s¿è /etc/rc.conf ÀɮסC¦b®Ö¤ß (kernel) ±Ò°Ê®É©ÒÅã¥Üªº¿ù»~°T®§¡A¯à°÷§i¶D§AÀɮפ¤­þ¤@¦æ¦³¿ù»~¡C ¬°¤°»ò§Ú¨S¿ìªk³]©w§Úªº¦Lªí¾÷¡H ½Ð°Ñ¦Ò¤@¤U Handbook ¤¤¡A¦³Ãö¦C¦Lªº³¡¥÷¡C¥¦À³¸Ó¯à°÷¸Ñ¨M §A¤j³¡¥÷ªº°ÝÃD¡C½Ð°Ñ¦Ò Handbook ¤¤ªº¦C¦L³¡¥÷¡C ¦³¨Ç¦Lªí¾÷»Ý­n¥D¾÷¤ä´©ªºÅX°Êµ{¦¡ (host-based driver) ¤~¯à °õ¦æ¥ô¦ó¦C¦L¥\¯à¡CFreeBSD ¥»¨­¨Ã¤£¤ä´©³o¨Ç©Ò¿×ªº WinPrinters¡C ¦pªG§Aªº¦Lªí¾÷µLªk¦b DOS ©Î Windows NT 4.0 ¤U°õ¦æ¡A¨º¥¦¤j·§´N¬O¤@¥x WinPrinter¡C§A°ß¤@¯à¨Ï¥Î ³o¼Ëªº¦Lªí¾÷ªº§Æ±æ¡A´N¬O¸Õ¸Õ print/pnm2ppa ¤ä¤£¤ä´©¥¦¤F¡C §Ú­n«ç»ò¼Ë­×¥¿§Úªº¨t²Î©Ò¨Ï¥ÎªºÁä½L¹ï¬M (keyboard mapping)¡H ½Ð°Ñ¦Ò Handbook ¤¤ªº using localization ³¹¸`¡A¤×¨ä¬O console setup ³¹¸`¡C ¬°¤°»ò§Ú¦b¨t²Î±Ò°Ê®É¡A±o¨ì unknown: <PNP0303> can't assign resources ªº°T®§¡H ¥H¤U¬O±q freebsd-current ³q«H½×¾Âªº¤@½g¤å³¹¤¤¸`¿ý¥X¨Óªº¡C
&a.wollman;, 2001 ¦~¥|¤ë 24 ¤é µLªk«ü¬£¸ê·½ (can't assign resources) °T®§ªí¥Ü ¨º¨Ç¸Ë¸m¬O¶Ç²Îªº ISA ¸Ë¸m¡A¦Ó®Ö¤ß¤¤¤w¸g½s¤J¤£»{±o PNP ªºÅX°Êµ{ ¦¡¡C³o¨Ç¸Ë¸m¥]¬AÁä½L±±¨î¾¹¡A¥iµ{¦¡¤Æ§ÃÂ_±±¨î´¹¤ù¡AÁÙ¦³´X­Ó¼Ð·Ç ³]³Æ¡C¸ê·½µLªk«ü¬£µ¹³o¨Ç¸Ë¸m¡A¬O¦]¬°¦­¤w¦³ÅX°Êµ{¦¡¨Ï¥Î¨º¨Ç¦ì§} ¤F¡C
¬°¤°»ò§ÚµLªkÅý user quotas ¥¿±`¤u§@¡H ¤£­n¦b / ¥´¶} quotas¡A §â quotas ÀÉ©ñ¦b¥¦¥²¶·±j­¢¸m¤JªºÀɮרt²Î¤º¡AÁ|¨Ò¡G Àɮרt²Î Quota ÀÉ /usr /usr/admin/quotas /home /home/admin/quotas FreeBSD ¤ä´© System V IPC ®æ¦¡«ü¥O¶°¡H ¬Oªº¡AFreeBSD ¤ä´© System V-style IPC¡C³o¥]¬A¦@¨É°O¾ÐÅé¡A °T®§¸ò«H¸¹¡C§A»Ý­n¦b§Aªº®Ö¤ß³]©wÀɤº¥[¤J¤U¦C´X¦æ¥H±Ò°Ê¥¦­Ì¡C options SYSVSHM # enable shared memory options SYSVSEM # enable for semaphores options SYSVMSG # enable for messaging ¦b FreeBSD 3.2 ¥H¤Î¤§«áªºª©¥»¡A³o¨Ç¿ï¶µ¤w¸g¬O GENERIC ®Ö¤ßªº¤@³¡¥÷¡A¤]´N¬O»¡¥¦­Ì¤w ¸g½s¶i¤F§Aªº¨t²Î¤¤¡C ­«·s½sĶ¨Ã¦w¸Ë¡C §Ú¸Ó¦p¦óÅý sendmail ³z¹L UUCP ¨Ó»¼°e¶l¥ó¡H ¸òÀH FreeBSD ®M¸Ë¦Ó¨Óªº sendmail ³]©w¬O¾A¦X¨º¨Çª½±µ³s¤Wºô»Úºô¸ô ªº¯¸¥x¡C·Q³z¹L UUCP ¥æ´«¶l¥óªº¯¸¥x¥²¶·¥t¥~¦w¸Ë sendmail ªº³]©wÀɮסC ¤â°Ê­×§ï /etc/sendmail.cf ¬Oµ´¹ï¥²­nªº¡C ²Ä 8 ª©ªº sendmail ´£¨Ñ¤@­Ó¥þ·sªº¤J¤f¥H³z¹L¤@¨Ç¹³ &man.m4.1; ªº³B²z´N¯à²£¥Í³]©wÀÉ¡A³o¨Æ¹ê¤W¬O¤@­Ó°ª¼h·§©Àµ¥¯Åªº§Þ¥©©Ê³]©w¡C §AÀ³¸Ó¥i¥H¦b /usr/src/usr.sbin/sendmail/cf ¥H¤U¸Ì¨Ï¥Î¥¦¡G °²¦p§A¤£¬O¥Î full sources ¤è¦¡¦w¸Ë¨t²Î¡A¨º»ò sendmail ³]©w¶µ¥Ø¥i¯à¤w¸g¤À´²¦¨¦n´X­Ó¨Ó·½¤À¥¬Àɦbµ¥µÛ§A¡A°²³]§A¤w¸g mount ¥úºÐ¾÷¡A°µ¥H¤U°Ê§@¡G &prompt.root; cd /cdrom/src &prompt.root; cat scontrib.?? | tar xzf - -C /usr/src contrib/sendmail §OÅå·W¡A³o¥u¦³¼Æ¤Q¸U­Ó¦ì¤¸²Õªº¤j¤p¡C¦b cf ¥Ø¿ý¸Ìªº README ¥i¥H´£¨Ñ¤@­Ó m4 ³]©wªkªº°ò ¥»¤¶²Ð¡C ¥H UUCP »¼°e¨Ó»¡¡A«ØÄ³§A³Ì¦n¨Ï¥Î mailertable ¯SÂI¡C«Øºc¤@­Ó¸ê®Æ®wÅý sendmail ¥i¥H¨Ï¥Î¥¦¦Û¤vªº¸ô®|¨Mµ¦¡C ­º¥ý¡A§A¥²¶·«Ø¥ß¦Û¤vªº .mc ÀÉ¡C /usr/src/usr.sbin/sendmail/cf/cf ¥Ø¿ý¬O³o¨Ç Àɮתº®a¡C¬d¬Ý¤@¤U¡A¤w¸g¦³¦n´X­Ó½d¨ÒÀÉ¡A°²³]§A¤w¸g©R¦W¦Û¤vªºÀÉ¥s foo.mc¡A§A­n°µªº¥u¬O§â¥¦Âà´«¦¨¤@­Ó¦³®Äªº sendmail.cf¡G &prompt.root; cd /usr/src/usr.sbin/sendmail/cf/cf &prompt.root; make foo.cf &prompt.root; cp foo.cf /etc/mail/sendmail.cf ¤@­Ó¨å«¬ªº .mc Àɬݰ_¨Ó¥i¯à¹³³o¼Ë¡G VERSIONID(`Your version number') OSTYPE(bsd4.4) FEATURE(accept_unresolvable_domains) FEATURE(nocanonify) FEATURE(mailertable, `hash -o /etc/mail/mailertable') define(`UUCP_RELAY', your.uucp.relay) define(`UUCP_MAX_SIZE', 200000) define(`confDONT_PROBE_INTERFACES') MAILER(local) MAILER(smtp) MAILER(uucp) Cw your.alias.host.name Cw youruucpnodename.UUCP accept_unresolvable_domains¡A nocanonify¡A ©M confDONT_PROBE_INTERFACES ¯S©Ê±NÁ×§K¥ô¦ó¦b »¼°e¶l¥ó®É·|¥Î¨ì DNS ªº¾÷·|¡CUUCP_RELAY ¶µ¥Øªº¥X²{²z¥Ñ«Ü©_©Ç¡A´N¤£­n°Ý¬°¦ó¤F¡C²³æªº©ñ¤J¤@­Óºô»Úºô¸ô ¤W¥i¥H³B²z .UUCP µêÀÀºô°ì¦ì§}ªº¥D¾÷¦WºÙ¡F³q±`¡A§A¥u»Ý­n¦b³o ¸Ì¶ñ¤J§A ISP ªº«H¥ó¦^ÂгB (mail replay)¡C §A¤w¸g°µ¨ì³o¸Ì¤F¡A§AÁٻݭn³o­Ó¥s /etc/mail/mailertable¡C¦pªG§A¥u¦³¤@­Ó¥Î ¨Ó¶Ç»¼©Ò¦³¶l¥óªº¹ï¥~³q¹Dªº¸Ü¡A¥H¤UªºÀÉ®×´N¨¬°÷¤F¡G # # makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable uucp-dom:your.uucp.relay ¥t¤@­Ó§ó½ÆÂøªº¨Ò¤l¬Ý°_¨Ó¹³³o¼Ë¡G # # makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable # horus.interface-business.de uucp-dom:horus interface-business.de uucp-dom:if-bus interface-business.de uucp-dom:if-bus heep.sax.de smtp8:%1 horus.UUCP uucp-dom:horus if-bus.UUCP uucp-dom:if-bus uucp-dom: ¦p§A©Ò¨£¡A³o¬O¬Y­Ó¯u¹êÀɮ׸̪º¤@³¡¥÷¡C­º¤T¦æ³B²zºô°ì©w§}«H¥ó ¤£À³¸Ó³Q°e¥X¨ì¤º©w¸ô®|¡A¦Ó¥Ñ¬Y¨Ç UUCP ¾F©~(UUCP neighbor)¨ú¥N ªº¯S®í±¡§Î¡A³o¬O¬°¤F ÁYµu»¼°eªº¸ô®|¡C¤U¤@¦æ³B²z¨ì ¥»¦a¤A¤Óºô¸ôºô°ìªº«H¥óÅý¥¦¥i¥H¨Ï¥Î SMTP ¨Ó»¼°e¡C³Ì«á¡AUUCP ¾F©~´£¨ì .UUCP µêÀÀºô°ìªº°O¸ü¡A¤¹³\¤@­Ó uucp-neighbor !recipient ±À½ ¤º©w³W«h¡C³Ì«á¤@¦æ«h¥H¤@­Ó³æ¿Wªº¥yÂI°µµ²§ô¡A¥H UUCP »¼°e¨ì´£¨Ñ·í §A¥þ¥@¬É©Ê¶l¥ó¹hªùªºUUCP ¾F©~¡C©Ò¦³¦b uucp-dom: ÃöÁä¦r¸Ìªº¸`ÂI¦WºÙ¥²¶·³£¬O¦³®Äªº UUCP ¾F©~¡A§A¥i¥H¥Î uuname ©R¥O¥h½T»{¡C ´£¿ô§A³o­ÓÀɮצb¨Ï¥Î«e¥²¶·³QÂà´«¦¨ DBM ¸ê®Æ®wÀɮסA³Ì¦n¦b mailertable ³Ì¤W­±¥Îµù¸Ñ¼g¥X©R¥O¦C¨Ó§¹¦¨³o­Ó¤u§@¡C·í§A¨C¦¸§ó´«§A ªº mailertable «á§AÁ`¬O»Ý­n°õ¦æ³o­Ó©R¥O¡C ³Ì«á´£¥Ü¡G¦pªG§A¤£½T©w¬Y¨Ç¯S©wªº«H¥ó¸ô®|¥i¥Î¡A°O±o§â ¿ï¶µ¥[¨ì sendmail¡C³o·|±N sendmail ±Ò°Ê¦b address test mode¡F¥u­n«ö¤U 0¡A±µµÛ¿é¤J§A§Æ±æ´ú¸Õªº«H¥ó¸ô®|¦ì§}¡C ³Ì«á¤@¦æ§i¶D§A¨Ï¥Î¤º³¡ªº«H¥ó¥N²zµ{¦¡¡A¥N²zµ{¦¡ªº·|³qª¾¥Øªº¥D¾÷¡A ¥H¤Î(¥i¯àÂà´«ªº)¦ì§}¡C­nÂ÷¶}¦¹¼Ò¦¡½Ð«ö Control-D¡C &prompt.user; sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > 3,0 foo@example.com canonify input: foo @ example . com .. parse returns: $# uucp-dom $@ your.uucp.relay $: foo < @ example . com . > > ^D ·í§Ú¥Î¼·±µ³s¤Wºô¸ô®É¸Ó«ç»ò³]©w«H¥ó»¼°e¡H ¦pªG§A¤w¸g¦³¤@­Ó©T©wªº IP ¼Æ¦r¡A§A¤£»Ý­n½Õ¾ã¥ô¦ó¤º©w­È¡C³]¦n §A­n«ü©wªººô¸ô¦WºÙ¡A¨ä¥Lªº sendmail ³£·|À°§A°µ§¹¡C ¦pªG§A®³¨ìªº¬O°ÊºA°t¸mªº IP ¼Æ¦r¦Ó¨Ï¥Î¼·±µ ppp ³s±µ¨ìºô»Úºô ¸ô¡A§A¥i¯à¤w¸g¦b§Aªº ISP «H¥ó¥D¾÷¤W¦³¤@­Ó«H½c¡C°²³]§Aªº ISP ºô°ì ¬O example.net¡A§Aªº¨Ï¥ÎªÌ¦W ºÙ¬O user¡C¥ç°²³]§AºÙ¦Û¤vªº¥D¾÷¦WºÙ¬O bsd.home ¦Ó§Aªº ISP §i¶D§A¥i¥H¨Ï¥Î relay.example.net ·í§@«H¥ó¦^ÂгB¡C ¬°¤F±q§Aªº«H½c±µ¦¬«H¥ó¡A§A±N»Ý­n¦w¸Ë¨ú«Hµ{¦¡¥H«K±q«H½c¨ú¦^«H¥ó¡C Fetchmail ¬O¤@­Ó¤£¿ùªº¿ï¾Ü¡A¦]¬°¥¦¤ä ´©³\¦h¤£¦Pªº³q°T¨ó©w¡A³q±`§Aªº ISP ·|´£¨Ñ POP3¡C¦pªG§A¿ï¾Ü¨Ï¥Î user-ppp¡A§A¥i¥H¦b³s½u¨ìºô¸ô¦¨¥\«á¦Û°Ê§ì¨ú§Aªº«H¥ó¡A¥u­n¦b /etc/ppp/ppp.linkup¸Ì­±³]©w¥H¤U³o¶µ¡G MYADDR: !bg su user -c fetchmail °²¨Ï§A¥¿¨Ï¥Î sendmail (¦p¤U©Ò¥Ü) ¶Ç°e«H¥ó¨ì«D¥»¦a±b¸¹¡A¸m¤J¥H¤U©R¥O¡G !bg su user -c "sendmail -q" ¦b¤W­±¨º¶µ©R¥O¤§«á¡C³o·|±j­¢ sendmail ¦b³s±µ¤Wºô¸ô«á°¨¤W¶}©l³B²z mailqueue¡C §Ú°²³]§A¦b bsd.home ¾÷¾¹¤W¦³¤@­Ó user ªº±b¸¹¡C¦b bsd.home ¾÷¾¹¤W user ªº®a¥Ø¿ý¸Ì«Ø¥ß¤@­Ó .fetchmailrc ªºÀɮסG poll example.net protocol pop3 fetchall pass MySecret µL¶·Âب¥¡A³o­ÓÀɰ£¤F user ¥~¤£À³¸Ó³Q¥ô ¦ó¤HŪ¨ú¡A¦]¬°¥¦¥]§t MySecret ³o­Ó±K½X¡C ¬°¤F¦b±H«H®É¦³¥¿½Tªº©ïÀY from:¡A§A¥²¶·§i¶D sendmail ¨Ï¥Î user@example.net ¦Ó«D user@bsd.home¡C§A¥i¯à·|§Æ±æ§i¶D sendmail ±q relay.example.net °e¥X©Ò¦³«H¥ó¡A ¥[§Ö«H¥ó¶Ç°e¡C ¥H¤Uªº .mc ÀÉÀ³¯àº¡¨¬§Aªº­n¨D¡G VERSIONID(`bsd.home.mc version 1.0') OSTYPE(bsd4.4)dnl FEATURE(nouucp)dnl MAILER(local)dnl MAILER(smtp)dnl Cwlocalhost Cwbsd.home MASQUERADE_AS(`example.net')dnl FEATURE(allmasquerade)dnl FEATURE(masquerade_envelope)dnl FEATURE(nocanonify)dnl FEATURE(nodns)dnl define(`SMART_HOST', `relay.example.net') Dmbsd.home define(`confDOMAIN_NAME',`bsd.home')dnl define(`confDELIVERY_MODE',`deferred')dnl ¦p¦óÂà´«³o­Ó .mc Àɮרì sendmail.cf Àɪº¸Ô²Ó²Ó¸`¡A½Ð°Ñ¦Ò¤W¤@¸`¡C ¥t¥~¡A¦b§ó·s sendmail.cf ¥H«á¤£­n§Ñ°O­«·s±Ò°Ê sendmail¡C °£¤F Sendmail ¥~¡AÁÙ¦³­þ¨Ç¶l¥ó¦øªA¾¹¥i¥H¨Ï¥Î©O¡H Sendmail ¬O FreeBSD ¹w³]¨Ï¥Îªº¶l¥ó¦øªA¾¹¡A¦ý¬O§AÁÙ¬O¥i¥H«Ü®e©ö¦a¥H¨ä¥¦ ¶l¥ó¦øªA¾¹ (¨Ò¦p¡A±q port ¦w¸Ëªº¶l¥ó¦øªA¾¹) ¨ú¥N¤§¡C port ¸Ì¦³«Ü¦h¥i¨Ñ¿ï¾Üªº¶l¥ó¦øªA¾¹¡A¹³ mail/exim¡B mail/postfix¡B mail/qmail¡B mail/zmailer µ¥¡A ´N¬O´X­Ó«Ü¨üÅwªïªº¿ï¾Ü¡C ¦h¼Ë¿ï¾Ü¬O¦n¨Æ¡A¦Ó¥B¤j®a¦³³\¦h¶l¥ó¦øªA¾¹¥i¥H¨Ï¥Î¤]³Q»{¬°¬O ¦n¨Æ¡F©Ò¥H½ÐÁ×§K¦b³q«H½×¾Â¸Ì°Ý¹³ Sendmail ¦³¤ñ Qmail ¦n¶Ü¡H ³o¼Ëªº°ÝÃD¡C¦pªG§A¯uªº«Ü·Q°Ýªº¸Ü¡A½Ð¥ý¨ì³q«H½×¾Â archive ¸Ì§ä¤@¤U¡C¨C¤@­Ó¶l¥ó¦øªA¾¹ªºÀuÂI»P¯ÊÂI¡A¥H«e¤j·§´N¤w¸g °Q½×¦n´X¦¸¤F¡C §Ú§Ñ¤F root ±K½X¤F¡I«ç»ò¿ì¡H ¤£­nÅå·W¡I¥u­n­«·s±Ò°Ê¨t²Î¡A¦b¬Ý¨ì Boot: ®É¿é¤J boot -s §Y¥i¶i¤J³æ¨Ï¥ÎªÌ¼Ò¦¡ (¦b 3.2-RELEASE ¤§«eªºª©¥»½Ð§ï¥Î -s)¡C ¦b°Ý­n¨Ï¥Î­þ­Ó shell ®É¡A«ö¤U ENTER¡C§A·|¬Ý¨ì¤@­Ó &prompt.root; ªº´£¥Ü¸¹¡A¿é¤J mount -u / ¥H­«·s±¾¤W(mount) §Aªº®ÚÀɮרt²Î¥i¨ÑŪ/¼g¡C°õ¦æ passwd root ¥H§ó´« root ±K½X¡AµM«á°õ¦æ &man.exit.1; Ä~Äò±Ò°Êµ{§Ç¡C §Ú¸Ó«ç»òÅý Control-Alt-Delete ¤£·|­«·s±Ò°Ê¨t²Î¡H ¦pªG§A¬O¨Ï¥Î FreeBSD 2.2.7-RELEASE ©Î¤§«áª©¥»ªº syscons(¨t²Î¤º©wªº¥D±±¥xÅX°Êµ{¦¡)¡A§â¤U¦C³o¦æ©ñ¨ì®Ö¤ß³]©wÀɤº¡A µM«á­«°µ¤@­Ó·sªº®Ö¤ß¡G options SC_DISABLE_REBOOT ­Y¬O¨Ï¥Î FreeBSD 2.2.5-RELEASE ©Î¤§«áª©¥»ªº PCVT ¥D±±¥xÅX°Ê µ{¦¡¡A«h¥H¤U¦C¿ï¶µ¥N´À¡G options PCVT_CTRL_ALT_DEL ¨ä¥L§ó¦­´Áªº FreeBSD ª©¥»¡A½Ð­×§ï§A¥¿¦b¨Ï¥Îªº¥D±±¥xÁä½L¹ïÀ³¡A ¨Ã±N©Ò¦³ boot ÃöÁä¦r¥H nop ¨ú¥N¡C¤º©wªºÁä½L¹ïÀ³¬O¦b /usr/share/syscons/keymaps/us.iso.kbd¡C §A¥i¯à»Ý­n©ú¥Õªº§h©J /etc/rc.conf ¥hŪ¨ú ³o­ÓÁä½L¹ïÀ³¥H½T«O§ó°Ê¥Í®Ä¡C·íµM¦pªG§A¥¿¦b¥Î¾A¦X§A°êÄyªºÁä½L¹ïÀ³¡A §AÀ³¸Ó½s¿è¨º¤@­Ó¡C §Ú¸Ó«ç»ò§â DOS ¤å¦rÀÉ®×­«·s®æ¦¡¤Æ¦¨ UNIX ªº¡H ¥u­n¨Ï¥Î³o­Ó perl ©R¥O¡G &prompt.user; perl -i.bak -npe 's/\r\n/\n/g' file ... file ´N¬O­n³B²zªºÀɮסC³o­Ó­×§ï¬O¦b¤º³¡§¹¦¨¡A­ì©lªºÀÉ®×·|Àx¦s¦¨ °ÆÀɦW¬° .bak ªºÀɮסC ©ÎªÌ§A¥i¥H¨Ï¥Î &man.tr.1; ³o­Ó©R¥O¡G &prompt.user; tr -d '\r' < dos-text-file > unix-file dos-text-file ¬O¥]§t DOS ¤å¦rªº ÀɮסA¦Ó unix-text-file «h¬O¥]§tÂà´« ªº¿é¥Xµ²ªG¡C³o¤ñ¨Ï¥Î perl ÁÙ­n§Ö¤W¤@ÂIÂI¡C §Ú¸Ó«ç»ò¥Î¦WºÙ¬å±¼ process¡H ¨Ï¥Î &man.killall.1; ¡C ¬°¦ó¦b su ¤@ª½»¡§Ú¤£¦b root ªº ACL ¸Ì¡H ³o­Ó¿ù»~¬O¦]¬° Kerberos ¤À´²»{ÃÒ¨t²Î¡C³o­Ó°ÝÃD¨Ã¤£¬O«ÜÄY­« ¦ý¬O¥O¤H¹½·Ð¡C§A¥i¥H¥Î -K ¿ï¶µ¥h°õ¦æ su¡A©Î¬O¹³¤U­Ó°ÝÃD©Ò´y­zªº ²¾°£ Kerberos¡C §Ú¸Ó«ç»ò²¾°£ Kerberos¡H ­n±q¨t²Î¸Ì²¾°£ Kerberos¡A­«¸Ë§A¥¿¦b°õ¦æªº release ª©¥»ªº bin distribution¡C¦pªG§A¦³ CDROM¡A§A¥i¥H mount cd(°²³]¦b /cdrom) ¨Ã°õ¦æ¡G &prompt.root; cd /cdrom/bin &prompt.root; ./install.sh ©ÎªÌ§A¤]¥i¥H±N /etc/make.conf ¸Ìªº "MAKE_KERBEROS" ¿ï¶µ¥þ³£®³±¼¡AµM«á¦A build world. §Ú¸Ó«ç»ò¼W¥[¨t²ÎªºµêÀÀ²×ºÝ¾÷¡H ¦pªG§A¦³³\¦h telnet¡Assh¡AX ©Î¬O screen ¨Ï¥ÎªÌ¡A§A©Î³\·|¥Î§¹ µêÀÀ²×ºÝ¾÷¡A³o¯à±Ð§A«ç»ò¥[§ó¦h¡G «Ø¥ß¨Ã¦w¸Ë¤@­Ó·sªº®Ö¤ßµ{¦¡¨Ã¥B§â³o¤@¦æ pseudo-device pty 256 ¥[¤J¨ì³]©wÀɸ̡C °õ¦æ³o­Ó©R¥O¡G &prompt.root; cd /dev &prompt.root; sh MAKEDEV pty{1,2,3,4,5,6,7} ·|³y¥X 256 ­ÓµêÀÀ²×ºÝ¾÷ªº¸Ë¸m¸`ÂI¡C ½s¿è /etc/ttys ¨Ã¥[¤J²Å¦X 256 ­Ó²×ºÝ¾÷ªº¦æ¼Æ¡C¥¦­ÌÀ³¸Ó²Å¦X¤w¸g¦s¦b³æ¶µªº®æ¦¡¡AÁ|¨Ò¨Ó»¡¡A ¥¦­Ì¬Ý°_¨Ó¹³¡G ttyqc none network ¦r¥À³]­pªº¶¶§Ç¬O tty[pqrsPQRS][0-9a-v]¡A¨Ï¥Î¥¿³Wªí¥Ü¦¡¡C ¥Î·sªº®Ö¤ßµ{¦¡­«·s±Ò°Ê¹q¸£´N¥i¥H¤F¡C /dev/snd0 ³o­Ó¸Ë¸m°µ¤£¥X¨Ó¡I ¨Ã¨S snd ³o­Ó¸Ë¸mªº¦s¦b¡C³o­Ó¦W¦r ¬O¥Î¨Ó·í§@¦U­Ó²Õ¦¨ FreeBSD Án­µÅX°Êµ{¦¡²Õ¡A½Ñ¦p mixer¡A sequencer¡A¥H¤Î dsp ªºÂ²ºÙ¡C ¥i¥H¥Î¥H¤Uªº©R¥O§@¥X³o¨Ç¸Ë¸m¡G &prompt.root; cd /dev &prompt.root; sh MAKEDEV snd0 ¥i¥H¤£¥Î¶}¾÷¡A­«·sŪ¨ú /etc/rc.conf¡B ¦A¦¸±Ò°Ê /etc/rc ¶Ü? ¥ý¶i¤J³æ¤H¨Ï¥ÎªÌ¼Ò¦¡¡AµM«á¦A¦^¨ì¦h¨Ï¥ÎªÌ¼Ò¦¡¡C ¦b¥D±±¥x°õ¦æ¡G &prompt.root; shutdown now (Note: without -r or -h) &prompt.root; return &prompt.root; exit ¤°»ò¬O sandbox¡H Sandbox ¬O¨t²Î¦w¥þ¥Îªº³N»y¡A¦³¨â­Ó·N¸q¡G ©ñ¦b¬Y¨ÇµêÀÀ¨¾Å@Àð¸Ìªº°õ¦æµ{§Ç¡A³o¨Ç¨¾Å@Àð¬O¥Î¨Óªý¤î ¬Y¨Ç¤H«I¤J³o¹Dµ{§Ç¡A¶i¦Ó¥X¤J©ó§ó¤jªº¨t²Î¤¤¡C ³o¹Dµ{§Ç¥i¥H§¹¥þ¦b¨¾Å@Àð¸Ì °Ê§@¡C¤]´N ¬O»¡¡A¥¦©Ò°õ¦æªº¥ô¦óµ{¦¡¤£¥i¯à·|º¯³z¨ìÀ𪺥~­±¡C©Ò¥H¦pªG ±z¹ï¥¦¦³¦w¥þ¤WªºÅU¼{¡A¨Ã¤£»Ý­n¯S§O¥hºÊÅ¥¥¦ªº¤@Á|¤@°Ê¡A¤Ï ¥¿¥¦¥u¯à¦bÀ𤺬¡°Ê¡C Á|¨Ò¨Ó»¡¡A¥i¥H¥Î userid ¨Ó°µ³o¹D¨¾Å@Àð¡A³o¥¿¬O security ©M named »¡©ú¤å¥ó¤¤ªº©w¸q¡C ²{¦b´N¥Î ntalk ³o­ÓªA°È§@»¡©ú¡]¨£ /etc/inetd.conf¡^¡C³o­ÓªA°È¥H«eªº userid ¬O root¡A²{¦b°õ¦æ®É«h¬O¥Î tty¡Ctty ³o­Ó¨Ï¥ÎªÌ´N¬O¤@­Ó sandbox¡A¦pªG¦³¤H¯à°÷¶¶§Q¥Î ntalk «I¤J¨t²Î¡A²{¦b¥L´Nºâ¶i±o¨Ó¤]¥u¯à¥Î³o­Ó userid¡C ©ñ¦b¬Y­Ó¼ÒÀÀ¾÷¾¹¸Ìªºµ{¦¡¡A³o¤ñ¤W­z¨Ó±o§óÄY±K¡C°ò¥»¤W ³oªí¥Ü¯à«I¤J¸Óµ{¦¡ªº¤H¬Û«H¥L¯à¦A¶i¤J©ÒÄݪº¾÷¾¹¡A¦ý¨Æ¹ê¤W ¥u·|¶i¤J¼ÒÀÀ¥X¨Óªº¾÷¾¹¡AµLªk¶i¤@¨B­×§ï¥ô¦ó¯u¹êªº¸ê®Æ¡C ¹F¨ì³o­Ó¥Øªº³Ì±`¥Îªº¤èªk¡A´N¬O¦b¬Y­Ó¤l¥Ø¿ý¤U°µ¥X¼ÒÀÀªº Àô¹Ò¡AµM«á¥Î chroot °õ¦æ¸Óµ{¦¡¡A³o¼Ë¸Óµ{¦¡ªº®Ú¥Ø¿ý«K¬O³o­Ó ¤l¥Ø¿ý¡A¦Ó«D¨t²Î¯u¥¿ªº®Ú¥Ø¿ý¡C ¥t¤@­Ó±`¨£§@ªk¬O±N¬Y­ÓÀɮרt²Î mount ¦¨°ßŪ¡A¦ý¦b¥¦ ¤W­±¥t¥~»s³y¥Xµ{¦¡¥H¬°¥i¥H¼g¤JªºÀɮרt²Î¡C³o­Óµ{¦¡·|¬Û«H ¥¦¥i¥H¹ï¨ä¥LÀÉ®×Ū¼g¡A¦ý¥u¦³¥¦¬Ý¤£¨ì³o­Ó°ßŪ®ÄÀ³ - ¨t²Î °õ¦æªº¤@¯ëµ{¦¡³£¬Ý±o¨ì¡C §Ú­Ì¸Õ¹Ï±N³oÃþ sandbox ºÉ¶q³z©ú¤Æ¡AÅý¨Ï¥ÎªÌ©Î«I¤JªÌ µLªk¬Ý¨ì¥L¬O§_¦b¬Y­Ó sandbox ¸Ì­±¡C UNIX ¹ê§@¨âºØ sandbox¡A¤@­Ó¦bµ{¦¡¼h­±¡A¥t¤@­Ó«h¬O¥Ñ userid ¨Ó¹F¦¨¡C ¨C­Ó UNIX °õ¦æµ{§Ç·|¥Î¨¾¤õÀð±N¥¦©M©Ò¦³¨ä¥Lµ{§Ç¹j¶}¡A¬Y­Óµ{§Ç ¤£¥i¥HÀH·N­×§ï¨ä¥Lµ{§Ç¦ì§}ªº¸ê®Æ¡C³o©M Windows ¤¤¡Aµ{¦¡¥i¥H»´©ö ­×§ï¨ä¥L¦ì§}¸ê®Æ¡Aµ²ªG¾É­P·í¾÷ªº±¡§Î¤j¤£¬Û¦P¡C ¨C­Ó UNIX µ{§Ç³£ÄÝ©ó¬Y­Ó¯S©wªº userid¡C¦pªG¸Ó userid ¤£¬O root¡A´N·|±N¥¦©M¨ä¥L¨Ï¥ÎªÌªºµ{§Ç¹j¶}¡C Userid ¦P®É¤]¥Î©óµwºÐ¸ê®Æªº¦s¨úÅv¤W¡C ¤°»ò¬O securelevel? securelevel ¬O®Ö¤ß¤¤©Ò¹ê§@ªº¤@­Ó¦w¥þ¾÷¨î¡C°ò¥»¤W·í securelevel ¬O¥¿­È®É¡A®Ö¤ß·|­­¨î¬Y¨Ç¤u§@¡F§Y¨Ï¬O superuser (¤]´N¬O root) ¤]µLªk§¹¦¨¨º¨Ç¤u§@¡C¦b¼¶¼g ¥»¤å®É¡Asecurelevel ¾÷¨î¦b¤@¯ëªº­­¨î¥~¡AÁÙ¯à°÷­­¨î¥H¤Uªº¥\¯à¡G ²M°£¬Y¨Ç¯S©wªºÀɮ׺X¼Ð¡A¨Ò¦p schg (¨t²Î°ßŪ¼ÐºX, the system immutable flag) ¸g¥Ñ /dev/mem »P /dev/kmem¡A ±N¸ê®Æ¼g¤J¦Ü®Ö¤ß°O¾ÐÅ餤 ¸ü¤J®Ö¤ß¼Ò²Õ §ó°Ê &man.ipfirewall.4; ³W«h¡C ·Q­nÀˬd¦b¬Y­Ó¹B§@¤¤ªº¨t²Îªº securelevel ª¬ºA¡A¥u­n°õ¦æ¥H¤U ©R¥O§Y¥i¡G &prompt.root; sysctl kern.securelevel ¿é¥Xªºµ²ªG·|¥]§t¤@­Ó &man.sysctl.8; ÅܼƦWºÙ (¦b³o­Ó¨Ò¤l¤¤¡A ¥¦¬O kern.securelevel) ¥H¤Î¤@­Ó¼Æ¦r¡C«áªÌ§Y¬O ¥Ø«eªº securelevel ­È¡C¦pªG¥¦¬O¤@­Ó¥¿­È (¤]´N¬O¤j©ó 0)¡Aªí¥Ü¦Ü¤Ö ¦³¤@¨Ç securelevel ªº«OÅ@¾÷¨î¤w¸g¶}±Ò¤F¡C §A¨S¦³¿ìªk­°§C¤@­Ó¹B§@¤¤ªº¨t²Îªº securelevel¡F¦pªG¥i¥Hªº¸Ü¡A ´N¥¢¥h¤F³o­Ó¾÷¨îªº·N¸q¤F¡C¦pªG§A­n§@¤@¨Ç»Ý­n securelevel ¬° «D¥¿­È¤~¥i¥Hªº°Ê§@ªº¸Ü (¨Ò¦p installworld ©Î§ó°Ê¤é´Á)¡A§A»Ý­n­×§ï /etc/rc.conf ¤ºªº securelevel ³]©w (§ä§ä kern_securelevel ©M kern_securelevel_enable ÅܼÆ)¡AµM«á­«·s¶}¾÷¡C ·Q­nª¾¹D§ó¦h¦³Ãö©ó securelevel »P¦U­Ó¤£¦Pµ¥¯Å¼vÅTªº²Ó¸`¡A ½Ð°Ñ¦Ò &man.init.8; »¡©ú¤å¥ó¡C securelevel ¥i¤£¬O¸UÆF¤¦¡F¥¦¦³³\¦h¤wª¾ªº¯Ê³´¡A©¹©¹³y¦¨ ¤@ºØ¦w¥þªº°²¶H¡C ¥¦¤@­Ó³Ì¤jªº°ÝÃD¡A´N¬O­nÅý³o­Ó¥\¯à§¹¥þ¦³®Äªº¸Ü¡A¦b securelevel µo´§§@¥Î«eªº±Ò°Ê¹Lµ{¤¤¡A©Ò¦³¨Ï¥Î¨ìªºÀɮ׳£ ¥²¶·³Q«OÅ@°_¨Ó¡C¦pªG¤@­Ó§ðÀ»ªÌ¦b securelevel ¦³®Ä«e (¥Ñ©ó ¦³¨Ç¨t²Î¦b±Ò°Ê¤¤©Ò§@ªº¨Æ±¡¡AµLªk¦b¸û°ªªº securelevel ¤¤ ¥¿±`¹B§@¡A©Ò¥H³o·|¦b±Ò°Ê¹Lµ{¤¤«á´Á¤~·|¹B§@)¡A¯àÅý¥L­Ìªºµ{¦¡ ³Q°õ¦æªº¸Ü¡Asecurelevel ªº«OÅ@´N§¹¥þµL®Ä¤F¡C«OÅ@±Ò°Êµ{§Ç ¤¤©Ò¦³ªºÀɮצb§Þ³N¤W¬O¥i¦æªº¡A¦ý¬O¦pªG¯uªº³o¼Ë§@ªº¸Ü¡A¨t²Î ºûÅ@±N·|Åܦ¨¤@³õ¹ÚÆL¡C§Y¨Ï¥u¬O­×§ï¤@­Ó³]©wÀÉ¡A¤]¥²¶·±N¾ã­Ó ¨t²ÎÃö³¬¡A¦Ü¤Ö¤]±o¨ì³æ¤H¼Ò¦¡¡C °£¤F³oÂI¡AÁÙ¦³³\¦h¨ä¥¦ªºªF¦è³£¦b³q«H½×¾Â¤W°Q½×¡A¤×¨ä¬O freebsd-security¡C½Ð¨ì ³o¸Ì ·j´M¥H«eªº °Q½×¡C¦³¨Ç¤H§Æ±æ securelevel ¯à°÷¾¨§Ö®ø¥¢¡A¥Ñ¥t¤@­Ó§óÀu¨qªº ¾÷¨î¨ú¥N¡A¤£¹L¾÷·|¦³ÂI´ù¯í¡C ­·ÀI¦Û¦æ©Ó¾á¡C §Ú·Q­n§â§Úªº¨t²Îª@¯Å¨ì³Ì·sªº -STABLE¡A¦ý¬O±o¨ìªº¬O -RC ©Î -PRERELEASE¡I«ç»ò¤F¡H ²³æ¦a»¡¡G¨º¥u¬O¦W¦r¦Ó¤w¡CRC ªº·N«ä¬O Release Candiate¡A µo¦æ­Ô¿ïª©¥»¡A¥¦ªí¥Ü·sª©¥»§Ö­nµo¦æ¤F¡C¦b FreeBSD ¤¤¡A -PRERELEASE ³q±`¬Oµo¦æ«eªºµ{¦¡½X­áµ²ªº¥N¦Wµü¡C(¦³¨Çµo¦æª©¥»¤¤¡A -BETA ¼ÐÅÒ¸ò -PRERELEASE ¬O¬Û¦P·N«äªº¡C) ¸Ô²Ó¦a»¡¡GFreeBSD ±q¨â­Ó¦a¤è¤À¤ä¥X¥¦ªºµo¦æª©¥»¡C¥Dª©¸¹¡B ÂI¹s¡Brelease (¨Ò¦p 3.0-RELEASE ¤Î 4.0-RELEASE) ªº¡A¬O±qµo®i¹Lµ{ ¶}©l®É¤À¤ä¥X¨Óªº¡A³q±`ºÙ¬° -CURRENT ¡C¦³°Æª©¸¹ªºª©¥» (¨Ò¦p 3.1-RELEASE ©Î 4.2-RELEASE)¡A¬O ¬¡ÅDªº -STABLE ¤À¤ä¤¤ªºµo¦æª©¥» §Ö·Ó¡C±q 4.3-RELEASE ¶}©l¡A¨C¤@­Óµo¦æª©¥»¦³¥¦¦Û¤vªº¤À¤ä¡A¥i¬° °¾¦n·¥«×«O¦uªºµo®i³t«× (³q±`¥u·|§@¦w¥þ¤è­±ªº§ó·s) ªº¤H©Ò¥Î¡C ·Ç³Æ­n»s§@µo¦æª©¥»®É¡A¨ä©Ò¦bªº¤À¤ä·|¸g¹L¤@©wªºµ{§Ç¡C¦³¤@­Ó¬O µ{¦¡½X­áµ²¡C·íµ{¦¡½X­áµ²¶}©l®É¡A¤À¤ä¦WºÙ·|§ó¦W¡A¥H¤Ï¬M¥¦§Ö­n¦¨¬° ¤@­Óµo¦æª©¥»¤F¡CÁ|­Ó¨Ò¤l¡A¦pªG­ì¨Óªº¤À¤ä¥s 4.5-STABLE¡A¥¦ªº¦W¦r ·|Åܦ¨ 4.6-PRERELEASE ¥Hªí¥Üµ{¦¡½X¤w­áµ²¡A¨Ã¥BÃB¥~ªºµo¦æ«e´ú¸Õ ±N­n¶}©l¤F¡C¯äÂΧ󥿤´¥i¦^³ø¡A¥H¦¨¬°µo¦æª©¥»ªº¤@³¡¥÷¡C·íµ{¦¡½X ¦³¤F¥i¦¨¬°µo¦æª©¥»ªºÂú§Î®É¡A¥¦ªº¦W¦r´N·|Åܦ¨ 4.6-RC¡A¥Hªí¥Üµo¦æ ª©¥»§Ö¦n¤F¡C¶i¤J RC ¶¥¬q«á¡A¥u¦³§ä¨ìªº³Ì¦³¼vÅTªº¯äÂΤ~·|³Q­×¥¿¡C ·íµo¦æª©¥» (¥»¨Ò¤¤¬° 4.6-RELEASE) ²£¥Í«á¡Aµo¦æª©¥»·|¦³¦Û¤vªº¤À¤ä¡A ­ì¤À¤ä·|³Q§ó¦W¬° 4.6-STABLE¡C ·Q­n±oª¾§ó¦h¦³Ãöª©¥»¸¹½X»P¦U CVS ¤À¤äªº¸ê°T¡A½Ð°Ñ¦Ò Release Engineering ¤@¤å¡C §Ú¸ÕµÛ­n¦w¸Ë¤@­Ó·sªº®Ö¤ß¡A¦ý¬OµLªk chflags¡C§Ú¸Ó«ç»ò¸Ñ¨M¡H ²³æ¦a»¡¡G§Aªº securelevel ¥i¯à¤j©ó¹s¡Cª½±µ­«·s¶}¾÷¨ì ³æ¤H¼Ò¦¡¡A¦A¦w¸Ë®Ö¤ß¡C ¸Ô²Ó¦a»¡¡GFreeBSD ¦b securelevel ¤j©ó¹s±¡ªp¤U¡A¤£¤¹³\ Åܧó¨t²ÎºX¼Ð (system flags)¡C§A¥i¥H¥Î³o­Ó«ü¥OÀˬd§Aªº securelevel¡G &prompt.root; sysctl kern.securelevel §A¨S¦³¿ìªk­°§C securelevel¡F§A¥²¶·±Ò°Ê¨t²Î¨ì³æ¤H¼Ò¦¡¥H ¦w¸Ë®Ö¤ß¡A©Î¬O­×§ï /etc/rc.conf ¤ºªº securelevel ¦A­«·s¶}¾÷¡C½Ð°Ñ¦Ò &man.init.8; »¡©ú¤å¥ó¡A¥H¨ú±o §ó¦h¦³Ãö securelevel ªº¸ê°T¡AÁÙ¦³ /etc/defaults/rc.conf ©M &man.rc.conf.5; »¡©ú¤å¥ó¡A¥H¨ú±o§ó¦h¦³Ãö rc.conf ªº¸ê°T¡C ¦b§Úªº¨t²Î¤W¡A§ÚµLªkÅܧó®É¶¡¶W¹L¤@¬í¥H¤Wªº½d³ò¡I §Ú¸Ó«ç»ò¿ì¡H ²³æ¦aÁ¿¡G§A¨t²Îªº securelevel ¤]³\¤j©ó 1¡Cª½±µ­«·s¶}¾÷¦Ü ³æ¤H¼Ò¦¡¡AµM«á¦A­×§ï®É¶¡¡C ¸Ô²Ó¦a»¡¡G¦b securelevel ¤j©ó 1 ªº±¡ªp¤U¡AFreeBSD ¤£¤¹³\®É¶¡ Åܰʤj©ó¤@¬í¡C§A¥i¥H¥Î¥H¤Uªº©R¥O¨ÓÀˬd¥Ø«eªº securelevel¡G &prompt.root; sysctl kern.securelevel §AµLªk­°§C securelevel¡F§A¥²¶·±Ò°Ê¹q¸£¦Ü³æ¤H¼Ò¦¡¤U¥H­×§ï®É¶¡¡A ©Î¬O­×§ï /etc/rc.conf ¦A­«·s¶}¾÷¡C½Ð°Ñ¦Ò &man.init.8; »¡©ú¤å¥ó¡A¥H¨ú±o§ó¦h¦³Ãö securelevel ªº¸ê°T¡AÁÙ¦³ /etc/defaults/rc.conf ©M &man.rc.conf.5; »¡©ú¤å¥ó¡A¥H¨ú±o§ó¦h¦³Ãö rc.conf ªº¸ê°T¡C ¬°¤°»ò rpc.statd ¥Î¤F 256 megabytes ªº°O¾ÐÅé¡H ¤£¡A¨º¤£¬O memory leak¡A¦Ó¥B¥¦¤]¤£¬O¯uªº¥Î¤F 256 Mbyte ªº°O¾ÐÅé¡C¥¦¥u¬O³ßÅw (·N«ä´N¬OÁ`·|³o¼Ë§@) ±N¤@ª¯²¼ªº°O¾ÐÅé ¬MÁ¨쥦¦Û¤vªº¦ì§}ªÅ¶¡¡A¥H¤è«K§@¨Æ¡C´N§Þ³N¦Ó¨¥¡A³o¼Ë¨Ã¨S¦³ ¤°»ò¤£¹ï¡F³o¼Ë¥u¬O·|Åý &man.top.1; ©M &man.ps.1; À~¤@¤j¸õ¦Ó¤w¡C &man.rpc.statd.8; ·|±N¥¦ªºª¬ºAÀÉ®× (¦ì©ó /var ) ¬M®g¦Ü¥¦ªº¦ì§}ªÅ¶¡¸Ì¡F¬°¤F¨¾¤î»Ý­nªº®É­Ô¦A¼W¤j©Ò ¾É­Pªº­«·s¬M®g¡A¥¦¤@¦¸·|¨Ï¥Î¬Û·í¤jªº¤j¤p¡C±qµ{¦¡½X¨Ó¬Ýªº¸Ü´N §ó©úÅã¤F¡A¥i¥H¬Ý¨ì &man.mmap.2; ªºªø«×°Ñ¼Æ¬° 0x10000000 ¡A¥¦¬O IA32 ¬[ºc¤Wªº¤Q¤»¤À¤§¤@ªº©w§}ªÅ¶¡¡A¤]´N¬O 256MB¡C ¬°¤°»ò§Ú¨S¿ìªk¨ú®ø schg Àɮ׺X¼Ð¡H §A¥¿¦b¤@­Ó´£°ª¤F securelevel (¤]´N¬O¤j©ó 0) ªº¨t²Î¹B§@¡C ­°§C securelevel ¦A¸Õ¸Õ¬Ý¡C½Ð°Ñ¦Ò FAQ ¤¤¹ï securelevel ªº»¡©ú ©M &man.init.8; »¡©ú¤å¥ó¡C ¬°¤°»òªñ¨Óªº·sª© FreeBSD ¹w³]µLªk§Q¥Î .shosts §¹¦¨ SSH »{ÃÒ¡H ¬°¤°»òªñ¨Ó·sª© FreeBSD .shosts »{ÃÒ¹w³] ¬°¨ú®øªº­ì¦]¡A¬O¦]¬° &man.ssh.1; ¹w³]¤£¦w¸Ë¬° suid ¦¨ root¡C­n ­×¥¿ ³oÂI¡A§A¥i¥H§@¤U¦Cªº ¥ô¦ó¤@¥ó¨Æ¡G ­n¤@³Ò¥Ã¶h¸Ñ¨M¡A½Ð±N /etc/make.conf ¸Ìªº ENABLE_SUID_SSH ³]¦¨ true ¡AµM«á¦A­«·s build ssh (©Î¬O°õ¦æ make world)¡C ¥u§@¤@®Éªº­×¥¿ªº¸Ü¡A¥i¥H root ¨­¥÷ °õ¦æ chmod 4755 /usr/bin/ssh ±N /usr/bin/ssh ³]¦¨ 4555 ¡CµM«á±N ENABLE_SUID_SSH= true ¥[¤J /etc/make.conf ¸Ì¡A³o¼Ë¤U¦¸ make world °õ¦æ´N·|¥Í®Ä¤F¡C ¤°»ò¬O vnlru? ·í¨t²Î¹F¨ì¤W­­ kern.maxvnodes ®É¡A vnlru ·|²M°£¨ÃÄÀ©ñ vnode¡C³o­Ó®Ö¤ß °õ¦æºü¤j³¡¥÷ªº®É¶¡³£¨S¨Æ§@¡A¥u¦³·í§A¦³«Ü¤jªº°O¾ÐÅé¡A¦Ó¥B ¥¿¦b¦s¨ú¤W¸U­Ó¤pÀɮ׮ɡA¤~·|³Q±Ò°Ê¡C
Wei-Hon Chen
plasmaball@pchome.com.tw
X Window System ¤Î Virtual Consoles §Ú·Q­n°õ¦æ X ¡A§Ú¸Ó«ç»ò°µ¡H ³Ì²³æªº¤èªk´N¬O¦b¦w¸Ë¨t²Îªº®É­Ô¤@¨Ö¦w¸Ë¡C µM«á¬Ý¬Ý xf86config ªº¤å¥ó¡A³o­Óµ{¦¡¥i¥H À°±z³]©w XFree86(tm) ¨Ï¥¦¯à°÷¨Ï¥Î±zªºÅã¥Ü¥d/·Æ¹«µ¥¶gÃä¡C ±z©Î³\¤]·Q¸Õ¸Õ¬Ý Xaccel server¡C¸Ô±¡½Ð¬Ý Xi Graphics ©Î¬O Metro Link ³o¤@¬q¡C §Ú ¸ÕµÛ ­n°õ¦æ X, ¦ý¬O·í§ÚÁä¤J startx ®É¡A±o¨ì KDENABIO failed (Operation not permitted) ¿ù»~¡C§Ú¸Ó«ç»ò¿ì¡H §Aªº¨t²Î¤@©w´£°ª¤F securelevel¡A¹ï¤£¹ï¡H¦b¤@­Ó´£°ª¤F securelevel ªº¨t²Î¤W¡A¬Oµ´¹ïµLªk°_°Ê X ªº¡C·Qª¾¹D¬°¤°»ò¡A ½Ð°Ñ¦Ò &man.init.8; »¡©ú¤å¥ó¡C ©Ò¥H³o­Ó°ÝÃDÅܦ¨¡G§AÁÙ¯à«ç»ò¿ì¡C°ò¥»¤W§A¦³¨âºØ¿ï¾Ü¡G ±N§Aªº securelevel ³]¦^¹s (³q±`¦b /etc/rc.conf ¸Ì­±³]©w)¡A©Î¬O¦b±Ò°Ê®É°õ¦æ &man.xdm.1; (¦b securelevel ³Qª@°ª«e)¡C ½Ð°Ñ¦Ò ¥H¨ú±o§ó¦h¦³Ãö±Ò°Ê®É °õ¦æ &man.xdm.1; ªº¸ê°T¡C ¬°¤°»ò§Ú¤£¯à¦b X ¸Ì¨Ï¥Î·Æ¹«¡H ¦pªG±z¥Îªº¬O syscons (¤º©wªº console ÅX°Êµ{¦¡) ªº¸Ü¡A±z¥i¥H ¸g¥Ñ³]©w FreeBSD ¨ÓÅý¥¦¤ä´©¦b¨C­Ó virtual console ¨Ï¥Î·Æ¹«¡C¬°¤F Á×§K©M X ²£¥Í½Ä¬ð¡Asyscons ¨Ï¥Î¤F¤@­Ó¥s°µ /dev/sysmouse ªºµêÀÀ¸Ë¸m¡C©Ò¦³·Æ¹«²£¥Íªº event ³£·|§Q¥Î moused ¨Ó¼g¨ì sysmouse ³o­Ó¸Ë¸m¡C¦pªG±z§Æ±æ¦b¤@­Ó ©Î¥H¤Wªº virtual console ¤W¨Ï¥Î·Æ¹«¡A¨Ã¥B ¯à°÷¨Ï¥Î X ªº¸Ü¡A½Ð°Ñ¦Ò ¨Ã¥B³]©w¦n moused¡C µM«á½s¿è /etc/XF86Config ³o­ÓÀɮסA ¨Ã¥B½T»{§A¦³¥H¤U³o´X¦æªº³]©w¡C Section Pointer Protocol "SysMouse" Device "/dev/sysmouse" .... ¥H¤Wªº¨Ò¤l¡A¾A¥Î©ó XFree86 3.3.2 ¤Î¨ä«áªºª©¥»¡C¥Î©ó§ó¦­ªº ª©¥»ªº¡A¨ä Protocol À³¬° MouseSystems¡C ¦³¨Ç¤H¤ñ¸û³ßÅw¦b³]©w X ªº®É­Ô¥Î /dev/mouse ³o­Ó¸Ë¸m¡C¦pªG±z­nÅý¥¦¯à°÷ ¥¿±`¤u§@ªº¸Ü¡A±z´N¥²¶·§â /dev/mouse ³sµ²¨ì /dev/sysmouse (½Ð°Ñ¦Ò &man.sysmouse.4;): &prompt.root; cd /dev &prompt.root; rm -f mouse &prompt.root; ln -s sysmouse mouse §Úªº·Æ¹«¦³­Ó«Ü¬¯ªººu½ü¡C§Ú¯à¦b X ¸Ì­±¨Ï¥Î¶Ü¡H ¥i¥H¡C¤£¹L§A»Ý­n³]©w X ¥Î¤áºÝµ{¦¡¡C ½Ð°Ñ¦Ò Colas Nahaboo ªººô­¶ (http://www.inria.fr/koala/colas/mouse-wheel-scroll/) . ¦pªG§A­n¨Ï¥Î imwheel µ{¦¡¡A ¥u­n¸òµÛ¤U¦C¨BÆJ§@§Y¥i¡C Âà´«ºu½ü event Translate the Wheel Events imwheel µ{¦¡ªº¹B§@­ì²z¡A ¬O±N·Æ¹«ªº²Ä¥|Áä»P²Ä¤­ÁäÂà´«¦¨«öÁä event¡C¦]¬°¦p¦¹¡A©Ò¥H §A¥²¶·Åý·Æ¹«ÅX°Êµ{¦¡±N·Æ½ü¨Æ¥óÂà´«¦¨²Ä¥|Áä»P²Ä¤­Áä event¡C ¦³¨âºØ¤èªk¥i¥H¹F¨ì¥Øªº¡A¤@¬OÅý &man.moused.8; §@Âà´«¡A¤G¬O Åý X ¥»¨­¥h§@ event Âà´«¡C ¨Ï¥Î &man.moused.8; ¨ÓÂà´«ºu½ü Event ­nÅý &man.moused.8; ¨Ó§@ event Âà´«¡A¥u­n¦b °õ¦æ &man.moused.8; ªº©R¥O¦C¤¤¥[¤W §Y¥i¡CÁ|­Ó¨Ò¤l¡A¦pªG§A¤@¯ë³£¬O¥H moused -p /dev/psm0 ¨Ó°_°Ê &man.moused.8; ªº¸Ü¡A¥u­n§ï¦¨ moused -p /dev/psm0 -z 4 §Y¥i¡C¦pªG§A¬O¦b¶}¾÷¹Lµ{¤¤§Q¥Î /etc/rc.conf ¨Ó°_°Ê &man.moused.8;¡A §A¥i¥H¦b /etc/rc.conf ¤¤±N moused_flags ¤W¥[ §Y¥i¡C §A²{¦b»Ý­nÅý X ª¾¹D§Aªº·Æ¹«¦³¤­­Ó«öÁä¡A¥u­n¦b /etc/XF86Config ¤¤ªº Pointer °Ï¶ô¤¤¥[¤W Buttons 5 ³o¤@¦æ§Y¥i¡C¨Ò¦p¡A §A¥i¯à¦b /etc/XF86Config ¤¤¦³ ¥H¤Uªº Pointer °Ï¶ô¡G ¦b XFree86 3.3.x ¨t¦Cªº XF86Config ³]©wÀɪº <quote>Pointer</quote> °Ï¶ô¤¤¡A¥H moused §@Âà´« ªººu½ü¹«ªº³]©w½d¨Ò Section "Pointer" Protocol "SysMouse" Device "/dev/sysmouse" Buttons 5 EndSection ¦b XFree86 4.x ¨t¦Cªº XF86Config ³]©wÀɪº <quote>InputDevice</quote> °Ï¶ô¤¤¡A¥H X Server §@Âà´« ªººu½ü¹«ªº³]©w½d¨Ò Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/sysmouse" Option "Buttons" "5" EndSection ¦b <quote>.emacs</quote> ¤¤¡A³]©wºu½ü¹«ªº­ì¥Í ­¶­±ºu°Ê¤ä´©½d¨Ò ;; wheel mouse (global-set-key [mouse-4] 'scroll-down) (global-set-key [mouse-5] 'scroll-up) §Q¥Î§Aªº X Server ¨Ó§@ºu½ü Event Âà´« ¦pªG§A¨S¦³°õ¦æ &man.moused.8;¡A©Î¬O§A¤£·Q§Q¥Î &man.moused.8; ¥h§@ºu½ü event Âà´«¡A§A¥i¥H§ï¥Î X server ¨Ó§@³o¼Ëªº event Âà´«¡C§A±o¦b /etc/XF86Config Àɮפ¤§@´X­Ó§ó°Ê¡C²Ä¤@¡A §A­n¬°§Aªº·Æ¹«¿ï¾Ü¾A·íªº³q°T¨ó©w¡C¤j¦h¼Æªººu½ü¹«³£ ¨Ï¥Î IntelliMouse ¨ó©w¡A¤£¹L XFree86 ¤]¤ä´©¨ä¥¦ªº³q°T¨ó©w¡A¨Ò¦pù§Þªº MouseMan+ ·Æ¹«©Ò¥Îªº MouseManPlusPS/2¡C·í§A¿ï¦n¤§«á¡A¥u­n ¥[¶i¤@¦æ Pointer °Ï¶ôªº Protocol ÅܼƧY¥i¡C ²Ä¤G¡A§A­n§i¶D X server ±N±²°Ê¨Æ¥ó­«·s¹ï¬M¦Ü·Æ¹«ªº ²Ä¥|©M²Ä¤­Áä¡C³o¥i¥H§Q¥Î ZAxisMapping ¿ï¶µ¿ì¨ì¡C Á|­Ó¨Ò¤l¡A¦pªG§A¨S¦³¨Ï¥Î &man.moused.8;¡A¦Ó§A¦³¤@­Ó IntelliMouse ¦w¸Ë¦b PS/2 ·Æ¹«°ðªº¸Ü¡A§A¥i¥H¦b /etc/XF86Config ¸Ì¨Ï¥Î¥H¤Uªº³]©w¡C ¦b XF86Config ³]©wÀɪº <quote>Pointer</quote> °Ï¶ô¤¤¡A¥H X Server §@Âà´«ªººu½ü¹«ªº³]©w½d¨Ò Section "Pointer" Protocol "IntelliMouse" Device "/dev/psm0" ZAxisMapping 4 5 EndSection ¦b XFree86 4.x ¨t¦Cªº XF86Config ³]©wÀɪº <quote>InputDevice</quote> °Ï¶ô¤¤¡A¥H X Server §@Âà´« ªººu½ü¹«ªº³]©w½d¨Ò Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psm0" Option "ZAxisMapping" "4 5" EndSection ¦b <quote>.emacs</quote> ¤¤¡A³]©wºu½ü¹«ªº­ì¥Í ­¶­±ºu°Ê¤ä´©½d¨Ò ;; wheel mouse (global-set-key [mouse-4] 'scroll-down) (global-set-key [mouse-5] 'scroll-up) ¦w¸Ë imwheel ±µ¤U¨Ó¡A±q Ports ¸Ì¦w¸Ë imwheel ¡C¦b x11 Ãþ§O¸Ì¥i¥H§ä¨ì¥¦¡A¥¦¥i¥H±N ºu½ü event ¹ï¬M¨ìÁä½L event¡CÁ|­Ó¨Ò¤l¡A¥¦¥i¥H¦b§A ±Nºu½ü©¹«e±À®É¡A°e¥X¤@­Ó Page Up ¨ì§AªºÀ³¥Îµ{¦¡¥h¡CImwheel §Q¥Î¤@­Ó³]©wÀÉ¡A¥H«K¹ïÀ³ºu½ü event ¦ÜÁä½L event¡A³o¼Ë ¥¦´N¥i¥H¦b¤£¦PªºÀ³¥Îµ{¦¡¤¤¡A°e¥X¤£¦PªºÁä½L«öÁä¡C¹w³]ªº imwheel ³]©wÀɬO¦b /usr/X11R6/etc/imwheelrc¡A¦pªG§A·Q ½s¿è¦Û­qªº³]©wÀɪº¸Ü¡A¥i¥H±N¥¦½Æ»s¨ì ~/.imwheelrc¡AµM«á¨Ì§Aªº»Ý­n­×§ï¥¦¡C ³]©wÀɪº®æ¦¡¦b &man.imwheel.1; ¸Ì­±¦³¸Ô²Óªº»¡©ú¡C ³]©w Emacs »P Imwheel ¨ó¦P¤u§@ (¿ï¾Ü©Ê) ¦pªG§A¨Ï¥Î emacs ©Î¬O Xemacs ªº¸Ü¡A¨º§A»Ý­n¦b§Aªº ~/.emacs Àɮ׸̥[¤W¤@¤p¬q³]©w¡C emacs ½Ð¥[¤W³o¤@¬q¡G <application>Imwheel</application> ªº <application>Emacs</application> ³]©w ;;; For imwheel (setq imwheel-scroll-interval 3) (defun imwheel-scroll-down-some-lines () (interactive) (scroll-down imwheel-scroll-interval)) (defun imwheel-scroll-up-some-lines () (interactive) (scroll-up imwheel-scroll-interval)) (global-set-key [?\M-\C-\)] 'imwheel-scroll-up-some-lines) (global-set-key [?\M-\C-\(] 'imwheel-scroll-down-some-lines) ;;; end imwheel section Xemacs «h¦b ~/.emacs Àɸ̥[¤W³o¤@¬q¡G <application>Imwheel</application> ªº <application>Xemacs</application> ³]©w ;;; For imwheel (setq imwheel-scroll-interval 3) (defun imwheel-scroll-down-some-lines () (interactive) (scroll-down imwheel-scroll-interval)) (defun imwheel-scroll-up-some-lines () (interactive) (scroll-up imwheel-scroll-interval)) (define-key global-map [(control meta \))] 'imwheel-scroll-up-some-lines) (define-key global-map [(control meta \()] 'imwheel-scroll-down-some-lines) ;;; end imwheel section °õ¦æ Imwheel ¦w¸Ë¤§«á¡A§A¥i¥Hª½±µ¦b xterm ¸ÌÁä¤J imwheel ©R¥O¥H°_°Ê¥¦¡C¥¦·|¥H­I´º°õ¦æ¡A¨Ã¥B°¨¤Wµo´§®Ä¥Î¡C ¦pªG§A½T©w­nª½±µ¨Ï¥Î imwheel¡A ¥u­n§â¥¦¥[¶i§A¦Û¤vªº .xinitrc ©Î .xsession ¤ºÀÉ®×§Y¥i¡C§A¥i¥H¤£ºÞ imwheel ©Ò°e¥X¨Ó¦³Ãö PID ÀÉ®× Äµ§i¡C¨º¨Çĵ§i¥u¹ï Linux ª©ªº imwheel ¦³®Ä¦Ó¤w¡C ¬°¤°»ò X Window ªº¿ï³æ©M¹ï¸Ü®Ø¤£¯à¥¿±`¹B§@¡H §â Num Lock Ãö±¼¸Õ¸Õ¡C ¦pªG±zªº Num Lock ¦b¶}¾÷®Éªº¹w³]­È¬O¶}µÛªº¸Ü¡A±z¥²¶·§â¤U¦C ³o¦æ©ñ¨ì XF86Config ³]©wÀɤ¤ªº Keyboard ³¡¥÷¡C # Let the server do the NumLock processing. This should only be # required when using pre-R6 clients ServerNumLock ¤°»ò¬O virtual console¡H§Ú­n«ç»ò°µ¤~¯à¥Î¦h¤@ÂI¡H ²³æ¨Ó»¡¡Avirtual console ´N¬O¥i¥HÅý±z¤£¥²°µ¤Ó¦h½ÆÂøªº³]©w ¦p¨Ï¥Îºô¸ô©Î°õ¦æ X ¡A¦Ó¦b¦P¤@»O¾÷¾¹¤W¦P®É°µ¦n´X¥ó¨Æªº¤èªk¡C ·í±Ò°Ê¨t²Î¨ÃÅã¥Ü§¹©Ò¦³¶}¾÷°T®§¤§«á¡A±z´N·|¦b¿Ã¹õ¤W¬Ý¨ì¤@­Ó login ªº´£¥Ü²Å¸¹¡C¦b³o­Ó®É­Ô±z´N¥i¥H¿é¤J±zªº login name ¥H¤Î password ¡AµM«á´N¥i¥H¦b²Ä¤@­Ó virtual console ¤W¶}©l¤u§@¤F (©ÎªÌ¶}©lª±¡I) ¡C ¦b¬Y¨Ç±¡ªp¤U¡A±z¥i¯à·|·Q­n§@¨ä¥Lªº¤u§@¡A¨Ò¦p»¡¬O¬Ý¬Ý±z¥¿¦b °õ¦æªºµ{¦¡ªº»¡©ú¤å¥ó¡A©Î¬O·í±z¦b FTP ¶Ç¿éªºµ¥«Ý®É¶¡¤¤¬Ý¬Ý±zªº ¶l¥ó¡C±z¥u»Ý­n«ö Alt-F2 («ö¦í Alt Á䤣©ñ¡A¨Ã«ö¤U F2 Áä) ¡AµM«á ±z´N·|¦b²Ä¤G­Ó virtual console ¤W¬Ý¨ì¤@­Ó login ´£¥Ü²Å¸¹¡I·í±z·Q­n¦^¨ì­ì¨Óªº¤u§@®É¡A½Ð«ö Alt-F1¡C FreeBSD ¦b¦w¸Ë®Éªº¹w³]­È¬O¨Ï¥Î¤T­Ó virtual console (3.3-RELEASE «á¬°¤K­Ó)¡A±z¥i¥H¥Î Alt-F1¡AAlt-F2¡A¥H¤Î Alt-F3 ¦b¥¦­Ì¤§¶¡°µ¤Á´«¡C ¦pªG±z·Q­n¦h¤@ÂI virtual console ªº¸Ü¡A±z¥u»Ý­n½s¿è /etc/ttys ³o­ÓÀÉ (½Ð°Ñ¦Ò &man.ttys.5;)¡A ¦b Virtual terminals ³o­Óµù¸Ñ«á­±¥[¤J ttyv4 ¨ì ttyvc ªºÄæ¦ì¡G # Edit the existing entry for ttyv3 in /etc/ttys and change # "off" to "on". ttyv3 "/usr/libexec/getty Pc" cons25 on secure ttyv4 "/usr/libexec/getty Pc" cons25 on secure ttyv5 "/usr/libexec/getty Pc" cons25 on secure ttyv6 "/usr/libexec/getty Pc" cons25 on secure ttyv7 "/usr/libexec/getty Pc" cons25 on secure ttyv8 "/usr/libexec/getty Pc" cons25 on secure ttyv9 "/usr/libexec/getty Pc" cons25 on secure ttyva "/usr/libexec/getty Pc" cons25 on secure ttyvb "/usr/libexec/getty Pc" cons25 on secure ±z·Q¥Î´X­Ó´N³]´X­Ó¡C±z³]¶V¦h virtual terminal ¡A¥¦­Ì´N¥Î±¼ ¶V¦h¨t²Î¸ê·½¡F¦pªG±z¥u¦³¤£¨ì 8MB ªº°O¾ÐÅ骺¸Ü¡A³o¼vÅT´N¤j¤F¡C ±z¥i¯à¤]·|·Q§â secure ´«¦¨ insecure¡C ¦pªG±z·Q­n°õ¦æ X ªº¸Ü¡A±z ¥²¶· ¬°¥¦«O¯d (©ÎÃö±¼) ¦Ü¤Ö¤@­Ó virtual terminal ¡C³o´N¬O»¡¡A¦pªG ±z·Q¦b«ö¤Q¤G­Ó Alt ¥\¯àÁä®É³£¦³ login ´£¥Ü²Å¸¹¡A¦Ó¥B¤S¦b¦P¤@ ³¡¹q¸£¤W¤]·Q°õ¦æ X ªº¸Ü¡A¨º»ò³o¯u¬O¤Ó¤£©¯¤F - ±z¥u¯à¥Î¤Q¤@­Ó¡C ¨ú®ø¤@­Ó console ³Ì²³æªº¤èªk´N¬O§â¥¦Ãö±¼¡CÁ|¨Ò¨Ó»¡¡A¦pªG ±z¹³¤W­±Á¿ªº¤@¼Ë³]©w¤F¥þ³¡ªº 12 ­Ó terminal ¨Ã¥B·Q­n°õ¦æ X ¡A ±z¥²»Ý§â virtual terminal 12 ±q¡G ttyvb "/usr/libexec/getty Pc" cons25 on secure ³]¦¨¡G ttyvb "/usr/libexec/getty Pc" cons25 off secure ¦pªG±zªºÁä½L¥u¦³ 10 ­Ó¥\¯àÁ䪺¸Ü¡A±z´N­n§ï¦¨³o¼Ë¡G ttyv9 "/usr/libexec/getty Pc" cons25 off secure ttyva "/usr/libexec/getty Pc" cons25 off secure ttyvb "/usr/libexec/getty Pc" cons25 off secure (±z¤]¥i¥Hª½±µ§â³o´X¦æ¬å±¼¡C) ¤@¥¹±z§ï¤F /etc/ttys¡A¤U¤@­Ó¨BÆJ´N¬O­n ½T©w±z¦³¨¬°÷ªº virtual terminal ¸Ë¸m¡C³Ì²³æªº¤èªk´N¬O¡G &prompt.root; cd /dev &prompt.root; sh MAKEDEV vty12 ¦A¹L¨Ó¡A·Q­n±Ò°Ê³o¨Ç virtual console ³Ì²³æ (¤]¬O³Ì°®²b) ªº°µªk´N¬O­«¶}¾÷¡CµM«á¡A¦pªG±z¤£·Q­«¶}¾÷ªº¸Ü¡A±z¥i¥H§â X Window Ãö±¼¡AµM«á¥Î root ªº¨­¥÷°õ¦æ¤U¦C«ü¥O¡G &prompt.root; kill -HUP 1 ·í±z°õ¦æ³o­Ó©R¥O«e¡A±z¤@©w­n§¹¥þ§â X Window Ãö±¼¡C¦pªG ±z¤£³o»ò°µªº¸Ü¡A±zªº¨t²Î¥i¯à·|¦b±z°õ¦æ kill ©R¥O«á¥X²{·í±¼©Î Âꦺªº±¡ªp¡C §Ú­n«ç»ò±q X ¤Á´«¨ì virtual console¡H ½Ð¥Î Ctrl Alt Fn ¥H¤Á¦^¦Ü virtual console¡C Ctrl Alt F1 ¥i¥H¤Á¦^¦Ü²Ä¤@­Ó virtual console¡C ·í§A¤Á¦^¦Ü¤å¦r console «á¡A§A´N¥i¥H¨Ï¥Î¤@¯ë Alt Fn «öÁä²Õ¦X¡A¦b¦U console ¤§¶¡¤Á´«¡C ­n¦^¨ì X ªº¸Ü¡A§A¥²¶·¤Á¦^¦Ü°õ¦æ X ªº virtual console¡C ¦pªG§A¬O±q©R¥O¦C¸Ì°_°Ê X ªº¸Ü (¨Ò¦p¨Ï¥Î startx «ü¥O)¡A¨º»ò X ·|¨Ìªþ¦b¤U¤@­Ó¥¼¨Ï¥Îªº virtual console¡A¦Ó¤£¬O¥¦³Q °_°Êªº¤å¦r console¡C¦pªG§A¦³¤K­Ó¨Ï¥Î¤¤ªº virtual terminal¡A¨º»ò X ´N·|¦b²Ä¤E­Ó¤W°õ¦æ¡A§A´N¥i¥H¨Ï¥Î Alt F9 ¥Hªð¦^¦Ü X ¤¤¡C §Ú­n«ç»ò°µ¤~¯à¦b¶}¾÷®É±Ò°Ê XDM¡H ¦³¨âºØ¤èªk¥i¥H±Ò°Ê xdm¡C¤@ºØ¤èªk¬O±q /etc/ttys ¨Ó±Ò°Ê¡A ¥i¥H°Ñ¦Ò &man.ttys.5; »¡©ú¤å¥ó¤¤ªº½d¨Ò¡F¥t¤@ºØ¤èªk¬O¦b rc.local (½Ð°Ñ¦Ò &man.rc.8;) °õ¦æ xdm¡A©Î¬O ¦b /usr/local/etc/rc.d ©ñ¤@­Ó X.sh¡C³o¨âºØ¤èªk³£¬O¦Xªkªº¡A¦pªG±z¸Õ¬Y¤@ºØ ¤èªkµL®Äªº¸Ü¡A±z¥i¥H¸Õ¸Õ¥t¥~¤@ºØ¡C³o¨âºØ¤èªkªºµ²ªG¬O¤@¼Ëªº¡GX ·|Åã¥Ü¤@­Ó¹Ï§Î¤Æªº login: ´£¥Ü¡C ¥Î ttys ªº¤èªkªºÀuÂI¡A¦b©ó«ü©ú¤F X ¦b±Ò°Ê®É¨ì©³¬O¥Î¨º­Ó vty¡A ¨Ã¥B±N logout ®É­«·s±Ò°Ê X server ªº³d¥ô¥áµ¹ init¡C rc.local ªº¤èªk«h¬O¦b·í±Ò°Ê X ¥X¤F°ÝÃD®É¡A¥i¥H«Ü»´ÃP¦a§â xdm ±þ±¼¨Ó¸Ñ¨M °ÝÃD¡C ¦pªG¬O¥Î rc.local ªº¤èªk¡A¦b°õ¦æ xdm ®É±z¤£¯à¥[¥ô¦ó°Ñ¼Æ¡]¤]´N¬O¶]¦¨ daemon¡^¡C¥²¶·¦b getty °õ¦æ«á ¤~¯à±Ò°Ê xdm¡A§_«h getty ©M xdm ·|¤¬¬Û½Ä¬ð¦ÓÂê¦í console¡C³Ì¦nªº ¤è¦¡¬O¦b script ¤¤¥[­Ó sleep¡AÅý¥¦¼È°± 10 ¬íÄÁ¥ª¥k¡A±µµÛ¤~°õ¦æ xdm¡C ¦pªG§A¬O±q /etc/ttys ±Ò°Ê xdm¡Axdm »P &man.getty.8; ¤´¦³¾÷·|¤¬¬Û½Ä¬ð¡C¤@­ÓÁ×§K¥¦ªº¤èªk¡A´N¬O¦b /usr/X11R6/lib/X11/xdm/Xservers Àɮפ¤¥[¤J vt ¼Æ¦r¡C :0 local /usr/X11R6/bin/X vt4 ¤W­±ªº¨Ò¤l¤¤¡A·|«ü¥Ü X server ¦b /dev/ttyv3 ¤¤°õ¦æ¡C½Ðª`·N¼Æ¦r¬O®t¤@ªº¡CX server ±q¤@¶}©l¼Æ vty¡A¦Ó FreeBSD ®Ö¤ß«h¬O±q¹s¶}©l¼Æ vty ªº¡C ¬°¤°»ò·í§Ú°õ¦æ xconsole ®É¡Aµo¥Í¤F Couldn't open console ªº¿ù»~¡H ¦pªG§A¬O¥Î startx ¨Ó±Ò°Ê startx ªº¸Ü¡A/dev/console ªºÅv­­¨Ã ¤£·| §ïÅÜ¡Aµ²ªG´N¬O xterm -C ©M xconsole ³oÃþªºµ{¦¡µLªk ¥¿±`°õ¦æ¡C ³o¤@¤Áªº°ÝÃD¡A³£¬O¦]¬° console ªºÅv­­¬O±Ä¥Î¨t²Î¹w³]­È¡C ¦b¤@­Ó¦h¨Ï¥ÎªÌªº¨t²Î¸Ì¡A§Ú­Ì¤£§Æ±æ¨C­Ó¨Ï¥ÎªÌ³£¥i¥Hª½±µ¼g¤J¨t²Î console ¡C¦pªG¨Ï¥ÎªÌ¬O±q¾÷¾¹ªº VTY ª½±µ login ªº¸Ü¡A¨º»ò &man.fbtab.5; ¥i¥H¸Ñ¨M³oÃþªº°ÝÃD¡C ²³æ¦a»¡¡A½Ð½T«O /etc/fbtab (½Ð°Ñ¦Ò &man.fbtab.5;) ³o­ÓÀɮפ¤ªº³o¤@¦æ¨S¦³³Qµù¸Ñ±¼¡G /dev/ttyv0 0600 /dev/console ³o¤@¦æ³]©wªº¦s¦b¥i¥H½T«O±q /dev/ttyv0 µn¤Jªº¨Ï¥ÎªÌ¥i¥H±±¨î console¡C ¥H«e§Ú¥i¥H¥H¤@¯ë¨Ï¥ÎªÌ°õ¦æ XFree86¡A¬°¤°»ò²{¦b¥¦»¡§Ú¤@©w­n ¥H root ¤~¯à°õ¦æ¡H ©Ò¦³ªº X server ³£»Ý­n¥H root ¨Ó°õ¦æ¡A ¤~¯àª½±µ¦s¨ú§Aªºµø°TµwÅé¡Cª©¥»ªº XFree86 (<= 3.3.6) ·|¦Û°Ê ±N©Òªþªº server ¥H§Q¥Î root ¨­¥÷°õ¦æªº¤è¦¡ ¦w¸Ë°_¨Ó (setuid ¬° root)¡C¥Ñ©ó X server ³£¬OÅé¿nÃe¤j¤S½ÆÂøªºµ{¦¡¡AÅã¦Ó©ö¨£¦a¡A³o¬O¤@­Ó¦w¥þ¤Wªº¨aÃø¡C ¦]¬°³o­Ó­ì¦]¡A·sª©ªº XFree86 ´N¤£±N³o¨Ç server ¥H setuid ¬° root ªº¤è¦¡¦w¸Ë¡C «Ü©úÅã¦a¡A§Ú­Ì§¹¥þµLªk±µ¨ü±N X server ¥H root ªº¨­¥÷°õ¦æ¡C°_½X´N¦w¥þ¤W¤£¬O­Ó¦n¥D·N¡C ¦³¨âºØ¤èªk¥i¥H¥H¤@¯ë¨Ï¥ÎªÌªº¨­¥÷¨Ï¥Î X¡C²Ä¤@¬O§Q¥Î xdm ©Î¬O¨ä¥¦ªº display manager (¨Ò¦p kdm)¡F²Ä¤G¬O§Q¥Î Xwrapper¡C xdm ¬O¤@­Ó³B²z¹Ï§Î¬É­±µn¤Jªº daemon¡C ¥¦³q±`¦b¶}¾÷®É°õ¦æ°_¨Ó¡A¦Ó¥B­t³d¹ï¨Ï¥ÎªÌ§@¨­¥÷»{ÃÒ¡A¥H¤Î°_°Ê ¨Ï¥ÎªÌªº¤u§@Àô¹Ò¡F¥¦¥i»¡¬O¹Ï§ÎÀô¹Ò¤Uªº &man.getty.8; »P &man.login.1; ªº¹ïÀ³µ{¦¡¡C·Q±oª¾§ó¦h¦³Ãö xdm ªº¸ê°T¡A½Ð°Ñ¦Ò XFree86 ¤å¥ó¡A¥H¤Î¨ä FAQ ¶µ¥Ø¡C Xwrapper ¬O X server ªº¥]¸Ëµ{¦¡¡F¥¦¥i¥H Åý¤@¯ë¨Ï¥ÎªÌ¥i¥H¤â°Ê°_°Ê X server ªº¤p¤u¨ã¡A¦ÓÁÙ¯àºû«ù¤@©wªº¦w¥þ Àô¹Ò¡C¥¦·|Àˬd¶Ç¤Jªº©R¥O¦C°Ñ¼Æ¡A¦pªG¨S°ÝÃDªº¸Ü¡A´N°_°Ê¾A·íªº X server¡C¦pªG§A¦]¬°¬YºØ²z¥Ñ¦Ó¤£·Q°õ¦æ display manager ªº¸Ü¡A ¥¦¬O¬°§A¦Ó³]©wªº¡C¦pªG§A¦w¸Ë¤F§¹¾ãªº ports¡A§A¥i¥H¦b /usr/ports/x11/wrapper ¤¤§ä¨ì¥¦¡C §Úªº PS/2 ·Æ¹«¦b X ¤¤¦³ÂI¤£¥¿±`¡H ±zªº·Æ¹«©M±zªº·Æ¹«ÅX°Êµ{¦¡¥i¯à¦s¦b¦³¤£¦P¨Bªº²{¶H¡C ¦b 2.2.5 ¥H¤Î§ó¦­ªº¨t²Î¸Ì¡A±q X ¤Á¨ì virtual terminal µM«á ¦A¤Á¦^¨Ó´N¥i¥H¨Ï¥¦­Ì­«·s°µ¦P¨Bªº°Ê§@¡C¦pªG³o­Ó°ÝÃD±`±`µo¥Íªº¸Ü¡A ±z¥i¥H¦b±zªº®Ö¤ß³]©wÀɤ¤¥[¤J¤U­±³o­Ó¿ï¶µµM«á­«·s½sĶ¡G options PSM_CHECKSYNC ¦pªG±z¨S¦³«Ø¥ß®Ö¤ßµ{¦¡ªº¸gÅç¡A½Ð¬Ý ¦Û­q®Ö¤ß ³o¤@¸`¡C ¥[¤W³o­Ó¿ï¶µ¥H«á¡A·Æ¹«©M·Æ¹«ÅX°Êµ{¦¡¶¡ªº¦P¨B°ÝÃDÀ³¸Ó´N¤ñ¸û ¤£·|¥X²{¤F¡C¦pªG³o­Ó°ÝÃD¤´µM¦s¦bªº¸Ü¡A¦b²¾°Ê·Æ¹«®É«ö«ö·Æ¹««öÁä ¥i¥H¨Ï·Æ¹«©M·Æ¹«ÅX°Êµ{¦¡­«·s°µ¦P¨Bªº°Ê§@¡C ¸Óª`·Nªº¬O³o­Ó¿ï¶µ¨Ã¤£¬O¹ï¨C¤@­Ó¨t²Î³£¦³®Ä¡A¥¦¥i¯à·|Åý±µ¦b PS/2 ·Æ¹«¦ì¸mªº ALPS GlidePoint ¸Ë¸m¥¢¥h tap ³o¶µ¥\¯à¡C ¦b 2.2.6 ¤Î¨ä«áªºª©¥»¡A¦P¨Bªº½T»{¤w¸g¦³¤F¸û¦nªº¸Ñ¨M¿ìªk¡A ¦Ó¥B³o¨Ç³£¤w¸g¬O PS/2 ·Æ¹«ÅX°Êµ{¦¡ªº¼Ð·Ç¤F¡C³o­Ó¤èªk¤]¥i¥H¦b GlidePoint ¤W¥¿±`¤u§@¡C (¦]¬°½T»{ªºµ{¦¡½X¤w¸g¦¨¬°¤@­Ó¼Ð·Ç¥\¯à¡A ©Ò¥H¦b³o¨Çª©¥»¤¤§Ú­Ì¤£¦b´£¨Ñ PSM_CHECKSYNC ªº¿ï¶µ¤F¡C) ¤£¹L¦b ·¥¤Ö¼Æªº®×¨Ò¤¤¡A³o¨ÇÅX°Êµ{¦¡·|»~³ø¦P¨B©Ê¿ù»~¡AµM«á±z´N·|¬Ý¨ì ³o¼Ëªº®Ö¤ß°T®§¡G psmintr: out of sync (xxxx != yyyy) µM«á±z´N·|µo²{±zªº·Æ¹«¤£¯à¥¿±`¹B§@¤F¡C ¦pªG±zµo¥Í¤F³o¼Ëªºª¬ªp¡A±z¥²¶·Âǥѧâ PS/2 ·Æ¹«ÅX°Êµ{¦¡ªº flag ³]¦¨ 0x100 ¨Ó§â¦P¨B½T»{ªºµ{¦¡½Xµ¹¨ú®ø±¼¡CµM«á¦b¶}¾÷´£¥Ü²Å¸¹®É¥Î ¿ï¶µ¨Ó¶i¤J UserConfig¡G boot: -c µM«á¡A¦b UserConfig ©R¥O¦C¤¤Áä¤J¡G UserConfig> flags psm0 0x100 UserConfig> quit §Úªº PS/2 ·Æ¹«¤£¯à³z¹L MouseSystem ¨Ó¹B§@¡H ¦³¤@¨Ç³ø§i«ü¥X¬Y¨Ç¼tµPªº PS/2 ·Æ¹«¥u¯à¦b °ª¸ÑªR«× ª¬ºA¤U¤~¯à¹B§@¡C¦pªG¤£¬Oªº¸Ü¡A·Æ¹«´å¼Ð ·|±`±`¶]¨ì¿Ã¹õªº¥ª¤W¨¤¥h¡C «D±`¤£©¯ªº¡A³o­Ó°ÝÃD¦b 2.0.X ©M 2.1.X ¤U¬OµL¸Ñªº¡C¦b 2.2 ¨ì 2.2.5 ª©¡A±z¥i¥H¹ï /sys/i386/isa/psm.c ¨Ï¥Î¤U¦C patch µM«á­««Ø±zªº®Ö¤ß¡C¦pªG±z¨S¦³«Ø¥ß®Ö¤ßµ{¦¡ªº¸gÅç¡A ½Ð¬Ý ¦Û­q®Ö¤ß ³o¸`¡C @@ -766,6 +766,8 @@ if (verbose >= 2) log(LOG_DEBUG, "psm%d: SET_DEFAULTS return code:%04x\n", unit, i); + set_mouse_resolution(sc->kbdc, PSMD_RES_HIGH); + #if 0 set_mouse_scaling(sc->kbdc); /* 1:1 scaling */ set_mouse_mode(sc->kbdc); /* stream mode */ ¦b 2.2.6 ¤Î¥H«áªºª©¥»¡A¦b PS/2 ·Æ¹«ÅX°Êµ{¦¡¤¤³]©w 0x04 ªº flag ·|§â·Æ¹«³]¦¨°ª¸ÑªR«×¼Ò¦¡¡C¦b¶}¾÷´£¥Ü²Å¸¹®É¥Î ¿ï¶µ¨Ó¶i¤J UserConfig¡G boot: -c µM«á¡A¦b UserConfig ªº©R¥O¦C¤¤Áä¤J¡G UserConfig> flags psm0 0x04 UserConfig> quit «e¤@¸`¦³´£¨ì¥t¤@­Ó¥i¯à¾É­P·Æ¹«°ÝÃDªº­ì¦]¡C ·í§Ú«Ø¥ß X µ{¦¡®É¡Aimake »¡¥¦§ä¤£¨ì Imake.tmpl¡C¥¦¦b­þ¨à¡H Imake.tmpl ¬O Imake ®M¥óªº¤@³¡¥÷¡AImake ¬O¼Ð·Çªº«Ø¥ß X µ{¦¡ªº¤u¨ã¡C Imake.tmpl ©M¨ä¥L¼Æ­Ó header file ¤@¼Ë¬O«Ø¥ß X µ{¦¡ªº¥²­nÀɮסA±z¥i¥H¦b X prog distribution ¤¤§ä¨ì¥¦­Ì¡C±z¥i¥H¥Î sysinstall ¨Ó¦w¸Ë©Î¬O ª½±µ±q X distribution ¤¤¤â°Ê¦w¸Ë¡C §Ú¦b build ¤@­Ó X À³¥Îµ{¦¡¡A¥¦»Ý­n XFree86 3.3.x¡A¦ý¬O §Ú¤w¸g¦w¸Ë XFree86 4.x ¤F¡C§Ú¸Ó«ç»ò¿ì¡H ­n§i¶D port ¦b½s͵{¦¡®É¡A¨Ï¥Î XFree86 4.x ¨ç¦¡®w¡A§A¥i¥H ¦b /etc/make.conf ¸Ì (¦pªG§A¨S¦³³o­ÓÀÉ¡A ½Ð«Ø¥ß¥¦) ¥[¤W¤U­±³o¤@¦æ¡G XFREE86_VERSION= 4 §Ú­n«ç»ò°µ¤~¯à³]©w¥ªºJ¤l¥Îªº·Æ¹«¡H ¦b±zªº .xinitrc ©Î¬O .xsession ¤¤°õ¦æ xmodmap -e "pointer = 3 2 1" ªº«ü¥O¡C ­n¦p¦ó¦w¸Ë splash ¹Ï§ÎÅã¥Üµ{¦¡¡H¨º¸Ì¥i¥H§ä±o¨ì©O¡H ´N¦bµo¦æ FreeBSD 3.1 ¤§«e¡A§Ú­Ì¥[¶i¤F¦b¶}¾÷®ÉÅã¥Ü splash ¹Ï§Îªº·s¥\¯à¡C¥Ø«e¥Î¨ÓÅã¥Ü¦b¿Ã¹õ¤WªºÀÉ®× ¥²¶·¬O 256 ¦âªºÂI¯x°}¹Ï§Î (*.BMP) ©Î ZSoft PCX(*.PCX) ªº®æ¦¡¡C°£¦¹¤§¥~¡A¸ÑªR«×¤]¥²¶·¦b 320x200 ¥H¤U¡A¤~¯à©M¼Ð·Ç VGA Åã¥Ü¥d·f°t¨Ï¥Î¡C¦pªG±z½sĶ kernel ®É¦³¥[¤J VESA ¤ä´©¡A¨º»ò³Ì¤j¸ÑªR«×¥i¥H¨ì 1024x768¡Cª`·N VESA ªº ¤ä´©»Ý­n¥[¤J VM86 ³o­Ó kernel ¿ï¶µ¡CVESA ¤ä´©¹ê»Ú¤W¥i¥H¦b½sĶ kernel ®É¥[¤J VESA ¿ï¶µ¡B ©Î¸ü¤J VESA ªº kld module ¨Ó¹F¦¨¡C ±z­n­×§ï±±¨î FreeBSD ¶}¾÷¨BÆJªº³]©wÀÉ¡A¤~¯à¨Ï¥Î splash Åã¥Ü¹Ï§Îªº¥\¯à¡C³]©wÀɦbµo¦æ FreeBSD 3.2 «e¦³¨Ç§ó°Ê¡A©Ò¥H²{¦b ¦³¨â­Ó¤èªk¥i¥H¸ü¤J splash ªº¥\¯à¡G FreeBSD 3.1 ¥ý¿ï¥X¥Î¨ÓÅã¥Ü¦b¿Ã¹õ¤Wªº¹Ï§Î¡A3.1 ª©¥u¤ä´© Windows ªºÂI¯x°}®æ¦¡¡C¿ï¦n¤F±z­nªº¹ÏÀÉ«á¡A±N¥¦«þ¨ì /boot/splash.bmp¡C±µµÛ§â¤U­±´X¦æ¥[¤J /boot/loader.rc ¤¤¡G load kernel load -t splash_image_data /boot/splash.bmp load splash_bmp autoboot FreeBSD 3.2+ °£¤F¥[¤J¹ï PCX Àɮתº¤ä´©¥~¡AFreeBSD 3.2 ¤]§ï¶i¤F ¶}¾÷µ{§Çªº³]©w¤è¦¡¡C¦pªG±zÄ@·Nªº¸Ü¡A¥i¥H¥Î¤W­z FreeBSD 3.1 ªº¤èªk¡A±N splash_bmp ´«¦¨ splash_pcx ¨Ó¸ü¤J PCX ÀÉ®×§Y¥i¡C ¦pªG·Q¥Î·sªº³]©w¤è¦¡¡A±zªº /boot/loader.rc ¥²¶·¥]¬A³o´X¦æ¡G include /boot/loader.4th start Áٻݭn¤@­Ó¥]§t¥H¤U´X¦æªº /boot/loader.conf ¡G splash_bmp_load="YES" bitmap_load="YES" ³o¬O°²³]±z¥Î /boot/splash.bmp ¨Ó·í§@ splash ªº¿Ã¹õÅã¥Ü¡C¦pªG·Q¥Î PCX ªºÀɮסA§â¥¦«þ¦¨ /boot/splash.pcx¡A¦p¤W­z°µ¥X /boot/loader.rc¡A¦A±N³o´X¦æ¥[¨ì /boot/loader.conf ¤¤¡G splash_pcx_load="YES" bitmap_load="YES" bitmap_name="/boot/splash.pcx" ²{¦b´N¥u³Ñ¤U splash ¥Î¨ÓÅã¥Üªº¹ÏÀÉ¡A±z¥i¥H¦b http://www.baldwin.cx/splash/ §ä¨ì¦UºØ¼Ë«~¡C §Ú¯à¦b X ¸Ì¨Ï¥ÎÁä½L¤Wªº Windows ¶Ü¡H ¥i¥H¡C§A©Ò­n§@ªº¡A´N¬O§Q¥Î &man.xmodmap.1; ¥h©w¸q§A·Q¨Ï¥Î ªº¥\¯à¡C °²³]©Ò¦³ªº Windows ³£¬O¼Ð·Çªº¡A ¨º¥¦­Ìªº keycode ¤À§O¬°¡G 115 - Windows Áä¡A ¦b¥ª¤âªº Ctrl »P Alt Á䤧¶¡ 116 - Windows Áä¡A ¦b Alt-Gr Áä¥kÃä 117 - ¿ï³æÁä¡A¥k¤âªº Ctrl Á䥪Ãä ­nÅý¥ªÃ䪺 Windows Áä¦L¥X¤@­Ó³rÂI¡A¸Õ¸Õ³o­Ó¡G &prompt.root; xmodmap -e "keycode 115 = comma" §A¥i¯à­n­«¶]§Aªº windows manager¡A¤~·|¦³°Ê§@¡C ­nÅý Windows Áä ªº¹ï¬M¦b¨C¦¸ X °_°Ê®É¦Û°Ê³]©w¦n¡A§A¥i¥H¦b§Aªº ~/.xinitrc ¸Ì¥[¤W xmodmap¡A ©Î¬O³Ì¦n«Ø¥ß¤@­Ó ~/.xmodmaprc ÀɮסA¸Ì­± ¨C¤@¦æ´N¬O¤@­Ó xmodmap ªº¿ï¶µ¡AµM«á¦b§Aªº ~/.xinitrc ¸Ì¥[¤W¡G xmodmap $HOME/.xmodmaprc ³o¤@¦æ¡C ¨Ò¦p¡A§A·Q­n±N³o¤T­ÓÁä¦U¹ï¬M¨ì F13¡BF14 ©M F15¡C³oÅý§A¯à ¦b§Aªºµ{¦¡©Î¬O window manager ¤º±N¨ä¹ïÀ³¨ì«K§Qªº¥\¯à¤W¡Aµ¥¤@¤U §Ú­Ì·|¥Ü½d¡C §â³o¨Ç©ñ¶i ~/.xmodmaprc ¸Ì¡G keycode 115 = F13 keycode 116 = F14 keycode 117 = F15 °²¦p§A¥Î fvwm2 ªº¸Ü¡A§A¥i¥H§@³o¼Ëªº¹ï¬M¡A Åý F13 ¯à°÷Åý´å¼Ð©Ò¦bªºµøµ¡ÁY¦¨¤p¹Ï¥Ü (©Î¬O¤Ï¹L¨Ó)¡CF14 Åý´å¼Ð ©Ò¦bªºµøµ¡Åܦ¨³Ì¤W¼hªºµøµ¡¡A©Î¬O°h¨ì¤U¼h¥h (¦pªG¥¦¤w¸g¬O³Ì¤W¼h ¤Fªº¸Ü)¡CF15 «h±N Workplace (application) ¿ï³æ¥s¥X¨Ó¡A§Y¨Ï´å¼Ð ¤£¦b®à­±¤W¡C·í§A¨S¦³¥i¨£ªº®à­±°Ï°ì®É¡A³o­Ó¥\¯à´N¬Û·í¦a¤è«K (¦Ó¥B «öÁä¤Wªº¹Ï®×©M³o­Ó¥\¯à¬Û§k¦X)¡C ¥H¤Uªº ~/.fvwmrc ³]©w¥i§@¥X«e­zªº¥\¯à¡C Key F13 FTIWS A Iconify Key F14 FTIWS A RaiseLower Key F15 A A Menu Workplace Nop §Ú­n«ç»ò¼Ë¤~¯à±o¨ì OpenGL ªº 3D µwÅé¥[³t¥\¯à¡H 3D ¥[³t¥\¯àªº¦³µL¡Aµø§A©Ò¨Ï¥Îªº XFree86 ª©¥»»PÅã¥Ü´¹¤ù ªº«¬¸¹¦Ó©w¡C¦pªG§Aªº¬O NVIDIA ´¹¤ùªº¸Ü¡A½Ð¥h FreeBSD NVIDIA Driver Initiative ºô­¶¬Ý¬Ý¡A¨º¸Ì¦³¦b XFree86-4 ¤W¨Ï¥Î NVIDIA ´¹¤ùªº 3D ¥[³t¥\¯àªº°Q½×¡CXFree86-4 ¤Wªº¨ä¥¦Åã¥Ü¥d¼tµP µwÅé¥[³t¥\¯àªº¸ê°T¡A ¥]¬A Matrox G200/G400, ATI Rage 128/Radeon, 3dfx Voodoo 3, 4, 5, ¥H¤Î Banshee¡A¥i¦b XFree86-4 Direct Rendering on FreeBSD ºô­¶¤W§ä¨ì¡CXFree 3.3 ªº ¨Ï¥ÎªÌ¥i¥H¨Ï¥Î Utah-GLX port¡A¥¦¥i¥H¦b graphics/utah-glx §ä¨ì¡C ¨Ï¥Î¥¦¥i¥H¦b Matrox Gx00, ATI Rage Pro, SiS 6326, i810, Savage, ¥H¤Îªº NVIDIA ¤W±o¨ì¦³­­ªº OpenGL ¥[³t¡C
Biing Jong Lin
bjlin@stic.gov.tw
Networking §ÚÀ³¸Ó¨ì­þÃä§ä¦³ÃöµLºÏºÐ¶}¾÷ diskless booting ªº¸ê®Æ¡H Diskless booting ´N¬OÅý FreeBSD ¥D¾÷±qºô¸ô ¤W¶}¾÷¡A¨Ã¥B±qºô¸ô¤Wªº server ¤WŪ¨ú¨ä¥L¥²­nªºÀɮסA¦Ó«D¥Ñ¥D¾÷ ªºµwºÐ¤W¨ú±o³o¨ÇÀɮסC¸Ô²Óªº¸ê®Æ¥i¥H°Ñ¦Ò FreeBSD ¤â¥UªºµLºÏºÐ¶}¾÷½g ¡C FreeBSD ªº¥D¾÷¥i¥H·í§@¬Y­Óºô¸ô¤Wªº¸ô¥Ñ¾¹(router)¶Ü¡H ¬Oªº¡C½Ð°Ñ¦Ò FreeBSD ¤â¥Uªººô¸ô¶i¶¥½g advanced networking¡A¤×¨ä¬O¸ô¥Ñ»P¹h¹D¾¹ routing and gatewaysªº³¡¤À¡C §Ú¥i¥H³z¹L FreeBSD ±N§Úªº Win95 ¾÷¾¹³s¤W Internet ¶Ü¡H °ò¥»¤W¡A·|°Ý³oºØ°ÝÃDªº¤H¦b®a¸Ì¦Ü¤Ö¦³¨â¥x¹q¸£¡A¤@¥x¶] FreeBSD ¥t¥~¤@¥x¶] Win95¡F³o­Ó·Qªk¬O±N FreeBSD ¥D¾÷³s¤W Internet¡AµM«á³z ¹L³o¥x FreeBSD ¥D¾÷¡AÅý¶] Win95 ªº¹q¸£¯à°÷¤Wºô¡C³o­Ó°ÝÃDºâ¬O«e¤@ ­Ó°ÝÃDªº¤@­Ó¯S¨Ò ... µª®×¬O¡G¥i¥Hªº¡I¦b FreeBSD 3.x ª©¤¤¡A¨Ï¥ÎªÌ¼Ò¦¡(user-mode)ªº &man.ppp.8; ¥]§t¤F ¿ï¶µ¡C¦pªG§A¦b /etc/rc.conf ¨Ï¥Î¿ï¶µ¨Ã ³]©w gateway_enable ¬° YES ¡A¥H³oºØ³]©w±Ò°Ê &man.ppp.8; ¡A¨Ã¥B¥¿½Tªº³]©w§Aªº Windows ¥D¾÷ªº ¸Ü¡A³o­Ó°µªkÀ³¸Ó¬O¥i¥H¥¿±`¨Ï¥Îªº¡C Ãö©ó¥»¥DÃD§ó¸Ô²Óªº¸ê®Æ¥i¥H°Ñ¦Ò Steve Sims ©Ò¼¶¼gªº Pedantic PPP Primer ¤@¤å¡C ¦pªG§A¨Ï¥Îªº¬O®Ö¤ß¼Ò¦¡ (kernel-mode) PPP¡A©ÎªÌ§A¦³°Ï°ì³s½u (Ethernet connection) ¥i³q¹F Internet ªº¸Ü¡A§A±N»Ý­n¨Ï¥Î &man.natd.8;¡C½Ð¬d¾\ FAQ ¤¤Ãö©ó natd ªº³¡¤À¡C FreeBSD ¤ä´© SLIP ©M PPP ¶Ü¡H ¬Oªº¡C§A¥i¥H¬d¬d man pages ¤¤Ãö©ó &man.slattach.8;¡A &man.sliplogin.8;¡A&man.ppp.8;¡A¥H¤Î &man.pppd.8; ªº³¡¤À¡C &man.ppp.8; ¤Î &man.pppd.8; ´£¨Ñ¶i¥XÂù¦V³s½uªº¤ä´©¡A¥t¥~ &man.sliplogin.8; ±Mªù´£¨Ñ¶i¤J³s½uªº¤ä´©¡A¦Ó &man.slattach.8; ±Mªù´£¨Ñ¦V¥~³s½uªº¤ä´©¡C ¦pªG§A»Ý­n§ó¶i¤@¨Bªº¸ê®Æªº¸Ü,½Ð¬d¾\ FreeBSD ¤â¥U¤¤Ãö©ó PPP »P SLIP ªº»¡©ú¡C ¦pªG§A¥u¯à°÷¹L shell account ³s½u¨ì Internet ªº¸Ü¡A§A¤]³\¥i¥H¸Õ¸Õ net/slirp ³o­Ó®M¥óµ{¦¡¡C³o­Ó®M¥óµ{¦¡¥i¥H´£¨Ñ§Aªº¹q¸£ª½±µ³s¤W¬Y¨Ç(­­©wªº)ªA°È ³s½u¡A¦p ftp ¤Î http µ¥µ¥¡C FreeBSD ¤ä´© NAT ©Î Masquerading ¶Ü¡H ¦pªG§A¦³¤@­ÓªñºÝªº¤lºô¸ô(¦³¤@¥x¥H¤Wªº¾÷¾¹)¡A¦ý¬O§Aªº Internet provider «o¥u¤À°t¤@­Ó IP number µ¹§A(©ÎªÌ§A¥u¤À°t¨ì¤@­Ó °ÊºAªº IP number)¡A§A¥i¥H°Ñ¦Ò &man.natd.8; ³o­Óµ{¦¡¡C &man.natd.8; Åý§A¥i¥H³z¹L³o¤@­Ó IP number Åý¾ã­Ó¤lºô¸ôªº¹q¸£³£¯à³s¤W internet¡C &man.ppp.8; ³o­Óµ{¦¡¤]´£¨ÑÃþ¦üªº¥\¯à¡A¦pªG§A«ü©w ¿ï¶µ¡Calias library (&man.libalias.3;) ¦b³o¨â­Ó³B²z¤è¦¡¤¤³£·|³Q¨Ï¥Î¨ì¡C §Ú¦p¦ó±N¨â¥x FreeBSD ¥D¾÷¥Î¥­¦æ°ð (parallel line) ³z¹L PLIP ³s½u¡H ½Ð°Ñ¦Ò¤â¥U¤¤Ãö©ó PLIP section ªº³¡¤À¡C §Ú¨S¦³¿ìªk«Ø¥ß /dev/ed0 ³o­Ó device¡A ¬°¤°»ò¡H ¦]¬°¤£»Ý­n¡I¦b Berkeley ºô¸ô¬[ºc¤¤¡A¥u¦³ kernel µ{¦¡½X¥i¥Hª½ ±µ¦s¨úºô¸ô¬É­±¥d¡C½Ð°Ñ¦Ò /etc/rc.network ³o ­ÓÀɮשM manual pages ¨ú±o»P¨ä¥L¤£¦Pºô¸ôµ{¦¡¡C§ó¶i¤@¨Bªº¸ê°T¡G¦p ªG§Aı±o§A§¹¥þ·d²V¤Fªº¸Ü¡A±zÀ³¸Ó§ä¤@¥»»P¨ä¥L BSD ¬ÛÃö§@·~¨t²Îºô¸ô ºÞ²z¦³Ãö®Ñ¨Ó°Ñ¦Ò¡F°£¤F¤Ö¼ÆÅãµÛªº¤£¦P¥~¡AFreeBSD ªººô¸ôºÞ²z°ò¥»¤W©M SunOS 4.0 ©M Ultrix ¬O¤@¼Ëªº¡C §Ú¦p¦ó«Ø¥ß Ethernet aliases¡H ¦pªG§Aªº alias ¦ì§}¸ò§A¥Ø«eºô¸ô¤¶­±ªº¦ì§}¦b¦P¤@­Ó¤lºô¸ô¤Uªº ¸Ü¡A¥[¤J¤@­Ó netmask 0xffffffff ¦b§Aªº &man.ifconfig.8; command-line¡A½d¨Ò¦p¤U¡G &prompt.root; ifconfig ed0 alias 192.0.2.2 netmask 0xffffffff ¤£µMªº¸Ü¡A´N¦p¦P¥[¤J¤@­Ó·sªººô¸ô¦ì§}¤@¼Ë¿é¤J§Aªººô¸ô¦ì§}»P¤l ºô¸ô¾B¸n¡G &prompt.root; ifconfig ed0 alias 172.16.141.5 netmask 0xffffff00 §Ú¦p¦ó«ü©w§Úªº 3C503 ¨Ï¥Î¨ä¥L¤£¦Pªºªº network port¡H ¦pªG±z·Q¨Ï¥Î¨ä¥Lªº port¡A§A¥²¶·¦b &man.ifconfig.8; ªº©R¥O¤¤ «ü©wÃB¥~ªº°Ñ¼Æ¡C¤º©wªº port ¬O link0¡C­n¨Ï¥Î AUI port ¥N´À BNC port ªº¸Ü¡A§ï¥Î link2¡C³o¨Ç flags À³¸Ó§ïÅÜifconfig_* ªºÅܼƨӫü©w¡A §A¥i¥H¦b /etc/rc.conf ³o­ÓÀɮ׸̭±§ä¨ì (½Ð°Ñ¦Ò &man.rc.conf.5;)¡C ¬°¤°»ò§Ú¦b¨Ï¥Î FreeBSD ªº NFS ®É¥X²{°ÝÃD¡H §Ú­Ì¥Î§t»W¤@ÂIªº»¡ªk¡A¬Y¨Ç PC ªººô¸ô¥d¤ñ¨ä¥Lªº¦n¡A³oºØª¬ªp¦b ³y¦¨ NFS ³oºØ¹ïºô¸ô±Ó·Pªºµ{¦¡¦³®É·|¥X²{°ÝÃD¡C °Ñ¦Ò the Handbook entry on NFS ¥HÀò±o³o­Ó¥DÃDªº§ó¦h¸ê°T¡C ¬°¤°»ò§Ú¤£¯à NFS-mount Linux ªº¾÷¾¹¡H ¬Y¨Çª©¥»ªº Linux NFS µ{¦¡½X¥u±µ¨ü privileged port ªº mount request¡F¸Õ¥Î³o¦æ«ü¥O¬Ý¬Ý &prompt.root; mount -o -P linuxbox:/blah /mnt ¬°¤°»ò§Ú¤£¯à NFS-mount Sun ªº¾÷¾¹¡H ¶] SunOS 4.X ªº Sun ¤u§@¯¸¥u±µ¨ü¨Ó¦Û privileged port ªº mount request¡F¸Õ¥Î³o¦æ«ü¥O¬Ý¬Ý &prompt.root; mount -o -P sunbox:/blah /mnt ¬°¤°»ò mountd ¤@ª½°­¥s»¡ can't change attributes ¦Ó¥B§Ú¤@ª½¬Ý¨ì bad exports list ³o­Ó°T®§¦b§Úªº FreeBSD NFS ¦øªA¾¹¤W¡H ³o­Ó°ÝÃD³Ì±`µo¥Íªº­ì¦]¬O¦b©ó¤£¤F¸Ñ /etc/exports ªº¥¿½T®æ¦¡¡C½Ð¸ÔŪ &man.exports.5; ¥H¤Î¤â¥U¤¤Ãö©ó NFS ªº³¡¤À¡A¯S§O¬Oconfiguring NFS³o¤@¬q¡C ¬°¤°»ò§Ú¦b¨Ï¥Î PPP ³s½u¨ì NeXTStep ¾÷¾¹®É¦³°ÝÃD¡H §â TCP extensions ¨ú®ø¡A³o­Ó³]©w¦b /etc/rc.conf ¸Ì­±(°Ñ¦Ò &man.rc.conf.5;) §â ¥H¤U³o­Ó­È³]¦¨ NO¡G tcp_extensions=NO Xylogic ªº Annex ¥D¾÷¤]¦³¬Û¦Pªº°ÝÃD¡A±z­n°µ¬Û¦Pªº­×§ï¤~¯à³s ¤W³o¨Ç¥D¾÷¡C §Ú­n«ç¼Ë¤~¯à§â IP multicast support ¥´¶}¡H FreeBSD 2.0 ¥H«áªºª©¥»¤º©w³£¦³ ¤ä´© Multicast host ¾Þ§@¡C¦pªG ±z·Q±N±zªº¥D¾÷³]©w¦¨ multicast router ªº¸Ü¡A±z¥²¶·­«·s compile ±z ªº kernel¡A¥[¤J MROUTING ªº¿ï¶µ¡A¨Ã¥B°õ¦æ &man.mrouted.8; FreeBSD 2.2 ¤Î¤§«áªºª©¥»·|¦b¶}¾÷®É°õ¦æ &man.mrouted.8; ¦pªG¦b /etc/rc.conf ¤¤ mrouted_enable ³]©w¬° "YES" MBONE ªº¦UºØ¤u¨ã¥i¥H¦b¥L­Ì ports ¤U©ÒÄÝ¥s°µ mbone ¥Ø¿ý ¤¤§ä¨ì¡C¦pªG±z¦b§äµø°T·|ijªº¤u¨ã¦p vic ¥H¤Î vatªº¸Ü¡A¨ì¨ºÃä§ä§ä§a¡I ­þ¨Çºô¸ô¥d¬O¨Ï¥Î DEC PCI chipset¡H ¥H¤U¬O Glen Foster gfoster@driver.nsta.org ´£¨Ñªº²M³æ¡G Network cards based on the DEC PCI chipset Vendor Model ASUS PCI-L101-TB Accton ENI1203 Cogent EM960PCI Compex ENET32-PCI D-Link DE-530 Dayna DP1203, DP2100 DEC DE435, DE450 Danpex EN-9400P3 JCIS Condor JC1260 Linksys EtherPCI Mylex LNP101 SMC EtherPower 10/100 (Model 9332) SMC EtherPower (Model 8432) TopWare TE-3500P Znyx (2.2.x) ZX312, ZX314, ZX342, ZX345, ZX346, ZX348 Znyx (3.x) ZX345Q, ZX346Q, ZX348Q, ZX412Q, ZX414, ZX442, ZX444, ZX474, ZX478, ZX212, ZX214 (10mbps/hd)
¬°¤°»ò­n¥Î FQDN ¤~¯à³s¨ì¨ä¥L¾÷¾¹¡H §A¤]³\·|µo²{­n³sªº¾÷¾¹¨ä¹ê¬O¦b¥t¤@­Óºô°ì¡CÁ|­Ó¨Ò¤l¡A°²³]§A¬O¦b foo.bar.edu ³o­Óºô°ì¤¤¡A·Q­n³s¨ì¦b¤@¥x¥s mumble ªº¥D¾÷¡A¥L¦b example.org ºô°ì¤U¡A §A¥²¶·¥Î Fully-Qualified Domain Name mumble.example.org¡A¦Ó¤£¬O¥u¥Î mumble¡C ¶Ç²Îªº BSD BIND resolver ¤¹³\¥Î³oºØ¤è¦¡¸Ñ¥X¾÷¾¹ªº¦ì§}¡A¦ý¬O FreeBSD ¤ºªþ bind (see &man.named.8;) ª©¥»¤º©w¤è¦¡¡A«h¬O°£¤F§A©Ò¦bªººô°ì¥H¥~¡A¤£¤ä´©¨ä¥L«D FQDN ªºÁY¼g¡C ©Ò¥H¦p mumble ¥²¶·¦b mumble.foo.example.org¡A§_«h´N·|±qºô°ìªº³Ì©³ ¼h¶}©l§ä¡C ³o©M¥ý«eªº°µªk¤£¦P¡A¤]´N¬O¤£¥Î mumble.example.org¡A©M mumble.edu Ä~Äò·j´M¡C ¬Ý¤@¤U RFC 1535¡A¸Ì­±¦³´£¨ì¬°¤°»ò¤§«eªº°µªk¤£¦n¡A¬Æ¦Üºâ¬O­Ó¦w¥þ º|¬}¡C ³o¸Ì¦³­Ó¤£¿ùªº¸Ñªk, §A¥i¥H¥[¤J¤@¦æ search foo.example.org example.org instead of the previous domain foo.example.org ¦b§Aªº /etc/resolv.conf Àɮפ¤ (½Ð°Ñ¦Ò &man.resolv.conf.5;)¡C¦ý¬O­n½T©w·j´M¶¶§Ç¤£·|¹H¤Ï RFC 1535 ©Ò¿×ªº boundary between local and public administration¡C ¬°¤°»ò§Ú¦b³s½u®É¤@ª½¥X²{ Permission denied ªº¿ù»~°T®§¡H ¦pªG¦b½sĶ kernel ®É¥[¤J IPFIREWALL ¿ï¶µ¡A ½Ðª`·N 2.1.7R ¤º©w¬O©Úµ´©Ò¦³¥¼¸g®Ö­ãªººô¸ô«Ê¥](¦ý¦b¶}µo 2.1-STABLE ®É§ï±¼¤F)¡C I¦pªG¤£¤p¤ß§Ë¿ù¤F firewall ªº³]©w¡A§A¥i¥H¥H root °õ¦æ¥H¤U©R¥Oºô¸ô¥\¯à´N·|«ì´_¥¿±`¡G &prompt.root; ipfw add 65534 allow all from any to any ¤]¥i¥H¦b /etc/rc.conf ¥[¤J firewall_type="open" ªº¿ï¶µ¡C ¦pªG·Qª¾¹D¦p¦ó³]©w FreeBSD firewall¡A½Ð°Ñ¦Ò ¤â¥U¤¤¬ÛÃö³¹¸`¡C IPFW ·|³y¦¨¦h¤jªººô¸ô©µ¿ð¡H ½Ð°Ñ¦Ò¤â¥U¤¤ Firewalls ³¹¸`¡A¯S§O¬O IPFW Overhead & Optimization ³o¤@¬q¡C ¬°¤°»ò§Úªº ipfw fwd redirect ³W«h±NªA°ÈÂà¦V¨ä¥L¾÷¾¹®ÉµLªk¥¿±`¹B§@¡H ¥i¯à¬O§A°£¤FÂà°e«Ê¥]¥H¥~ÁÙÃB¥~·Q¶i¦æ¦ì§}ÂàĶ (network address translation, NAT)¡Afwd ³W«h©Ò¶i ¦æªº°Ê§@´N¦p¦P¦r­±©Ò¥Ü¡F¶ÈÂà°e«Ê¥]¡A¥¦¨Ã¤£·|¥h­×§ï«Ê¥]¤¤ªº¸ê®Æ¡C °²³]§Ú­Ì¦³¦p¤Uªº³W«h¡G 01000 fwd 10.0.0.1 from any to foo 21 ·í¤@­Ó³q©¹¯S©w¥Ø¼Ð¦ì§} foo ªº«Ê¥] °e¹F¥D¾÷®É¡A®Ú¾Ú³o±ø³W«h¡A«Ê¥]±N³QÂà°e¦Ü 10.0.0.1¡A¦ý¬O¥¦ªº¥Ø¼Ð¦ì§}«o¤´µM¬O foo¡I«Ê¥]ªº¥Ø¼Ð¦ì§}¨Ã ¨S¦³ §ó§ï¬° 10.0.0.1¡C¤j³¡¤Àªº¥D¾÷·|±N«Ê¥]¥á±ó¡A ¦]¬°¥L­Ì¨Ã¤£¬O³o­Ó¥Ø¼Ð¦ì§}¡C¦]¦¹¡A¨Ï¥Î fwd ³W«h ®É©¹©¹¤£¦p¨Ï¥ÎªÌ©Ò¹w´Áªº¨º¯ë¶¶§Q¡C³oºØ¦æ¬°¬O¨t²Î¯S©Ê¡A¦Ó«D¿ù»~¡C °Ñ¦Ò Ãö©óªA°ÈÂà¦Vªº±`¨£°Ý µª¶°¡A &man.natd.8; ¤â¥U¡A©ÎªÌ¬O¨Ï¥Î ports collection ¤¤³\ ¦hªA°ÈÂà¦Vªº¤u¨ã¨Ó¥¿½Tªº§¹¦¨§A·Q¶i¦æªº¤u§@¡C ­n¦p¦ó§â¹ï¬Y¥x¾÷¾¹ªººô¸ôªA°È­n¨D(service request)Âà¦V¨ì¥t¤@¥x¡H ¦b ports ¥Ø¿ýªºsysutils¤ÀÃþ¤¤¦³­Ó¥s socket ªº®M¥ó¡A¥i¥HÀ°§AÂà¦V FTP ©Î¨ä¥LÃþ¦üªº ºô¸ôªA°È¡C¥u­n§â¸Óºô¸ôªA°Èªº©R¥O§ï¦¨©I¥s socket §Y¥i¡A¦p¤U©Ò¥Ü¡G ftp stream tcp nowait nobody /usr/local/bin/socket socket ftp.example.com ftp ¨ä¤¤ ftp.example.com »P ftp ¤À§O¬O³QÂà¨ìªº¾÷¾¹©M port ¦WºÙ¡C ¨º¸Ì¥i¥H§ä¨ìºÞ²zÀW¼eªº¤u¨ã¡H FreeBSD ¤W¦³¤T®MÀW¼eºÞ²z¤u¨ã¡G &man.dummynet.4; ¤w¸g¾ã¦X¶i¤J FreeBSD ¨t²Î(§ó¸Ô²Óªº¥Î³~, &man.ipfw.4;); ALTQ ¥i¥H§K¶O¨Ï¥Î¡AEmerging Technologies ±À¥Xªº Bandwidth Manager «h¬O°Ó¥Î³nÅé¡C «ç»ò·|¶]¥X /dev/bpf0: device not configured³o­Ó°T®§¡H §A°õ¦æ¤F¤@­Ó»Ý­n¬f§JµÜ«Ê¥]¹LÂo¾¹ (Berkeley Packet Filter) ªº µ{¦¡ (&man.bpf.4;)¡A¦ý¬O§A¦b kernel ¤¤¨S¦³±Ò°Ê¥¦¡C§â¤U­±³o¤@¦æ¥[ ¤J kernel ³]©wÀɤ¤¡A½sͤ@­Ó·sªº kernel¡G pseudo-device bpf # Berkeley Packet Filter ¦b­«·s¶}¾÷¤§«á¡AÁÙ­n°µ¥X device node¡A¦b /dev ¤U°õ¦æ¡G &prompt.root; sh MAKEDEV bpf0 ¦pªG·Q­n§ó¶i¤@¨Bª¾¹D¦p¦ó°µ¥X¦UºØ device node¡A½Ð°Ñ¾\ Handbook Ãö©ó¶gÃä¸`ÂIªº»¡©ú ¡C §Ú­n«ç¼Ë¤~¯à±N Windows ¾÷¾¹¤¤ªººÏºÐ±¾¤J¨t²Î, ´N¹³ Linux ´£¨Ñ ªº smbmount ¨º¼Ë¡H ¨Ï¥Î SMBFS ¤u¨ã²Õ¡C³o®M¤u¨ã²Õ¤¤ ¥]§t¤F¤@¨t¦Cªº kernel ­×§ïÁÙ¦³¨Ï¥ÎªÌªº¤u¨ãµ{¦¡(userland programs)¡C ³o¨Çµ{¦¡©M¸ê°T¦b ports ¦¬Âä¤ net/smbfs ¤U¥i¥H§ä¨ì¡C¦b 4.5-RELEASE ¤§«áªºª©¥»«h¬O¨t²Î¤¤¤º«Ø¡C §Ú¦b¨t²Î¤é»x¤¤µo²{¥H¤U°T®§¡G icmp-response bandwidth limit 300/200 pps¡A³o¬O ½¼¦Ì¸J¿|¡H ³o¬O¨t²Î®Ö¤ß§i¶D§A¦³¬Y¨Ç¬¡°Ê¤Þµo¥¦°e¥X¤ñ¥¦©Ò»{¬°À³¸Ó°e¥X§ó ¦hªº ICMP ©Î TCP ­«¸m°T®§ (RST)¡CICMP ¦^À³°T®§±`±`¬O¦]¬°¦³¤H¹Á ¸Õ³s±µ¥¼³Q¨Ï¥Îªº UDP ³q°T°ð¡CTCP ­«¸m°T®§«h¬O¦³¤H¹Á¸Õ³s±µ¥¼¶} ©ñ TCP ³q°T°ð³y¦¨ªºµ²ªG¡C¥H¤U³o¨Ç¬¡°Ê¥i¯à´N¬O³y¦¨³o¨Ç°T®§ªº­ì¦]¡G ¼É¤OªkªºªA°È²Õµ´§ðÀ»(DoS)¤è¦¡ (¬Û¸û©ó°w¹ï¯S®í®zÂI¨Ï¥Î³æ¤@«Ê¥]ªº§ðÀ»¤è¦¡)¡C ¤j¶qªº³q°T°ð±½´y(¬Û¸û©ó¶È¹Á¸Õ¤Ö¼Æªº±`¨£ªA°È³q°T°ð)¡C ¥X²{ªº¼Æ¦r¤¤²Ä¤@­Ó¥Nªí®Ú¾Ú³o¨Ç¬y¶q kernel À³¸Ó°e¥Xªº«Ê¥]¼Æ¡A ²Ä¤G­Ó¼Æ¦r«h¬O kernel ¥Ø«e­­¨î³Ì¤jµo°e¼Æ¡C§A¥i¥H§Q¥Î sysctl ­×§ï net.inet.icmp.icmplim ÅܼƭȨӧó§ï³Ì¤j­È¡CÁ| ¨Ò¨Ó»¡,¦pªG§Æ±æ­×§ï­­¨î¬° 300 packets per second¡G &prompt.root; sysctl -w net.inet.icmp.icmplim=300 ¦pªG§A¤£·Q¦b¨t²Î¬ö¿ý¤¤¬Ý¨ì³o¨Ç°T®§¡A¦ý¬O¤´µM§Æ±æ«O«ù¦^À³ªº­­ ¨îªº¸Ü¡A§A¥i¥H§Q¥Î sysctl ­×§ï net.inet.icmp.icmplim_output ÅܼƨӨú®ø³o¨Ç°T ®§¡G &prompt.root; sysctl -w net.inet.icmp.icmplim_output=0 ³Ì«á¡A¦pªG§A·Q¨ú®ø³o¨Ç­­¨îªº¸Ü¡A§A¥i¥H³]©w net.inet.icmp.icmplim (¦p¤W¨Ò©Ò¥Ü) ¬° 0¡C°ò©ó¤W­z²z¥Ñ¡A§Ú­Ì¤£«ØÄ³§A¨ú®ø³o¨Ç­­¨î¡C ³o­Ó¿ù»~°T®§ arp: unknown hardware address format ¬O¤°»ò·N«ä¡H ³o¥Nªí§Aªº°Ï°ìºô¸ô³s½u¤W¦³¤@¨Ç³]³Æ¨Ï¥Î FreeBSD ¬Ý¤£À´±o MAC ®æ¦¡¡C³o³q±`¬O¥Nªí¦³¤H¦b§Aªº°Ï°ìºô¸ô¤W¶i¦æ¹êÅç¡A³Ì±`¨£ªº´N¬O cable modem ªº³s½u¡C³o°T®§µL®`¡A¦Ó¥BÀ³¸Ó¤£¦Ü©ó¼vÅT¨ì FreeBSD ¥D ¾÷ªº®Ä¯à¡C §Ú­è­è¸Ë¦n CVSup ®M¥ó¡A¦ý¬O¦b¹Á¸Õ°õ¦æ®Éµo¥Í¤F¿ù»~¡A­n«ç»ò¿ì¡H ­º¥ý¡A¬Ý¬Ý¿ù»~ªº°T®§¬O§_¦p¤U¡G /usr/libexec/ld-elf.so.1: Shared object "libXaw.so.6" not found ³oºØ¿ù»~°T®§¥Nªí§A¥D¾÷¤W¦w¸Ëªº net/cvsup ¨S¦³¥]§t XFree86 ®M¥ó¡C¦pªG§A·Q­n¨Ï¥Î CVSup ¤º«Øªº¹Ï§Î¤¶­± GUI ªº¸Ü¡A§A»Ý­n¦w¸Ë XFree86¡C¦¹¥~¡A¦pªG§A¥u·Q¥H©R¥O¦C¤è ¦¡¨Ï¥Î CVSup ªº¸Ü¡A§AÀ³¸Ó¥ý²¾°£¤§«e ¦w¸Ëªº®M¥ó¡C¨Ã¦w¸Ë net/cvsup-without-gui ³o®M ³nÅé¡C¦b FreeBSD ¤â¥U¤¤ CVSup ¬q¸¨¤¤¦³§ó¸Ô²Óªº»¡©ú¡C
Biing Jong Lin
bjlin@stic.gov.tw
Security BIND (named) °£¤F¦b³q°T°ð 53 ¥H¥~¤]¦b ¨ä¥L°ª½s¸¹³q°T°ð (high-numbered port) ²âÅ¥ (Listen)¡C ³o¬O«ç»ò¦^¨Æ¡H FreeBSD 3.0 «áªºª©¥»¨Ï¥Î¤@­Ó¯S®íªº BIND ª©¥»¡A³o­Óª©¥»·|¨Ï ¥ÎÀH¾÷ªº°ª½s¸¹³q°T°ð¨Ó¦^À³¥~³¡ªº¬d¸ß¡C¦pªG§A¦]¬°­n¾A¦X¨¾¤õÀ𪺠³]©w©Î¬O³æ¯Âªº·QÅý¦Û¤v¬Ý¨ÓµÎªA¤@ÂI¦Ó·Q¥Î 53 ³q°T°ð¦^À³¥~³¡¬d¸ß¡A ¨º»ò§A¥i¥H¹Á¸Õ§ó§ï¥H¤UÀɮ׬ÛÃö¤º®e /etc/namedb/named.conf¡G options { query-source address * port 53; }; §A¤]¥i¥H±N * §ó§ï¬°¯S©w IP address¡A ÂÇ¥H¥[±j±±¨î±ø¥ó¡C ¶¶«K®¥³ß§A¡C¯à°÷Ū¨ú§A¨t²Î¤Wªº &man.sockstat.1; ³ø§i¨Ã¥Bª`·N ¤£¥¿±`ª¬ªp¬O¤@¥ó¦n¨Æ¡I Sendmail °£¤F¦b¼Ð·Çªº³q°T°ð 25 ¥~¤]¦b³q°T°ð 587 ²âÅ¥¡I³o¬O«ç »ò¦^¨Æ¡H ¸û·sª©¥»ªº Sendmail ¤ä´© mail submission ³o¶µ¥\¯à¡A¨Ã¥B¨Ï ¥Î³q°T°ð 587¡C³o¶µ¥\¯àÁÙ¨S¦³³Q¼sªx¤ä´©¦ý¬O¤ä´©ªº¼Æ¥Ø¥¿¦b¼Wªø ¤¤¡C §Úµo²{¤F³o­Ó UID 0 toor ±b¸¹¡A³o¬O¤°»ò ¸J¿|¡H§Ú³Q¶Â±¼¤F¶Ü¡H ©ñ¤ß¡Ctoor ¬O¤@­Ó alternative ºÞ²zªÌ±b¸¹ (toor ¬O root ªºÂà¦V«÷ªk)¡C ¥H©¹¬O¸òÀH &man.bash.1; ¦w¸Ë¦Ó«Ø¨îªº¡A«á¨Ó«h¦¨¬°¨t²Î¤º©w«Ø¨îªº¤@ ­Ó±b¸¹¡C³o­Ó±b¸¹±N¦ñÀH¤@­Ó«D¼Ð·Çªº shell ´ú¸Õ¨Ï¥Î¡A Åý§A¤£»Ý­n¥h §ó§ï¨ì root ªº¤º«Ø shell¡C¦]¬°³o¨Ç¨ä¥Lªº shell ¨Ã¨S¦³¸òÀH¨t²Î¹w³]­È¦w¸Ë (Á|¨Ò¨Ó»¡¡A¬Y¨Ç¥Ñ ports ¦w¸Ëªº shell package)¡A¦Ó³Q¤º©w¦w¸Ë¦b /usr/local/bin ¥Ø¿ý¤U¡A¦³¥i¯à¦s¦b¤£¦PªºÀɮרt²Î¤¤¡C ­Õ­Y root ªº shell ³Q©ñ¦b /usr/local/bin¡A¥B /usr (©Î¬O¨ä¥L¥]§tµÛ /usr/local/bin ³o­Ó¤l¥Ø¿ýªºÀɮרt²Î) ¦]¬°¬Y¨Ç­ì¦]¨Ã¨S¦³³Q¥¿±`ªº mount °_¨Óªº¸Ü¡Aroot ±NµLªk¥¿±`ªºµn¤J¨t²Î¶i¦æºû­× (ÁöµM»¡§A­«¶}¾÷¦¨³æ¤H¼Ò¦¡´N·|°Ý§A­n ¸ü¤J­þ­Ó shell)¡C ¦³¨Ç¤H¨Ï¥Î toor ±b¸¹¶i¦æ¨C¤éªº root ºûÅ@¤u§@¡A¦p¦¹¥i¥H¨Ï¥Î«D¼Ð·Çªº shell¡A¦Ó root ¥i¥H«O¯d¼Ð·Ç shell¡A ¥H¦]À³³æ¤@¨Ï¥ÎªÌ¼Ò¦¡ (single user mode) ©Îºò«æª¬ªp³B²z¡C ¨Ì·Ó¨t²Î¤º©w­È¡A§A±NµLªk¨Ï¥Î toor µn¤J¡A ¦]¬°³o­Ó±b¸¹©|¥¼§ó§ï±K½X³]©w¡C¦]¦¹§A¦pªG§A·Q±Ò°Ê³o­Ó±b¸¹¡A§A»Ý­n ¨Ï¥Î root µn¤J¨t²Î¨Ã¥B­×§ï toor ªº±K½X¡C ¬°¤°»ò suidperl µLªk¥¿±`¹B§@¡H ¦]¬°¬Y¨Ç¦w¥þªº¦Ò¡Asuidperl ¤º©wªº¦w¸Ë ¨Ã¨S¦³³]©w suid bit¡C¨t²ÎºÞ²zªÌ¥i¥H¨Ì·Ó¥H¤U©R¥O±Ò°Ê suid ³]©w¡C &prompt.root; chmod u+s /usr/bin/suidperl ¦pªG§A·Q­n¦b¥Ñ source ¤É¯Å®É suidperl ¤º©w ±Ò°Ê suid ¥\¯àªº¸Ü¡A½s¿è /etc/make.conf ¥[¤J ENABLE_SUIDPERL=true µM«á°õ¦æ make buildworld¡C
PPP I cannot make &man.ppp.8; work. What am I doing wrong? You should first read the &man.ppp.8; man page and the PPP section of the handbook. Enable logging with the command set log Phase Chat Connect Carrier lcp ipcp ccp command This command may be typed at the &man.ppp.8; command prompt or it may be entered in the /etc/ppp/ppp.conf configuration file (the start of the default section is the best place to put it). Make sure that /etc/syslog.conf (see &man.syslog.conf.5;) contains the lines !ppp *.* /var/log/ppp.log and that the file /var/log/ppp.log exists. You can now find out a lot about what is going on from the log file. Do not worry if it does not all make sense. If you need to get help from someone, it may make sense to them. If your version of &man.ppp.8; does not understand the set log command, you should download the latest version. It will build on FreeBSD version 2.1.5 and higher. Why does &man.ppp.8; hang when I run it? This is usually because your hostname will not resolve. The best way to fix this is to make sure that /etc/hosts is consulted by your resolver first by editing /etc/host.conf and putting the hosts line first. Then, simply put an entry in /etc/hosts for your local machine. If you have no local network, change your localhost line: 127.0.0.1 foo.bar.com foo localhost Otherwise, simply add another entry for your host. Consult the relevant man pages for more details. You should be able to successfully ping -c1 `hostname` when you are done. Why will &man.ppp.8; not dial in -auto mode? First, check that you have got a default route. By running netstat -rn (see &man.netstat.1;), you should see two entries like this: Destination Gateway Flags Refs Use Netif Expire default 10.0.0.2 UGSc 0 0 tun0 10.0.0.2 10.0.0.1 UH 0 0 tun0 This is assuming that you have used the addresses from the handbook, the man page or from the ppp.conf.sample file. If you do not have a default route, it may be because you are running an old version of &man.ppp.8; that does not understand the word HISADDR in the ppp.conf file. If your version of &man.ppp.8; is from before FreeBSD 2.2.5, change the add 0 0 HISADDR line to one saying add 0 0 10.0.0.2 Another reason for the default route line being missing is that you have mistakenly set up a default router in your /etc/rc.conf (see &man.rc.conf.5;) file (this file was called /etc/sysconfig prior to release 2.2.2), and you have omitted the line saying delete ALL from ppp.conf. If this is the case, go back to the Final system configuration section of the handbook. What does No route to host mean? This error is usually due to a missing MYADDR: delete ALL add 0 0 HISADDR section in your /etc/ppp/ppp.linkup file. This is only necessary if you have a dynamic IP address or do not know the address of your gateway. If you are using interactive mode, you can type the following after entering packet mode (packet mode is indicated by the capitalized PPP in the prompt): delete ALL add 0 0 HISADDR Refer to the PPP and Dynamic IP addresses section of the handbook for further details. Why does my connection drop after about 3 minutes? The default PPP timeout is 3 minutes. This can be adjusted with the line set timeout NNN where NNN is the number of seconds of inactivity before the connection is closed. If NNN is zero, the connection is never closed due to a timeout. It is possible to put this command in the ppp.conf file, or to type it at the prompt in interactive mode. It is also possible to adjust it on the fly while the line is active by connecting to ppps server socket using &man.telnet.1; or &man.pppctl.8;. Refer to the &man.ppp.8; man page for further details. Why does my connection drop under heavy load? If you have Link Quality Reporting (LQR) configured, it is possible that too many LQR packets are lost between your machine and the peer. Ppp deduces that the line must therefore be bad, and disconnects. Prior to FreeBSD version 2.2.5, LQR was enabled by default. It is now disabled by default. LQR can be disabled with the line disable lqr Why does my connection drop after a random amount of time? Sometimes, on a noisy phone line or even on a line with call waiting enabled, your modem may hang up because it thinks (incorrectly) that it lost carrier. There is a setting on most modems for determining how tolerant it should be to temporary losses of carrier. On a USR Sportster for example, this is measured by the S10 register in tenths of a second. To make your modem more forgiving, you could add the following send-expect sequence to your dial string: set dial "...... ATS10=10 OK ......" Refer to your modem manual for details. Why does my connection hang after a random amount of time? Many people experience hung connections with no apparent explanation. The first thing to establish is which side of the link is hung. If you are using an external modem, you can simply try using &man.ping.8; to see if the TD light is flashing when you transmit data. If it flashes (and the RD light does not), the problem is with the remote end. If TD does not flash, the problem is local. With an internal modem, you will need to use the set server command in your ppp.conf file. When the hang occurs, connect to &man.ppp.8; using &man.pppctl.8;. If your network connection suddenly revives (PPP was revived due to the activity on the diagnostic socket) or if you cannot connect (assuming the set socket command succeeded at startup time), the problem is local. If you can connect and things are still hung, enable local async logging with set log local async and use &man.ping.8; from another window or terminal to make use of the link. The async logging will show you the data being transmitted and received on the link. If data is going out and not coming back, the problem is remote. Having established whether the problem is local or remote, you now have two possibilities: The remote end is not responding. What can I do? There is very little you can do about this. Most ISPs will refuse to help if you are not running a Microsoft OS. You can enable lqr in your ppp.conf file, allowing &man.ppp.8; to detect the remote failure and hang up, but this detection is relatively slow and therefore not that useful. You may want to avoid telling your ISP that you are running user-PPP... First, try disabling all local compression by adding the following to your configuration: disable pred1 deflate deflate24 protocomp acfcomp shortseq vj deny pred1 deflate deflate24 protocomp acfcomp shortseq vj Then reconnect to ensure that this makes no difference. If things improve or if the problem is solved completely, determine which setting makes the difference through trial and error. This will provide good ammunition when you contact your ISP (although it may make it apparent that you are not running a Microsoft product). Before contacting your ISP, enable async logging locally and wait until the connection hangs again. This may use up quite a bit of disk space. The last data read from the port may be of interest. It is usually ascii data, and may even describe the problem (Memory fault, core dumped?). If your ISP is helpful, they should be able to enable logging on their end, then when the next link drop occurs, they may be able to tell you why their side is having a problem. Feel free to send the details to &a.brian;, or even to ask your ISP to contact me directly. &man.ppp.8; has hung. What can I do? Your best bet here is to rebuild &man.ppp.8; by adding CFLAGS+=-g and STRIP= to the end of the Makefile, then doing a make clean && make && make install. When &man.ppp.8; hangs, find the &man.ppp.8; process id with ps ajxww | fgrep ppp and run gdb ppp PID. From the gdb prompt, you can then use bt to get a stack trace. Send the results to brian@Awfulhak.org. Why does nothing happen after the Login OK! message? Prior to FreeBSD version 2.2.5, once the link was established, &man.ppp.8; would wait for the peer to initiate the Line Control Protocol (LCP). Many ISPs will not initiate negotiations and expect the client to do so. To force &man.ppp.8; to initiate the LCP, use the following line: set openmode active It usually does no harm if both sides initiate negotiation, so openmode is now active by default. However, the next section explains when it does do some harm. I keep seeing errors about magic being the same. What does it mean? Occasionally, just after connecting, you may see messages in the log that say magic is the same. Sometimes, these messages are harmless, and sometimes one side or the other exits. Most PPP implementations cannot survive this problem, and even if the link seems to come up, you will see repeated configure requests and configure acknowledgments in the log file until &man.ppp.8; eventually gives up and closes the connection. This normally happens on server machines with slow disks that are spawning a getty on the port, and executing &man.ppp.8; from a login script or program after login. I have also heard reports of it happening consistently when using slirp. The reason is that in the time taken between &man.getty.8; exiting and &man.ppp.8; starting, the client-side &man.ppp.8; starts sending Line Control Protocol (LCP) packets. Because ECHO is still switched on for the port on the server, the client &man.ppp.8; sees these packets reflect back. One part of the LCP negotiation is to establish a magic number for each side of the link so that reflections can be detected. The protocol says that when the peer tries to negotiate the same magic number, a NAK should be sent and a new magic number should be chosen. During the period that the server port has ECHO turned on, the client &man.ppp.8; sends LCP packets, sees the same magic in the reflected packet and NAKs it. It also sees the NAK reflect (which also means &man.ppp.8; must change its magic). This produces a potentially enormous number of magic number changes, all of which are happily piling into the server's tty buffer. As soon as &man.ppp.8; starts on the server, it is flooded with magic number changes and almost immediately decides it has tried enough to negotiate LCP and gives up. Meanwhile, the client, who no longer sees the reflections, becomes happy just in time to see a hangup from the server. This can be avoided by allowing the peer to start negotiating with the following line in your ppp.conf file: set openmode passive This tells &man.ppp.8; to wait for the server to initiate LCP negotiations. Some servers however may never initiate negotiations. If this is the case, you can do something like: set openmode active 3 This tells &man.ppp.8; to be passive for 3 seconds, and then to start sending LCP requests. If the peer starts sending requests during this period, &man.ppp.8; will immediately respond rather than waiting for the full 3 second period. LCP negotiations continue until the connection is closed. What is wrong? There is currently an implementation mis-feature in &man.ppp.8; where it does not associate LCP, CCP & IPCP responses with their original requests. As a result, if one PPP implementation is more than 6 seconds slower than the other side, the other side will send two additional LCP configuration requests. This is fatal. Consider two implementations, A and B. A starts sending LCP requests immediately after connecting and B takes 7 seconds to start. When B starts, A has sent 3 LCP REQs. We are assuming the line has ECHO switched off, otherwise we would see magic number problems as described in the previous section. B sends a REQ, then an ACK to the first of A's REQs. This results in A entering the OPENED state and sending and ACK (the first) back to B. In the meantime, B sends back two more ACKs in response to the two additional REQs sent by A before B started up. B then receives the first ACK from A and enters the OPENED state. A receives the second ACK from B and goes back to the REQ-SENT state, sending another (forth) REQ as per the RFC. It then receives the third ACK and enters the OPENED state. In the meantime, B receives the forth REQ from A, resulting in it reverting to the ACK-SENT state and sending another (second) REQ and (forth) ACK as per the RFC. A gets the REQ, goes into REQ-SENT and sends another REQ. It immediately receives the following ACK and enters OPENED. This goes on until one side figures out that they are getting nowhere and gives up. The best way to avoid this is to configure one side to be passive - that is, make one side wait for the other to start negotiating. This can be done with the set openmode passive command. Care should be taken with this option. You should also use the set stopped N command to limit the amount of time that &man.ppp.8; waits for the peer to begin negotiations. Alternatively, the set openmode active N command (where N is the number of seconds to wait before starting negotiations) can be used. Check the manual page for details. Why does &man.ppp.8; lock up shortly after connection? Prior to version 2.2.5 of FreeBSD, it was possible that your link was disabled shortly after connection due to &man.ppp.8; mis-handling Predictor1 compression negotiation. This would only happen if both sides tried to negotiate different Compression Control Protocols (CCP). This problem is now corrected, but if you are still running an old version of &man.ppp.8; the problem can be circumvented with the line disable pred1 Why does &man.ppp.8; lock up when I shell out to test it? When you execute the shell or ! command, &man.ppp.8; executes a shell (or if you have passed any arguments, &man.ppp.8; will execute those arguments). Ppp will wait for the command to complete before continuing. If you attempt to use the PPP link while running the command, the link will appear to have frozen. This is because &man.ppp.8; is waiting for the command to complete. If you wish to execute commands like this, use the !bg command instead. This will execute the given command in the background, and &man.ppp.8; can continue to service the link. Why does &man.ppp.8; over a null-modem cable never exit? There is no way for &man.ppp.8; to automatically determine that a direct connection has been dropped. This is due to the lines that are used in a null-modem serial cable. When using this sort of connection, LQR should always be enabled with the line enable lqr LQR is accepted by default if negotiated by the peer. Why does &man.ppp.8; dial for no reason in -auto mode? If &man.ppp.8; is dialing unexpectedly, you must determine the cause, and set up Dial filters (dfilters) to prevent such dialing. To determine the cause, use the following line: set log +tcp/ip This will log all traffic through the connection. The next time the line comes up unexpectedly, you will see the reason logged with a convenient timestamp next to it. You can now disable dialing under these circumstances. Usually, this sort of problem arises due to DNS lookups. To prevent DNS lookups from establishing a connection (this will not prevent &man.ppp.8; from passing the packets through an established connection), use the following: set dfilter 1 deny udp src eq 53 set dfilter 2 deny udp dst eq 53 set dfilter 3 permit 0/0 0/0 This is not always suitable, as it will effectively break your demand-dial capabilities - most programs will need a DNS lookup before doing any other network related things. In the DNS case, you should try to determine what is actually trying to resolve a host name. A lot of the time, &man.sendmail.8; is the culprit. You should make sure that you tell sendmail not to do any DNS lookups in its configuration file. See the section on Mail Configuration for details on how to create your own configuration file and what should go into it. You may also want to add the following line to your .mc file: define(`confDELIVERY_MODE', `d')dnl This will make sendmail queue everything until the queue is run (usually, sendmail is invoked with , telling it to run the queue every 30 minutes) or until a sendmail -q is done (perhaps from your ppp.linkup file). What do these CCP errors mean? I keep seeing the following errors in my log file: CCP: CcpSendConfigReq CCP: Received Terminate Ack (1) state = Req-Sent (6) This is because &man.ppp.8; is trying to negotiate Predictor1 compression, and the peer does not want to negotiate any compression at all. The messages are harmless, but if you wish to remove them, you can disable Predictor1 compression locally too: disable pred1 Why does &man.ppp.8; lock up during file transfers with IO errors? Under FreeBSD 2.2.2 and before, there was a bug in the tun driver that prevents incoming packets of a size larger than the tun interface's MTU size. Receipt of a packet greater than the MTU size results in an IO error being logged via syslogd. The PPP specification says that an MRU of 1500 should always be accepted as a minimum, despite any LCP negotiations, therefore it is possible that should you decrease the MTU to less than 1500, your ISP will transmit packets of 1500 regardless, and you will tickle this non-feature - locking up your link. The problem can be circumvented by never setting an MTU of less than 1500 under FreeBSD 2.2.2 or before. Why does &man.ppp.8; not log my connection speed? In order to log all lines of your modem conversation, you must enable the following: set log +connect This will make &man.ppp.8; log everything up until the last requested expect string. If you wish to see your connect speed and are using PAP or CHAP (and therefore do not have anything to chat after the CONNECT in the dial script - no set login script), you must make sure that you instruct &man.ppp.8; to expect the whole CONNECT line, something like this: set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 4 \ \"\" ATZ OK-ATZ-OK ATDT\\T TIMEOUT 60 CONNECT \\c \\n" Here, we get our CONNECT, send nothing, then expect a line-feed, forcing &man.ppp.8; to read the whole CONNECT response. Why does &man.ppp.8; ignore the \ character in my chat script? Ppp parses each line in your config files so that it can interpret strings such as set phone "123 456 789" correctly (and realize that the number is actually only one argument. In order to specify a " character, you must escape it using a backslash (\). When the chat interpreter parses each argument, it re-interprets the argument in order to find any special escape sequences such as \P or \T (see the man page). As a result of this double-parsing, you must remember to use the correct number of escapes. If you wish to actually send a \ character to (say) your modem, you would need something like: set dial "\"\" ATZ OK-ATZ-OK AT\\\\X OK" resulting in the following sequence: ATZ OK AT\X OK or set phone 1234567 set dial "\"\" ATZ OK ATDT\\T" resulting in the following sequence: ATZ OK ATDT1234567 Why does &man.ppp.8; get a seg-fault, but I see no ppp.core file? Ppp (or any other program for that matter) should never dump core. Because &man.ppp.8; runs with an effective user id of 0, the operating system will not write &man.ppp.8;'s core image to disk before terminating it. If, however &man.ppp.8; is actually terminating due to a segmentation violation or some other signal that normally causes core to be dumped, and you are sure you are using the latest version (see the start of this section), then you should do the following: &prompt.user; tar xfz ppp-*.src.tar.gz &prompt.user; cd ppp*/ppp &prompt.user; echo STRIP= >>Makefile &prompt.user; echo CFLAGS+=-g >>Makefile &prompt.user; make clean all &prompt.user; su &prompt.root; make install &prompt.root; chmod 555 /usr/sbin/ppp You will now have a debuggable version of &man.ppp.8; installed. You will have to be root to run &man.ppp.8; as all of its privileges have been revoked. When you start &man.ppp.8;, take a careful note of what your current directory was at the time. Now, if and when &man.ppp.8; receives the segmentation violation, it will dump a core file called ppp.core. You should then do the following: &prompt.user; su &prompt.root; gdb /usr/sbin/ppp ppp.core (gdb) bt ..... (gdb) f 0 .... (gdb) i args .... (gdb) l ..... All of this information should be given alongside your question, making it possible to diagnose the problem. If you are familiar with gdb, you may wish to find out some other bits and pieces such as what actually caused the dump and the addresses & values of the relevant variables. Why does the process that forces a dial in auto mode never connect? This was a known problem with &man.ppp.8; set up to negotiate a dynamic local IP number with the peer in auto mode. It is fixed in the latest version - search the man page for iface. The problem was that when that initial program calls &man.connect.2;, the IP number of the tun interface is assigned to the socket endpoint. The kernel creates the first outgoing packet and writes it to the tun device. &man.ppp.8; then reads the packet and establishes a connection. If, as a result of &man.ppp.8;'s dynamic IP assignment, the interface address is changed, the original socket endpoint will be invalid. Any subsequent packets sent to the peer will usually be dropped. Even if they are not, any responses will not route back to the originating machine as the IP number is no longer owned by that machine. There are several theoretical ways to approach this problem. It would be nicest if the peer would re-assign the same IP number if possible :-) The current version of &man.ppp.8; does this, but most other implementations do not. The easiest method from our side would be to never change the tun interface IP number, but instead to change all outgoing packets so that the source IP number is changed from the interface IP to the negotiated IP on the fly. This is essentially what the iface-alias option in the latest version of &man.ppp.8; is doing (with the help of &man.libalias.3; and &man.ppp.8;'s switch) - it is maintaining all previous interface addresses and NATing them to the last negotiated address. Another alternative (and probably the most reliable) would be to implement a system call that changes all bound sockets from one IP to another. &man.ppp.8; would use this call to modify the sockets of all existing programs when a new IP number is negotiated. The same system call could be used by dhcp clients when they are forced to re-bind() their sockets. Yet another possibility is to allow an interface to be brought up without an IP number. Outgoing packets would be given an IP number of 255.255.255.255 up until the first SIOCAIFADDR ioctl is done. This would result in fully binding the socket. It would be up to &man.ppp.8; to change the source IP number, but only if it is set to 255.255.255.255, and only the IP number and IP checksum would need to change. This, however is a bit of a hack as the kernel would be sending bad packets to an improperly configured interface, on the assumption that some other mechanism is capable of fixing things retrospectively. Why do most games not work with the -nat switch? The reason games and the like do not work when libalias is in use is that the machine on the outside will try to open a connection or send (unsolicited) UDP packets to the machine on the inside. The NAT software does not know that it should send these packets to the interior machine. To make things work, make sure that the only thing running is the software that you are having problems with, then either run tcpdump on the tun interface of the gateway or enable &man.ppp.8; tcp/ip logging (set log +tcp/ip) on the gateway. When you start the offending software, you should see packets passing through the gateway machine. When something comes back from the outside, it will be dropped (that is the problem). Note the port number of these packets then shut down the offending software. Do this a few times to see if the port numbers are consistent. If they are, then the following line in the relevant section of /etc/ppp/ppp.conf will make the software functional: nat port proto internalmachine:port port where proto is either tcp or udp, internalmachine is the machine that you want the packets to be sent to and port is the destination port number of the packets. You will not be able to use the software on other machines without changing the above command, and running the software on two internal machines at the same time is out of the question - after all, the outside world is seeing your entire internal network as being just a single machine. If the port numbers are not consistent, there are three more options: Submit support in libalias. Examples of special cases can be found in /usr/src/lib/libalias/alias_*.c (alias_ftp.c is a good prototype). This usually involves reading certain recognised outgoing packets, identifying the instruction that tells the outside machine to initiate a connection back to the internal machine on a specific (random) port and setting up a route in the alias table so that the subsequent packets know where to go. This is the most difficult solution, but it is the best and will make the software work with multiple machines. Use a proxy. The application may support socks5 for example, or (as in the cvsup case) may have a passive option that avoids ever requesting that the peer open connections back to the local machine. Redirect everything to the internal machine using nat addr. This is the sledge-hammer approach. Has anybody made a list of useful port numbers? Not yet, but this is intended to grow into such a list (if any interest is shown). In each example, internal should be replaced with the IP number of the machine playing the game. Asheron's Call nat port udp internal :65000 65000 Manually change the port number within the game to 65000. If you have got a number of machines that you wish to play on assign a unique port number for each (i.e. 65001, 65002, etc) and add a nat port line for each one. Half Life nat port udp internal:27005 27015 PCAnywhere 8.0 nat port udp internal:5632 5632 nat port tcp internal:5631 5631 Quake nat port udp internal:6112 6112 Alternatively, you may want to take a look at www.battle.net for Quake proxy support. Quake 2 nat port udp internal:27901 27910 nat port udp internal:60021 60021 nat port udp internal:60040 60040 Red Alert nat port udp internal:8675 8675 nat port udp internal:5009 5009 What are FCS errors? FCS stands for Frame Check Sequence. Each PPP packet has a checksum attached to ensure that the data being received is the data being sent. If the FCS of an incoming packet is incorrect, the packet is dropped and the HDLC FCS count is increased. The HDLC error values can be displayed using the show hdlc command. If your link is bad (or if your serial driver is dropping packets), you will see the occasional FCS error. This is not usually worth worrying about although it does slow down the compression protocols substantially. If you have an external modem, make sure your cable is properly shielded from interference - this may eradicate the problem. If your link freezes as soon as you have connected and you see a large number of FCS errors, this may be because your link is not 8 bit clean. Make sure your modem is not using software flow control (XON/XOFF). If your datalink must use software flow control, use the command set accmap 0x000a0000 to tell &man.ppp.8; to escape the ^Q and ^S characters. Another reason for seeing too many FCS errors may be that the remote end has stopped talking PPP. You may want to enable async logging at this point to determine if the incoming data is actually a login or shell prompt. If you have a shell prompt at the remote end, it is possible to terminate &man.ppp.8; without dropping the line by using the close lcp command (a following term command will reconnect you to the shell on the remote machine. If nothing in your log file indicates why the link might have been terminated, you should ask the remote administrator (your ISP?) why the session was terminated. Why do MacOS and Windows 98 connections freeze when running PPPoE on the gateway? Thanks to Michael Wozniak mwozniak@netcom.ca for figuring this out and Dan Flemming danflemming@mac.com for the Mac solution: This is due to what is called a Black Hole router. MacOS and Windows 98 (and maybe other Microsoft OSs) send TCP packets with a requested segment size too big to fit into a PPPoE frame (MTU is 1500 by default for Ethernet) and have the do not fragment bit set (default of TCP) and the Telco router is not sending ICMP must fragment back to the www site you are trying to load. (Alternatively, the router is sending the ICMP packet correctly, but the firewall at the www site is dropping it.) When the www server is sending you frames that do not fit into the PPPoE pipe the Telco router drops them on the floor and your page does not load (some pages/graphics do as they are smaller than a MSS.) This seems to be the default of most Telco PPPoE configurations (if only they knew how to program a router... sigh...) One fix is to use regedit on your 95/98 boxes to add the following registry entry... HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\NetTrans\0000\MaxMTU It should be a string with a value 1436, as some ADSL routers are reported to be unable to deal with packets larger than this. This registry key has been changed to Tcpip\Parameters\Interfaces\ID for adapter\MTU in Windows 2000 and becomes a DWORD. Refer to the Microsoft Knowledge Base documents Q158474 - Windows TCPIP Registry Entries and Q120642 - TCPIP & NBT Configuration Parameters for Windows NT for more information on changing Windows MTU to work with a NAT router. Another regedit possibility under Windows 2000 is to set the Tcpip\Parameters\Interfaces\ID for adapter\EnablePMTUBHDetect DWORD to 1 as mentioned in the Microsoft document 120642 mentioned above. Unfortunately, MacOS does not provide an interface for changing TCP/IP settings. However, there is commercial software available, such as OTAdvancedTuner (OT for OpenTransport, the MacOS TCP/IP stack) by Sustainable Softworks, that will allow users to customize TCP/IP settings. MacOS NAT users should select ip_interface_MTU from the drop-down menu, enter 1450 instead of 1500 in the box, click the box next to Save as Auto Configure, and click Make Active. The latest version of &man.ppp.8; (2.3 or greater) has an enable tcpmssfixup command that will automatically adjust the MSS to an appropriate value. This facility is enabled by default. If you are stuck with an older version of &man.ppp.8;, you may want to look at the tcpmssd port. None of this helps - I am desperate! What can I do? If all else fails, send as much information as you can, including your config files, how you are starting &man.ppp.8;, the relevant parts of your log file and the output of the netstat -rn command (before and after connecting) to the &a.questions; or the comp.unix.bsd.freebsd.misc news group, and someone should point you in the right direction. Serial Communications This section answers common questions about serial communications with FreeBSD. PPP and SLIP are covered in the section. How do I tell if FreeBSD found my serial ports? As the FreeBSD kernel boots, it will probe for the serial ports in your system for which the kernel was configured. You can either watch your system closely for the messages it prints or run the command &prompt.user; dmesg | grep sio after your system is up and running. Here is some example output from the above command: sio0 at 0x3f8-0x3ff irq 4 on isa sio0: type 16550A sio1 at 0x2f8-0x2ff irq 3 on isa sio1: type 16550A This shows two serial ports. The first is on irq 4, is using port address 0x3f8, and has a 16550A-type UART chip. The second uses the same kind of chip but is on irq 3 and is at port address 0x2f8. Internal modem cards are treated just like serial ports---except that they always have a modem attached to the port. The GENERIC kernel includes support for two serial ports using the same irq and port address settings in the above example. If these settings are not right for your system, or if you have added modem cards or have more serial ports than your kernel is configured for, just reconfigure your kernel. See section about building a kernel for more details. How do I tell if FreeBSD found my modem cards? Refer to the answer to the previous question. I just upgraded to 2.0.5 and my tty0X are missing! How do I solve this problem? Do not worry, they have been merged with the ttydX devices. You will have to change any old configuration files you have, though. How do I access the serial ports on FreeBSD? The third serial port, sio2 (see &man.sio.4;, known as COM3 in DOS), is on /dev/cuaa2 for dial-out devices, and on /dev/ttyd2 for dial-in devices. What is the difference between these two classes of devices? You use ttydX for dial-ins. When opening /dev/ttydX in blocking mode, a process will wait for the corresponding cuaaX device to become inactive, and then wait for the carrier detect line to go active. When you open the cuaaX device, it makes sure the serial port is not already in use by the ttydX device. If the port is available, it steals it from the ttydX device. Also, the cuaaX device does not care about carrier detect. With this scheme and an auto-answer modem, you can have remote users log in and you can still dial out with the same modem and the system will take care of all the conflicts. How do I enable support for a multiport serial card? Again, the section on kernel configuration provides information about configuring your kernel. For a multiport serial card, place an &man.sio.4; line for each serial port on the card in the kernel configuration file. But place the irq and vector specifiers on only one of the entries. All of the ports on the card should share one irq. For consistency, use the last serial port to specify the irq. Also, specify the COM_MULTIPORT option. The following example is for an AST 4-port serial card on irq 7: options "COM_MULTIPORT" device sio4 at isa? port 0x2a0 tty flags 0x781 device sio5 at isa? port 0x2a8 tty flags 0x781 device sio6 at isa? port 0x2b0 tty flags 0x781 device sio7 at isa? port 0x2b8 tty flags 0x781 irq 7 vector siointr The flags indicate that the master port has minor number 7 (0x700), diagnostics enabled during probe (0x080), and all the ports share an irq (0x001). Can FreeBSD handle multiport serial cards sharing irqs? Not yet. You will have to use a different irq for each card. Can I set the default serial parameters for a port? The ttydX (or cuaaX) device is the regular device you will want to open for your applications. When a process opens the device, it will have a default set of terminal I/O settings. You can see these settings with the command &prompt.root; stty -a -f /dev/ttyd1 When you change the settings to this device, the settings are in effect until the device is closed. When it is reopened, it goes back to the default set. To make changes to the default set, you can open and adjust the settings of the initial state device. For example, to turn on CLOCAL mode, 8 bits, and XON/XOFF flow control by default for ttyd5, do: &prompt.root; stty -f /dev/ttyid5 clocal cs8 ixon ixoff A good place to do this is in /etc/rc.serial. Now, an application will have these settings by default when it opens ttyd5. It can still change these settings to its liking, though. You can also prevent certain settings from being changed by an application by making adjustments to the lock state device. For example, to lock the speed of ttyd5 to 57600 bps, do &prompt.root; stty -f /dev/ttyld5 57600 Now, an application that opens ttyd5 and tries to change the speed of the port will be stuck with 57600 bps. Naturally, you should make the initial state and lock state devices writable only by root. The &man.MAKEDEV.8; script does NOT do this when it creates the device entries. How can I enable dialup logins on my modem? So you want to become an Internet service provider, eh? First, you will need one or more modems that can auto-answer. Your modem will need to assert carrier-detect when it detects a carrier and not assert it all the time. It will need to hang up the phone and reset itself when the data terminal ready (DTR) line goes from on to off. It should probably use RTS/CTS flow control or no local flow control at all. Finally, it must use a constant speed between the computer and itself, but (to be nice to your callers) it should negotiate a speed between itself and the remote modem. For many Hayes command-set--compatible modems, this command will make these settings and store them in nonvolatile memory: AT &C1 &D3 &K3 &Q6 S0=1 &W See the section on sending AT commands below for information on how to make these settings without resorting to an MS-DOS terminal program. Next, make an entry in /etc/ttys (see &man.ttys.5;) for the modem. This file lists all the ports on which the operating system will await logins. Add a line that looks something like this: ttyd1 "/usr/libexec/getty std.57600" dialup on insecure This line indicates that the second serial port (/dev/ttyd1) has a modem connected running at 57600 bps and no parity (std.57600, which comes from the file /etc/gettytab, see &man.gettytab.5;). The terminal type for this port is dialup. The port is on and is insecure---meaning root logins on the port are not allowed. For dialin ports like this one, use the ttydX entry. It is common practice to use dialup as the terminal type. Many users set up in their .profile or .login files a prompt for the actual terminal type if the starting type is dialup. The example shows the port as insecure. To become root on this port, you have to login as a regular user, then &man.su.1; to become root. If you use secure then root can login in directly. After making modifications to /etc/ttys, you need to send a hangup or HUP signal to the &man.init.8; process: &prompt.root; kill -HUP 1 This forces the &man.init.8; process to reread /etc/ttys. The init process will then start getty processes on all on ports. You can find out if logins are available for your port by typing &prompt.user; ps -ax | grep '[t]tyd1' You should see something like: 747 ?? I 0:00.04 /usr/libexec/getty std.57600 ttyd1 How can I connect a dumb terminal to my FreeBSD box? If you are using another computer as a terminal into your FreeBSD system, get a null modem cable to go between the two serial ports. If you are using an actual terminal, see its accompanying instructions. Then, modify /etc/ttys (see &man.ttys.5;), like above. For example, if you are hooking up a WYSE-50 terminal to the fifth serial port, use an entry like this: ttyd4 "/usr/libexec/getty std.38400" wyse50 on secure This example shows that the port on /dev/ttyd4 has a wyse50 terminal connected at 38400 bps with no parity (std.38400 from /etc/gettytab, see &man.gettytab.5;) and root logins are allowed (secure). Why can I not run tip or cu? On your system, the programs &man.tip.1; and &man.cu.1; are probably executable only by uucp and group dialer. You can use the group dialer to control who has access to your modem or remote systems. Just add yourself to group dialer. Alternatively, you can let everyone on your system run &man.tip.1; and &man.cu.1; by typing: &prompt.root; chmod 4511 /usr/bin/cu &prompt.root; chmod 4511 /usr/bin/tip My stock Hayes modem is not supported---what can I do? Actually, the man page for &man.tip.1; is out of date. There is a generic Hayes dialer already built in. Just use at=hayes in your /etc/remote (see &man.remote.5;) file. The Hayes driver is not smart enough to recognize some of the advanced features of newer modems---messages like BUSY, NO DIALTONE, or CONNECT 115200 will just confuse it. You should turn those messages off when you use &man.tip.1; (using ATX0&W). Also, the dial timeout for &man.tip.1; is 60 seconds. Your modem should use something less, or else tip will think there is a communication problem. Try ATS7=45&W. Actually, as shipped &man.tip.1; does not yet support it fully. The solution is to edit the file tipconf.h in the directory /usr/src/usr.bin/tip/tip. Obviously you need the source distribution to do this. Edit the line #define HAYES 0 to #define HAYES 1. Then make and make install. Everything works nicely after that. How am I expected to enter these AT commands? Make what is called a direct entry in your /etc/remote file (see &man.remote.5;). For example, if your modem is hooked up to the first serial port, /dev/cuaa0, then put in the following line: cuaa0:dv=/dev/cuaa0:br#19200:pa=none Use the highest bps rate your modem supports in the br capability. Then, type tip cuaa0 (see &man.tip.1;) and you will be connected to your modem. If there is no /dev/cuaa0 on your system, do this: &prompt.root; cd /dev &prompt.root; sh MAKEDEV cuaa0 Or use cu as root with the following command: &prompt.root; cu -lline -sspeed with line being the serial port (e.g. /dev/cuaa0) and speed being the speed (e.g.57600). When you are done entering the AT commands hit ~. to exit. Why does the <@> sign for the pn capability not work? The <@> sign in the phone number capability tells tip to look in /etc/phones for a phone number. But the <@> sign is also a special character in capability files like /etc/remote. Escape it with a backslash: pn=\@ How can I dial a phone number on the command line? Put what is called a generic entry in your /etc/remote file (see &man.remote.5;). For example: tip115200|Dial any phone number at 115200 bps:\ :dv=/dev/cuaa0:br#115200:at=hayes:pa=none:du: tip57600|Dial any phone number at 57600 bps:\ :dv=/dev/cuaa0:br#57600:at=hayes:pa=none:du: Then you can do something like tip -115200 5551234. If you prefer &man.cu.1; over &man.tip.1;, use a generic cu entry: cu115200|Use cu to dial any number at 115200bps:\ :dv=/dev/cuaa1:br#57600:at=hayes:pa=none:du: and type cu 5551234 -s 115200. Do I have to type in the bps rate every time I do that? Put in an entry for tip1200 or cu1200, but go ahead and use whatever bps rate is appropriate with the br capability. &man.tip.1; thinks a good default is 1200 bps which is why it looks for a tip1200 entry. You do not have to use 1200 bps, though. How can I more easily access a number of hosts through a terminal server? Rather than waiting until you are connected and typing CONNECT host each time, use tip's cm capability. For example, these entries in /etc/remote (see &man.remote.5;): pain|pain.deep13.com|Forrester's machine:\ :cm=CONNECT pain\n:tc=deep13: muffin|muffin.deep13.com|Frank's machine:\ :cm=CONNECT muffin\n:tc=deep13: deep13:Gizmonics Institute terminal server:\ :dv=/dev/cuaa2:br#38400:at=hayes:du:pa=none:pn=5551234: will let you type tip pain or tip muffin to connect to the hosts pain or muffin; and tip deep13 to get to the terminal server. Can tip try more than one line for each site? This is often a problem where a university has several modem lines and several thousand students trying to use them... Make an entry for your university in /etc/remote (see &man.remote.5;) and use <\@> for the pn capability: big-university:\ :pn=\@:tc=dialout dialout:\ :dv=/dev/cuaa3:br#9600:at=courier:du:pa=none: Then, list the phone numbers for the university in /etc/phones (see &man.phones.5;): big-university 5551111 big-university 5551112 big-university 5551113 big-university 5551114 &man.tip.1; will try each one in the listed order, then give up. If you want to keep retrying, run &man.tip.1; in a while loop. Why do I have to hit CTRL+P twice to send CTRL+P once? CTRL+P is the default force character, used to tell &man.tip.1; that the next character is literal data. You can set the force character to any other character with the ~s escape, which means set a variable. Type ~sforce=single-char followed by a newline. single-char is any single character. If you leave out single-char, then the force character is the nul character, which you can get by typing CTRL+2 or CTRL+SPACE. A pretty good value for single-char is SHIFT+CTRL+6, which I have seen only used on some terminal servers. You can have the force character be whatever you want by specifying the following in your $HOME/.tiprc file: force=single-char Why is everything I type suddenly in UPPER CASE? You must have pressed CTRL+A, &man.tip.1; raise character, specially designed for people with broken caps-lock keys. Use ~s as above and set the variable raisechar to something reasonable. In fact, you can set it to the same as the force character, if you never expect to use either of these features. Here is a sample .tiprc file perfect for Emacs users who need to type CTRL+2 and CTRL+A a lot: force=^^ raisechar=^^ The ^^ is SHIFT+CTRL+6. How can I do file transfers with tip? If you are talking to another Unix system, you can send and receive files with ~p (put) and ~t (take). These commands run &man.cat.1; and &man.echo.1; on the remote system to accept and send files. The syntax is: ~p <local-file> [<remote-file>] ~t <remote-file> [<local-file>] There is no error checking, so you probably should use another protocol, like zmodem. How can I run zmodem with tip? First, install one of the zmodem programs from the ports collection (such as one of the two from the comms category, lrzsz or rzsz. To receive files, start the sending program on the remote end. Then, press enter and type ~C rz (or ~C lrz if you installed lrzsz) to begin receiving them locally. To send files, start the receiving program on the remote end. Then, press enter and type ~C sz files (or ~C lsz files) to send them to the remote system. Why does FreeBSD not find my serial ports, even when the settings are correct? Motherboards and cards with Acer UARTs do not probe properly under the FreeBSD sio probe. Obtain a patch from www.lemis.com to fix your problem. ¨ä¥¦¦U¦¡¦U¼Ëªº°ÝÃD ¬°¬Æ»ò FreeBSD ¥Îªº¸m´«(swap)ªÅ¶¡¤ñ Linux ¦h¡H FreeBSD¶È¬O¬Ý°_¨Ó¸m´«ªÅ¶¡(swap)¥Îªº¤ñLinux¦h¦Ó¤w¡C¦b¨Æ¹ê¤W¡A ¨Ã¤£µM¡C¥D­nªº®t²§¬O¦b©ó¡AFreeBSD¿n·¥ªº±N¶¢¸mµL¥Îªº¥D°O¾ÐÅ餺®e ±À¤J¸m´«ªÅ¶¡(swap)¤¤¡A¥H¨Ï±o¥D°O¾ÐÅé¥i¥H§ó¬°¦³®Ä²vªº³Q¨Ï¥Î¡C¦Ó Linuxªºµ¦²¤¬O±N¸m´«ªÅ¶¡(swap)¥Î¨Ó§@¬°¸Ñ¨M°O¾ÐÅé°ÝÃDªº³Ì²×¤â¬q¡C ¸ûÀWÁcªº¨Ï¥Î¸m´«ªÅ¶¡(swap)¡C¬O¤@ºØ§ó¦³®Ä²vªº¨Ï¥Î¥D°O¾ÐÅ骺¤â¬q¡C µù¡G·í¤@¤è­±FreeBSD¿n·¥ªº¨Ï¥Î¸m´«ªÅ¶¡(swap)ªº¦P®É¡A§A¥²»Ýª` ·N¨ì¡AFreeBSD¨Ã¤£·|¥ô·Nªº±N©Ò¦³ªºªF¦è³£±À¤J¸m´«ªÅ¶¡(swap)¤¤¡C¦p¦¹¡A §A¤~¤£·|¦b¤@©]±J¾K°_§É«áµo²{¡A¾ã­Ó¨t²Î³£³Q­Ë¶i¤F¸m´«ªÅ¶¡(swap)¤§¤¤¡C §Y¨Ï§Ú¥u¦³¹B¦æ¤Ö¼Æµ{¦¡¡A¬°¤°»ò top Åã¥Ü¥X ¨Óªº³Ñ¾l°O¾ÐÅéÁÙ¬O«Ü¤Ö¡H ²³æªºµª®×¬O¡A©Ò¦³¥¼¨Ï¥Î¨ìªº¶¢¸m°O¾ÐÅé³£¬O³Q®ö¶Oªº°O¾ÐÅé¡A ¥ô¦ó¥¼³Q§Aªºµ{¦¡©Ò§Q¥Î¨ìªº°O¾ÐÅé±N³Q®Ö¤ß(kernel)¥Î¨Ó·í §@ºÏºÐ§Ö¨ú(disk cache)¡C¦Ó³oºØ°O¾ÐÅé³Q &man.top.1; ¼Ð°O¬° ¶¢¸mªº(Inact)¡A§Ö¨ú(Cache)¡A ¥H¤Î ½w½Ä°Ï(Buf)¡A¨Ã­t³d¦b¦U­Ó¤£¦Pªº¦ì¸m­t³d ¼È¦s¸ê®Æ¡C³Q¼È¦s(cached)ªº¸ê®Æ¥Nªí¨t²Î¤£»Ý­n¥h¦s¨ú¸ûºCªººÏºÐ¸Ë¸m ´N¥i¥H±o¨ì¸ê®Æ¡A¦p¦¹¡A¥i¥H´£¤É¨t²Îªº®Ä¯à¡CÁ`¦Ó¨¥¤§¡A&man.top.1; Åã¥Ü¥X¸û¤Öªº ¶¢¸m(Free) °O¾ÐÅé¬O¦nªº¡A¥u­nÅã¥Ü ¥X¨Óªº­È¤£¬O «D±` ªº§C¡C ¬°¬Æ»ò­n¥Î(¬Æ»ò¬O) a.out ©M ELF °õ¦æÀɮ榡¡H ­n¤F¸Ñ¬°¤°»òFreebsd¨Ï¥Î ELF ®æ¦¡¡A§A¦³¥² ­n¥ý»{ÃѤ@¤U¤TºØ¦b¥Ø«e Unix ¨t²Î¤¤³Ì³Q¼sªxÀ³¥Î¨ìªº°õ¦æÀɮ榡¡G ¦b FreeBSD 3.x ¤§«e¡AFreeBSD ¨Ï¥Î a.out ®æ¦¡¡C &man.a.out.5; ³o¬O³Ì¦­¡A¦P¬O¤]¬O ³Ì¨å«¬ ªºUnix¥ØªºÀÉ ®æ¦¡¡C³oºØ®æ¦¡ªºÀɮרϥΤ@ºØµu¥Bºò±KªºÀÉÀY¡A¦P®É¡A¦ñÀHµÛ¤@ ­ÓÅ]³N¼Æ¦r¥Î¨Ó¿ëÃѮ榡¡C(°Ñ¦Ò &man.a.out.5; ¦³§ó¦h¸Ô²Óªº»¡ ©ú)¡C¥¦¥]§t¦³¤T­Ó¸`°Ï¡G .text .data ¤Î .bss ¥[¤W¤@­Ó²Å¸¹ªí ¤Î¦r¦êªí¡C COFF SVR3¥ØªºÀɮ榡¡CÀÉÀY¥]§t¤F¤@­Ó¸`°Ïªí¡A©Ò¥H¥i¥H¨ã³Æ¤ñ .text .data .bss ÁÙ¦hªº¸`°Ï¡C ELF ELF¬° COFF ®æ¦¡ªº«áÄ~ªÌ¡A¥D­nªº¯S¼x¬° ¥i¥H¨ã¦³½Æ¼Æ¸`°Ï¬q¡A¨Ã¥i¥H¨Ï¥Î32-bits©Î¬O64-bitsªº¼Æ­È¡C ¥D­nªº¯ÊÂI¬°¡G ELF ®æ¦¡¬O¦b¨C­Ó¨t²Î¤¤¥u ·|¦³¤@ºØ ABI ªº°²³]¬°«eÃD³Q³]­p¥X¨Óªº¡C¦ý¬O¡A¦b¨Æ¹ê¤W¡A³o­Ó °²³]¿ùªºÂ÷ÃСC¦]¬°¡AÁa¨Ï¦b°Ó¥Îªº SYSV ¥@¬É¸Ì¡A¤]¦Ü¤Ö¦³ SVR4¡A Solaris ©M SCO ¤TºØ ABI¡C ͵ù¡GABI(Application Binary Interface)¡C¦pªG¤@©w­n½Ķ¡A ´N¥s¥¦ À³¥Îµ{¦¡¤G¶i¦ì¤¶­± ¦n¤F¡C ABI³Qµo ®i¥X¨Óªº¥Î·N¡A¬O¬°¤F«P¨Ï¦b¬Û¦PCPU©Òµo®i¥X¨ÓªºÀ³¥Îµ{¦¡¡A¯à°÷ ¦b¤£¦Pªº¨t²Î¤W¡A§@¨ì¤G¤¸ÀÉ(Binary Code)¬Û®e¡C¤ñ¤è»¡¡A Sun ©Ò´£¥Xªº Solaris ABI ¡A«OÃÒ°õ¦æÀɯà°÷¦b¬Û¦P CPU ªº Solaris ¨t²Î¤W°õ¦æ¡A¥t¤@­Ó¨Ò¤l¬O Windows ¨t²Î¡C¦PÄÝ©ó Intel x86 ª©¥»ªº°õ¦æÀɯà°÷¦Û¥Ñªº¦bWindows 9x/me¤ÎWindows NT/2k/XP¤§¶¡°õ¦æ¡C FreeBSD´£¨Ñ¤@­Ó¤½¥Îµ{¦¡±Nµ{¦¡©Ò»ÝªºABI¸ê°T¯O¤W¡AÂǦ¹¸ÕµÛ ¥h¸Ñ¨M³o­Ó°ÝÃD¡C½Ð°Ñ¦Ò &man.brandelf.1; ¥H¨ú±o§ó¦h¸ê°T¡Ci FreeBSD ¨Ó¦Û ¶Ç²Î ªº°}Àç¡C¦b¶Ç²Î¤W¡AFreeBSD³£ ¨Ï¥Î &man.a.out.5; ®æ¦¡¡A³o¼Ëªº§Þ³N¦b¦n´X¥Nªº BSD ³£³QÃÒ©ú¬O¥i¾aªº¡C ÁöµM¡A¦bFreeBSD¤W¥i¥H«Ø¥ß¥H¤Î¥¿½Tªº°õ¦æ­ì¥Í ELF ®æ¦¡ÀÉ®×(¥]§t®Ö¤ß)¡CµM¦Ó, FreeBSD¦b¤@¶}©l¤Ï¹ï±N¹w³]®æ¦¡Âà´«¬° ELF¡A ¬°¤°»ò©O¡H·íLinux¶}©lµh­WªºÂà´«¦Ü ELF ®æ¦¡®É¡A ¨Ã«D¬O¬°¤F­n°kÂ÷ a.out ®æ¦¡¡C¬Û¤Ïªº¡A³o¬O¦] ¬°¤§«e Linuxªº¦@¨É¨ç¦¡®w(shared libraries)±Ä¥Î¥H¸õÅDªí®æ (jump-table)¬°°ò¦ªº§Þ³N¥h³]­p¡C³o¬O¤@ºØÅýµo®iªÌ·P¨ì§xÂZ¡A¥B«D±` Ãø¥H¨Ï¥Î¡A¤£¨ã¨¬°÷¼u©Êªº¤èªk¡C¬JµM¡A¤w¸g¦s¦bªº ELF ¤u¨ã´£¨Ñ¤F¦@¨É¨ç¦¡®w(shared libraries)ªº¸Ñ ¨M¤è®×¡A¦Ó¥B¡A¨º¬Ý°_¨Ó¬O­Ó «e½Ãªº¤èªk¡A¦]¦¹¡A©Ò»Ý ªºÂà´«¥N»ù´N¥i±µ¨ü¦]¦ÓÂà´«¡C ¦bFreeBSDªºª¬ªp¤¤¡A§Ú­Ìªº¦@¨É¨ç¦¡®w(shared libraries)¾÷¨î©M SunOS ªº«¬¦¡«D±`¬Ûªñ¡A¥B©ö©ó¨Ï¥Î¡CµM¦Ó¡A ±q 3.0 ¶}©l¡AFreeBSD ¥¿¦¡±N ELF §ï¬°¹w³]®æ¦¡¡C ÁöµM¡Aa.out ®æ¦¡¨Ì¦p¥H©¹¯ëªº¦n¡A¦ý¬O¡A§Ú­Ì ½sͤu¨ãªº¼¶¼gªÌ¡AGNU ªº¦¨­û¡A¥L­Ì¤¤¤î¤F¹ï a.out ®æ¦¡ªº¤ä´©»PºûÅ@¡C¦b³oºØª¬ªp¤U¡A­¢¨Ï §Ú­Ì¥²¶·¦Û¦æºûÅ@¥t¤@¥÷ª©¥»ªº compiler ©M linker¡A¤]¨Ï±o§Ú­ÌµLªk ±q³Ì·sªº GNU µo®i¦¨ªG¤¤Àò±o¦n³B¡C¦¹¥~¡A¹ï ISO-C++ ªº»Ý¨D¡A¤×¨ä¬O «Øºc¤l(constructors)©M¸Ñºc¤l(destructors)¡A¤]±a°Ê¥¼¨Óª©¥»¤¤¹ï ELF ªº­ì¥Í¤ä´©¡C ¬Oªº, ¦ý¬O, ¬°¤°»ò·|¦³³o»ò¦h¤£¦P®æ¦¡ªº°õ¦æÀɦs¦b©O? ¦b¶Â·t¦Ó»»»·ªº¹L¥h¡A¶È¦³Â²­®ªºµwÅé¦s¦b¡C¦Ó¦]¬°µwÅé²­®¡A·íµM¤] ¥u¯à°õ¦æ¤p¦Ó²³æªº¨t²Î¡Ca.out ®æ¦¡¬O°ò©ó¨º­Ó®É¥N©Ò»Ý­n¡A¦Ó³Q³Ð³y ¥X¨Óªº(¨Ò¦p¹³PDP-11)¡C¦b³o¤§«á¡A³\¦h¤H¸ÕµÛ±N Unix ²¾´Ó¨ì¨ä¥L¥­¥x ®É¡A¥L­Ì¤]«O¯d¤F a.out ®æ¦¡ªº°õ¦æÀÉ¡C¦]¬°¡A³o¹ï¦­´Áªº Motorola 68k¡A VAXen ¤§Ãþªº¨t²Î¤w¸g¨¬°÷¨Ï¥Î¤F¡C µM¦Ó¡A¤H¨Ã¤£·|º¡¨¬©ó²{ª¬¡C¤@¨ÇÁo©úªºµwÅé¤uµ{®v·Q¨ì¤F¡A¦pªG¯à Åý³nÅé¦h³B²z¤@¨Ç¨Æ¡A¨º CPU ªº¹q´¹Å鼯´N¯à¤Ö¤@ÂI¡A¨Ã¥B¶]±o§ó§Ö¡C­n ¦b³oºØ·s¦¡ªºµwÅé¤W¤u§@(²{¦bºÙ¬°RISC)¡Aa.out ³oºØ®æ¦¡´N¤£¦X¾A¤F¡C°ò©ó³o¼Ëªº²{¹ê©Ò»Ý¡A§ó¦hªº°õ¦æÀɮ榡³Qµo®i¥X ¨Ó¡A¥H´£¨Ñ¤ñ²³æ¥B¨ü¨ì³\¦h­­¨îªº a.out ®æ¦¡ §ó¦nªº®Ä¯à¡C¤ñ¤è¹³¬O COFF¡A ECOFF¡A¤w¤Î¤@¨Ç¸û¤£¬°¤H©Ò©Pª¾ªº®æ¦¡¯É¯É³Q³Ð³y ¥X¨Ó¡C¦ý¬O¡A³o¨Ç®æ¦¡³£¤w¹F¨ì¦U¦Ûªº·¥­­¡Aª½¨ì¦³¤@¤Ñ ELF ªº¥X²{¡C ¦¹¥~¡A·íµ{¦¡ªºÅé¿n¶V¨Ó¶V¤j¡A¦ÓºÏºÐªÅ¶¡©M¥D°O¾ÐÅé¬Û¹ï¨Ó»¡³£¸û ¤p®É¡A¦@¨É¨ç¦¡®w(shared libraries)ªºÆ[©À³Qµo®i¥X¨Ó¤F¡C¦b³o¦P®É¡A µêÀÀ°O¾ÐÅé¨t²Î(VM System)¤]Åܱo¶V¨Ó¶Vºë¥©¡C·í¨C¤@ºØ¶i¨B³£¦b a.out®æ¦¡¤W³Qµo®i¥X¨Ó®É¡A¥¦ªº¥i¥Î©Ê¤]¦P®ÉÅÜ ±o¶V¨Ó¶V§C¡C¥t¥~¡A¤H­ÌÁ٧Ʊæµ{¦¡¯à¦b°õ¦æ´Á¶¡°ÊºA¸ü¤J¡A©Î¬O±N¤w¸g °õ¦æ¹L¥B¨S¦³¥Îªºªì©l¤Æµ{¦¡½X¥á±ó¡AÂÇ¥H¸`¬Ù§ó¦hªº°O¾Ð¡Cµ{¦¡»y¨¥¦b ³o­Ó®É´Á¤]«K±o§óºë¥©¡A¤H­Ì¤]§Æ±æ¦b main ¤§«e¦Û°Êªº°õ¦æ§ó¦hªºªF¦è¡C ¦]¦¹¡A³\¦hÁcÂø¥B¥t¤H¹Ä¬°Æ[¤îªº§Þ¥©³Q¥Î¦b a.out ®æ¦¡¤W¥h¸Ñ¨M³o¨Ç°ÝÃD¡C¦ý¬O¡A¥Ñ©ó a.out ®æ¦¡ ¥ý¤Ñªº­­¨î¡A­n¸Ñ¨M³o¨Ç°ÝÃD¥²»Ý¥I¥X§ó¦hªº¥N»ù¤Î®É¶¡¦¨¥»¡A¨ÃÅýµ{¦¡ ªº½ÆÂø«×¤j¬°´£¤É¡C¦Ó ELF ®æ¦¡¥i¥H¤@Á|¸Ñ¨M³o¤@ ¤Á°ÝÃD¡C¦ý¬O¡A­n±N¾ã­Ó¨t²Î±q®Ú¥»Âà´«¹L¥h¡A±N·|¦³¤£µuªº°}µh´Á¡A¦] ¦¹¡A ELF®æ¦¡±N·|¦³¤@°}¤l»P a.out ¨Ã¦s¡C µM¦Ó¡AÀHµÛ®É¶¡ªº¹L¥h¡AFreeBSDªº build tools ºt¤Æ¦¨¥­¦æªº¨â­Ó ¤ä½u(¤×¨ä¬O²Õ;¹©M¸ü¤J¾¹)¡CFreeBSD³o±ø¸ô¥[¶i¤F¦@¨É¨ç¦¡®w (shared libraries)¨Ã­×¥¿¤F¤@¨Ç¿ù»~¡C¦Ó­ì¨Óµo®i³o¨Çµ{¦¡ªº GNU ¦¨­û «h¬°¤F¦]À³²{ªp¡A­«¼g¤F³o¨Çµ{¦¡¡A¥H§ó²³æªº¤è¦¡¹ï¸ó¥­¥x½sĶ (building cross compilers)¡A¥H¤Î¦hºØ®æ¦¡ (plugging in different formats) §@¥X¤F¤ä´©¡C³\¦h¤H·Q§@¥X¥H FreeBSD ¬°¥Øªº¥­¥xªº¸ó¥­¥x½s;¹¡C¦ý¤£©¯ªº¬O¡AFreeBSD ªº as ©M ld ¤£¯à§@ ³o¶µ¤u§@¡C·sªº GNU ¤u¨ãµ{¦¡¥[¤J¤F¸ó¥­¥x½sĶ (Cross Compiler)¡A ELF®æ¦¡¤ä´©¡A¦@¨É¨ç¦¡®w(shared libraries)¡A C++ ªºÂX¥R... µ¥µ¥¡C¦¹¥~¡A³\¦h¼t°Ó¥H ELF ®æ¦¡ µo¦æ¨ä²£«~¡A¦pªG³o¨ÇªF¦è¯à¦b FreeBSD ¤W°õ¦æªº¸Ü·íµM¬O³Ì¦nªº¡C¬JµM¡A ¯à°÷°õ¦æ ELF ®æ¦¡ªº°õ¦æÀɤF¡A¬°¤°»òÁÙ¶·­n a.out ©O¡H¥¦¤w¸g¬O¤@¤Ç««««¦Ñ¨oªº°¨¤F¡A¦bºÜ¤O ºÉ©¾ªº©^Äm³o»ò¦h¦~¤§«á¡A¸Ó¬OÅý¥¦¦bªª³õªÎ¨Uªº¯ó¦a¤W¦n¦n¥ð®§ªº®É­Ô ¤F¡C ELF ®æ¦¡¤ñ a.out ¨ã¦³§ó¨}¦nªº®i²{¯à¤O¡A¨Ã ¥B¦b©³¼h¨t²Î¤¤¨ã¦³§ó¦hªº¥iÂX®i©Ê¡CELF ¤u¨ãµ{¦¡ §ó®e©ö³QºûÅ@¡A¥B´£¨Ñ¸ó¥­¥x½sĶªº¤ä´©¡A³o¤@ÂI¹ï«Ü¦h¤H¨Ó»¡¬O«Ü­«­n ªº¡CELF ®æ¦¡¥i¯à¤ñ a.out ºC¤@ÂI¡A¦ý¬O¨ä®t²§«D ±`Ãø´ú¶q¥X¨Ó¡C³o¨âªÌ¶¡ÁÙ¦³³\¦h²Ó¸`¤Wªº¤£¦P¡A¤ñ¤è»¡¤À­¶¹ïÀ³ªº¤è¦¡¡A µ{¦¡½Xªì©l¤Æªº¤èªk...µ¥µ¥¡C³o¨Ç¨Ã¤£¬O«Ü­«­n¡A¦ý¬O¡A¨âªÌ´N¬O¤£¦P¡C ¥H«á¡AGENERIC ®Ö¤ß(kernel)±N·|²¾°£¹ï a.out ®æ¦¡¡C·í¤£¦b¦³°õ¦æ¶Ç²Î a.out µ{¦¡ªº¶·­n®É¡A ±N·|±q®Ö¤ß(kernel)¤¤²¾°£¡C ¬°¬Æ»òchmod¤£·|§ïÅܲŸ¹³sµ²(symlink)ªº¦s¨úÅv­­¡H Symlinks ¥»¨­¨Ã¨S¦³¦s¨úÅv­­¡A¦P®É¡A¦b¹w³]ªºª¬ªp¤U¡A &man.chmod.1; ±N¤£·|¸òÀHµÛ symlinks ¥h§ï«K¥Ø¼ÐÀɮתº¦s¨úÅv­­¡C¦]¦¹¡A ¦pªG§A¦³¤@­ÓÀÉ®× foo¡A¦P®É¡A¦³¤@­Ó symlink bar «ü¦V³o­ÓÀɮסA¥H¤U³o­Ó©R¥O±N¥Ã»··|¦¨¥\ ªº³Q°õ¦æ¡C &prompt.user; chmod g-w bar µM¦Ó¡A¦b foo ¤Wªº¦s¨úÅv­­±N¤£·|³Q§ï ÅÜ¡C §A¥²»Ý¨Ï¥Î ©Î¬O±N »P ¿ï¶µ¤@°_¨Ï¥Î¡A°Ñ¦Ò &man.chmod.1; ¥H¤Î &man.symlink.7; ¥H¨ú±o§ó¦hªº¸ê°T¡C ¨Ï¥Î¿ï¶µ ·|Åý &man.chmod.1; ¥H »¼°j(RECURSIVE) ªº¤è¦¡¤u§@¡C·í§A§â &man.chmod.1; ¥Î¦b¥Ø¿ý©Î¬O³sµ²¨ì¥Ø¿ýªº²Å¸¹³sµ²®É§ó­n¤p¤ß¡C ¦pªG§A­n§ïÅܤ@­Ó²Å¸¹³sµ²°Ñ¦Ò¨ìªº¥Ø¿ý¤§¦s¨úÅv­­ &man.chmod.1; ¡A ¥Bª`·N¤£­n¥[¤W¥ô¦ó¿ï¶µ¡A¨Ã¥B¦b symlink ªºµ²§À¥[¤W±×½u (/)¡CÁ|¨Ò¨Ó»¡¡A¦pªG foo ³sµ²¨ì¥Ø¿ý bar¡A ¦Ó§A­n§ó§ï foo (¹ê»Ú¤W¬O bar)¡A¨º´N¨Ï¥Î¡G &prompt.user; chmod 555 foo/ µ²§Àªº±×½u·|¨Ï±o &man.chmod.1; §ïÅÜ foo ©Ò«ü¦Vªº¥Ø¿ý bar ªºÅv­­¡C ¬°¤°»ò¦b FreeBSD 2.2.x ¤Î§ó¦­ªºª©¥»¤¤¡Aµn¤J¦WºÙ(login names) ³Q­­¨î¦b¤K­Ó¦r¤¸¥H¤U©O¡H §A¥i¯à»{¬°­×§ï UT_NAMESIZE «á¦b­«·s½s;ã­Ó ¨t²Î¬O«Ü®e©öªº¨Æ¡C¦Ó¥B¦b³o¤§«á¡A¨C¥ó¨Æ³£¥i¥H¹B§@ªº«Ü¦n¡C¤£©¯ªº¬O¡A ¦³³\¦hªºµ{¦¡©M¤u¨ã(¥]§t¨t²Î¤u¨ã)§â¼Æ¦r¼g¦º¦bµ{¦¡¸ÌÀY(¨Ã«DÁ`¬O 8 ©Î 9¡A¦³®É¥i¯à¬O¥j©Çªº 15 ©Î 20)¡C³o¤£¶È¶È¬O·|±N §Aªº¨t²Î°O¿ýÀɧËÃa¦Ó¤w(¨Ó¦Û©óÅܰʪø«×©M©T©wªø«×°O¿ýªº®t²§)¡A¦P®É ¤]·|¯}Ãa Sun ªº NIS Client ªº¹B§@¡C¦P®É¡A©M¨ä¥LªºUnix¨t²Î¤§¶¡¤] ¦³¥i¯à·|²£¥Í¥¼ª¾ªº°ÝÃD¡C ¦bFreeBSD 3.0 ¤Î¤§«áªºª©¥»¡A±b¸¹ªº³Ì¤jªø«×¼W¥[¨ì16­Ó¦r¤¸¡A ¦P®É¡A¨º¨Ç±Nªø«×¼g¦ºªºµ{¦¡¤]³Q§ä¥X¨Ó¨Ã§@¤F¾A·íªº­×¥¿¡C¥¿¦]¬°¼vÅT ¨t²Îªº½d³ò«Ü¼s¡A©Ò¥Hª½¨ì3.0ª©¤§«á¤~ºâ¤j­P­×¥¿§¹¦¨¡C ¦pªG§A¦³¦Û«H¦b¥X°ÝÃDªº®É«á¯à¦Û¦æ¸Ñ¨M¡A§A¥i¥H§Q¥Î¤U­±ªº¤èªkÅý ¸û¦­´Áªºª©¥»¤ä´©¸ûªøªº±b¸¹¡C­º¥ý¡A­×§ï /usr/include/utmp.h ¤¤ªºUT_NAMESIZE¡C µM«á¡A§A¥²¶·§â /usr/include/sys/param.h ¤¤ªº MAXLOGNAME §ï¦¨¸ò UT_NAMESIZE ¬Û¦P¡C³Ì«á¡A¦pªG§A¬O±q­ì©lµ{ ¦¡«Ø¥ß¨t²Î, §O§Ñ¤F /usr/include ¨C¦¸³£·|³Q§ó·s¡C ­×§ï /usr/src/.. ¤¤¾A·íªºÀɮסC §Ú¯à¦bFreeBSD¤U°õ¦æDOSµ{¦¡¶Ü¡H ¬Oªº¡A¦Û3.0ª©°_§A¥i¥H¨Ï¥ÎBSDIªº doscmd DOS ¼ÒÀÀ¾¹¡A¦pªG§A¹ï³o­ÓªF¦è ¦³¿³½ì¡A©Î¬O·Q¥[¤Jµo®i¦æ¦C¡A½Ð±H¤@«Ê¹q¤l¶l¥ó¨ì &a.emulation; ¡C ¹ï©ó3.0¤§«eªº¨t²Î¡A¦b ports ¤¤¦³¤@®M³nÅé¥i¥H¼Òèö 8088¡A¨Ã´£ ¨Ñ¨¬°÷ªºBIOS¤¤Â_ªA°È¥H°õ¦æDOS¤å¦r¼Ò¦¡ªºµ{¦¡¡A³o®M³nÅé¥s°µ pcemu¡A¦P®É¡A¹B¦æ¥¦¶·­n X Windows(¥ÑXFree86´£¨Ñ)¡C ¦pªG­n§âFreeBSD¤å¥ó½Ķ¦¨§Úªº¥À»y¡A§Ú»Ý­n§@¤°»ò¡H °Ñ¾\FreeBSD¤å¥ó¤¤ªº ½Ķ±`¨£°Ýµª¡C ¬°¤°»ò§Ú±H¨ì FreeBSD.org ¬ÛÃö¦a§}ªº¹q¤l¶l¥ó³£³Q°h¦^¤F©O¡H FreeBSD.org ªº¶l¥ó¨t²Î¹ï©ó¶i¨Óªº¶l¥ó±Ä¨úÄY®æªºÀˬd¡A¨Ã¥B°h¦^ ©Ò¦³³]©w¤£¥¿½T¡A©Î¬O¼ç¦bªº©U§£¶l¥ó¡C§Aªº¶l¥ó³Q°h¦^¥i¯à¬O¦]¬°¤U¦C ­ì¦]©Ò¤Þ°_¡G ³o«Ê¹q¤l¶l¥ó¨Ó¦Û¤wª¾ªº©U§£¶l¥ó°Ï°ì©Î¬OIP¤¤¡C FreeBSD¶l¥ó¦øªA¾¹±N©Úµ´±µ¦¬¤wª¾ªº©U§£¶l¥ó¨Ó·½ªº¹q¤l¶l¥ó¡C ¦pªG´£¨Ñ§Aºô¸ôªA°Èªº¤½¥q©Î¬Oºô°ì¤¤¦³²£¥Í¹L©U§£¶l¥ó©Î¬O¦³©U§£ ¶l¥óÂ༽¯¸¡A½Ð§A´«¤@­ÓªA°È´£¨ÑªÌ¡A©Î¬O°®¯Ü©ñ±ó¡C ¹q¤l¶l¥óªº¥»¤å¶È¦³HTML¡C ¶l¥óÀ³¸Ó¤w¯Â¤å¦r®æ¦¡µo°e¡A½Ð³]©w§Aªº¹q¤l¶l¥ó³nÅé°e¥X¯Â¤å ¦r®æ¦¡¡C FreeBSDªº¶l¥ó³B²zµ{¦¡µLªk¥ÑIP¤Ï¬d°e¥ó¥D¾÷ªºIP¡C ³]¸m DNS ¤Ï¬d¬O±µ¨ü¤@¥x¥D¾÷¶l¥óªº¤@­Ó¼Ð·Ç­n¨D¡A½Ð¬°±zªº¶l¥ó ¥D¾÷³]¸m DNS ¤Ï¬d¡C³\¦h´£¨Ñ®a®xºô¸ôªA°È (DSL¡Acable¡Adialup µ¥) ªº¤½¥q¨Ã¤£´£¨Ñ³o¼ËªºªA°È¡C¦b³oºØ±¡ªp¤U¡A½Ð³z¹Lºô¸ôªA°È´£¨ÑªÌªº ¶l¥ó¦øªA¾¹°e¥X±zªº¹q¤l¶l¥ó¡C ¦b SMTP ¨Ï¥Î EHLO/HELO ©R¥O®É©Òµ¹¤©ªº hostname µLªk³Q¸ÑªR¨ì ¤@­Ó IP ¦ì¸m¡C ¦b¶l¥ó³Q±µ¨ü¥H«e¡A¤@­Ó¥R¤À¦X®æ¡A¥B¥i³Q¸ÑªRªº¥D¾÷¦WºÙ¦b SMTP ¨ó©wªº¹ï½Í¤¤¬O¥²­nªº¡C¦pªG§A¨S¦³¦b DNS ¦øªA¾¹¤¤µn°O§A ªº¥D¾÷¦WºÙ¡A½Ð³z¹Lºô¸ôªA°È´£¨ÑªÌªº¶l¥ó¦øªA¾¹°e¥X±zªº¹q¤l¶l ¥ó¡C §Aªº°T®§¤¤§¨±aµÛ¤@­Ó message ID ¥H localhost ¦r¦êµ²§ô¡C ¬Y¨Ç¶l¥ó³nÅé²£¥Í¬Y¨Ç¤£¥¿½Tªº message ID¡A³o±N¤£³Q±µ¨ü¡C §A¥²»Ý§ó§ï³]©wÅý§Aªº¶l¥ó³nÅé²£¥Í¥¿½Tªº message ID¡A¦pªG³oµL ªk¸Ñ¨M¡A¦Ò¼{»¡ªA§Aªº¶l¥ó³nÅé§@ªÌ§ó·sµ{¦¡¥H³B²z³o­Ó°ÝÃD¡C §Ú¥i¥H¦b­þ¸Ì§ä¨ì¤@­Ó§K¶OªºFreeBSD±b¸¹¡H FreeBSDªº¦øªA¾¹¥»¨­¤£´£¨Ñ¥ô¦ó¹ï¥~ªºªA°È¡A¨ä¥Lªº³æ¦ì¤¤¡A ¦³¤H´£¨Ñ¶}©ñªº Unix ¨t²ÎªA°È¡C¨ä¤¤¦³¨Ç¥i¯à­n¦¬¨ú¨Ç³\¶O¥Î¡C Arbornet, Inc¡A ¤]³QºÙ¬° M-Net¡A¦Û 1983 ¦~°_´N¶}©l´£¨Ñ Unix ¨t²ÎªA°È¡C¤@¶}©l¡A ¥L­Ì¨Ï¥Î Altos ¨Ã°õ¦æ System III¡C¥L­Ì¦b 1991 ¦~Âà´«¨t²Î¦¨¬° BSD/OS¡C¦b 2000 ¦~¤»¤ë¡A¥L­Ì¦A«×§ó´«¦¨¬° FreeBSD¡CM-Net ¯àÅý¨Ï ¥ÎªÌ³z¹L SSH ¤Î telnet ³s½u¨ì¥D¾÷¡A¨Ã´£¨Ñ§¹¾ãªº FreeBSD ³nÅé¥H ¨Ñ¨Ï¥Î¡CµM¦Ó¡AM-Net §@¬°¤@­Ó«D¬Õ§Q²Õ´¹B¦æ¡A¦s¨úÅv¥u­­©ó¦¨­û©M ÃÙ§UªÌ¡AM-Net ¤]´£¨Ñ BBS ¨t²Î©Mºô¸ô²á¤ÑªA°È¡C Grex ´£¨Ñ¤F«D±` Ãþ¦ü M-Net ªºªA°È¡A¥]¬A¤F BBS ¨t²Î©Mºô¸ô²á¤Ñ¡CµM¦Ó¡A¾÷¾¹¬O¨Ï¥Î Sun 4M¡A¨Ã°õ¦æ SunOS¡C ¤°»ò¬O sup¡A§Ú¸Ó¦p¦ó¨Ï¥Î¥¦¡H SUP ªº·N«ä¬O Software Update Protocol¡A¥Ñ CMU µo®i¡A ¥Î¨Óºû«ù¾ã­Óµo®iªº¦P¨B¡C§Ú­Ì§Q¥Î¥¦«O«ù»·ºÝªº¯¸¥x©M­ì©l¯¸¥x¤§¶¡ ªº¦P¨B¤u§@¡C µM¦Ó¡ASUP ¦bÀW¼eªº¨Ï¥Î¤W¨Ã¤£¤Ó¤Íµ½¡A¦P®É¡A¥Ø«e¤]¤£¦A¨Ï¥Î¤F¡C ¥Ø«e«ØÄ³ºû«ù­ì©l½X¦P¨B§ó·sªº¤èªk¬O CVSup¡C ³o­Ó¥i·Rªº¤p¬õ¤Hªº¦W¦r¬O¤°»ò¡H ¦ü¥G¡A¥L¨Ã¨S¦³¤@­Ó¥¿¦¡ªº¦W¦r¡A©h¥B´NºÙ¨ä¬° BSD ¤p´cÅ] §a¡C¦pªG§A°õ·N­n¨Ï¥Î¤@­Ó¦W¦r¡C¨º´N¥s¥L ¤p°Êª«(beastie) §a¡Cµù¡Gbeastie ¦bŪ­µ¤W¸ò BSD «Ü±µªñ¡C §A¥i¥H¦bBSD¤p´cÅ]ªº ¥D­¶ ¤W¨ú±o§ó¦hªº¸ê°T¡C §Ú¯à¨Ï¥ÎBSDªº¤p´cÅ]¹Ï®×¶Ü¡H ¤]³\§a¡A§Ú¤]¤£½T©w¡CBSD¤p´cÅ]¹Ï®×ªºª©Åv¬OÄݩ󰨷²º¸Ä¬®æÄõ±Ð·| (Marshall Kirk McKusick)©Ò¾Ö¦³¡C§A¥i¥H¸ÕµÛ¥h¬d¬Ýºô­¶±Ô­zÃö©óBSD¤p´cÅ]¨v¹³ ¥H¨ú±o§ó¸Ô²ÓÃö©ó¨Ï¥Î¥Lªº¸ê°T¡C Á`Âkªº¨Ó»¡¡A¦pªG§A¯Âºé¬°¤F¦Û¤v·Q­nŲ½à¡A¨º»ò¡A§A¥i¥H¦Û¥Ñªº¨Ï ¥Î¨v¹³¡C¦pªG§A¬O­Ó¤H¨Ï¥Î¡A¥u­n±¡ªp¾A·í¡AÀ³¸Ó³£·|³Q³\¥i¡C¦pªG§A·Q ¦b°Ó·~¤W¨Ï¥Î¡A«h§A¥²»ÝÁpôĬ®æÄõ±Ð·|(Kirk McKusick)¥H¨ú±o³\¥i¡C ¦pªG§A»Ý­n§ó¶i¤@¨B¸Ô²Óªº¸ê°T¡A½Ð°Ñ¦Ò BSD¤p´cÅ]ªº­º­¶¡C §A¦³¥ô¦óªº BSD ¤p´cÅ]¹Ï®×¥i¥HÅý§Ú¨Ï¥Î¶Ü¡H §A¥i¥H¦b /usr/share/examples/BSD_daemon/ µo²{ eps ¤Î Xfig ¨âºØ®æ¦¡ªº¹ÏÀÉ¡C - - MFC ¥Nªí¤°»ò·N«ä¡H - - - - MFC ¬O¤@­ÓÁY¼g¡A¥¦¥Nªí¤F Merged From -CURRENT¡C - ¥¦³Q¨Ï¥Î¦b CVS logs ¤¤¡A¥Hªí¥Ü±q CURRENT ¤¤¾ã¦X¶i STABLE ¤À¤ä - ªº§ïÅÜ¡C - - - - - - BSD ¨s³º¥Nªí¤°»ò·N«ä¡H - - - - ¥¦¬O¤@ºØ©Ó¶Ç¦Û¶Â·t®É¥Nªº¥j¦Ñ¯µ±K»y¨¥¡A¶È¶È¦b¤º³¡¦¨­û¤§¤¤¡A - ¥H¤f¦Õ¬Û¶Çªº¤è¦¡®¨®¨ªº¬y¶ÇµÛ¡C¥¦¥Î¨Ó¥Nªí¬Y¨Ç¯«¯¦ªºªF¦è¡A¦ý¬O¡A - §Ú­ÌµLªk¹ï³o¨ÇªF¦è¥H½T¹êªº¤å¦r¥[¥H±Ô­z¨Ã¨ã¹³¤Æ¡A¥¦´X¥G¤£§@¥ô¦ó - ªºÂ½Ä¶»P¸ÑÄÀ¡C¦pªGµw¬O­n¥H¤HÃþ²{¦³ªº»y¨¥¥[¥H»¡©ú¡A¥u¯à»¡¥¦ªº·N - «ä¤j·§¤¶©ó ¤@¯Å¤èµ{¦¡Áɨ®(Formula-1 Racing Team)¡A - ¥øÃZ¬O¬ü¨ýªºÂI¤ß(Penguins are tasty snacks)¡A¥H¤Î - §Ú­Ì¤ñLinux§ó¨ã¦³«ÕÀq·P(We have a better sense of humor than Linux) - ³o¤TªÌ¤§¶¡¡C:-) - - ¦n¤F¡A¤£¸ò§A¶}ª±¯º¤F¡C¥¿½Tªº»¡¡ABSD ¬O - Berkeley Software Distribution ªºÁY¼g¡A³o¬O¥Ñ Berkeley - CSRG (Computer Systems Research Group) - ¿ï¨Ó·í§@¥L­Ì©Òµo¦æªº Unix ¦WºÙ¡C - - - - - - POLA ¥Nªí¤°»ò·N«ä¡H - - - - ³Ì¤ÖÅå³Y­ì«h¡C³o¥Nªí¤F FreeBSD ªºµo®i¹Lµ{¡A¥ô¦óªº§ïÅܨì¤F¨Ï - ¥ÎªÌºÝÀ³¸Ó«O«ù¤£Åý¨Ï¥ÎªÌ·P¨ìÅå³Y¡C¤ñ¤è»¡¡A±N - /etc/defaults/rc.conf ¤¤ªº¨t²Î±Ò°Ê¶¶§Ç¥ô·N - ªº§ó§ï±N¹H¤Ï³o­Ó­ì«h¡C - - - - - - ¤°»ò¬O repo-copy¡H + + §Ú¦b¤å¥ó¡B¶l»¼½×¾Â¤W¡A±`·|¬Ý¨ì¤@¨ÇÁY¼g¦r¡B§Þ³N¦r·J¡A³o¨Ç¥i¥H¥h­þÃä¬d©O¡H - ¤@¥÷ repo-copy (¥¦¬O repository copy ªºµuªí®æ) - ª½±µ°Ñ¦Ò¨ìCVS­Ü®w¤¤ªºÀɮסC - - ¨S¦³¤F¤@¥÷ repo-copy¡A¦pªG¤@­ÓÀÉ®×¶·­n³Q½Æ»s©Î¬O³Q·h²¾¨ì­Ü®w - ¤¤ªº¨ä¥L¦a¤è¡A½T»{ªÌ±N·|°õ¦æ cvs add ¥H§âÀÉ®× - ©ñ¨ì·sªº¦a¤è¡A¦P®É¡A¹ïÂÂÀÉ®×°õ¦æ cvs rm¡AÂÂÀÉ - ®×±N³Q²¾°£¡C - - ³o­Ó¤èªk¤£§Qªº¦a¤è¬O¡A¾ú¥vÀÉ®×(§Y¦b CVS °O¿ý¤¤)±N¤£·|³Q½Æ»s - ¨ì·sªº¦aÂI¡C¦b FreeBSD Project ¤¤¦Ò¼{¨ì¡A³o­Ó¾ú¥v°O¿ý¬O«Ü¦³¥Î³Bªº¡A - ¤@­Ó repository copy ¬O¸g±`³Q¥Î¨ìªº¡C³o¬O repository meisters - ¤@ª½¨Ï¥Î¨Ó±NÀɮ׽ƻs¶i­Ü®wªº¬yµ{¡A¦Ó«D¨Ï¥Î &man.cvs.1;¡C + ½Ð°Ñ¾\ + &os; ¦r·Jªí¡C ¬°¤°»ò§Ú¸Ó¦b·N¸}½ñ¨®´×ªºÃC¦â¡H ¤@­Ó³Ìµu³Ìµuªºµª®×¬O¡A§A¤£¸Ó¦b·N¡Cµy·Lªø¤@ÂIªºµª®×¬O¡AÁöµM §A¦³¯à¤O¦Û¤v¥h«Ø³y¤@®y¸}½ñ¨®´×¡A¦ý¬O¡A³o¤£¥Nªí¦]¬°§A¤£³ßÅw²{¦b³o ­Ó¸}½ñ¨®´×ªºÃC¦â¡A´N¤¤¤î¥Lªº«Ø¿v¡C³o­Ó¤ñ³ëªº·N«ä¬O¡A§A¤£»Ý­n¥hª§½× ¨C¤@­Ó²Ó¶µ¯S¼x¡A¥u¦]¬°§A¦³¿ìªk¥h§@¥¦¡C¬Y¨Ç¤Hªºµû½×¬O¡AÂø­µªº²£¥Í«× ¹ïÅܤƪº½ÆÂø©Ê¬Û¤Ï¦a¤ñ¨Ò¡C §óªø¥B¸û§¹¾ãªºµª®×¬O¡A¦b¸g¹Lªø®É¶¡ª§½×Ãö©ó¬O§_¸Ó±N &man.sleep.1; ªº¬í°Ñ¼Æ²¾°£¡A&a.phk;µoªí¤F¤@½gªø½× ¤@®y¦Û¦æ¨®½´ (¥ô¦óÃC¦âªº)¦b«C¯Üªº¯ó¦a¤W...¡C ¨º«h°T®§³Q¾A·íªº³¡¤À³Q¤Þ¥Î¦b¤U­±¡C
&a.phk; on freebsd-hackers, October 2, 1999 ¤°»ò¬OÃö©ó³o­Ó¸}½ñ¨®´×? ³¡¤Àªº¤H³o¼Ëªº¸ß °Ý§Ú¡C ³o¬O¤@­Ó«D±`ªø»·ªº¬G¨Æ¡A§_«h´N¬O¤@­Ó¥j¦Ñªº¬G¨Æ¡C¦ý¬O¨Æ¹ê¤W¡A ³o­Ó¬G¨Æ«D±`ªºµu¡CC. Northcote Parkinson ¦b1960¦~¥Nªì´Á¼g¤F¤@¥» ®Ñ¡A®Ñ¦W¬° Parkinson's Law¡A¦b³o¥»®Ñ¤¤¥]§t¤F«Ü¦h ¨ã¦³¨ô¨£ªº°ÊºAºÞ²z¾Ç¡C [¤Þ­z¤@ÂI¦b³o¥»®Ñ¤Wªºµû½×] ¦b³o­Ó³Q±²¤J¸}½ñ¨®´×®×ªº¯S®í¨Ò¤l¡A¥D­nªº­n¯À¬O®Ö¯àµo¹q³õ¡A §Ú·Q¡A³o¨¬¥H»¡©ú³o¥»®Ñªº¦~ÄÖ¡C Parkinson ®i¥Ü¤F§A¸Ó¦p¦ó¦b¸³¨Æ·|¤¤Ä¹±oÃÙ¦P¥h«Ø³y¤@®y¼Æ¦Ê¸U ©Î¬Æ¦Ü¤Q»õ¬ü¤¸ªº®Ö¯àµo¹q³õ¡A¦ý¬O¡A¦pªG§A·Q­n¥h«Ø³y¤@®y¸}½ñ¨®´×¡A §A±N·|³QªÈÄñ¦bµL½aµLºÉªº°Q½×¤§¤¤¡C Parkinson ¸ÑÄÀ¡A³o¬O¦]¬°¤@­Ó®Ö¯àµo¹q³õ¬O³o¼Ëªº¼sÁï¡A³o¼Ëªº ©ù¶Q¡A¨Ã¥B³o¼Ëªº½ÆÂø¡A¥H¦Ü©ó¤H­ÌµLªk´x´¤¥¦¡A¦Ó¨Ã«D¹Á¸Õ¡A¥L­Ì«æ ¤Áªº§Æ±æ¦³¤H¯à°÷À°¥L­Ì³B²z¨Ã¸Ñ¨M©Ò¦³º¾¸Hªº²Ó¶µ¡C Richard P. Feynmann µ¹¤F¤@¨Ç¦³½ì¡A¥B«D±`¤@°w¨£¦åªº½×ÂI¡A¦b¥Lªº ®Ñ´£¨ì¤F Los Alamos ªº¨Ò¤l¡C ¥t¤@¤è­±¡A¥ô¦ó¤H³£¯à¦Û¤v¦b¶g¥½²Õ¸Ë¤@®y¸}½ñ¨®´×¥X¨Ó¡A¨Ã¥B¤´ ¦³¶¢²á¥i¥HÆ[½à¹qµø¤Îª±¹CÀ¸¡C¦]¦¹¡AµL½×§A§@¤F¦h»ò§¹µ½ªº·Ç³Æ¡A¤] ¤£ºÞ§A´£¥Xªº¤è®×¬O¦h»òªº¦X©y¡A¬Y¨Ç¤H¤´±N§ì¦í¾÷·|¶]¥X¨Ó§i¶D§A¡A ¥L¥¿¦b§@¦P¼Ëªº¨Æ¡A¥¿¦b¥I¥X§V¤O¡A¥L´N¦b ³o¸Ì¡C ¦b¤¦³Á¡A§Ú­ÌºÙ³o­Ó¥s§@ ªê¦º¯d¥Ö(setting your fingerprint)¡C¥¦Ãö«Y¨ì§A ­Ó¤HªºÅº¶Æ©MÁn±æ¡A³oÃö«Y¨ì§A¬O§_¥i¥H«üµÛ¬Y¦a«á¹ïµÛ§O¤H»¡ ³o¸Ì! ³o¬O§Ú§@ªº¡C ³o¬O¬Fªv¤Hª««Ü­«­nªº¤@­Ó¯S¼x¡C¦ý¬O¡A®É¾÷¬O¤j¦h¼Æ¤H¥Á©Ò½á»Pªº¡C ·Q·Q¨º¨Ç¯d¦b¤ôªd¦a¤Wªº¸}¦L§a¡C
Edward Chuang
edwardc@firebird.org.tw
The FreeBSD Funnies How cool is FreeBSD¡H °Ý¡G¦³¤H°µ¹L FreeBSD °õ¦æ®Éªº·Å«×´ú¸Õ¶Ü¡H §Úª¾¹D Linux ¤ñ DOS ²D¡A¦ý¨SÅ¥¤H´£¹L FreeBSD¡A¦ü¥G«Ü¼ö¡C µª¡G¨S¦³¡A¦ý¬O¦b¨ýı¤W¦³°µ¹LµL¼Æ¦¸´ú¸Õ¡C§Ú­Ìé¤W¦ÛÄ@¨ü¸ÕªÌªº ²´·ú¡A¨Æ¥ý¦Aµ¹¥L­ÌªA¥Î 250 ²@§Jªº LSD-25 °g¤ÛÃÄ¡C35% ªº¨ü¸ÕªÌ»¡ FreeBSD ¹Á°_¨Ó¹³¾ï¤l¡A¦Ó Linux «h¬Oµµ¦âªººd¾ðªG¹ê¡C¾Ú§Ú©Òª¾¡A¨S ¦³¤@²Õ´£¨ì·Å«×¤W¯S§Oªº®t²§¡C«á¨Óµo²{¡A¦³¤Ó¦h¨ü¸ÕªÌ¦b´ú¸Õ®É¹Ú¹C¨« ¥X©Ð¶¡¼vÅT¨ì¼Æ¾Ú¡A³Ì«á¥u±o©ñ±ó¾ã­Ó½Õ¬d¡C§Ú·Q¤j³¡¥÷ªº¨ü¸ÕªÌ²{¦b¦b Apple ¤u§@¡AÄ~ Drag and Drop ¤§«á¡A¬ã¨s¥þ·sªº Scratch and Sniff ¹Ï§Î¬É­±¡CIt's a funny old business we're in¡I ¤£¶}ª±¯º¤F¡AFreeBSD ©M Linux ³£¨Ï¥Î HLT (halt) «ü¥O¥H¦b¨t²Î¶¢¸m®É­°§C¹q¤Oªº¨Ï¥Î¤]´î¤Ö¤F¼öªº²£¥Í¡C¦pªG¦³ ³]©w APM (automatic power management)¡AFreeBSD ¤]¥i¥HÅý CPU ¶i ¤J§C¹q¤O¼Ò¦¡¡C ½Ö¦b§Úªº°O¾ÐÅé´¡¼Ñ¤¤¨F¨F§@ÅT¡H¡H °Ý¡GFreeBSD ½s֤ͮ߮ɦ³°µ¬Æ»ò ©_¯S ªº¨Æ Åý°O¾ÐÅé¨F¨F§@ÅT¶Ü¡H·í½sĶ®É(ÁÙ¦³¶}¾÷®É½T»{³nºÐ«áªºµu¼È®É¶¡)¡A ¤]ºØ¦ü¥G¨Ó¦Û°O¾ÐÅé´¡¼Ñªº©_©ÇÁn­µ¡C µª¡G¬Oªº¡I¦b BSD ªº¤å¥ó¤¤§A·|±`±`¬Ý¨ì ­I«áÆF¡A ¤j³¡¥÷ªº¤H³£¤£ª¾¹D¨º¬O¤@ºØ¹ê»Ú¦s¦bªººë¯«Åé --- ´x±±µÛ§Aªº¹q¸£¡C §AÅ¥¨ìªºÁn­µ¬O³o¨Ç­I«áÆF¥H°ª­µ¤f­ï¦b·¾³q«ç¼Ë°µ³\¦hªº¨t²ÎºÞ²z¤u §@¡C ¦pªG³o¨ÇÁn­µ«Ü§xÂZ§A¡A¨Ó¦Û DOS ªº fdisk /mbr ´N¯àÂ\²æ¡A¦ý¦pªG¦³¬Û¤Ïªº®ÄªG ¤]¤£­nÅå³Y¡C¨Æ¹ê¤W¡A¦pªG¦b»ö¦¡¤¤Å¥¨ì Bill Gates ®£©ÆªºÁn­µ±q¤º «Øªº³â¥z¶Ç¨Ó¡A°¨¤W°k¦Ó¥B¤£­n¦^ÀY¡I ±q BSD ­I«áÆF¤£¥­¿Åªº¼vÅT¤¤ ¸Ñ©ñ¡ADOS ©M Windows ­I«áÆF³q±`³£¯à­«·s±±¨î¾ã¥x¾÷¾¹¨Ã¹ï§AªºÆF »î¶A©G¡C¦pªG¦³¿ï¾Ü¡A§Ú·Q§Ú¹çÄ@²ßºD©_©ÇªºÁn­µ¡C ­n´X­Ó FreeBSD hacker ¤~¯à´«±¼¤@­Ó¹q¿Oªw¡H ¤@¤d¤@¦Ê¤C¤Q¤G­Ó¡G ¤G¤Q¤T­Ó¦b -current ¤W©ê«è¬Ý¤£¨ì¥ú¤F¡F ¥|­Ó«ÅºÙ³o¬O³]©w¤Wªº°ÝÃD¡A©Ò¥H¹³³o¼Ëªº email À³¸Ó©ñ¦b -questions¡F ¤T­Ó submit PR¡A¨ä¤¤¤@­Ó°e¿ù¨ì doc ¤U¡A¨Ã¥B¤º®e¥u ¦³¡¨³o¸Ì¦n·t¡¨¡F ¤@­Ó commit ©|¥¼´ú¸Õªº¹q¿Oªw¡A³y¦¨¤£¯à buildworld¡A ¤­¤ÀÄÁ«á¥L§â­ì¨Óªº¿Oªw´«¦^¨Ó¡F ¤K­Óº´°_ flame war¡A³d©Ç°e¥X PR ªº¤H¨S¦³¥]¬A patch¡F ¤­­Ó®I«è buildworld Äê±¼¤F¡F ¤T¤Q¤@­Ó»¡ buildworld ¥i¥H¥Î¡A¤£¯à¥Îªº¤H¤@©w¬O cvsup ªº ®É¾÷¤£¹ï¡F ¤@­Ó§â´«¦¨·s¿Oªwªº patch ¥á¨ì -hackers ¤W¡F ¤@­Ó»¡¥L¤T¦~«e´N°µ¥X¤F patch¡A¦ý°e¨ì -current «á«o³Q©¿²¤±¼¡A ©Ò¥H¥L¹ï¾ã­Ó PR ¨t²Î¦³«Ü¤£¦nªº¦L¶H¡C¦¹¥~¡A¥L¤]»{¬°®³¥Xªº·s¿OªwµL ªk¤Ï¥ú¡F ¤T¤Q¤C­Ó©H­ý»¡¹q¿Oªw¤£ÄÝ©ó°ò¥»¨t²Îªº¤@³¡¥÷¡A©Ò¥H committer ¤£¯à¤£¥ý¿Ô¸ß¾ã­Ó Community ªº·N¨£´N³o¼Ë°µ¤U¥h¡CÁÙ¦³¡A-core ¨ì©³©M³o¥ó¨Æ¦³¤°»òÃö«Y¡H¡I ¨â¦Ê¤H©ê«è´«¿Oªw¤§«á¡A¸}½ñ¨®´×ªºÃC¦âÅܱo¦n©_©Ç¡F ¤T­Ó«ü¥X¡A¥Î¨Ó´«¿Oªwªº patch ¤£²Å¦X &man.style.9; ªº³W©w¡F ¤Q¤C­Ó®I«è®³¥X¨Óªº·s¿Oªw¬°¤°»ò¬O¥Î GPL¡F ¤­¦Ê¤K¤Q¤»¤H³´¤J¤@³õ flame war¡A¦b GPL¡BBSD¡BMIT¡BNPL ¦U­Ó license ©M FSF ¬Y¦ì¤£¨ã¦W³Ð¿ì¤H¤h­Ó¤H½Ã¥Í¤§¶¡¡A¤ñ¸û©¼¦¹ ªºÀu¶Õ¡F ¤C­Ó±N³o¤@¦ê°Q½×ªº¤£¦P³¡¥÷¤À§O²¾¨ì -chat ©M -advocacy¡F ´Nºâ´£¥Xªº·s¿Oªw¤ñªº·t¡AÁÙ¬O¦³¤@­Ó§â¥¦ commit ¶i¨Ó¡F ¨â­Ó´«¦^­ì¥ýªº¿Oªw¡A¨Ã¥B¯d¤U·¥¬°¼««ãªº commit °T®§¡C¥L­Ì»{¬° »P¨äÅý FreeBSD ¥Î·t¿Oªw¡AÁÙ¤£¦p°®¯Ü«Ý¦b¶Â·t¤¤ºâ¤F¡F ¥|¤Q¤»¤H¹ï¨ú®ø¤£¥Î·t¿Oªw³o¥ó¨Æ¤jÁn¯e©I¡A­n¨D -core ¥ß¨è´£¥X¼á²M¡F ¤Q¤@­Ó­n¨D´«¦¨¤p¤@ÂIªº¹q¿Oªw¡A¥H«K¥¼¨Ó FreeBSD ¦pªG²¾´Ó¨ì ¹q¤lÂû¤W«á·|§ó¬°¤è«K¡F ¤C¤Q¤T¤H©ê«è -hackers ©M -chat ¤Wªº SNR¡AÂÇ unsubscribe ¨Óªí¥Ü§Üij¡F ¤Q¤T­Ó°e¥X¡¨unsubscribe¡¨¡B¡¨§Ú­n¦p¦ó unsubscribe¡¨©Î¡¨«ô°U§â §Ú±q list ¦W³æ¤¤§R±¼¡¨¡A«Hªº³Ì«á­±«h¬O¤@¯ë¥Ñ majordomo ¥[¤W¥h ªº footer¡F ·í¨C­Ó¤H¦£©ó©¼¦¹¥s½|®É¡A¦³­Ó³Ã¥ë¶X¨S¤Hª`·N¡A§â¥i¥H¥Îªº¿Oªw°½ °½´«¤W¥h¡F ¤T¤Q¤@­Ó«ü¥X¦pªG¥Î TenDRA ½sĶ·sªº¿Oªw¡A·|¤ñªº¨Ó±o«G 0.364%¡]ÁöµM¿Oªw·|³Q½sͦ¨¥¿¤»­±Åé¡^¡A©Ò¥H FreeBSD ¤º©wªº½s;¹ À³¸Ó¬O TenDRA¡A¦Ó¤£¬O EGCS¡F ¦³­Ó¤H»¡·s¿Oªw¯Ê¥F¬ü·P¡F ¤E­Ó¤H¡]¥]¬A­ì¥ý°e PR ªº¤H¡^°Ý¡¨¤°»ò¬O MFC¡H¡¨¡F ¤­¤Q¤C­Ó©ê«è¦Û±q´«¤F¿Oªw«á¡A¨â­Ó¬P´Á³£¨S¦³¥ú¥X²{¡C &a.nik; ¸Éª`¡G ­è¬Ý¨ì®É¡A§Ú§Ö¯ºÂ½¤F¡C µM«á·Q¨ì¡A¡¨µ¥¤@¤U¡A¤£¬OÀ³¸ÓÁÙ¦³¤@­Ó­n±N³o¨Ç°O¦b list ¤W¶Ü¡H¡¨ ±µµÛ²×©ó¤F¸Ñ§Úªº¨Ï©R :-) ¼g¤J /dev/null ªº¸ê®Æ¶]¨ì­þ¸Ì¥h¤F¡H ¦b CPU ¤¤¦³¤@ºØ¯S§Oªº¸ê®Æ´²¼ö¾¹¡A§Q¥Î±Æ¥X´²¼ö¤ù/­·®°²Õ¦X®É¡A Âà´«¦¨¼ö¯à¡D³o´N¬O¬°¤°»ò CPU §N«o¤éÁÍ­«­nªº­ì¦]¡F·í¤H­Ì¨Ï¥Î§ó§Ö ªº³B²z¾¹®É¡A¥L­ÌÅܦ¨¤£¦b¥G¦³¶V¨Ó¶V¦h¥L­Ìªº¸ê®Æ³£°e¶i¤F /dev/null ¡A¦Ó¨Ïªº¥L­Ìªº CPU ¹L¼ö¡D ¦pªG§A§R°£¤F /dev/null (¨º±N·|¦³®ÄªºÃö³¬ CPU ªº¸ê®Æ´²¼ö¾¹) §Aªº CPU ¤]³\·|­°§C¤u§@·Å«×¡A¦ý¬O§Aªº¨t²Î±N ·|«Ü§Öªº¹³¬O¿©±w¤F«K¯µ¦ñÀHµÛ©Ò¦³¶W¥Xªº¸ê®Æ¶}©lÅܦ¨¦æ¬°¤£¥¿±`¡C ¦pªG§A¦³§Ö³tªººô¸ô³s½u¡A§A¥i¥H§Q¥ÎŪ¨ú /dev/random ¨Ã±N¥LÀH·N¶Ç°e¦Ü¦U³B¡A ¨Ó­°§C§A CPU ªº·Å«×¡FµM¦Ó§A±N³´¤J¨Ï§Aºô¸ô³s½u©Î / ¦³¹L¼öªº­·ÀI©Î¬O·S´o§Aªº ISP¡A ¤j³¡¤Àªº¸ê®Æ³Ì²×±N·|¦b¥L­Ìªº³]³Æ¤WÂà´«¦¨¼ö¡A¤£¹L¥L­Ì³q±`³£¾Ö¦³ ¦nªº´²¼ö¡A©Ò¥H¦pªG§A°µªº¤£¤Ó¹L¤À¡AÀ³¸Ó¬O¨S¤°»ò¤j¤£¤Fªº¡C Paul Robinson ¸É¥R¡G ¤¤¤åª© FAQ ª`¡G¥H¤Uµu¤åÄÝ©ó¬ü¦¡«ÕÀq¡A®£Â½Ä¶«á³y¦¨»y²j¤£¸Ô¡A »y·N¤£³qªº±¡§Î¡A©T«O¯d­ì¥Ä­ì¨ýÅýŪªÌ¦Û¦æ«~À|¡C There are other methods. As every good sysadmin knows, it is part of standard practise to send data to the screen of interesting variety to keep all the pixies that make up your picture happy. Screen pixies (commonly mis-typed or re-named as 'pixels') are categorised by the type of hat they wear (red, green or blue) and will hide or appear (thereby showing the colour of their hat) whenever they receive a little piece of food. Video cards turn data into pixie-food, and then send them to the pixies - the more expensive the card, the better the food, so the better behaved the pixies are. They also need constant simulation - this is why screen savers exist. To take your suggestions further, you could just throw the random data to console, thereby letting the pixies consume it. This causes no heat to be produced at all, keeps the pixies happy and gets rid of your data quite quickly, even if it does make things look a bit messy on your screen. Incidentally, as an ex-admin of a large ISP who experienced many problems attempting to maintain a stable temperature in a server room, I would strongly discourage people sending the data they do not want out to the network. The fairies who do the packet switching and routing get annoyed by it as well.
En-Ran Zhou
zhouer@tfcis.org
¶i¶¥¥DÃD ¦p¦ó¯à¾Ç²ß§ó¦h¦³Ãö FreeBSD ¤º³¡ªºªF¦è¡H ¥Ø«e¥«­±¤WÁÙ¨S¦³±´°Q§@·~¨t²Î¤º³¡ªº®Ñ¬O±M¬° FreeBSD ¦Ó¼g ªº¡CµM¦Ó¡A³\¦h¤@¯ëªº UNIX ª¾Ãѳ£¥i¥Hª½±µÀ³¥Î¦b FreeBSD ¤W¡Cªþ ¥[¤@ÂI¡A¤´µM¦³¬ÛÃöªº®Ñ¬O±M¬° BSD ©Ò¼gªº¡C ½Ð°Ñ¦Ò Handbook ªº§@·~¨t²Î¤º³¡¤§°Ñ¦Ò®Ñ¥Ø ¡C ¦p¦ó¯à¬° FreeBSD ¥X¤@¥÷¤O¡H ½Ð°Ñ¦Ò³o½g¤å³¹ Contributing to FreeBSD ¨Ó´£¨Ñ±zªº«ØÄ³¡C¦pªG±z¯àÀ°¦£¨º´N§óÅwªï¤F¡I SNAP ©M RELEASE ¬O¤°»ò¡H ¥Ø«e¦³¤T­Ó¬¡ÅD/¥b¬¡ÅDªº¤À¤ä¦b FreeBSD ªº CVS Repository (RELENG_2 ¤À¤ä¤@¦~¤j·§§ó°Ê¨â¦¸¡A¥¿¬O¬°¦ó¥u¦³¤T­Ó¬¡ÅDªºµo®i¤¤¤À¤ä)¡G RELENG_2_2 §Y 2.2-STABLE RELENG_3 §Y 3.X-STABLE RELENG_4 §Y 4-STABLE HEAD §Y -CURRENT §Y 5.0-CURRENT ¦p¦P¨ä¥L¨â­Ó¡AHEAD ¨Ã¤£¬O¯u¥¿ ªº branch tag¡A¥¦¥u¬O¤@­Ó²Å¸¹±`¼Æ¡A«ü¦V current (©|¥¼¤À¤äªºµo®i¤¤ª©¥») ²°O¬° -CURRENT¡C ¥H²{¦b¨Ó»¡¡A-CURRENT ´Â¦V 5.0 µo®i¡A¦Ó 4-STABLE ¤À¤ä¡A¤]´N¬O RELENG_4¡A¦b 2000 ¦~¤T¤ë±q -CURRENT ¤À¤ä¥X¨Ó¡C 2.2-STABLE ³o­Ó¤À¤ä¡A¤]´N¬O RELENG_2_2¡A¦b 1996 ¦~¤Q¤@¤ë±q -CURRENT ¤À¤ä¥X ¨Ó¡A³o­Ó¤À¤ä¥Ø«e¤w¸g§¹¥þ°h¥ð¤F¡C ­n«ç»ò§@¥X¦Û¤vªº release¡H ½Ð°Ñ·Ó Release ¤uµ{ ¤å³¹»¡©ú¡C ¬°¤°»ò make world §â­ì¨Ó¸Ëªº binary ÀÉ ³£´«±¼¤F¡H ¨S¿ù¡A´N¬O³o¼Ë¤l¡C¦p¦W¦r©Ò¥Ü¡Amake world ·|­«·s½s͍t²Î¤º«Øªº¨C­Ó binary ÀÉ¡A³o¼Ë¦bµ²§ô®É´N¥i½T©w¦³­Ó¤@­P ¥B°®²bªºÀô¹Ò(©Ò¥H­nªá¤W¦n¤@¬q®É¶¡)¡C ¦b°õ¦æ make world ©Î make install ®É¡A¦pªG¦³³] DESTDIR ³o­ÓÀô¹ÒÅܼơA·s²£¥Íªº binary ±N·|¸Ë¦b ${DESTDIR} ¤U¦P¼Ëªº¥Ø¿ý¾ð¤¤¡C¦ý¦b¬Y¨Ç­×§ï shared library ©M­««Ø binary ªºµL¯S©w±¡ªp¤U¡A³o¼Ë°µ¥i¯à·|¨Ï make world ¥¢±Ñ¡C ¦b¨t²Î¶}¾÷®É¡A¥X²{ (bus speed defaulted)¡C Adaptec 1542 SCSI ¥d¤¹³\¨Ï¥ÎªÌ¥Î³nÅé½Õ¾ã¶×¬y±Æªº¦s¨ú³t«×¡C ¦­´Áªº 1542 ÅX°Êµ{¦¡¸Õ¹Ï±N¥¦³]¦¨¥i¥Îªº³Ì§Ö³t«×¡A¦ý«á¨Óµo²{¦b¤@ ¨Ç¾÷¾¹¤W¤£¯à¥Î¡A©Ò¥H²{¦b­n¦b kernel ³]©w¤¤¥[ TUNE_1542 ³o­Ó¿ï¶µ¨Ó±Ò°Ê³o­Ó¥\¯à¡C¦b¤ä´©ªº¾÷¾¹ ¤W¥Î³o­Ó¿ï¶µ·|¨ÏµwºÐ¦s¨ú§ó§Ö¡A¦ý¦b¤£¤ä´©ªº¾÷¾¹¤W¦³¥i¯à·|·´±¼¸ê®Æ¡C ¦bºô¸ôÀW¼e¦³­­ªº±¡ªp¤U¡A§Ú¤]¥i¥H¸ò¤W current ªºµo®i¶Ü¡H ¬Oªº¡AÂÇµÛ CTM ±z´N¥i¥H¤£¥Î¤U¸ü¥þ³¡ªºµ{¦¡½X¡C ¬O«ç»ò§âµo¦æª©¥»¤¤ªºÀɮפÁ¦¨¤@­Ó­Ó 240k ªº¤pÀɮתº¡H ¥H BSD ¬°°ò¦ªº¸û·s¨t²Î¦³­Ó ¿ï¶µ ¥i¥H§âÀÉ®×¥H¥ô·N¼Æ¥Ø byte ¤Á¶}¡C ³o¸Ì¬O /usr/src/Makefile ¤¤ªº¤@­Ó ¨Ò¤l¡G bin-tarball: (cd ${DISTDIR}; \ tar cf - . \ gzip --no-name -9 -c | \ split -b 240640 - \ ${RELEASEDIR}/tarballs/bindist/bin_tgz.) §Ú¦b kernel ¤¤¥[¤F·s¥\¯à¡A§Ú­n§â¥¦±Hµ¹½Ö¡H ½Ð°Ñ¦Ò Contributing to FreeBSD ¤¤ªº¤å³¹¡A¥H¤F¸Ñ­n¦p¦ó´£¨Ñ±zªºµ{¦¡½X¡C ¦P®É¤]ÁÂÁ±zªºÃö¤ß¡I ISA ªºÀH´¡§Y¥Î¥d¬O¦p¦ó°»´ú¤Îªì©l¤Æªº¡H ¥Ñ Frank Durda IV ©Ò¼g¡G uhclem@nemesis.lonestar.org ²³æªº»¡¡A·í¥D¾÷µo¥X¬O§_¦³ PnP ¥dªº¸ß°Ý°T¸¹®É¡A©Ò¦³ªº PnP ¥d ·|¦b´X­Ó©T©wªº I/O port §@¦^À³¡C©Ò¥H·í°»´ú PnP ªºµ{¦¡¶}©l®É¡A¥¦ ·|¥ý°Ý¦³¨S¦³ PnP ¥d¦b¡A±µµÛ©Ò¦³ PnP ¥d·|¦b¥¦Åªªº port ¥H¦Û¤vªº «¬¸¹ # §@¦^µª¡A³o¼Ë°»´úµ{¦¡´N·|±o¨ì¤@­Ó wired-OR yes ªº¼Æ¦r¡A¨ä¤¤¦Ü¤Ö·|¦³¤@­Ó bit ¬O¥´¶}ªº¡CµM«á°»´úµ{¦¡·|­n¨D«¬¸¹ (¥Ñ Microsoft/Intel«ü©w)¤p©ó X ªº¥dÂ÷½u¡C¦A¥h¬Ý¬O §_ÁÙ¦³¥d¦^µª¦P¼Ëªº¸ß°Ý¡A¦pªG±o¨ì 0¡A´Nªí¥Ü¨S ¦³«¬¸¹¤j©ó X ªº¥d¡C ²{¦bµ{¦¡·|°Ý¬O§_¦³«¬¸¹¤p©ó X ªº¥d¡A¦pªG¦³ªº¸Ü¡Aµ{¦¡¦A­n«¬¸¹¤j©ó X-(limit/4) ªº¥dÂ÷½u¡AµM«á­«ÂÐ ¤W­±ªº°Ê§@¡C¥Î­«½Æ³oºØÃþ¦ü semi-binary search ªº¤èªk¡A¦b¬Y½d³ò¤º §ä­Ó´X¦¸«á¡A´úµ{¦¡³Ì«á·|¦b¾÷¾¹¤¤°Ï¤À¥X©Ò¦³ªº PnP ¥d¡A·j´M¦¸¼Æ¤] »·§C©ó¤@­Ó­Ó§äªº 2^64 ¦¸¡C ¤@±i¥dªº ID ¥Ñ¨â­Ó 32-bit(©Ò¥H¤W­±¬O 2ˆ64) + 8bit °»¿ù½X ²Õ¦¨¡A²Ä¤@­Ó 32 bits ¬O¥Î¨Ó°Ï¤À¦U®a¼t°Óªº¡C³o¨Ç¼t°Ó±q¨Ó¨S¦³¥X¨Ó¼á ²M¹L¡A¦ý¬Ý¨ÓÀ³°²³]¦P¤@®a¥Xªº¤£¦PºØÃþªº¥dªº¼t°Ó ID ¦³¥i¯à¤£¦P¡C¥Î 32 bits ¥u¨Óªí¥Ü¤£¦P¼t°Óªº·Qªk¹ê¦b¦³ÂI¹LÀY¤F¡C ²Ä¤G­Ó 32 bits «h¬O«¬¸¹ #¡B¤A¤Óºô¸ô¦ì§}¡B©Î¤@¨Ç¨Ï³o±i¥d¿W¯Sªº ¸ê®Æ¡C°£«D²Ä¤@­Ó 32 bits ¤£¦P¡A§_«h¼t°Ó¤£¥i¯à§@¥X²Ä¤G­Ó 32 bit ¬Û ¦Pªº¨â±i¥d¡C©Ò¥H¦b¤@¥x¾÷¾¹¤¤¥i¥H¦³¦P¼Ëªº¦n´X±i¥d¡AµM¦Ó¥L­Ì¾ã­Ó 64 bits ÁÙ¬O·|³£¤£¤@¼Ë¡C ³o¨â­Ó 32 bit µ´¹ï¤£¥i¥H¥þ¬°¹s¡A³o¤~¯à¨Ï±o³Ì¶}©l binary search ¤¤ªº wired-OR ·|±o¨ì¤@­Ó«D¹s¼Æ¦r¡C ¤@¥¹¨t²Î°Ï¤À¥X©Ò¦³¥dªº ID¡A±µµÛ·|¸g¥Ñ¦P¼Ëªº I/O port ¤@­Ó­Ó­« ·s±Ò°Ê¨C±i¥d¡A±µµÛ§ä¥X¤wª¾¤¶­±¥d©Ò»Ýªº¸ê·½¡B¦³­þ¨Ç¤¤Â_¥i¥H¨Ï¥Îµ¥ µ¥¡C©Ò¦³¥d³£·|³Q±½´y¤@¦¸¡A¨Ó¦¬¶°³o¨Ç¸ê®Æ¡C ³o¨Ç¸ê°T±µµÛ©MµwºÐ¤Wªº ECU ÀɮסB©Î MLB BIOS ¸Ìªº¸ê®Æµ²¦X¦b¤@ °_¡A³q±`¬Oºî¦X ECU ©M MLB ¸Ìªº BIOS PnP ¸ê®Æ¡A³o¨Ç¶gÃä¨Ã¤£¤ä´©¯u¥¿ ªº PnP¡AµM¦Ó°»´úµ{¦¡¦bÀˬd BIOS ©M ECU ¸ê®Æ«á¡A¥¦¥i¥HÁ×§K PnP ¶gÃä ©M¨º¨Ç°»´ú¤£¨ìªº¬Û½Ä¬ð¡C ±µµÛ¦A«×«ô³X³o¨Ç PnP ¶gÃä¡A³o¦¸·|§â¥i¥Îªº I/O¡BDMA¡BIRQ ©M°O¾Ð Åé¬M®gªº¦ì§}³£«ü©wµ¹¥¦­Ì¡C³o¨Ç¶gÃä´N·|¥X²{¦b©Ò«ü©wªº¦a¤è¡Aª½¨ì¤U¤@ ¦¸­«·s¶}¾÷¬°¤î¡A¤£¹L¤]¨S¦³¤H»¡¤£¯à§â¥¦­ÌÀH®É²¾¨Ó²¾¥h¡C ¤W­±¦³¬Û·í¦hªºÂ²¤Æ¡A¦ý§AÀ³¸Ó¤w¸g¤F¸Ñ¤j­Pªº¹Lµ{¡C Microsoft §âªí¥Ü¦Lªí¾÷ª¬ºAªº´X­Ó¥D­n port ®³¨Ó§@ PnP¡A¥L­Ìªº ÅÞ¿è¬O¨S¦³¤@±i¥d·|¦b³o¨Ç¦a¤è¸Ñ½X§@¬Û¤Ïªº I/O cycles¡C¦ý¬O§Ú§ä¨ì ¤@´Ú¦­´Á¤´¦bµû¦ô PnP ´£®×®Éªº IBM ­ì¼t printer board¡A¥¦ªº½T¥h¸Ñ ¹ï³o¨Çª¬ºA port ªº¼g¤J¸ê®Æ¡A¦ý¬O MS »¡¤F´Nºâ¡C©Ò¥H ¥¦­Ìªº½T¦³¹ï¦Lªí¾÷ª¬ºA port ¼g¤J¡AÁÙ¦³Åª¨ú¸Ó¦ì§} + 0x800¡B©M¥t¤@­Ó¦b 0x200 ¤Î 0x3ff ¤§¶¡ªº port¡C §Ú¬°¬Y³]³Æ¼g¤FÅX°Êµ{¦¡¡A¯à¤£¯àµ¹¥¦¤@­Ó major number¡H ³o­n¬Ý§A¬O§_¥´ºâ±N³o­ÓÅX°Êµ{¦¡¤½¶}¨Ï¥Î¡A¦pªG¬Oªº¸Ü¡A½Ð§â¥¦ªº ­ì©l½X°e¤@¥÷µ¹§Ú­Ì¡AÁÙ¦³ files.i386 ­×§ïªº ³¡¥÷¡Bkernel ³]©wÀɼ˥»¡B¥H¤Î¥Î¨Ó²£¥Í³]³ÆÀɪº &man.MAKEDEV.8;¡C ¦pªG§A¤£¥´ºâ¤½¶}¡B©Î¦]¬°ª©Åv°ÝÃD¦Ó¤£¯à¤½¶}ªº¸Ü¡A§Ú­Ì¦³¯S¦a«O¯d character major number 32 ©M block major number 8 µ¹³o¤è­±ªº¨Ï¥Î¡A ª½±µ¥Î³o¨â­Ó´N¦n¤F¡C¤£½×¦p¦ó¡A§Ú­Ì³£·|«Ü·P¿E§A¯à¦b &a.hackers; µoªíÅX°Êµ{¦¡ªº®ø®§¡C Ãö©ó§ó°Ê¥Ø¿ý©ñ¸mªº­ì«h¡H ¦b¦^µªÃö©ó§ó°Ê¥Ø¿ý©ñ¸mªº­ì«h¤è­±¡A§Ú¦b 1983 ¦~¼g¦n¥Ø«eªº§@ªk «á´N¨S¦³¦A§ïÅܹL¡A³oºØ¤è¦¡¬O°w¹ï­ì¥ýªº FFS Àɮרt²Î¡A«á¨Ó¤]¨S¦³ ¹ï¥¦§@¥ô¦ó§ó°Ê¡C¥¦¦bÁ×§K cylinder group ³Q¶ñº¡³o¤è­±°µ±o¬Û·í¦¨¥\¡A ¦ý¬O´N¹³¦³¨Ç¤H¤w¸gª`·N¨ì¡A¥¦©M find ´N°t¦X±o¤£¤j¦n¡C¤j³¡¥÷ªºÀÉ®× ¨t²Î¬O¥Ñ¨º¨Ç¥Î depth first search(aka ftw) ²£¥Íªº archive »s³y¥X ¨Ó¡A¸Ñ¥X¨Óªº¥Ø¿ý inode ·|¾î¸ó¦n´X­Ó cylinder group¡A¦pªG¥H«á­n°µ depth first search ªº¸Ü¡A³o¬O³ÌÁV¿|ªº±¡ªp¤§¤@¡C¦pªG§Ú­Ìª¾¹DÁ`¦@ ·|²£¥Í¦h¤Ö¥Ø¿ýªº¸Ü¡A¸Ñªk¬O¦b°µ¥ô¦ó¦s¨ú/¼g¤J°Ê§@¤§«e¡A¦b¨C­Ó cylinder group ¤W¥ý³y¥X(©Ò¦³¥Ø¿ý¼Æ/cylinder greoup ªº¼Æ¥Ø)³o»ò¦h ªº¥Ø¿ý¡C«Ü©úÅ㪺¡A§Ú­Ì¥²¶·­n¦³®Ú¾Ú¦a¥h²q³o ­Ó¼Æ¦r¡A´Nºâ¤@­Ó¹³ 10 ªº«Ü¤p©T©w¼Æ¥Ø¤]·|¨Ï®Ä²v¥H¯Å¼Æ¦¨ªø¡C°Ï¤À restore (§Y¸Ñ¶}¤W­zªº archive) ©M¤@¯ëÀÉ®×¾Þ§@ªº¤èªk¥i¥H¬O(²{¦b¥Îªººtºâªk¥i¯à­n§ó±Ó·P)¡G ¦pªG¤@¨Ç¥Ø¿ý(³Ì¦h 10 ­Ó)³£¦b 10 ¬í¤º²£ ¥Íªº¸Ü¡A¨º»ò´N§â³o¨Ç¥Ø¿ý »E¶°¦b¦P¤@­Ó cylinder group¡C¤£ºÞ«ç¼Ë¡A §Úªº¸gÅç«ü¥X³o¬O¤@­Ó¤w¸g ¥R¥÷¹êÅç¹Lªº³¡¥÷¡C Kirk McKusick, September 1998 ¦p¦ó¦b kernel panics ®É±o¨ì³Ì¦hªº¸ê°T¡H [³o¸`¬O±q &a.wpaul; ¦b freebsd-current mailing list ¤Wµoªíªº«H¤¤¸`¿ý¡A &a.des; ­×¥¿¤F¥´¦r¿ù»~¡B¦A¥[¤W¬A©·¸Ìªºª`¸Ñ¡C] From: Bill Paul <wpaul@skynet.ctr.columbia.edu> Subject: Re: the fs fun never stops To: Ben Rosengart Date: Sun, 20 Sep 1998 15:22:50 -0400 (EDT) Cc: current@FreeBSD.org [Ben µoªí¤F¤U­±ªº panic °T®§] > Fatal trap 12: page fault while in kernel mode > fault virtual address = 0x40 > fault code = supervisor read, page not present > instruction pointer = 0x8:0xf014a7e5 ^^^^^^^^^^ > stack pointer = 0x10:0xf4ed6f24 > frame pointer = 0x10:0xf4ed6f28 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, def32 1, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 80 (mount) > interrupt mask = > trap number = 12 > panic: page fault ·í§A¬Ý¨ì¹³³o¼Ëªº°T®§®É¡A¥u§â¥¦«þ¤@¥÷°e¤W¨Ó¬O¤£°÷ªº¡C§Ú¦b¤W­± ¯S¦a¼Ð©úªº instruction pointer ­È¬Û·í­«­n¡A¤£©¯ªº¬O¥¦·|¦]³]©w¦Ó ¤£¦P¡C´«¥y¸Ü»¡¡A³o­Ó­È·|¸ò§A¥Îªº kernel image ÀɦÓÅܰʡC¦pªG¬O¥Î ¬Y­Ó snapshot ª©¥»ªº GENERIC kernel¡A¤]³\¨ä¥L¤H¥i¥H°lÂܨì¥X°ÝÃD ªº¨ç¦¡¡A¦ý¦pªG§A¬O¥Î¦Û­qªº kernel¡A¨º»ò¥u¦³ §A¤~¯à§i¶D§Ú­Ì°ÝÃD¥X¦b¨º¸Ì¡C ­n°µªº¨Æ¥]¬A³o¨Ç¡G §â instruction pointer ªº­È°O¤U¨Ó¡Cª`·N¦b«e­±ªº 0x8: ¦b³o­Ó±¡ªp¤¤¨Ã¤£­«­n¡A§Ú­Ì­nªº¬O 0xf0xxxxxx¡C ·í¨t²Î­«·s¶}¾÷«á¡A°õ¦æ³o¹D©R¥O¡G &prompt.user; nm -n /(³y¦¨ panic ªº kernel ÀÉ®×) | grep f0xxxxxx ¨ä¤¤ f0xxxxxx ´N¬O°O¤U¨Óªº instruction pointer ­È¡C¦³¥i¯à¤£·|­è¦n§ä¨ì§¹¾ãªº³o­Ó¦r¦ê¡A ³o¬O¦]¬° kernel symbol table ¸Ìªº¦U­Ó symbol ¥u¬O¨ç¦¡ªº¶i ¤JÂI¡A¦ý instruction pointer ©Ò«üªº¦ì§}¦³¥i¯à¬O¦b¨ç¦¡¤ºªº ¬Y¤@³B¡A¦Ó¤£¤@©w¦b¶}ÀY¡C©Ò¥H¦pªG§ä¤£¨ì¾ã­Ó¦r¦ê¡A¨º»ò§â instruction pointer ­Èªº³Ì«á¤@­Ó¼Æ¦r®³±¼¡A¦A¸Õ¤@¦¸¡G &prompt.user; nm -n /(³y¦¨ panic ªº kernel ÀÉ®×) | grep f0xxxxx ¦pªG³o¼Ë¤]§ä¤£¨ì¡A¨º´N§â¥t¤@­Ó¼Æ¦r¥h±¼¦A§ä¡A¤@ª½­«½Æ¨ì§ä¨ì ¬°¤î¡A µ²ªG¬O¤@¦ê¥i¯à³y¦¨ panic ªº¨ç¦¡¦Cªí¡C³o¼Ë¤ñª½±µ§ä¨ì ¥X°ÝÃDªº¨ç¦¡¨Ó±o®t¡A¦ý¦Ü¤Ö¦n¹L¤°»ò³£¨S¦³¡C §Ú±`±`¬Ý¨ì¤H­ÌÅã¥Ü¤@¤j¤ù panic °T®§¡A¦ý«Ü¤Ö¬Ý¨ì¦³¤Hªá¤@ÂI®É¶¡ §â instruction pointer ©M kernel symbol table ¤¤ªº¨ç¦¡¤ñ¸û¤@¤U¡C ­n°lÂÜ¥X³y¦¨ panic ­ì¦]ªº³Ì¦n¤èªk¬O¥ý°µ¥X crash dump¡AµM«á¥Î &man.gdb.1; ¦b¤W­±°µ stack trace¡C ¤£ºÞ¬O¨º¤@ºØ¡A§Ú³q±`¬O¥Î³o­Ó¤èªk¡G ¼g¦n kernel ³]©wÀÉ¡C¦pªG§A»Ý­n¥Î kernel debugger¡A¦b³] ©wÀɤ¤¥[¤W options DDB ³o­Ó¿ï¶µ¡C (·í§ÚÃhºÃ¦³¥X²{µL½a°j°é®É¡A³q±`·|¥Î³o­Ó¨Ó³]©w¤¤Â_ÂI¡C) ¥Î config -g KERNELCONFIG °µ¥X¥Î¨Ó½sĶªº¥Ø¿ý¡C cd /sys/compile/ KERNELCONFIG; make µ¥«Ý kernel ½s͵²§ô¡C make install ­«·s¶}¾÷ &man.make.1; ±N·|»s³y¥X¨â­Ó kernel¡Ckernel ÁÙ¦³ kernel.debug¡C kernel ±N·|³Q¦w¸Ë¨ì /kernel¡A¦Ó kernel.debug ¥i¥Î¨Óµ¹ &man.gdb.1; ·í§@ debugging symbols ªº¨Ó·½¡C ­n½T©w¯à§ì¨ì crash dump¡A¥ý½s¿è /etc/rc.conf ±N dumpdev «ü ¨ì swap ¤À³Î°Ï¡C³o¼Ë &man.rc.8; ·|¥Î &man.dumpon.8; ¨Ó±Ò°Ê crash dump¡A§A¤]¥i¥H¤â°Ê°õ¦æ &man.dumpon.8; ¦b panic ¤§«á¡A crash dump ¥i¥H¥Î &man.savecore.8; ¦s°_¨Ó¡F¦pªG /etc/rc.conf ¸Ì¦³³] dumpdev ¨º»ò­«·s¶}¾÷«á &man.rc.8; ·|¦Û°Ê°õ¦æ &man.savecore.8; §â crash dump ¦s¦b /var/crash¡C FreeBSD ªº crash dump ³q±`©M¾÷¾¹¸Ìªº¹ê»Ú°O¾ÐÅé¤@¼Ë¤j¡A´N ¹³¦pªG¦³ 64MB °O¾ÐÅé¡Acrash dump ¤j¤p´N¬O 64MB¡C©Ò¥H­n½T©w /var/crash ¤U¦³¨¬°÷ªºªÅ¶¡¡A©Î¬O¥i¥H¤â °Ê°õ¦æ &man.savecore.8; §â crash dump ©ñ¨ì¥t¤@­ÓªÅ¶¡¸û°÷ªº ¥Ø¿ý¤U¡C¥t¤@ºØ¤]³\¥i¥H­­¨î crash dump ªº¤èªk¡A¬O¦b kernel ³]©wÀɤ¤¥Î options MAXMEM=(foo)¡A±N kernel ¥i¥Îªº°O¾ÐÅé­­¨î¦b¦X²zªº¤j¤p¡CÁ|¨Ò¨Ó»¡¡A¦pªG§A¦³ 128MB ªº°O¾Ð Åé¡A¦ý¬O¥i¥H­­¨î kernel ¥u¯à¥Î 16MB ªº°O¾ÐÅé¡A³o¼Ë crash dump ´N¬O 16MB ¦Ó¤£¬O 128MB ¤F¡C ¤@¥¹µo²{¦³¤F crash dump¡A´N¥i¥H¥Î &man.gdb.1; ¨Ó°µ stack trace ¡A¦p¤U©Ò¥Ü¡G &prompt.user; gdb -k /sys/compile/KERNELCONFIG/kernel.debug /var/crash/vmcore.0 (gdb) where ­nª`·N¥i¯à·|¥X²{¦n´X­Ó¿Ã¹õªº¥i¥Î¸ê°T¡A§A¥i¥H¥Î &man.script.1; §â©Ò¦³¿é¥X³£¦s°_¨Ó¡C¥Î¥]¬A©Ò¦³ debug symbol ªº kernel ¨Ó°£¿ù¡A³o ¼ËÀ³¸Ó¥i¥Hª½±µÅã¥Ü panic ¬Oµo¥Í¦b¨º¤@¦æ¡C³q±`¬O¥Ñ¤U©¹¤WŪ stack strace¡A³o¼Ë¤~¯à¤@­Ó­Ó°lÂÜ¥X¦³­þ¨Ç°Ê§@¤Þ¨ì crash¡C¤]¥i¥H¥Î &man.gdb.1; §â¦UºØÅܼƩε²ºcªº¤º®e¦L¥X¨Ó¡A¥HÀˬd¨t²Î crash ®Éªº ¹ê»Úª¬ºA¡C ¦n°Õ¡A¦pªG§A¦³²Ä¤G¥x¹q¸£¦Ó¥B¦³°÷ºÆ¨g¡A¥i¥H±N &man.gdb.1; ³]©w ¦¨»·ºÝ°£¿ù¡C³o¼Ë§A¥i¥H¦b¤@¥x¾÷¾¹¤¤¥Î &man.gdb.1; ¥h°£¿ù¥t¤@¥x¸Ìªº kernel¡A¥i¥H°õ¦æªº¥]¬A³]©w¤¤Â_ÂI¡B¦b kernel ­ì©l½X¤¤¤@¨B¨B°õ¦æµ¥ µ¥¡A´N¹³¦b¤@¯ë¨Ï¥ÎªÌµ{¦¡¤W°£¿ù¤@¼Ë¡C¥Ñ©ó¨S¦³¤°»ò¾÷·|¬°°£¿ù¦Ó³]¸m ¨â¥x¨Ã¾F¹q¸£¡A©Ò¥H§ÚÁÙ¨S¦³³o¼Ëª±¹L¡C [Bill ¸É¥R¡G"§Ú§Ñ¤F´£¨ì¤@ÂI¡G¦pªG§A¦³±Ò°Ê DDB ¦Ó kernel ¤]¤w¸g¶i¤J°£¿ù¾¹¡A¥i¥H¦b DDB ©R¥O¦C¤U¥´ 'panic'¡A±j­¢²£¥Í panic (ÁÙ¦³ crash dump)¡C¤]¦³¥i¯à¦b panic ¶¥¬q®É¦A¶i¤J°£¿ù¾¹¡A ¦pªG³o¼Ëªº¸Ü¡A¿é¤J 'continue'¡A±µµÛ¥¦´N·|§¹¦¨ crash dump¡C" -ed] ¬°¤°»ò dlsym() ¤£¯à¾Þ§@ ELF °õ¦æÀÉ¡H ¦b ELF ¤@¨t¦Cªº¤u¨ã¤¤¡A¤º©w¬O¤£·|Åý dynamic linker ¬Ý¨ì°õ¦æ Àɸ̩w¸q¤F­þ¨Ç symbol¡C©Ò¥H dlsym() ¨S¦³¿ì ªk¥ÎÂǥѩI¥s dlopen(NULL, flags) ¨ú±oªº handle¡A¥Î¥¦¥h·j´M¦³¨º¨Ç symbol ¤@©w·|¥¢±Ñ¡C ¦pªG§A·Q­n¥Î dlsym() §ä¥X¬Y­Ó process ªº¥D°õ¦æÀɤ¤¦³­þ¨Ç symbol¡A«h­n¦b link ®É¹ï ELF linker (&man.ld.1;) ¥[¤W ³o­Ó°Ñ¼Æ¡C §Ú­n¦p¦ó¼W¥[©Î´î¤Ö kernel ¯à©w§}ªºªÅ¶¡¡H ¹w³]­È¬O¡AFreeBSD 3.x ªº kernel ¥i¥H©w§}ªºªÅ¶¡¬O 256 MB ¦Ó FreeBSD 4.x ¥i¥H¨ì 1 GB¡C¦pªG¬Oºô¸ô­t²ü¬Û·í­«ªº¦øªA¾¹ (¨Ò¦p¤j«¬ FTP ©Î HTTP ¦øªA¾¹)¡A§A¤]³\·|µo²{ 256 MB ¥i¯à¤£¤j°÷¡C ©Ò¥H¡A­n¦p¦ó¼W¥[©w§}ªÅ¶¡©O¡H­n±q¨â¤è­±µÛ¤â¡C­º¥ý­º¥ý§i¶D kernel ¥»¨­­n«O¯d¸û¤jªÅ¶¡µ¹¦Û¤v¡C¨ä¦¸¡A¬JµM¬O¦b©w§}ªÅ¶¡ªº³Ì¤W ­±¸ü¤J kernel¡A©Ò¥HÁÙ­n½Õ§C¸ü¤Jªº¦ì§}¡A¤~¤£·|©M«e­±©w§}ªº½d³ò ­«Å|¡C ¼W¥[ src/sys/i386/include/pmap.h ¸Ìªº NKPDE ´N¥i¥H¹F¦¨²Ä¤@­Ó¥Ø¼Ð¡C1 GB ªº©w§}ªÅ¶¡·| ¹³³o¼Ë¡G #ifndef NKPDE #ifdef SMP #define NKPDE 254 /* addressable number of page tables/pde's */ #else #define NKPDE 255 /* addressable number of page tables/pde's */ #endif /* SMP */ #endif ­nºâ¥X NKPDE ªº¥¿½T­È¡A±N·Q­nªºªÅ¶¡¤j¤p (¥H megabyte ¬°³æ¦ì)°£¥H 4¡A±µµÛ³æ CPU ¾÷¾¹´î 1¡A Âù CPU «h¬O´î 2¡C ­n¸Ñ¨M²Ä¤G­Ó°ÝÃD¡A¥²¶·¦Û¦æºâ¥X kernel ³Q¸ü¤Jªº¦ì§}¡G¨D¥X 0x100100000 ´î±¼©w§}ªÅ¶¡¤j¤pªº­È(¥H byte ¬°³æ¦ì)¡A¦p 1 GB ¤j¤p´N¬O 0xc0100000¡C§âsrc/sys/i386/conf/Makefile.i386 ¸Ìªº LOAD_ADDRESS ³]¦¨³o­Ó­È¡Q±µµÛ¦b src/sys/i386/conf/kernel.script ¤¤¡A±N section ¦Cªí³Ì«e­±ªº location counter ³]¦¨¬Û¦Pªº­È¡A¦p¤U¡G OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(btext) SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/obj/elf/home/src/tmp/usr/i386-unknown-freebsdelf/lib); SECTIONS { /* Read-only sections, merged into text segment: */ . = 0xc0100000 + SIZEOF_HEADERS; .interp : { *(.interp) } µM«á­«·s½sͱzªº kernel¡C±z¥i¯à·|¦b°õ¦æ &man.ps.1;¡B&man.top.1; ³oÃþªºµ{¦¡®É¸I¨ì°ÝÃD¡Qmake world À³¸Ó´N¥i¥H¸Ñ¨M (©Î§â§ï¹Lªº pmap.h ½Æ»s¨ì /usr/include/vm/ ¤U¡A¦A¤â°Ê½sĶ libkvm¡A&man.ps.1; ÁÙ¦³ &man.top.1;)¡C ª`·N¡Gkernel ©Ò¯à©w§}ªºªÅ¶¡¤j¤p¥²¶·¬O 4 megabytes ªº­¿¼Æ¡C [&a.dg; ¸É¥R¡G§Ú»{¬° kernel ©w§}ªÅ¶¡¤j¤pÀ³¸Ó­n¬O 2 ªº­¼¾­¡A¦ý¤£¤j½T©w³o¤@ÂI¡Cªº±Ò°Êµ{¦¡·|°Ê¨ì high order address bits¡A°O±o¥¦°²³]¦Ü¤Ö¦³ 256 MB¡C]
Vanilla Shu
vanilla@FreeBSD.org
·PÁÂ
FreeBSD Core Team °²¦p±z¦b³o¥÷ FAQ ¤¤§ä¨ì¿ù»~ªº¦a¤è¡A©Î¬O±z·Q¼W¥[¨Ç¬Æ»ò¡A ½Ð¼g«Ê«H¨ì &a.faq; ¡C§Ú­Ì«D±`·PÁ±zªº«ØÄ³¡A ¦]¬°±zªº«ØÄ³Åý³o¥÷¤å¥óÅܱo§ó¦n¡I
&a.jkh; ¤£°±ªº§ó·s¹L®Éªº FAQ &a.dwhite; ¸g±`¦b freebsd-questions ¤W¦^µª°ÝÃD &a.joerg; ¸g±`¦b Usenet ¤W¦^µª°ÝÃD &a.wollman; Networking and formatting Jim Lowe Multicast information &a.pds; FreeBSD FAQ ³o¥÷¤å¥óªº¥´¦r­W¤u The FreeBSD Team Kvetching, moaning, submitting data ¹ï©ó¨º¨Ç´¿¸g¹ï³o¥÷ FAQ ´£¨ÑÀ°§U¡A¦Ó§Ú­Ì¨S´£¨ìªº¤H­Ì¡A §Ú­Ì¥Ñ°Jªº·PÁ±z¡I
&bibliography;
diff --git a/zh_TW.Big5/books/fdp-primer/Makefile b/zh_TW.Big5/books/fdp-primer/Makefile new file mode 100644 index 0000000000..ecc7ebc217 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/Makefile @@ -0,0 +1,51 @@ +# +# $FreeBSD$ +# +# Build the FreeBSD Documentation Project Primer. +# + +MAINTAINER=doc@FreeBSD.org + +DOC?= book + +FORMATS?= html-split html + +INSTALL_COMPRESSED?= gz +INSTALL_ONLY_COMPRESSED?= + +# +# SRCS lists the individual SGML files that make up the document. Changes +# to any of these files will force a rebuild +# + +# SGML content +SRCS= book.sgml +SRCS+= overview/chapter.sgml +SRCS+= psgml-mode/chapter.sgml +SRCS+= see-also/chapter.sgml +SRCS+= sgml-markup/chapter.sgml +SRCS+= sgml-primer/chapter.sgml +SRCS+= stylesheets/chapter.sgml +SRCS+= structure/chapter.sgml +SRCS+= doc-build/chapter.sgml +SRCS+= the-website/chapter.sgml +SRCS+= tools/chapter.sgml +SRCS+= translations/chapter.sgml +SRCS+= writing-style/chapter.sgml + +SRCS+= examples/appendix.sgml + +# Images from the cross-document image library +IMAGES_LIB= callouts/1.png +IMAGES_LIB+= callouts/2.png +IMAGES_LIB+= callouts/3.png +IMAGES_LIB+= callouts/4.png +IMAGES_LIB+= callouts/5.png + +# Entities +SRCS+= chapters.ent + +URL_RELPREFIX?= ../../../.. +DOC_PREFIX?= ${.CURDIR}/../../.. + +.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.Big5/books/fdp-primer/book.sgml b/zh_TW.Big5/books/fdp-primer/book.sgml new file mode 100644 index 0000000000..02437e4b30 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/book.sgml @@ -0,0 +1,251 @@ + + + +%books.ent; + %chapters; + + +]> + + + + FreeBSD Documentation Project Primer for New Contributors + + FreeBSD ¤å¥ó­p¹º + + + 1998 + 1999 + 2000 + 2001 + 2002 + 2003 + 2004 + 2005 + 2006 + DocEng + + + $FreeBSD$ + + $FreeBSD$ + + &bookinfo.legalnotice; + + + ·PÁ±z°Ñ»P FreeBSD ¤å¥ó­p¹º¡A±zªºÂIºw°^Äm¡A³£¬Û·íÄ_¶Q¡C + + This primer covers everything you will need to know in order + to start contributing to the FreeBSD Documentation Project, from + the tools and software you will be using (both mandatory and + recommended) to the philosophy behind the Documentation + Project. + + ¥»¤å¥óÁÙ¦b¯ó½Z¡A©|¥¼§¹½Z¡C¥¼§¹¦¨ªº³¹¸`¡A§Ú­Ì·|¦b³¹¸`¦WºÙ®ÇÃä¥[µù¡y + * ¡z¥H§@ÃѧO¡C + + + + + §Ç¨¥ + + + Shell ´£¥Ü²Å¸¹(Prompts) + + ¤UªíÅã¥Ü¥X¤@¯ë±b¸¹»P root ªº´£¥Ü²Å¸¹¡A¦b©Ò¦³ªº¤å¥ó¨Ò¤l¤¤·|¥Î´£¥Ü²Å¸¹(prompt) + ¡A¨Ó´£¿ô±z¸Ó¥Î­þºØ±b¸¹¤~¹ï¡C + + + + + + ±b¸¹ + ´£¥Ü²Å¸¹(Prompt) + + + + + + ´¶³q±b¸¹ + &prompt.user; + + + + root + &prompt.root; + + + + + + + + ®Ñ¤¤©Ò¥Îªº½s±Æ­·®æ + + ¤Uªí¬°¥»®Ñ¤¤©Ò¨Ï¥Î½s±Æ­·®æ¤è¦¡¡G + + + + + + ¥Nªí·N¸q + Á|¨Ò + + + + + + The name of commands, files, and directories. On screen + computer output. + Edit your .login + file.Use ls -a to list all + files.You have mail. + + + + + ¦b¿é¤J«ü¥O«á¡A¿Ã¹õ¤W·|¥X²{ªº¹ïÀ³¤º®e¡G + + &prompt.user; su +Password: + + + + Á¿¨ì­n°Ñ¦Òªº Manual ®É... + + Use + su + 1 + to change user names. + + + + ¦bÁ¿¨ì±b¸¹(user)¡B¸s²Õ(group)ªº¦WºÙªº®É­Ô... + + Only root can do this. + + + + »y®ðªº±j½Õ¡C + + You must do this. + + + + ¥´«ü¥O®É¥i´À´«ªº³¡¥÷(¥i§ï¬°²Å¦X¦Û¤v¾÷¾¹¤WªºÀɦW¡B³]³Æ©Î¨ä¥LÃþ¦ü³¡¥÷)¡C + + To delete a file, type rm filename + + + + Àô¹ÒÅܼƳ]©w + + $HOME is your home directory. + + + + + + + + ¡yNote¡BTip¡BImportant¡BWarning¡BExample¡zªº¹B¥Î + + ¥H¤U¤å¦r¬O¡yª`·N(Note)¡z¡B¡y§Þ¥©(Tip)¡z¡B¡y­«­n°T®§(Important)¡z¡B¡yĵ§i(Warning)¡z¡B¡y½d¨Ò(Example)¡zªº¹B¥Î¡C + + + Notes are represented like this, and contain information that + you should take note of, as it may affect what you do. + + + + Tips are represented like this, and contain information that you + might find useful, or lead to an easier way to do something. + + + + Important information is represented like this. Typically they + flag extra steps you may need to carry out. + + + + Warnings are represented like this, and contain information + warning you about possible damage if you do not follow the + instructions. This damage may be physical, to your hardware or to + you, or it may be non-physical, such as the inadvertent deletion of + important files. + + + + ³o¬OÁ|¨Ò»¡©ú + + Examples are represented like this, and typically contain + examples you should walk through, or show you what the results of a + particular action should be. + + + + + ·PÁ + + ¦b¦¹­n·PÁ Sue Blake, Patrick Durusau, Jon Hamilton, Peter + Flynn, Christopher Maden ³o¨Ç¤Hªº¨ó§U»P¾\Ūªì´Á¯ó½Z¡A¨Ã´£¨Ñ³\¦hÄ_¶Qªº¼í½Z·N¨£»Pµû½×¡C + + + + &chap.overview; + &chap.tools; + &chap.sgml-primer; + &chap.sgml-markup; + &chap.stylesheets; + &chap.structure; + &chap.doc-build; + &chap.the-website; + &chap.translations; + &chap.writing-style; + &chap.psgml-mode; + &chap.see-also; + + &app.examples; + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/chapter.decl b/zh_TW.Big5/books/fdp-primer/chapter.decl new file mode 100644 index 0000000000..3e187a32ee --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/chapter.decl @@ -0,0 +1,2 @@ + + diff --git a/zh_TW.Big5/books/fdp-primer/chapters.ent b/zh_TW.Big5/books/fdp-primer/chapters.ent new file mode 100644 index 0000000000..7329e4a05a --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/chapters.ent @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/doc-build/chapter.sgml b/zh_TW.Big5/books/fdp-primer/doc-build/chapter.sgml new file mode 100644 index 0000000000..38b62abc46 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/doc-build/chapter.sgml @@ -0,0 +1,498 @@ + + + + The Documentation Build Process + + This chapter's main purpose is to clearly explain how + the documentation build process is organized, and + how to affect modifications to this process. + + + After you have finished reading this chapter you should: + + + + Know what you need to build the FDP documentation, in + addition to those mentioned in the SGML tools chapter. + + + + Be able to read and understand the + make instructions that are present in + each document's Makefiles, as well as an + overview of the doc.project.mk includes. + + + + Be able to customize the build process by using + make variables and + make targets. + + + + + The FreeBSD Documentation Build Toolset + + Here are your tools. Use them every way you can. + + + + The primary build tool you will need is + make, but specifically + Berkeley Make. + + + + Package building is handled by FreeBSD's + pkg_create. If you are not using + FreeBSD, you will either have to live without packages, or + compile the source yourself. + + + + gzip is needed to create + compressed versions of the document. + bzip2 compression and + zip archives are also supported. + tar is supported, but package + building demands it. + + + + install is the default method + to install the documentation. There are alternatives, + however. + + + + + It is unlikely you will have any trouble finding these last two, they + are mentioned for completeness only. + + + + + Understanding Makefiles in the Documentation tree + + There are three main types of Makefiles + in the FreeBSD Documentation Project tree. + + + + Subdirectory + Makefiles simply pass + commands to those directories below them. + + + + Documentation + Makefiles describe the + document(s) that should be produced from this directory. + + + + Make + includes are the glue that perform the document production, + and are usually of the form + doc.xxx.mk. + + + + + Subdirectory Makefiles + + These Makefiles usually take the form of: + + SUBDIR =articles +SUBDIR+=books + +COMPAT_SYMLINK = en + +DOC_PREFIX?= ${.CURDIR}/.. +.include "${DOC_PREFIX}/share/mk/doc.project.mk" + + In quick summary, the first four non-empty lines define the + make variables, + SUBDIR, COMPAT_SYMLINK, + and DOC_PREFIX. + + The first SUBDIR statement, as well as + the COMPAT_SYMLINK statement, shows how to + assign a value to a variable, overriding any previous + value. + + The second SUBDIR statement shows how a + value is appended to the current value of a variable. The + SUBDIR variable is now articles + books. + + The DOC_PREFIX assignment shows how a + value is assigned to the variable, but only if it is not already + defined. This is useful if DOC_PREFIX is not + where this Makefile thinks it is - the user + can override this and provide the correct value. + + Now what does it all mean? SUBDIR + mentions which subdirectories below this one the build process + should pass any work on to. + + COMPAT_SYMLINK is specific to + compatibility symlinks (amazingly enough) for languages to their + official encoding (doc/en would point to + en_US.ISO-8859-1). + + DOC_PREFIX is the path to the root of the + FreeBSD Document Project tree. This is not always that easy to + find, and is also easily overridden, to allow for flexibility. + .CURDIR is a make + builtin variable with the path to the current directory. + + The final line includes the FreeBSD Documentation Project's + project-wide make system file + doc.project.mk which is the glue which + converts these variables into build instructions. + + + + Documentation Makefiles + + These Makefiles set a bunch of + make variables that describe how to + build the documentation contained in that directory. + + Here is an example: + + MAINTAINER=nik@FreeBSD.org + +DOC?= book + +FORMATS?= html-split html + +INSTALL_COMPRESSED?= gz +INSTALL_ONLY_COMPRESSED?= + +# SGML content +SRCS= book.sgml + +DOC_PREFIX?= ${.CURDIR}/../../.. + +.include "$(DOC_PREFIX)/share/mk/docproj.docbook.mk" + + The MAINTAINER variable is a very + important one. This variable provides the ability to claim + ownership over a document in the FreeBSD Documentation + Project, whereby you gain the responsibility for maintaining + it. + + DOC is the name (sans the + .sgml extension) of the main document + created by this directory. SRCS lists all + the individual files that make up the document. This should + also include important files in which a change should result + in a rebuild. + + FORMATS indicates the default formats + that should be built for this document. + INSTALL_COMPRESSED is the default list of + compression techniques that should be used in the document + build. INSTALL_ONLY_COMPRESS, empty by + default, should be non-empty if only compressed documents are + desired in the build. + + + We covered optional variable assignments in the + previous section. + + + The DOC_PREFIX and include statements + should be familiar already. + + + + + FreeBSD Documentation Project make includes + + This is best explained by inspection of the code. Here are + the system include files: + + + + doc.project.mk is the main project + include file, which includes all the following include files, as + necessary. + + + + doc.subdir.mk handles traversing of + the document tree during the build and install processes. + + + + doc.install.mk provides variables + that affect ownership and installation of documents. + + + + doc.docbook.mk is included if + DOCFORMAT is docbook + and DOC is set. + + + + + doc.project.mk + + By inspection: + + DOCFORMAT?= docbook +MAINTAINER?= doc@FreeBSD.org + +PREFIX?= /usr/local +PRI_LANG?= en_US.ISO8859-1 + +.if defined(DOC) +.if ${DOCFORMAT} == "docbook" +.include "doc.docbook.mk" +.endif +.endif + +.include "doc.subdir.mk" +.include "doc.install.mk" + + + + Variables + + DOCFORMAT and MAINTAINER + are assigned default values, if these are not set by the + document make file. + + PREFIX is the prefix under which the + documentation building tools are + installed. For normal package and port installation, this is + /usr/local. + + PRI_LANG should be set to whatever + language and encoding is natural amongst users these documents are + being built for. US English is the default. + + + PRI_LANG in no way affects what documents + can, or even will, be built. Its main use is creating links to + commonly referenced documents into the FreeBSD documentation + install root. + + + + + Conditionals + + The .if defined(DOC) line is an example of + a make conditional which, like in + other programs, defines behavior if some condition is true or + if it is false. defined is a function which + returns whether the variable given is defined or not. + + .if ${DOCFORMAT} == "docbook", next, + tests whether the DOCFORMAT variable is + "docbook", and in this case, includes + doc.docbook.mk. + + The two .endifs close the two above + conditionals, marking the end of their application. + + + + + doc.subdir.mk + + This is too long to explain by inspection, you should be + able to work it out with the knowledge gained from the previous + chapters, and a little help given here. + + + Variables + + + + SUBDIR is a list of subdirectories + that the build process should go further down + into. + + + + ROOT_SYMLINKS is the name of + directories that should be linked to the document + install root from their actual locations, if the current + language is the primary language (specified by + PRI_LANG). + + + + COMPAT_SYMLINK is described in the + Subdirectory Makefile + section. + + + + + + Targets and macros + + Dependencies are described by + target: + dependency1 dependency2 ... + tuples, where to build target, you need to build + the given dependencies first. + + After that descriptive tuple, instructions on how to build + the target may be given, if the conversion process between the + target and its dependencies are not previously defined, or if + this particular conversion is not the same as the default + conversion method. + + A special dependency .USE defines + the equivalent of a macro. + +_SUBDIRUSE: .USE +.for entry in ${SUBDIR} + @${ECHO} "===> ${DIRPRFX}${entry}" + @(cd ${.CURDIR}/${entry} && \ + ${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ ) +.endfor + + In the above, _SUBDIRUSE is now a + macro which will execute the given commands when it is listed + as a dependency. + + What sets this macro apart from other targets? Basically, + it is executed after the instructions + given in the build procedure it is listed as a dependency to, + and it does not adjust .TARGET, which is the + variable which contains the name of the target currently + being built. + +clean: _SUBDIRUSE + rm -f ${CLEANFILES} + + In the above, clean will use the + _SUBDIRUSE macro after it has + executed the instruction + rm -f ${CLEANFILES}. In effect, this causes + clean to go further and further down + the directory tree, deleting built files as it goes + down, not on the way back up. + + + Provided targets + + + + install and + package both go down the + directory tree calling the real versions of themselves + in the subdirectories + (realinstall and + realpackage + respectively). + + + + clean removes files created + by the build process (and goes down the directory tree + too). cleandir does the same, + and also removes the object directory, if any. + + + + + + + More on conditionals + + + + exists is another condition + function which returns true if the given file exists. + + + + empty returns true if the given + variable is empty. + + + + target returns true if the given + target does not already exist. + + + + + + Looping constructs in make (.for) + + .for provides a way to repeat a set of + instructions for each space-separated element in a variable. + It does this by assigning a variable to contain the current + element in the list being examined. + +_SUBDIRUSE: .USE +.for entry in ${SUBDIR} + @${ECHO} "===> ${DIRPRFX}${entry}" + @(cd ${.CURDIR}/${entry} && \ + ${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ ) +.endfor + + In the above, if SUBDIR is empty, no + action is taken; if it has one or more elements, the + instructions between .for and + .endfor would repeat for every element, + with entry being replaced with the value of + the current element. + + + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/examples/appendix.sgml b/zh_TW.Big5/books/fdp-primer/examples/appendix.sgml new file mode 100644 index 0000000000..4e4196b78a --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/examples/appendix.sgml @@ -0,0 +1,355 @@ + + + + Examples + + This appendix contains example SGML files and command lines you can + use to convert them from one output format to another. If you have + successfully installed the Documentation Project tools then you should + be able to use these examples directly. + + These examples are not exhaustive—they do not contain all the + elements you might want to use, particularly in your document's front + matter. For more examples of DocBook markup you should examine the SGML + source for this and other documents, available in the + CVSup doc collection, or + available online starting at + . + + To avoid confusion, these examples use the standard DocBook 4.1 DTD + rather than the FreeBSD extension. They also use the stock stylesheets + distributed by Norm Walsh, rather than any customizations made to those + stylesheets by the FreeBSD Documentation Project. This makes them more + useful as generic DocBook examples. + + + DocBook <sgmltag>book</sgmltag> + + + DocBook <sgmltag>book</sgmltag> + + + + + + An Example Book + + + Your first name + Your surname + +
foo@example.com
+
+
+ + + 2000 + Copyright string here + + + + If your book has an abstract then it should go here. + +
+ + + Preface + + Your book may have a preface, in which case it should be placed + here. + + + + My first chapter + + This is the first chapter in my book. + + + My first section + + This is the first section in my book. + + +
]]>
+
+
+ + + DocBook <sgmltag>article</sgmltag> + + + DocBook <sgmltag>article</sgmltag> + + + +
+ + An example article + + + Your first name + Your surname + +
foo@example.com
+
+
+ + + 2000 + Copyright string here + + + + If your article has an abstract then it should go here. + +
+ + + My first section + + This is the first section in my article. + + + My first sub-section + + This is the first sub-section in my article. + + +
]]>
+
+
+ + + Producing formatted output + + This section assumes that you have installed the software listed in + the textproc/docproj port, either by hand, or by + using the port. Further, it is assumed that your software is installed + in subdirectories under /usr/local/, and the + directory where binaries have been installed is in your + PATH. Adjust the paths as necessary for your + system. + + + Using Jade + + + Converting DocBook to HTML (one large file) + + &prompt.user; jade -V nochunks \ + -c /usr/local/share/sgml/docbook/dsssl/modular/catalog \ + -c /usr/local/share/sgml/docbook/catalog \ + -c /usr/local/share/sgml/jade/catalog \ + -d /usr/local/share/sgml/docbook/dsssl/modular/html/docbook.dsl \ + -t sgml file.sgml > file.html + + + + Specifies the nochunks parameter to the + stylesheets, forcing all output to be written to + STDOUT (using Norm Walsh's stylesheets). + + + + Specifies the catalogs that Jade will need to process. + Three catalogs are required. The first is a catalog that + contains information about the DSSSL stylesheets. The second + contains information about the DocBook DTD. The third contains + information specific to Jade. + + + + Specifies the full path to the DSSSL stylesheet that Jade + will use when processing the document. + + + + Instructs Jade to perform a + transformation from one DTD to another. In + this case, the input is being transformed from the DocBook DTD + to the HTML DTD. + + + + Specifies the file that Jade should process, and redirects + output to the specified .html file. + + + + + + Converting DocBook to HTML (several small files) + + &prompt.user; jade \ + -c /usr/local/share/sgml/docbook/dsssl/modular/catalog \ + -c /usr/local/share/sgml/docbook/catalog \ + -c /usr/local/share/sgml/jade/catalog \ + -d /usr/local/share/sgml/docbook/dsssl/modular/html/docbook.dsl \ + -t sgml file.sgml + + + + Specifies the catalogs that Jade will need to process. + Three catalogs are required. The first is a catalog that + contains information about the DSSSL stylesheets. The second + contains information about the DocBook DTD. The third contains + information specific to Jade. + + + + Specifies the full path to the DSSSL stylesheet that Jade + will use when processing the document. + + + + Instructs Jade to perform a + transformation from one DTD to another. In + this case, the input is being transformed from the DocBook DTD + to the HTML DTD. + + + + Specifies the file that Jade should process. The + stylesheets determine how the individual HTML files will be + named, and the name of the root file (i.e., the + one that contains the start of the document. + + + + This example may still only generate one HTML file, depending on + the structure of the document you are processing, and the + stylesheet's rules for splitting output. + + + + Converting DocBook to Postscript + + The source SGML file must be converted to a &tex; file. + + &prompt.user; jade -Vtex-backend \ + -c /usr/local/share/sgml/docbook/dsssl/modular/catalog \ + -c /usr/local/share/sgml/docbook/catalog \ + -c /usr/local/share/sgml/jade/catalog \ + -d /usr/local/share/sgml/docbook/dsssl/modular/print/docbook.dsl \ + -t tex file.sgml + + + + Customizes the stylesheets to use various options + specific to producing output for &tex;. + + + + Specifies the catalogs that Jade will need to process. Three + catalogs are required. The first is a catalog that contains + information about the DSSSL stylesheets. The second contains + information about the DocBook DTD. The third contains + information specific to Jade. + + + + Specifies the full path to the DSSSL stylesheet that + Jade will use when processing the document. + + + + Instructs Jade to convert the output to &tex;. + + + + The generated .tex file must now be run + through tex, specifying the + &jadetex macro package. + + &prompt.user; tex "&jadetex" file.tex + + You have to run tex at + least three times. The first run processes the + document, and determines areas of the document which are referenced + from other parts of the document, for use in indexing, and so + on. + + Do not be alarmed if you see warning messages such as + LaTeX Warning: Reference `136' on page 5 undefined on input + line 728. at this point. + + The second run reprocesses the document now that certain pieces + of information are known (such as the document's page length). This + allows index entries and other cross-references to be fixed + up. + + The third pass performs any final cleanup necessary. + + The output from this stage will be + file.dvi. + + Finally, run dvips to convert the + .dvi file to Postscript. + + &prompt.user; dvips -o file.ps file.dvi + + + + Converting DocBook to PDF + + The first part of this process is identical to that when + converting DocBook to Postscript, using the same + jade command line (). + + When the .tex file has been generated you + run pdfTeX. However, use the &pdfjadetex macro package + instead. + + &prompt.user; pdftex "&pdfjadetex" file.tex + + Again, run this command three times. + + This will generate + file.pdf, which does + not need to be processed any further. + + + +
+ + diff --git a/zh_TW.Big5/books/fdp-primer/overview/chapter.sgml b/zh_TW.Big5/books/fdp-primer/overview/chapter.sgml new file mode 100644 index 0000000000..bac205dd03 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/overview/chapter.sgml @@ -0,0 +1,270 @@ + + + + ·§½× + + Åwªï°Ñ»P FreeBSD ¤å¥ó­p¹º¡Cºû«ùÀu¨q½è¶qªº¤å¥ó¹ï FreeBSD ªº¦¨¥\¨Ó»¡¤Q¤À­«­n¡A + ¦Ó FreeBSD ¤å¥ó­p¹º(¥H¤U¬Ò¥H FDP ¨Ó¥Nªí FreeBSD Documentation Project + ªºÁY¼g) «h»P³o¨Ç¤å¥ó¼¶¼g¡B§ó·s®§®§¬ÛÃö¡A¦]¦¹±zªºÂIºw°^Äm³£¬O¤Q¤ÀÄ_¶Qªº¡C + + ¥»¤å¥ó³Ì¥D­nªº¥Øªº¡A´N¬O²M·¡§i¶D±z¡G¡yFDP ªº¬[ºc¦³­þ¨Ç¡z¡B¡y¦p¦ó¼¶¼g¨Ã´£¥æ¤å¥óµ¹ FDP¡z¡B + ¡y¦p¦ó¦³®Ä¹B¥Î¤u¨ã¨Ó¨ó§U¼¶½Z¡z¡C + + + Membership + + §Ú­ÌÅwªï¨C­Ó¼ö¤ßªº§Ó¤h¨Ó¥[¤J FDP ¦æ¦C¡CFDP ¨Ã¤£­­©w¨C¤ë¥²¶·¥æ¥X¦h¤Ö½Z¶q¡A¤~¯à¥[¤J¡C + ±z°ß¤@¶·­n§@ªº´N¬O­q¾\ &a.doc; ¡C + + Ū§¹¥»¥÷¤å¥ó¡A±z±N·|¡G + + + + ÁA¸Ñ¦³­þ¨Ç¤å¥ó¬O¥Ñ FDP ©ÒºûÅ@ªº¡C + + + + ¥i¥H¬ÝÀ´ FDP ©ÒºûÅ@ªº SGML ­ì©l¤å¥ó¡C + + + + ª¾¹D¦p¦ó¨Ó¹ï¤å¥ó§@­×§ï¡C + + + + ª¾¹D¦p¦ó§ë½Z¦Û¤vªº­×§ï³¡¥÷¡A¨Ã³Ì«á¥¿¦¡¶i¤J FreeBSD ¤å¥ó¤º¡C + + + + + The FreeBSD Documentation Set + + FDP Á`¦@­t³d FreeBSD ªº 4 ºØÃþ§Oªº¤å¥ó¡G + + + + Manual pages + + + ­^¤åª©ªº¨t²Î manual ¨Ã¤£¬O¥Ñ FDP ©Ò¼¶¼gªº¡A¦]¬°¥¦­Ì¬OÄÝ©ó base system ªº³¡¥÷¡C + µM¦Ó¡AFDP ¥i¥H(¤]´¿³o»ò°µ¹L)­×§ï³o¨Ç¤å¥ó¡A¨ÓÅý³o¨Ç¤å¥ó¼g±o§ó²M·¡¡A¬Æ¦Ü¬O°É¥¿¿ù»~ªº¦a¤è¡C + + The translation teams are responsible for translating the + system manual pages into different languages. These translations + are kept within the FDP. + + + + + FAQ + + + FAQ ¥D­n¬O¦¬¶°¦b¦U½×¾Â©Î newsgroup ·|±`°Ý¨ì©Î¦³¥i¯à·|°Ý¨ìªº FreeBSD ¬ÛÃö°ÝÃD»Pµª®× ¡C + (²³æÁ¿¡A´N¬O¡y°Ýµª¶°¡z®æ¦¡) ³q±`·|Â\¦b³o¸Ì­±ªº°Ýµª®æ¦¡¡A¤£·|©ñ¤Óªøªº¸Ô²Ó¤º®e¡C + + + + + Handbook + + + The Handbook aims to be the comprehensive on-line resource and + reference for FreeBSD users. + + + + + Web site + + + FreeBSD ¥D­n¦U¶µ¤¶²Ð¤è­±ªº WWW ³¡¥÷¡AÅwªï³}³} http://www.FreeBSD.org/ + ¥H¤Î³\¦h¨ä¥L mirror ¯¸¡C³oºô¯¸¬O³\¦h¤H²Ä¤@¦¸±µÄ² FreeBSD ªº¦a¤è¡C + + + + + These four groups of documentation are all available in the + FreeBSD CVS tree. This means that the logs of changes to these + files are visible to anyone, and anyone can use a program such as + CVSup or + CTM to keep local copies of + this documentation. + + In addition, many people have written tutorials or other web + sites relating to FreeBSD. Some of these are stored in the CVS + repository as well (where the author has agreed to this). In + other cases the author has decided to keep his documentation + separate from the main FreeBSD repository. The FDP endeavors to + provide links to as much of this documentation as + possible. + + + + ¦b¶}¤u¤§«e... + + ¥»¤å°²³]±z¤w¸gÁA¸Ñ¡G + + + + ¦p¦ó±q FreeBSD CVS repository §ó·s¦Û¤v¹q¸£¤Wªº FreeBSD ¤å¥ó ³¡¥÷(¥H CVS + ©Î CVSup ©Î¬O + CTM) ©Î¬O¥Î + CVSup ¨Ó¤U¸ü checked-out ªº°Æ¥» + + + + ¦p¦ó¥Î FreeBSD Ports ®M¥óºÞ²z¾÷¨î©Î &man.pkg.add.1; ¨Ó¤U¸ü¡B¦w¸Ë³nÅé¡C + + + + + + §Ö³t¤W¤â½g + + ­Y·Q¥ý¦Û¦æ¸Õ¸Õ¬Ý¡A¨Ã¦³«H¤ß¥i¥H§@±o¨ì¡A¨º»ò´N·Ó¤U­±¨BÆJ§a¡C + + + + ¦w¸Ë textproc/docproj ³o­Ó²Õ¦X«¬ port(meta-port). + + &prompt.root; cd /usr/ports/textproc/docproj +&prompt.root; make JADETEX=no install + + + + Get a local copy of the FreeBSD doc tree. + Either use CVSup in checkout mode to do this, or + get a full copy of the CVS repository locally. + + If you have the CVS repository locally then as a minimum you + will need to checkout the doc/share, and + doc/en_US.ISO8859-1/share + directories. + + &prompt.user; cvs checkout doc/share +&prompt.user; cvs checkout doc/en_US.ISO8859-1/share + + ­YµwºÐªÅ¶¡°÷¤jªº¸Ü¡A¨º¥i¥H§â©Ò¦³ doc ³£ check out ¥X¨Ó¡G + + &prompt.user; cvs checkout doc + + + + If you are preparing a change to an existing book or article, + check it out of the repository as necessary. If you are planning on + contributing a new book or article then use an existing one as a + guide. + + Á|¨Ò¨Ó»¡¡A­Y·Q¼g½g·s¤å³¹¡A¤º®e¬O¦³Ãö¦b FreeBSD »P Windows 2000 ¤§¶¡«Ø¥ß VPN ³s½u¡A + ¨º»ò¥i¥H·ÓÃþ¦ü¤U­±³o¼Ëªº§@ªk¡G + + + + Check out the articles + directory. + + &prompt.user; cvs checkout doc/en_US.ISO8859-1/articles + + + + ½Æ»s²{¦³ªº¤å³¹§@¬°½d¥»¡C¦b³o­Ó¨Ò¤l¤¤¡A±z¥´ºâ¨M©w§â·s¤å³¹©ñ¦b + vpn-w2k ªº¥Ø¿ý¤U¡C + + &prompt.user; cd doc/en_US.ISO8859-1/articles +&prompt.user; cp -R committers-guide vpn-w2k + + + + ­Y¬O­n­×§ï²{¦³¤å³¹¡A¹³¬O FAQ(Â\¦b doc/en_US.ISO8859-1/books/faq) + ¡A¨º»ò­n±q repository ¤¤¨ú¥X¨Ó(check out)¡G + + &prompt.user; cvs checkout doc/en_US.ISO8859-1/books/faq + + + + ¥H½s¿è¾¹¨Ó½s¼g .sgml ÀÉ¡C + + + + ¥H lint ·í»²§U°Ñ¼Æ¡A¨Ó§Ö³tÀË´ú¤å¥óµ²ºc¤Î³sµ²¦³µL¿ù»~¡A + ¥H¤U³o­Ó«ü¥O¡A¹ê»Ú¤W¤£·|¶i¦æ¯Ó®Éªº½s®Ñ¹Lµ{¡A¥u¬O¥ý´ú¸Õ¤å¥ó¦³µL¿ù»~¡C + + &prompt.user; make lint + + When you are ready to actually build the document, you + may specify a single format or a list of formats in the + FORMATS variable. ¥Ø«e¤ä´©ªº®æ¦¡¦@¦³¡G + html, html-split, + txt, ps, + pdf, rtf ¡C + The most up to date list of supported formats is + listed at the top of the + doc/share/mk/doc.docbook.mk file. Make + sure to use quotes around the list of formats when you build + more than one format with a single command. + + Á|¨Ò¨Ó»¡¡A­Y¥u­n + html ®æ¦¡´N¦n¡A¨º»ò´N¥´¡G + + &prompt.user; make FORMATS=html + + ¦ý­Y§Æ±æ¦³ html ¤Î txt ®æ¦¡ªº¸Ü¡A + §A¥i¯à­n¥´¨â¦¸ &man.make.1; «ü¥O¤~¯à§¹¦¨¡G + + &prompt.user; make FORMATS=html +&prompt.user; make FORMATS=txt + + ¨ä¹ê¡A¤]¥i¥H¥Î³æ¤@«ü¥O¨Ó§¹¦¨¡G + + &prompt.user; make FORMATS="html txt" + + + + ³Ì«á¡A¥H &man.send-pr.1; ¨Ó´£¥æ­×§ïªº³¡¥÷¡C + + + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/psgml-mode/chapter.sgml b/zh_TW.Big5/books/fdp-primer/psgml-mode/chapter.sgml new file mode 100644 index 0000000000..afbb1c9175 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/psgml-mode/chapter.sgml @@ -0,0 +1,177 @@ + + + + Using <literal>sgml-mode</literal> with + <application>Emacs</application> + + Recent versions of Emacs or XEmacs (available from the ports + collection) contain a very useful package called PSGML. Automatically + invoked when a file with the .sgml extension is loaded, + or by typing M-x sgml-mode, it is a major mode for + dealing with SGML files, elements and attributes. + + An understanding of some of the commands provided by this mode can + make working with SGML documents such as the Handbook much easier. + + + + C-c C-e + + + Runs sgml-insert-element. You will be + prompted for the name of the element to insert at the current point. + You can use the TAB key to complete the element. Elements that are + not valid at the current point will be disallowed. + + The start and end tags for the element will be inserted. If the + element contains other, mandatory, elements then these will be + inserted as well. + + + + + C-c = + + + Runs sgml-change-element-name. Place the + point within an element and run this command. You will be prompted + for the name of the element to change to. Both the start and end + tags of the current element will be changed to the new + element. + + + + + C-c C-r + + + Runs sgml-tag-region. Select some text (move + to start of text, C-space, move to end of text, C-space) and then + run this command. You will be prompted for the element to use. This + element will then be inserted immediately before and after your + marked region. + + + + + C-c - + + + Runs sgml-untag-element. Place the point + within the start or end tag of an element you want to remove, and + run this command. The element's start and end tags will be + removed. + + + + + C-c C-q + + + Runs sgml-fill-element. Will recursively fill + (i.e., reformat) content from the current element in. The filling + will affect content in which whitespace is + significant, such as within programlisting + elements, so run this command with care. + + + + + C-c C-a + + + Runs sgml-edit-attributes. Opens a second + buffer containing a list of all the attributes for the closest + enclosing element, and their current values. Use TAB to navigate + between attributes, C-k to remove an existing + value and replace it with a new one, C-c C-c + to close this buffer and return to the main document. + + + + + C-c C-v + + + Runs sgml-validate. Prompts you to save the + current document (if necessary) and then runs an SGML validator. The + output from the validator is captured into a new buffer, and you can + then navigate from one troublespot to the next, fixing markup errors + as you go. + + + + + C-c / + + + Runs sgml-insert-end-tag. Inserts the + end tag for the current open element. + + + + + Doubtless there are other useful functions of this mode, but those are + the ones I use most often. + + You can also use the following entries in + .emacs to set proper spacing, indentation, + and column width for working with the Documentation Project. + + + (defun local-sgml-mode-hook + (setq fill-column 70 + indent-tabs-mode nil + next-line-add-newlines nil + standard-indent 4 + sgml-indent-data t) + (auto-fill-mode t) + (setq sgml-catalog-files '("/usr/local/share/sgml/catalog"))) + (add-hook 'psgml-mode-hook + '(lambda () (local-psgml-mode-hook))) + + + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/see-also/chapter.sgml b/zh_TW.Big5/books/fdp-primer/see-also/chapter.sgml new file mode 100644 index 0000000000..0ce1e28bd8 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/see-also/chapter.sgml @@ -0,0 +1,134 @@ + + + + See Also + + This document is deliberately not an exhaustive discussion of SGML, + the DTDs listed, and the FreeBSD Documentation Project. For more + information about these, you are encouraged to see the following web + sites. + + + The FreeBSD Documentation Project + + + + The FreeBSD + Documentation Project web pages + + + + The FreeBSD Handbook + + + + + + SGML + + + + The SGML/XML web + page, a comprehensive SGML resource + + + + Gentle introduction to SGML + + + + + + HTML + + + + The World Wide Web + Consortium + + + + The HTML 4.0 + specification + + + + + + DocBook + + + + The DocBook + Technical Committee, maintainers of the DocBook DTD + + + + DocBook: The Definitive + Guide, the online documentation for the DocBook + DTD. + + + + + The DocBook Open + Repository contains DSSSL stylesheets and other resources + for people using DocBook. + + + + + + The Linux Documentation Project + + + + The Linux Documentation + Project web pages + + + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/sgml-markup/chapter.sgml b/zh_TW.Big5/books/fdp-primer/sgml-markup/chapter.sgml new file mode 100644 index 0000000000..8a73062eb7 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/sgml-markup/chapter.sgml @@ -0,0 +1,2708 @@ + + + + SGML Markup + + This chapter describes the two markup languages you will encounter + when you contribute to the FreeBSD documentation project. Each section + describes the markup language, and details the markup that you are likely + to want to use, or that is already in use. + + These markup languages contain a large number of elements, and it can + be confusing sometimes to know which element to use for a particular + situation. This section goes through the elements you are most likely to + need, and gives examples of how you would use them. + + This is not an exhaustive list of elements, since + that would just reiterate the documentation for each language. The aim of + this section is to list those elements more likely to be useful to you. + If you have a question about how best to markup a particular piece of + content, please post it to the &a.doc;. + + + Inline vs. block + + In the remainder of this document, when describing elements, + inline means that the element can occur within a + block element, and does not cause a line break. A + block element, by comparison, will cause a line + break (and other processing) when it is encountered. + + + + HTML + + HTML, the HyperText Markup Language, is the markup language of + choice on the World Wide Web. More information can be found at + <URL:>. + + HTML is used to markup pages on the FreeBSD web site. It should not + (generally) be used to mark up other documentation, + since DocBook offers a + far richer set of elements to choose from. Consequently, you will + normally only encounter HTML pages if you are writing for the web + site. + + HTML has gone through a number of versions, 1, 2, 3.0, 3.2, and the + latest, 4.0 (available in both strict and + loose variants). + + The HTML DTDs are available from the ports collection in the + textproc/html port. They are automatically + installed as part of the textproc/docproj + port. + + + Formal Public Identifier (FPI) + + There are a number of HTML FPIs, depending upon the version (also + known as the level) of HTML that you want to declare your document to + be compliant with. + + The majority of HTML documents on the FreeBSD web site comply with + the loose version of HTML 4.0. + + PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" + + + + Sectional elements + + An HTML document is normally split into two sections. The first + section, called the head, contains + meta-information about the document, such as its title, the name of + the author, the parent document, and so on. The second section, the + body, contains the content that will be displayed + to the user. + + These sections are indicated with head and + body elements respectively. These elements are + contained within the top-level html element. + + + Normal HTML document structure + + <html> + <head> + <title>The document's title</title> + </head> + + <body> + + … + + </body> +</html> + + + + + Block elements + + + Headings + + HTML allows you to denote headings in your document, at up to + six different levels. + + The largest and most prominent heading is h1, + then h2, continuing down to + h6. + + The element's content is the text of the heading. + + + <sgmltag>h1</sgmltag>, <sgmltag>h2</sgmltag>, etc. + + Use: + + First section + + + +

This is the heading for the first section

+ + + +

This is the heading for the first sub-section

+ + + +

This is the heading for the second section

+ +]]>
+
+ + Generally, an HTML page should have one first level heading + (h1). This can contain many second level + headings (h2), which can in turn contain many + third level headings. Each + hn element should have + the same element, but one further up the hierarchy, preceding it. + Leaving gaps in the numbering is to be avoided. + + + Bad ordering of + <sgmltag>h<replaceable>n</replaceable></sgmltag> elements + + Use: + + First section + + + +

Sub-section

+ +]]>
+
+
+ + + Paragraphs + + HTML supports a single paragraph element, + p. + + + <sgmltag>p</sgmltag> + + Use: + + This is a paragraph. It can contain just about any + other element.

]]>
+
+
+ + + Block quotations + + A block quotation is an extended quotation from another document + that should not appear within the current paragraph. + + + <sgmltag>blockquote</sgmltag> + + Use: + + A small excerpt from the US Constitution:

+ +
We the People of the United States, in Order to form + a more perfect Union, establish Justice, insure domestic + Tranquility, provide for the common defence, promote the general + Welfare, and secure the Blessings of Liberty to ourselves and our + Posterity, do ordain and establish this Constitution for the + United States of America.
]]>
+
+
+ + + Lists + + You can present the user with three types of lists, ordered, + unordered, and definition. + + Typically, each entry in an ordered list will be numbered, while + each entry in an unordered list will be preceded by a bullet point. + Definition lists are composed of two sections for each entry. The + first section is the term being defined, and the second section is + the definition of the term. + + Ordered lists are indicated by the ol + element, unordered lists by the ul element, and + definition lists by the dl element. + + Ordered and unordered lists contain listitems, indicated by the + li element. A listitem can contain textual + content, or it may be further wrapped in one or more + p elements. + + Definition lists contain definition terms + (dt) and definition descriptions + (dd). A definition term can only contain inline + elements. A definition description can contain other block + elements. + + + <sgmltag>ul</sgmltag> and <sgmltag>ol</sgmltag> + + Use: + + An unordered list. Listitems will probably be + preceded by bullets.

+ +
    +
  • First item
  • + +
  • Second item
  • + +
  • Third item
  • +
+ +

An ordered list, with list items consisting of multiple + paragraphs. Each item (note: not each paragraph) will be + numbered.

+ +
    +
  1. This is the first item. It only has one paragraph.

  2. + +
  3. This is the first paragraph of the second item.

    + +

    This is the second paragraph of the second item.

  4. + +
  5. This is the first and only paragraph of the third + item.

  6. +
]]>
+
+ + + Definition lists with <sgmltag>dl</sgmltag> + + Use: + + +
Term 1
+ +

Paragraph 1 of definition 1.

+ +

Paragraph 2 of definition 1.

+ +
Term 2
+ +

Paragraph 1 of definition 2.

+ +
Term 3
+ +

Paragraph 1 of definition 3.

+]]>
+
+
+ + + Pre-formatted text + + You can indicate that text should be shown to the user exactly + as it is in the file. Typically, this means that the text is shown + in a fixed font, multiple spaces are not merged into one, and line + breaks in the text are significant. + + In order to do this, wrap the content in the + pre element. + + + <sgmltag>pre</sgmltag> + + You could use pre to mark up an email + message: + + From: nik@FreeBSD.org + To: freebsd-doc@FreeBSD.org + Subject: New documentation available + + There is a new copy of my primer for contributors to the FreeBSD + Documentation Project available at + + <URL:http://people.FreeBSD.org/~nik/primer/index.html> + + Comments appreciated. + + N]]> + + Keep in mind that < and + & still are recognized as special + characters in pre-formatted text. This is why the example + shown had to use &lt; instead of + <. For consistency, + &gt; was used in place of + >, too. Watch out for the special characters + that may appear in text copied from a plain-text source, + e.g., an email message or program code. + + + + + + Tables + + + Most text-mode browsers (such as Lynx) do not render tables + particularly effectively. If you are relying on the tabular + display of your content, you should consider using alternative + markup to prevent confusion. + + + Mark up tabular information using the table + element. A table consists of one or more table rows + (tr), each containing one or more cells of table + data (td). Each cell can contain other block + elements, such as paragraphs or lists. It can also contain another + table (this nesting can repeat indefinitely). If the cell only + contains one paragraph then you do not need to include the + p element. + + + Simple use of <sgmltag>table</sgmltag> + + Use: + + This is a simple 2x2 table.

+ + + + + + + + + + + + + +
Top left cellTop right cell
Bottom left cellBottom right cell
]]>
+ + A cell can span multiple rows and columns. To indicate this, + add the rowspan and/or colspan + attributes, with values indicating the number of rows of columns + that should be spanned. + + + Using <literal>rowspan</literal> + + Use: + + One tall thin cell on the left, two short cells next to + it on the right.

+ + + + + + + + + + + +
Long and thin
Top cellBottom cell
]]>
+
+ + + Using <literal>colspan</literal> + + Use: + + One long cell on top, two short cells below it.

+ + + + + + + + + + + +
Top cell
Bottom left cellBottom right cell
]]>
+
+ + + Using <literal>rowspan</literal> and + <literal>colspan</literal> together + + Use: + + On a 3x3 grid, the top left block is a 2x2 set of + cells merged into one. The other cells are normal.

+ + + + + + + + + + + + + + + + + + + + + +
Top left large cellTop right cell
Middle right cell
Bottom left cellBottom middle cellBottom right cell
]]>
+
+
+
+ + + In-line elements + + + Emphasizing information + + You have two levels of emphasis available in HTML, + em and strong. + em is for a normal level of emphasis and + strong indicates stronger emphasis. + + Typically, em is rendered in italic and + strong is rendered in bold. This is not always + the case, however, and you should not rely on it. + + + <sgmltag>em</sgmltag> and <sgmltag>strong</sgmltag> + + Use: + + This has been emphasized, while + this has been strongly emphasized.

]]>
+
+
+ + + Bold and italics + + Because HTML includes presentational markup, you can also + indicate that particular content should be rendered in bold or + italic. The elements are b and + i respectively. + + + <sgmltag>b</sgmltag> and <sgmltag>i</sgmltag> + + This is in bold, while this is + in italics.

]]>
+
+
+ + + Indicating fixed pitch text + + If you have content that should be rendered in a fixed pitch + (typewriter) typeface, use tt (for + teletype). + + + <sgmltag>tt</sgmltag> + + Use: + + This document was originally written by + Nik Clayton, who can be reached by email as + nik@FreeBSD.org.

]]>
+
+
+ + + Content size + + You can indicate that content should be shown in a larger or + smaller font. There are three ways of doing this. + + + + Use big and small + around the content you wish to change size. These tags can be + nested, so <big><big>This is much + bigger</big></big> is possible. + + + + Use font with the size + attribute set to +1 or -1 + respectively. This has the same effect as using + big or small. However, + the use of this approach is deprecated. + + + + Use font with the size + attribute set to a number between 1 and 7. The default font size + is 3. This approach is deprecated. + + + + + <sgmltag>big</sgmltag>, <sgmltag>small</sgmltag>, and + <sgmltag>font</sgmltag> + + The following fragments all do the same thing. + + This text is slightly smaller. But + this text is slightly bigger.

+ +

This text is slightly smaller. But + this text is slightly bigger + +

This text is slightly smaller. But + this text is slightly bigger.

]]>
+
+
+
+ + + Links + + + Links are also in-line elements. + + + + Linking to other documents on the WWW + + In order to include a link to another document on the WWW you + must know the URL of the document you want to link to. + + The link is indicated with a, and the + href attribute contains the URL of the target + document. The content of the element becomes the link, and is + normally indicated to the user in some way (underlining, change of + color, different mouse cursor when over the link, and so + on). + + + Using <literal><a href="..."></literal> + + Use: + + More information is available at the + FreeBSD web site.

]]>
+
+ + These links will take the user to the top of the chosen + document. +
+ + + Linking to other parts of documents + + Linking to a point within another document (or within the same + document) requires that the document author include anchors that you + can link to. + + Anchors are indicated with a and the + name attribute instead of + href. + + + Using <literal><a name="..."></literal> + + Use: + + This paragraph can be referenced + in other links with the name para1.

]]>
+
+ + To link to a named part of a document, write a normal link to + that document, but include the name of the anchor after a + # symbol. + + + Linking to a named part of another document + + Assume that the para1 example resides in a + document called foo.html. + + More information can be found in the + first paragraph of + foo.html.

]]>
+
+ + If you are linking to a named anchor within the same document + then you can omit the document's URL, and just include the name of + the anchor (with the preceding #). + + + Linking to a named part of the same document + + Assume that the para1 example resides in + this document: + + More information can be found in the + first paragraph of this + document.

]]>
+
+
+
+
+ + + DocBook + + DocBook was originally developed by HaL Computer Systems and O'Reilly + & Associates to be a DTD for writing technical documentation + A short history can be found under + http://www.oasis-open.org/committees/docbook/intro.shtml. + . Since 1998 it is maintained by the + DocBook Technical Committee. As such, and unlike LinuxDoc + and HTML, DocBook is very heavily oriented towards markup that + describes what something is, rather than describing + how it should be presented. + + + <literal>formal</literal> vs. <literal>informal</literal> + + Some elements may exist in two forms, formal + and informal. Typically, the formal version of + the element will consist of a title followed by the informal + version of the element. The informal version will not have a + title. + + + The DocBook DTD is available from the ports collection in the + textproc/docbook port. It is automatically + installed as part of the textproc/docproj + port. + + + FreeBSD extensions + + The FreeBSD Documentation Project has extended the DocBook DTD by + adding some new elements. These elements serve to make some of the + markup more precise. + + Where a FreeBSD specific element is listed below it is clearly + marked. + + Throughout the rest of this document, the term + DocBook is used to mean the FreeBSD extended DocBook + DTD. + + + There is nothing about these extensions that is FreeBSD + specific, it was just felt that they were useful enhancements for + this particular project. Should anyone from any of the other *nix + camps (NetBSD, OpenBSD, Linux, …) be interested in + collaborating on a standard DocBook extension set, please get in + touch with &a.doceng;. + + + The FreeBSD extensions are not (currently) in the ports + collection. They are stored in the FreeBSD CVS tree, as doc/share/sgml/freebsd.dtd. + + + + Formal Public Identifier (FPI) + + In compliance with the DocBook guidelines for writing FPIs for + DocBook customizations, the FPI for the FreeBSD extended DocBook DTD + is: + + PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" + + + + Document structure + + DocBook allows you to structure your documentation in several + ways. In the FreeBSD Documentation Project we are using two primary + types of DocBook document: the book and the article. + + A book is organized into chapters. This is a + mandatory requirement. There may be parts between + the book and the chapter to provide another layer of organization. + The Handbook is arranged in this way. + + A chapter may (or may not) contain one or more sections. These + are indicated with the sect1 element. If a section + contains another section then use the sect2 + element, and so on, up to sect5. + + Chapters and sections contain the remainder of the content. + + An article is simpler than a book, and does not use chapters. + Instead, the content of an article is organized into one or more + sections, using the same sect1 (and + sect2 and so on) elements that are used in + books. + + Obviously, you should consider the nature of the documentation you + are writing in order to decide whether it is best marked up as a book + or an article. Articles are well suited to information that does not + need to be broken down into several chapters, and that is, relatively + speaking, quite short, at up to 20-25 pages of content. Books are + best suited to information that can be broken up into several + chapters, possibly with appendices and similar content as well. + + The FreeBSD + tutorials are all marked up as articles, while this + document, the FreeBSD + FAQ, and the FreeBSD Handbook are + all marked up as books. + + + Starting a book + + The content of the book is contained within the + book element. As well as containing structural + markup, this element can contain elements that include additional + information about the book. This is either meta-information, used + for reference purposes, or additional content used to produce a + title page. + + This additional information should be contained within + bookinfo. + + + Boilerplate <sgmltag>book</sgmltag> with + <sgmltag>bookinfo</sgmltag> + + + <book> + <bookinfo> + <title>Your title here</title> + + <author> + <firstname>Your first name</firstname> + <surname>Your surname</surname> + <affiliation> + <address><email>Your email address</email></address> + </affiliation> + </author> + + <copyright> + <year>1998</year> + <holder role="mailto:your email address">Your name</holder> + </copyright> + + <releaseinfo>$FreeBSD$</releaseinfo> + + <abstract> + <para>Include an abstract of the book's contents here.</para> + </abstract> + </bookinfo> + + … + +</book> + + + + + Starting an article + + The content of the article is contained within the + article element. As well as containing + structural markup, this element can contain elements that include + additional information about the article. This is either + meta-information, used for reference purposes, or additional content + used to produce a title page. + + This additional information should be contained within + articleinfo. + + + Boilerplate <sgmltag>article</sgmltag> with + <sgmltag>articleinfo</sgmltag> + + + <article> + <articleinfo> + <title>Your title here</title> + + <author> + <firstname>Your first name</firstname> + <surname>Your surname</surname> + <affiliation> + <address><email>Your email address</email></address> + </affiliation> + </author> + + <copyright> + <year>1998</year> + <holder role="mailto:your email address">Your name</holder> + </copyright> + + <releaseinfo>$FreeBSD$</releaseinfo> + + <abstract> + <para>Include an abstract of the article's contents here.</para> + </abstract> + </articleinfo> + + … + +</article> + + + + Indicating chapters + + Use chapter to mark up your chapters. Each + chapter has a mandatory title. Articles do not + contain chapters, they are reserved for books. + + + A simple chapter + + + The chapter's title + + ... +
]]> + + + A chapter cannot be empty; it must contain elements in addition + to title. If you need to include an empty + chapter then just use an empty paragraph. + + + Empty chapters + + + This is an empty chapter + + +]]> + + + + + Sections below chapters + + In books, chapters may (but do not need to) be broken up into + sections, subsections, and so on. In articles, sections are the + main structural element, and each article must contain at least one + section. Use the + sectn element. The + n indicates the section number, which + identifies the section level. + + The first sectn is + sect1. You can have one or more of these in a + chapter. They can contain one or more sect2 + elements, and so on, down to sect5. + + + Sections in chapters + + + A sample chapter + + Some text in the chapter. + + + First section (1.1) + + … + + + + Second section (1.2) + + + First sub-section (1.2.1) + + + First sub-sub-section (1.2.1.1) + + … + + + + + Second sub-section (1.2.2) + + … + + +]]> + + + + This example includes section numbers in the section titles. + You should not do this in your documents. Adding the section + numbers is carried out by the stylesheets (of which more + later), and you do not need to manage them yourself. + + + + + Subdividing using <sgmltag>part</sgmltag>s + + You can introduce another layer of organization between + book and chapter with one or + more parts. This cannot be done in an + article. + + + Introduction + + + Overview + + ... + + + + What is FreeBSD? + + ... + + + + History + + ... + +]]> + + + + + Block elements + + + Paragraphs + + DocBook supports three types of paragraphs: + formalpara, para, and + simpara. + + Most of the time you will only need to use + para. formalpara includes a + title element, and simpara + disallows some elements from within para. Stick + with para. + + + <sgmltag>para</sgmltag> + + Use: + + This is a paragraph. It can contain just about any + other element. ]]> + + Appearance: + + This is a paragraph. It can contain just about any other + element. + + + + + Block quotations + + A block quotation is an extended quotation from another document + that should not appear within the current paragraph. You will + probably only need it infrequently. + + Blockquotes can optionally contain a title and an attribution + (or they can be left untitled and unattributed). + + + <sgmltag>blockquote</sgmltag> + + Use: + + A small excerpt from the US Constitution: + +
+ Preamble to the Constitution of the United States + + Copied from a web site somewhere + + We the People of the United States, in Order to form a more perfect + Union, establish Justice, insure domestic Tranquility, provide for the + common defence, promote the general Welfare, and secure the Blessings + of Liberty to ourselves and our Posterity, do ordain and establish this + Constitution for the United States of America. +
]]>
+ + Appearance: + +
+ Preamble to the Constitution of the United States + + Copied from a web site somewhere + + We the People of the United States, in Order to form a more + perfect Union, establish Justice, insure domestic Tranquility, + provide for the common defence, promote the general Welfare, and + secure the Blessings of Liberty to ourselves and our Posterity, + do ordain and establish this Constitution for the United States + of America. +
+
+
+ + + Tips, notes, warnings, cautions, important information and + sidebars. + + You may need to include extra information separate from the + main body of the text. Typically this is meta + information that the user should be aware of. + + Depending on the nature of the information, one of + tip, note, + warning, caution, and + important should be used. Alternatively, if the + information is related to the main text but is not one of the above, + use sidebar. + + The circumstances in which to choose one of these elements over + another is unclear. The DocBook documentation suggests: + + + + A Note is for information that should be heeded by all + readers. + + + + An Important element is a variation on Note. + + + + A Caution is for information regarding possible data loss + or software damage. + + + + A Warning is for information regarding possible hardware + damage or injury to life or limb. + + + + + <sgmltag>warning</sgmltag> + + Use: + + + Installing FreeBSD may make you want to delete Windows from your + hard disk. +]]> + + + + + Installing FreeBSD may make you want to delete Windows from + your hard disk. + + + + + Lists and procedures + + You will often need to list pieces of information to the user, + or present them with a number of steps that must be carried out in + order to accomplish a particular goal. + + In order to do this, use itemizedlist, + orderedlist, or + procedureThere are other types of + list element in DocBook, but we are not concerned with those at + the moment. + + + + itemizedlist and + orderedlist are similar to their counterparts in + HTML, ul and ol. Each one + consists of one or more listitem elements, and + each listitem contains one or more block + elements. The listitem elements are analogous to + HTML's li tags. However, unlike HTML, they are + required. + + procedure is slightly different. It consists + of steps, which may in turn consists of more + steps or substeps. Each + step contains block elements. + + + <sgmltag>itemizedlist</sgmltag>, + <sgmltag>orderedlist</sgmltag>, and + <sgmltag>procedure</sgmltag> + + Use: + + + + This is the first itemized item. + + + + This is the second itemized item. + + + + + + This is the first ordered item. + + + + This is the second ordered item. + + + + + + Do this. + + + + Then do this. + + + + And now do this. + +]]> + + Appearance: + + + + This is the first itemized item. + + + + This is the second itemized item. + + + + + + This is the first ordered item. + + + + This is the second ordered item. + + + + + + + + + Do this. + + + + Then do this. + + + + And now do this. + + + + + + Showing file samples + + If you want to show a fragment of a file (or perhaps a complete + file) to the user, wrap it in the programlisting + element. + + White space and line breaks within + programlisting are + significant. In particular, this means that the opening tag should + appear on the same line as the first line of the output, and the + closing tag should appear on the same line as the last line of the + output, otherwise spurious blank lines may be included. + + + <sgmltag>programlisting</sgmltag> + + Use: + + When you have finished, your program should look like + this: + +#include <stdio.h> + +int +main(void) +{ + printf("hello, world\n"); +}]]> + + Notice how the angle brackets in the + #include line need to be referenced by their + entities instead of being included literally. + + Appearance: + + When you have finished, your program should look like + this: + + #include <stdio.h> + +int +main(void) +{ + printf("hello, world\n"); +} + + + + + Callouts + + A callout is a mechanism for referring back to an earlier piece + of text or specific position within an earlier example without + linking to it within the text. + + To do this, mark areas of interest in your example + (programlisting, + literallayout, or whatever) with the + co element. Each element must have a unique + id assigned to it. After the example include a + calloutlist that refers back to the example and + provides additional commentary. + + + <sgmltag>co</sgmltag> and + <sgmltag>calloutlist</sgmltag> + + When you have finished, your program should look like + this: + +#include <stdio.h> + +int +main(void) +{ + printf("hello, world\n"); +} + + + + Includes the standard IO header file. + + + + Specifies that main() returns an + int. + + + + The printf() call that writes + hello, world to standard output. + +]]> + + Appearance: + + When you have finished, your program should look like + this: + + #include <stdio.h> + +int +main(void) +{ + printf("hello, world\n"); +} + + + + Includes the standard IO header file. + + + + Specifies that main() returns an + int. + + + + The printf() call that writes + hello, world to standard output. + + + + + + + Tables + + Unlike HTML, you do not need to use tables for layout purposes, + as the stylesheet handles those issues for you. Instead, just use + tables for marking up tabular data. + + In general terms (and see the DocBook documentation for more + detail) a table (which can be either formal or informal) consists of + a table element. This contains at least one + tgroup element, which specifies (as an attribute) + the number of columns in this table group. Within the tablegroup + you can then have one thead element, which + contains elements for the table headings (column headings), and one + tbody which contains the body of the + table. + + Both tgroup and thead + contain row elements, which in turn contain + entry elements. Each entry + element specifies one cell in the table. + + + <sgmltag>informaltable</sgmltag> + + Use: + + + + + + This is column head 1 + This is column head 2 + + + + + + Row 1, column 1 + Row 1, column 2 + + + + Row 2, column 1 + Row 2, column 2 + + + +]]> + + Appearance: + + + + + + This is column head 1 + This is column head 2 + + + + + + Row 1, column 1 + Row 1, column 2 + + + + Row 2, column 1 + Row 2, column 2 + + + + + + + Always use the pgwide attribute with + a value of 1 with the + informaltable element. A bug in Internet + Explorer can cause the table to render incorrectly if this + is omitted. + + If you do not want a border around the table the + frame attribute can be added to the + informaltable element with a value of + none (i.e., <informaltable + frame="none">). + + + Tables where <literal>frame="none"</literal> + + Appearance: + + + + + + This is column head 1 + This is column head 2 + + + + + + Row 1, column 1 + Row 1, column 2 + + + + Row 2, column 1 + Row 2, column 2 + + + + + + + + + Examples for the user to follow + + A lot of the time you need to show examples for the user to + follow. Typically, these will consist of dialogs with the computer; + the user types in a command, the user gets a response back, they + type in another command, and so on. + + A number of distinct elements and entities come into play + here. + + + + screen + + + Everything the user sees in this example will be on the + computer screen, so the next element is + screen. + + Within screen, white space is + significant. + + + + + prompt, + &prompt.root; and + &prompt.user; + + + Some of the things the user will be seeing on the screen + are prompts from the computer (either from the operating system, command + shell, or application). These should be marked up using + prompt. + + As a special case, the two shell prompts for the normal + user and the root user have been provided as entities. Every + time you want to indicate the user is at a shell prompt, use + one of &prompt.root; and + &prompt.user; as necessary. They do + not need to be inside prompt. + + + &prompt.root; and + &prompt.user; are FreeBSD + extensions to DocBook, and are not part of the original + DTD. + + + + + + userinput + + + When displaying text that the user should type in, wrap it + in userinput tags. It will probably be + displayed differently to the user. + + + + + + <sgmltag>screen</sgmltag>, <sgmltag>prompt</sgmltag>, and + <sgmltag>userinput</sgmltag> + + Use: + + &prompt.user; ls -1 +foo1 +foo2 +foo3 +&prompt.user; ls -1 | grep foo2 +foo2 +&prompt.user; su +Password: +&prompt.root; cat foo2 +This is the file called 'foo2']]> + + Appearance: + + &prompt.user; ls -1 +foo1 +foo2 +foo3 +&prompt.user; ls -1 | grep foo2 +foo2 +&prompt.user; su +Password: +&prompt.root; cat foo2 +This is the file called 'foo2' + + + + Even though we are displaying the contents of the file + foo2, it is not marked + up as programlisting. Reserve + programlisting for showing fragments of files + outside the context of user actions. + + +
+ + + In-line elements + + + Emphasizing information + + When you want to emphasize a particular word or phrase, use + emphasis. This may be presented as italic, or + bold, or might be spoken differently with a text-to-speech + system. + + There is no way to change the presentation of the emphasis + within your document, no equivalent of HTML's b + and i. If the information you are presenting is + important then consider presenting it in + important rather than + emphasis. + + + <sgmltag>emphasis</sgmltag> + + Use: + + FreeBSD is without doubt the + premiere Unix like operating system for the Intel architecture.]]> + + Appearance: + + FreeBSD is without doubt the premiere Unix + like operating system for the Intel architecture. + + + + + Quotations + + To quote text from another document or source, or to denote + a phrase that is used figuratively, use quote. + Within a quote tag, you may use most of the + markup tags available for normal text. + + + Quotations + + Use: + + However, make sure that the search does not go beyond the + boundary between local and public administration, + as RFC 1535 calls it.]]> + + Appearance: + + However, make sure that the search does not go beyond the + boundary between local and public administration, + as RFC 1535 calls it. + + + + + Keys, mouse buttons, and combinations + + To refer to a specific key on the keyboard, use + keycap. To refer to a mouse button, use + mousebutton. And to refer to combinations of key + presses or mouse clicks, wrap them all in + keycombo. + + keycombo has an attribute called + action, which may be one of + click, double-click, + other, press, + seq, or simul. The last two + values denote whether the keys or buttons should be pressed in + sequence, or simultaneously. + + The stylesheets automatically add any connecting symbols, such + as +, between the key names, when wrapped in + keycombo. + + + Keys, mouse buttons, and combinations + + Use: + + To switch to the second virtual terminal, press + Alt + F1. + +To exit vi without saving your work, type + Esc: + q!. + +My window manager is configured so that + Alt + right + mouse button is used to move windows.]]> + + Appearance: + + To switch to the second virtual terminal, press + Alt + F1. + + To exit vi without saving your work, type + Esc: + q!. + + My window manager is configured so that + Alt + right + mouse button is used to move windows. + + + + + Applications, commands, options, and cites + + You will frequently want to refer to both applications and + commands when writing for the Handbook. The distinction between + them is simple: an application is the name for a suite (or possibly + just 1) of programs that fulfil a particular task. A command is the + name of a program that the user can run. + + In addition, you will occasionally need to list one or more of + the options that a command might take. + + Finally, you will often want to list a command with its manual + section number, in the command(number) format so + common in Unix manuals. + + Mark up application names with + application. + + When you want to list a command with its manual section number + (which should be most of the time) the DocBook element is + citerefentry. This will contain a further two + elements, refentrytitle and + manvolnum. The content of + refentrytitle is the name of the command, and the + content of manvolnum is the manual page + section. + + This can be cumbersome to write, and so a series of general entities + have been created to make this easier. Each entity takes the form + &man.manual-page.manual-section;. + + The file that contains these entities is in + doc/share/sgml/man-refs.ent, and can be + referred to using this FPI: + + PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN" + + Therefore, the introduction to your documentation will probably + look like this: + + <!DOCTYPE book PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ + +<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> +%man; + +… + +]> + + Use command when you want to include a + command name in-line but present it as something the + user should type in. + + Use option to mark up the options + which will be passed to a command. + + When referring to the same command multiple times in + close proximity it is preferred to use the + &man.command.section; + notation to markup the first reference and use + command to markup subsequent references. + This makes the generated output, especially HTML, appear + visually better. + + This can be confusing, and sometimes the choice is not always + clear. Hopefully this example makes it clearer. + + + Applications, commands, and options. + + Use: + + Sendmail is the most + widely used Unix mail application. + +Sendmail includes the + + sendmail + 8 + , &man.mailq.8;, and &man.newaliases.8; + programs. + +One of the command line parameters to + sendmail + 8 + , , will display the current + status of messages in the mail queue. Check this on the command + line by running sendmail -bp.]]> + + Appearance: + + Sendmail is the most widely used + Unix mail application. + + Sendmail includes the + + sendmail + 8 + , + mailq + 8 + , and + newaliases + 8 + programs. + + One of the command line parameters to + sendmail + 8 + , , will display the current + status of messages in the mail queue. Check this on the command + line by running sendmail -bp. + + + + Notice how the + &man.command.section; notation is easier to follow. + + + + + Files, directories, extensions + + Whenever you wish to refer to the name of a file, a directory, + or a file extension, use filename. + + + <sgmltag>filename</sgmltag> + + Use: + + The SGML source for the Handbook in English can be + found in /usr/doc/en/handbook/. The first + file is called handbook.sgml in that + directory. You should also see a Makefile + and a number of files with a .ent + extension.]]> + + Appearance: + + The SGML source for the Handbook in English can be found in + /usr/doc/en/handbook/. The first file is + called handbook.sgml in that directory. You + should also see a Makefile and a number of + files with a .ent extension. + + + + + The name of ports + + + FreeBSD extension + + These elements are part of the FreeBSD extension to DocBook, + and do not exist in the original DocBook DTD. + + + You might need to include the name of a program from the + FreeBSD Ports Collection in the documentation. Use the + filename tag with the role + attribute set to package to identify these. + Since ports + can be installed in any number of locations, only include + the category and the port name; do not include + /usr/ports. + + + <sgmltag>filename</sgmltag> tag with + <literal>package</literal> role + + Use: + + Install the net/ethereal port to view network traffic.]]> + + Appearance: + + Install the net/ethereal + port to view network traffic. + + + + + Devices + + + FreeBSD extension + + These elements are part of the FreeBSD extension to DocBook, + and do not exist in the original DocBook DTD. + + + When referring to devices you have two choices. You can either + refer to the device as it appears in /dev, or + you can use the name of the device as it appears in the kernel. For + this latter course, use devicename. + + Sometimes you will not have a choice. Some devices, such as + networking cards, do not have entries in /dev, + or the entries are markedly different from those entries. + + + <sgmltag>devicename</sgmltag> + + Use: + + sio is used for serial + communication in FreeBSD. sio manifests + through a number of entries in /dev, including + /dev/ttyd0 and /dev/cuaa0. + +By contrast, the networking devices, such as + ed0 do not appear in /dev. + +In MS-DOS, the first floppy drive is referred to as + a:. In FreeBSD it is + /dev/fd0.]]> + + Appearance: + + sio is used for serial communication + in FreeBSD. sio manifests through a + number of entries in /dev, including + /dev/ttyd0 and + /dev/cuaa0. + + By contrast, the networking devices, such as + ed0 do not appear in + /dev. + + In MS-DOS, the first floppy drive is referred to as + a:. In FreeBSD it is + /dev/fd0. + + + + + Hosts, domains, IP addresses, and so forth + + + FreeBSD extension + + These elements are part of the FreeBSD extension to DocBook, + and do not exist in the original DocBook DTD. + + + You can markup identification information for networked + computers (hosts) in several ways, depending on the nature of the + information. All of them use hostid as the + element, with the role attribute selecting the + type of the marked up information. + + + + No role attribute, or + role="hostname" + + + With no role attribute (i.e., + hostid.../hostid) the + marked up information is the simple hostname, such as + freefall or wcarchive. + You can explicitly specify this with + role="hostname". + + + + + role="domainname" + + + The text is a domain name, such as + FreeBSD.org or + ngo.org.uk. There is no hostname + component. + + + + + role="fqdn" + + + The text is a Fully Qualified Domain Name, with both + hostname and domain name parts. + + + + + role="ipaddr" + + + The text is an IP address, probably expressed as a dotted + quad. + + + + + role="ip6addr" + + + The text is an IPv6 address. + + + + + role="netmask" + + + The text is a network mask, which might be expressed as a + dotted quad, a hexadecimal string, or as a + / followed by a number. + + + + + role="mac" + + + The text is an Ethernet MAC address, expressed as a series + of 2 digit hexadecimal numbers separated by colons. + + + + + + <sgmltag>hostid</sgmltag> and roles + + Use: + + The local machine can always be referred to by the + name localhost, which will have the IP address + 127.0.0.1. + +The FreeBSD.org domain + contains a number of different hosts, including + freefall.FreeBSD.org and + bento.FreeBSD.org. + +When adding an IP alias to an interface (using + ifconfig) always use a + netmask of 255.255.255.255 + (which can also be expressed as 0xffffffff. + +The MAC address uniquely identifies every network card + in existence. A typical MAC address looks like 08:00:20:87:ef:d0.]]> + + Appearance: + + The local machine can always be referred to by the name + localhost, which will have the IP address 127.0.0.1. + + The FreeBSD.org domain + contains a number of different hosts, including freefall.FreeBSD.org and bento.FreeBSD.org. + + When adding an IP alias to an interface (using + ifconfig) always use a + netmask of 255.255.255.255 (which + can also be expressed as 0xffffffff. + + The MAC address uniquely identifies every network card in + existence. A typical MAC address looks like 08:00:20:87:ef:d0. + + + + + Usernames + + + FreeBSD extension + + These elements are part of the FreeBSD extension to DocBook, + and do not exist in the original DocBook DTD. + + + When you need to refer to a specific username, such as + root or bin, use + username. + + + <sgmltag>username</sgmltag> + + Use: + + To carry out most system administration functions you + will need to be root.]]> + + Appearance: + + To carry out most system administration functions you will + need to be root. + + + + + Describing <filename>Makefile</filename>s + + + FreeBSD extension + + These elements are part of the FreeBSD extension to DocBook, + and do not exist in the original DocBook DTD. + + + Two elements exist to describe parts of + Makefiles, maketarget and + makevar. + + maketarget identifies a build target exported + by a Makefile that can be given as a parameter + to make. makevar identifies a + variable that can be set (in the environment, on the + make command line, or within the + Makefile) to influence the process. + + + <sgmltag>maketarget</sgmltag> and + <sgmltag>makevar</sgmltag> + + Use: + + Two common targets in a Makefile + are all and clean. + +Typically, invoking all will rebuild the + application, and invoking clean will remove + the temporary files (.o for example) created by + the build process. + +clean may be controlled by a number of + variables, including CLOBBER and + RECURSE.]]> + + Appearance: + + Two common targets in a Makefile are + all and + clean. + + Typically, invoking all will rebuild + the application, and invoking clean will + remove the temporary files (.o for example) + created by the build process. + + clean may be controlled by a number + of variables, including CLOBBER and + RECURSE. + + + + + Literal text + + You will often need to include literal text in the + Handbook. This is text that is excerpted from another file, or + which should be copied from the Handbook into another file + verbatim. + + Some of the time, programlisting will be + sufficient to denote this text. programlisting + is not always appropriate, particularly when you want to include a + portion of a file in-line with the rest of the + paragraph. + + On these occasions, use literal. + + + <sgmltag>literal</sgmltag> + + Use: + + The maxusers 10 line in the kernel + configuration file determines the size of many system tables, and is + a rough guide to how many simultaneous logins the system will + support.]]> + + Appearance: + + The maxusers 10 line in the kernel + configuration file determines the size of many system tables, and + is a rough guide to how many simultaneous logins the system will + support. + + + + + Showing items that the user <emphasis>must</emphasis> fill + in + + There will often be times when you want to show the user what to + do, or refer to a file, or command line, or similar, where the user + cannot simply copy the examples that you provide, but must instead + include some information themselves. + + replaceable is designed for this eventuality. + Use it inside other elements to indicate parts + of that element's content that the user must replace. + + + <sgmltag>replaceable</sgmltag> + + Use: + + + &prompt.user; man command +]]> + + Appearance: + + + &prompt.user; man command + + + replaceable can be used in many different + elements, including literal. This example also + shows that replaceable should only be wrapped + around the content that the user is meant to + provide. The other content should be left alone. + + Use: + + The maxusers n + line in the kernel configuration file determines the size of many system + tables, and is a rough guide to how many simultaneous logins the system will + support. + +For a desktop workstation, 32 is a good value + for n.]]> + + Appearance: + + The maxusers n + line in the kernel configuration file determines the size of many + system tables, and is a rough guide to how many simultaneous + logins the system will support. + + For a desktop workstation, 32 is a good + value for n. + + + + + Quoting system errors + + You might want to show errors generated by FreeBSD. + Mark these with errorname. This + indicates the exact error that appears. + + + <sgmltag>errorname</sgmltag> + + Use: + + Panic: cannot mount root ]]> + + + + Appearance: + + + Panic: cannot mount root + + + + + + + Images + + + Image support in the documentation is currently extremely + experimental. I think the mechanisms described here are unlikely to + change, but that is not guaranteed. + + You will also need to install the + graphics/ImageMagick port, which is used to + convert between the different image formats. This is a big port, + and most of it is not required. However, while we are working on the + Makefiles and other infrastructure it makes + things easier. This port is not in the + textproc/docproj meta port, you must install it + by hand. + + The best example of what follows in practice is the + doc/en_US.ISO8859-1/articles/vm-design/ document. + If you are unsure of the description that follows, take a look at the + files in that directory to see how everything hangs together. + Experiment with creating different formatted versions of the + document to see how the image markup appears in the formatted + output. + + + + Image formats + + We currently support two formats for images. The format you + should use will depend on the nature of your image. + + For images that are primarily vector based, such as network + diagrams, time lines, and similar, use Encapsulated Postscript, and + make sure that your images have the .eps + extension. + + For bitmaps, such as screen captures, use the Portable Network + Graphic format, and make sure that your images have the + .png extension. + + These are the only formats in which images + should be committed to the CVS repository. + + Use the right format for the right image. It is to be expected + that your documentation will have a mix of EPS and PNG images. The + Makefiles ensure that the correct format image + is chosen depending on the output format that you use for your + documentation. Do not commit the same image to the + repository in two different formats. + + + It is anticipated that the Documentation Project will switch to + using the Scalable Vector Graphic (SVG) format for vector images. + However, the current state of SVG capable editing tools makes this + impractical. + + + + + Markup + + The markup for an image is relatively simple. First, markup a + mediaobject. The mediaobject + can contain other, more specific objects. We are concerned with + two, the imageobject and the + textobject. + + You should include one imageobject, and two + textobject elements. The + imageobject will point to the name of the image + file that will be used (without the extension). The + textobject elements contain information that will + be presented to the user as well as, or instead of, the + image. + + There are two circumstances where this can happen. + + + + When the reader is viewing the documentation in HTML. In + this case, each image will need to have associated alternate + text to show the user, typically whilst the image is loading, or + if they hover the mouse pointer over the image. + + + + When the reader is viewing the documentation in plain text. + In this case, each image should have an ASCII art equivalent to + show the user. + + + + An example will probably make things easier to understand. + Suppose you have an image, called fig1, that + you want to include in the document. This image is of a rectangle + with an A inside it. The markup for this would be as + follows. + + <mediaobject> + <imageobject> + <imagedata fileref="fig1"> + </imageobject> + + <textobject> + <literallayout class="monospaced">+---------------+ +| A | ++---------------+</literallayout> + </textobject> + + <textobject> + <phrase>A picture</phrase> + </textobject> +</mediaobject> + + + + Include an imagedata element inside the + imageobject element. The + fileref attribute should contain the filename + of the image to include, without the extension. The stylesheets + will work out which extension should be added to the filename + automatically. + + + + The first textobject should contain a + literallayout element, where the + class attribute is set to + monospaced. This is your opportunity to + demonstrate your ASCII art skills. This content will be used if + the document is converted to plain text. + + Notice how the first and last lines of the content of the + literallayout element butt up next to the + element's tags. This ensures no extraneous white space is + included. + + + + The second textobject should contain a + single phrase element. The contents of this + will become the alt attribute for the image + when this document is converted to HTML. + + + + + + <filename>Makefile</filename> entries + + Your images must be listed in the + Makefile in the IMAGES + variable. This variable should contain the name of all your + source images. For example, if you have + created three figures, fig1.eps, + fig2.png, fig3.png, then + your Makefile should have lines like this in + it. + + … +IMAGES= fig1.eps fig2.png fig3.png +… + + or + + … +IMAGES= fig1.eps +IMAGES+= fig2.png +IMAGES+= fig3.png +… + + Again, the Makefile will work out the + complete list of images it needs to build your source document, you + only need to list the image files you + provided. + + + + Images and chapters in subdirectories + + You must be careful when you separate your documentation into + smaller files (see ) in + different directories. + + Suppose you have a book with three chapters, and the chapters + are stored in their own directories, called + chapter1/chapter.sgml, + chapter2/chapter.sgml, and + chapter3/chapter.sgml. If each chapter has + images associated with it, I suggest you place those images in each + chapter's subdirectory (chapter1/, + chapter2/, and + chapter3/). + + However, if you do this you must include the directory names in + the IMAGES variable in the + Makefile, and you must + include the directory name in the imagedata + element in your document. + + For example, if you have chapter1/fig1.png, + then chapter1/chapter.sgml should + contain: + + <mediaobject> + <imageobject> + <imagedata fileref="chapter1/fig1"> + </imageobject> + + … + +</mediaobject> + + + + The directory name must be included in the + fileref attribute. + + + + The Makefile must contain: + + … +IMAGES= chapter1/fig1.png +… + + Then everything should just work. + + + + + Links + + + Links are also in-line elements. + + + + Linking to other parts of the same document + + Linking within the same document requires you to specify + where you are linking from (i.e., the text the user will click, or + otherwise indicate, as the source of the link) and where you are + linking to (the link's destination). + + Each element within DocBook has an attribute called + id. You can place text in this attribute to + uniquely name the element it is attached to. + + This value will be used when you specify the link + source. + + Normally, you will only be linking to chapters or sections, so + you would add the id attribute to these + elements. + + + <literal>id on chapters and sections</literal> + + + Introduction + + This is the introduction. It contains a subsection, + which is identified as well. + + + Sub-sect 1 + + This is the subsection. + +]]> + + + Obviously, you should use more descriptive values. The values + must be unique within the document (i.e., not just the file, but the + document the file might be included in as well). Notice how the + id for the subsection is constructed by appending + text to the id of the chapter. This helps to + ensure that they are unique. + + If you want to allow the user to jump into a specific portion of + the document (possibly in the middle of a paragraph or an example), + use anchor. This element has no content, but + takes an id attribute. + + + <sgmltag>anchor</sgmltag> + + This paragraph has an embedded + link target in it. It will not show up in + the document.]]> + + + When you want to provide the user with a link they can activate + (probably by clicking) to go to a section of the document that has + an id attribute, you can use either + xref or link. + + Both of these elements have a linkend + attribute. The value of this attribute should be the value that you + have used in a id attribute (it does not matter + if that value has not yet occurred in your document; this will work + for forward links as well as backward links). + + If you use xref then you have no control over + the text of the link. It will be generated for you. + + + Using <sgmltag>xref</sgmltag> + + Assume that this fragment appears somewhere in a document that + includes the id example: + + More information can be found + in . + +More specific information can be found + in .]]> + + The text of the link will be generated automatically, and will + look like (emphasized text indicates the text + that will be the link): + +
+ More information can be found in Chapter + One. + + More specific information can be found in the + section called Sub-sect 1. +
+
+ + Notice how the text from the link is derived from the section + title or the chapter number. + + + This means that you cannot use + xref to link to an id + attribute on an anchor element. The + anchor has no content, so the + xref cannot generate the text for the + link. + + + If you want to control the text of the link then use + link. This element wraps content, and the + content will be used for the link. + + + Using <sgmltag>link</sgmltag> + + Assume that this fragment appears somewhere in a document that + includes the id example. + + More information can be found in + the first chapter. + +More specific information can be found in + this section.]]> + + This will generate the following + (emphasized text indicates the text that will + be the link): + +
+ More information can be found in the first + chapter. + + More specific information can be found in + this section. +
+
+ + + That last one is a bad example. Never use words like + this or here as the source for the + link. The reader will need to hunt around the surrounding context + to see where the link is actually taking them. + + + + You can use link to + include a link to an id on an + anchor element, since the + link content defines the text that will be used + for the link. + +
+ + + Linking to documents on the WWW + + Linking to external documents is much simpler, as long as you + know the URL of the document you want to link to. Use + ulink. The url attribute is + the URL of the page that the link points to, and the content of the + element is the text that will be displayed for the user to + activate. + + + <sgmltag>ulink</sgmltag> + + Use: + + Of course, you could stop reading this document and + go to the FreeBSD + home page instead.]]> + + Appearance: + + Of course, you could stop reading this document and go to the + FreeBSD home page + instead. + + +
+ + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/sgml-primer/chapter.sgml b/zh_TW.Big5/books/fdp-primer/sgml-primer/chapter.sgml new file mode 100644 index 0000000000..c90154b62a --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/sgml-primer/chapter.sgml @@ -0,0 +1,1591 @@ + + + + SGML Primer + + The majority of FDP documentation is written in applications of + SGML. This chapter explains exactly what that means, how to read + and understand the source to the documentation, and the sort of SGML + tricks you will see used in the documentation. + + Portions of this section were inspired by Mark Galassi's Get Going With DocBook. + + + Overview + + Way back when, electronic text was simple to deal with. Admittedly, + you had to know which character set your document was written in (ASCII, + EBCDIC, or one of a number of others) but that was about it. Text was + text, and what you saw really was what you got. No frills, no + formatting, no intelligence. + + Inevitably, this was not enough. Once you have text in a + machine-usable format, you expect machines to be able to use it and + manipulate it intelligently. You would like to indicate that certain + phrases should be emphasized, or added to a glossary, or be hyperlinks. + You might want filenames to be shown in a typewriter style + font for viewing on screen, but as italics when printed, + or any of a myriad of other options for presentation. + + It was once hoped that Artificial Intelligence (AI) would make this + easy. Your computer would read in the document and automatically + identify key phrases, filenames, text that the reader should type in, + examples, and more. Unfortunately, real life has not happened quite + like that, and our computers require some assistance before they can + meaningfully process our text. + + More precisely, they need help identifying what is what. You or I + can look at + +
+ To remove /tmp/foo use &man.rm.1;. + + &prompt.user; rm /tmp/foo +
+ + and easily see which parts are filenames, which are commands to be typed + in, which parts are references to manual pages, and so on. But the + computer processing the document cannot. For this we need + markup.
+ + Markup is commonly used to describe adding + value or increasing cost. The term takes on both + these meanings when applied to text. Markup is additional text included + in the document, distinguished from the document's content in some way, + so that programs that process the document can read the markup and use + it when making decisions about the document. Editors can hide the + markup from the user, so the user is not distracted by it. + + The extra information stored in the markup adds + value to the document. Adding the markup to the document + must typically be done by a person—after all, if computers could + recognize the text sufficiently well to add the markup then there would + be no need to add it in the first place. This increases the + cost (i.e., the effort required) to create the + document. + + The previous example is actually represented in this document like + this: + + To remove /tmp/foo use &man.rm.1;. + +&prompt.user; rm /tmp/foo]]> + + As you can see, the markup is clearly separate from the + content. + + Obviously, if you are going to use markup you need to define what + your markup means, and how it should be interpreted. You will need a + markup language that you can follow when marking up your + documents. + + Of course, one markup language might not be enough. A markup + language for technical documentation has very different requirements + than a markup language that was to be used for cookery recipes. This, + in turn, would be very different from a markup language used to describe + poetry. What you really need is a first language that you use to write + these other markup languages. A meta markup + language. + + This is exactly what the Standard Generalized Markup Language (SGML) + is. Many markup languages have been written in SGML, including the two + most used by the FDP, HTML and DocBook. + + Each language definition is more properly called a Document Type + Definition (DTD). The DTD specifies the name of the elements that can + be used, what order they appear in (and whether some markup can be used + inside other markup) and related information. A DTD is sometimes + referred to as an application of SGML. + + A DTD is a complete + specification of all the elements that are allowed to appear, the order + in which they should appear, which elements are mandatory, which are + optional, and so forth. This makes it possible to write an SGML + parser which reads in both the DTD and a document + which claims to conform to the DTD. The parser can then confirm whether + or not all the elements required by the DTD are in the document in the + right order, and whether there are any errors in the markup. This is + normally referred to as validating the document. + + + This processing simply confirms that the choice of elements, their + ordering, and so on, conforms to that listed in the DTD. It does + not check that you have used + appropriate markup for the content. If you + tried to mark up all the filenames in your document as function + names, the parser would not flag this as an error (assuming, of + course, that your DTD defines elements for filenames and functions, + and that they are allowed to appear in the same place). + + + It is likely that most of your contributions to the Documentation + Project will consist of content marked up in either HTML or DocBook, + rather than alterations to the DTDs. For this reason this book will + not touch on how to write a DTD. +
+ + + Elements, tags, and attributes + + All the DTDs written in SGML share certain characteristics. This is + hardly surprising, as the philosophy behind SGML will inevitably show + through. One of the most obvious manifestations of this philosophy is + that of content and + elements. + + Your documentation (whether it is a single web page, or a lengthy + book) is considered to consist of content. This content is then divided + (and further subdivided) into elements. The purpose of adding markup is + to name and identify the boundaries of these elements for further + processing. + + For example, consider a typical book. At the very top level, the + book is itself an element. This book element obviously + contains chapters, which can be considered to be elements in their own + right. Each chapter will contain more elements, such as paragraphs, + quotations, and footnotes. Each paragraph might contain further + elements, identifying content that was direct speech, or the name of a + character in the story. + + You might like to think of this as chunking content. + At the very top level you have one chunk, the book. Look a little + deeper, and you have more chunks, the individual chapters. These are + chunked further into paragraphs, footnotes, character names, and so + on. + + Notice how you can make this differentiation between different + elements of the content without resorting to any SGML terms. It really + is surprisingly straightforward. You could do this with a highlighter + pen and a printout of the book, using different colors to indicate + different chunks of content. + + Of course, we do not have an electronic highlighter pen, so we need + some other way of indicating which element each piece of content belongs + to. In languages written in SGML (HTML, DocBook, et al) this is done by + means of tags. + + A tag is used to identify where a particular element starts, and + where the element ends. The tag is not part of the element + itself. Because each DTD was normally written to mark up + specific types of information, each one will recognize different + elements, and will therefore have different names for the tags. + + For an element called element-name the + start tag will normally look like + <element-name>. The + corresponding closing tag for this element is + </element-name>. + + + Using an element (start and end tags) + + HTML has an element for indicating that the content enclosed by + the element is a paragraph, called p. This + element has both start and end tags. + + This is a paragraph. It starts with the start tag for + the 'p' element, and it will end with the end tag for the 'p' + element.

+ +

This is another paragraph. But this one is much shorter.

]]>
+
+ + Not all elements require an end tag. Some elements have no content. + For example, in HTML you can indicate that you want a horizontal line to + appear in the document. Obviously, this line has no content, so just + the start tag is required for this element. + + + Using an element (start tag only) + + HTML has an element for indicating a horizontal rule, called + hr. This element does not wrap content, so only + has a start tag. + + This is a paragraph.

+ +
+ +

This is another paragraph. A horizontal rule separates this + from the previous paragraph.

]]>
+
+ + If it is not obvious by now, elements can contain other elements. + In the book example earlier, the book element contained all the chapter + elements, which in turn contained all the paragraph elements, and so + on. + + + Elements within elements; <sgmltag>em</sgmltag> + + This is a simple paragraph where some + of the words have been emphasized.

]]>
+
+ + The DTD will specify the rules detailing which elements can contain + other elements, and exactly what they can contain. + + + People often confuse the terms tags and elements, and use the + terms as if they were interchangeable. They are not. + + An element is a conceptual part of your document. An element has + a defined start and end. The tags mark where the element starts and + end. + + When this document (or anyone else knowledgeable about SGML) refers + to the <p> tag they mean the literal text + consisting of the three characters <, + p, and >. But the phrase + the <p> element refers to the whole + element. + + This distinction is very subtle. But keep it + in mind. + + + Elements can have attributes. An attribute has a name and a value, + and is used for adding extra information to the element. This might be + information that indicates how the content should be rendered, or might + be something that uniquely identifies that occurrence of the element, or + it might be something else. + + An element's attributes are written inside the + start tag for that element, and take the form + attribute-name="attribute-value". + + In sufficiently recent versions of HTML, the p + element has an attribute called align, which suggests + an alignment (justification) for the paragraph to the program displaying + the HTML. + + The align attribute can take one of four defined + values, left, center, + right and justify. If the + attribute is not specified then the default is + left. + + + Using an element with an attribute + + The inclusion of the align attribute + on this paragraph was superfluous, since the default is left.

+ +

This may appear in the center.

]]>
+
+ + Some attributes will only take specific values, such as + left or justify. Others will + allow you to enter anything you want. If you need to include quotes + (") within an attribute then use single quotes around + the attribute value. + + + Single quotes around attributes + + I am on the right!

]]>
+
+ + Sometimes you do not need to use quotes around attribute values at + all. However, the rules for doing this are subtle, and it is far + simpler just to always quote your attribute + values. + + The information on attributes, elements, and tags is stored + in SGML catalogs. The various Documentation Project tools use + these catalog files to validate your work. The tools in + textproc/docproj include a variety of SGML catalog + files. The FreeBSD Documentation Project includes its own set + of catalog files. Your tools need to know about both sorts of + catalog files. + + + For you to do… + + In order to run the examples in this document you will need to + install some software on your system and ensure that an environment + variable is set correctly. + + + + Download and install textproc/docproj + from the FreeBSD ports system. This is a + meta-port that should download and install + all of the programs and supporting files that are used by the + Documentation Project. + + + + Add lines to your shell startup files to set + SGML_CATALOG_FILES. (If you are not working + on the English version of the documentation, you will want + to substitute the correct directory for your + language.) + + + <filename>.profile</filename>, for &man.sh.1; and + &man.bash.1; users + + SGML_ROOT=/usr/local/share/sgml +SGML_CATALOG_FILES=${SGML_ROOT}/jade/catalog +SGML_CATALOG_FILES=${SGML_ROOT}/iso8879/catalog:$SGML_CATALOG_FILES +SGML_CATALOG_FILES=${SGML_ROOT}/html/catalog:$SGML_CATALOG_FILES +SGML_CATALOG_FILES=${SGML_ROOT}/docbook/4.1/catalog:$SGML_CATALOG_FILES +SGML_CATALOG_FILES=/usr/doc/share/sgml/catalog:$SGML_CATALOG_FILES +SGML_CATALOG_FILES=/usr/doc/en_US.ISO8859-1/share/sgml/catalog:$SGML_CATALOG_FILES +export SGML_CATALOG_FILES + + + + <filename>.cshrc</filename>, for &man.csh.1; and + &man.tcsh.1; users + + setenv SGML_ROOT /usr/local/share/sgml +setenv SGML_CATALOG_FILES ${SGML_ROOT}/jade/catalog +setenv SGML_CATALOG_FILES ${SGML_ROOT}/iso8879/catalog:$SGML_CATALOG_FILES +setenv SGML_CATALOG_FILES ${SGML_ROOT}/html/catalog:$SGML_CATALOG_FILES +setenv SGML_CATALOG_FILES ${SGML_ROOT}/docbook/4.1/catalog:$SGML_CATALOG_FILES +setenv SGML_CATALOG_FILES /usr/doc/share/sgml/catalog:$SGML_CATALOG_FILES +setenv SGML_CATALOG_FILES /usr/doc/en_US.ISO8859-1/share/sgml/catalog:$SGML_CATALOG_FILES + + + Then either log out, and log back in again, or run those + commands from the command line to set the variable values. + + + + + + Create example.sgml, and enter the + following text: + + + + + + An example HTML file + + + +

This is a paragraph containing some text.

+ +

This paragraph contains some more text.

+ +

This paragraph might be right-justified.

+ +]]>
+
+ + + Try to validate this file using an SGML parser. + + Part of textproc/docproj is the + nsgmls validating + parser. Normally, nsgmls reads in a document + marked up according to an SGML DTD and returns a copy of the + document's Element Structure Information Set (ESIS, but that is + not important right now). + + However, when nsgmls is given the + parameter, nsgmls will suppress its normal output, and + just print error messages. This makes it a useful way to check to + see if your document is valid or not. + + Use nsgmls to check that your document is + valid: + + &prompt.user; nsgmls -s example.sgml + + As you will see, nsgmls returns without displaying any + output. This means that your document validated + successfully. + + + + See what happens when required elements are omitted. Try + removing the title and + /title tags, and re-run the validation. + + &prompt.user; nsgmls -s example.sgml +nsgmls:example.sgml:5:4:E: character data is not allowed here +nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished + + The error output from nsgmls is organized into + colon-separated groups, or columns. + + + + + + Column + Meaning + + + + + + 1 + The name of the program generating the error. This + will always be nsgmls. + + + + 2 + The name of the file that contains the error. + + + + 3 + Line number where the error appears. + + + + 4 + Column number where the error appears. + + + + 5 + A one letter code indicating the nature of the + message. I indicates an informational + message, W is for warnings, and + E is for errors + It is not always the fifth column either. + nsgmls -sv displays + nsgmls:I: SP version "1.3" + (depending on the installed version). As you can see, + this is an informational message. + , and X is for + cross-references. As you can see, these messages are + errors. + + + + 6 + The text of the error message. + + + + + + Simply omitting the title tags has + generated 2 different errors. + + The first error indicates that content (in this case, + characters, rather than the start tag for an element) has occurred + where the SGML parser was expecting something else. In this case, + the parser was expecting to see one of the start tags for elements + that are valid inside head (such as + title). + + The second error is because head elements + must contain a title + element. Because it does not nsgmls considers that the + element has not been properly finished. However, the closing tag + indicates that the element has been closed before it has been + finished. + + + + Put the title element back in. + +
+
+
+ + + The DOCTYPE declaration + + The beginning of each document that you write must specify the name + of the DTD that the document conforms to. This is so that SGML parsers + can determine the DTD and ensure that the document does conform to + it. + + This information is generally expressed on one line, in the DOCTYPE + declaration. + + A typical declaration for a document written to conform with version + 4.0 of the HTML DTD looks like this: + + ]]> + + That line contains a number of different components. + + + + <! + + + Is the indicator that indicates that this + is an SGML declaration. This line is declaring the document type. + + + + + + DOCTYPE + + + Shows that this is an SGML declaration for the document + type. + + + + + html + + + Names the first element that + will appear in the document. + + + + + PUBLIC "-//W3C//DTD HTML 4.0//EN" + + + Lists the Formal Public Identifier (FPI) + Formal Public Identifier + + for the DTD that this + document conforms to. Your SGML parser will use this to find the + correct DTD when processing this document. + + PUBLIC is not a part of the FPI, but + indicates to the SGML processor how to find the DTD referenced in + the FPI. Other ways of telling the SGML parser how to find the + DTD are shown later. + + + + + > + + + Returns to the document. + + + + + + Formal Public Identifiers (FPIs)<indexterm significance="preferred"> + <primary>Formal Public Identifier</primary> + </indexterm> + + + + You do not need to know this, but it is useful background, and + might help you debug problems when your SGML processor can not locate + the DTD you are using. + + + FPIs must follow a specific syntax. This syntax is as + follows: + + "Owner//Keyword Description//Language" + + + + Owner + + + This indicates the owner of the FPI. + + If this string starts with ISO then this is an + ISO owned FPI. For example, the FPI "ISO + 8879:1986//ENTITIES Greek Symbols//EN" lists + ISO 8879:1986 as being the owner for the set + of entities for Greek symbols. ISO 8879:1986 is the ISO number + for the SGML standard. + + Otherwise, this string will either look like + -//Owner or + +//Owner (notice + the only difference is the leading + or + -). + + If the string starts with - then the + owner information is unregistered, with a + + it identifies it as being registered. + + ISO 9070:1991 defines how registered names are generated; it + might be derived from the number of an ISO publication, an ISBN + code, or an organization code assigned according to ISO 6523. + In addition, a registration authority could be created in order + to assign registered names. The ISO council delegated this to + the American National Standards Institute (ANSI). + + Because the FreeBSD Project has not been registered the + owner string is -//FreeBSD. And as you can + see, the W3C are not a registered owner either. + + + + + Keyword + + + There are several keywords that indicate the type of + information in the file. Some of the most common keywords are + DTD, ELEMENT, + ENTITIES, and TEXT. + DTD is used only for DTD files, + ELEMENT is usually used for DTD fragments + that contain only entity or element declarations. + TEXT is used for SGML content (text and + tags). + + + + + Description + + + Any description you want to supply for the contents of this + file. This may include version numbers or any short text that + is meaningful to you and unique for the SGML system. + + + + + Language + + + This is an ISO two-character code that identifies the native + language for the file. EN is used for + English. + + + + + + <filename>catalog</filename> files + + If you use the syntax above and process this document + using an SGML processor, the processor will need to have some way of + turning the FPI into the name of the file on your computer that + contains the DTD. + + In order to do this it can use a catalog file. A catalog file + (typically called catalog) contains lines that + map FPIs to filenames. For example, if the catalog file contained + the line: + + PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd" + + The SGML processor would know to look up the DTD from + strict.dtd in the 4.0 + subdirectory of whichever directory held the + catalog file that contained that line. + + Look at the contents of + /usr/local/share/sgml/html/catalog. This is + the catalog file for the HTML DTDs that will have been installed as + part of the textproc/docproj port. + + + + <envar>SGML_CATALOG_FILES</envar> + + In order to locate a catalog file, your + SGML processor will need to know where to look. Many of them + feature command line parameters for specifying the path to one or + more catalogs. + + In addition, you can set SGML_CATALOG_FILES to + point to the files. This environment variable should consist of a + colon-separated list of catalog files (including their full + path). + + Typically, you will want to include the following files: + + + + /usr/local/share/sgml/docbook/4.1/catalog + + + + /usr/local/share/sgml/html/catalog + + + + /usr/local/share/sgml/iso8879/catalog + + + + /usr/local/share/sgml/jade/catalog + + + + You should already have done + this. + + + + + Alternatives to FPIs + + Instead of using an FPI to indicate the DTD that the document + conforms to (and therefore, which file on the system contains the DTD) + you can explicitly specify the name of the file. + + The syntax for this is slightly different: + + ]]> + + The SYSTEM keyword indicates that the SGML + processor should locate the DTD in a system specific fashion. This + typically (but not always) means the DTD will be provided as a + filename. + + Using FPIs is preferred for reasons of portability. You do not + want to have to ship a copy of the DTD around with your document, and + if you used the SYSTEM identifier then everyone + would need to keep their DTDs in the same place. + + + + + Escaping back to SGML + + Earlier in this primer I said that SGML is only used when writing a + DTD. This is not strictly true. There is certain SGML syntax that you + will want to be able to use within your documents. For example, + comments can be included in your document, and will be ignored by the + parser. Comments are entered using SGML syntax. Other uses for SGML + syntax in your document will be shown later too. + + Obviously, you need some way of indicating to the SGML processor + that the following content is not elements within the document, but is + SGML that the parser should act upon. + + These sections are marked by <! ... > in + your document. Everything between these delimiters is SGML syntax as + you might find within a DTD. + + As you may just have realized, the DOCTYPE declaration + is an example of SGML syntax that you need to include in your + document… + + + + Comments + + Comments are an SGML construction, and are normally only valid + inside a DTD. However, as + shows, it is possible to use SGML syntax within your document. + + The delimiter for SGML comments is the string + --. The first occurrence of this string + opens a comment, and the second closes it. + + + SGML generic comment + + <!-- test comment --> + + + + + + + +]]> + + + + Use 2 dashes + + There is a problem with producing the Postscript and PDF versions + of this document. The above example probably shows just one hyphen + symbol, - after the <! and + before the >. + + You must use two -, + not one. The Postscript and PDF versions have + translated the two - in the original to a longer, + more professional em-dash, and broken this + example in the process. + + The HTML, plain text, and RTF versions of this document are not + affected. + + ]]> + + If you have used HTML before you may have been shown different rules + for comments. In particular, you may think that the string + <!-- opens a comment, and it is only closed by + -->. + + This is not the case. A lot of web browsers + have broken HTML parsers, and will accept that as valid. However, the + SGML parsers used by the Documentation Project are much stricter, and + will reject documents that make that error. + + + Erroneous SGML comments + + ]]> + + The SGML parser will treat this as though it were actually: + + <!THIS IS OUTSIDE THE COMMENT> + + This is not valid SGML, and may give confusing error + messages. + + ]]> + + As the example suggests, do not write + comments like that. + + ]]> + + That is a (slightly) better approach, but it still potentially + confusing to people new to SGML. + + + + For you to do… + + + + Add some comments to example.sgml, and + check that the file still validates using nsgmls. + + + + Add some invalid comments to + example.sgml, and see the error messages that + nsgmls gives when it encounters an invalid comment. + + + + + + + Entities + + Entities are a mechanism for assigning names to chunks of content. + As an SGML parser processes your document, any entities it finds are + replaced by the content of the entity. + + This is a good way to have re-usable, easily changeable chunks of + content in your SGML documents. It is also the only way to include one + marked up file inside another using SGML. + + There are two types of entities which can be used in two different + situations; general entities and + parameter entities. + + + General Entities + + You cannot use general entities in an SGML context (although you + define them in one). They can only be used in your document. + Contrast this with parameter + entities. + + Each general entity has a name. When you want to reference a + general entity (and therefore include whatever text it represents in + your document), you write + &entity-name;. For + example, suppose you had an entity called + current.version which expanded to the current + version number of your product. You could write: + + The current version of our product is + ¤t.version;.]]> + + When the version number changes you can simply change the + definition of the value of the general entity and reprocess your + document. + + You can also use general entities to enter characters that you + could not otherwise include in an SGML document. For example, + < and & cannot + normally appear in an SGML document. When the SGML + parser sees the < + symbol it assumes that a tag (either a start tag + or an end tag) is about to appear, and when it sees the + & symbol + it assumes the next text will be the name of an entity. + + Fortunately, you can use the two general entities + &lt; and &amp; + whenever you need to include one or other of these. + + A general entity can only be defined within an SGML context. + Typically, this is done immediately after the DOCTYPE + declaration. + + + Defining general entities + + + +]>]]> + + Notice how the DOCTYPE declaration has been extended by adding a + square bracket at the end of the first line. The two entities are + then defined over the next two lines, before the square bracket is + closed, and then the DOCTYPE declaration is closed. + + The square brackets are necessary to indicate that we are + extending the DTD indicated by the DOCTYPE declaration. + + + + + Parameter entities + + Like general + entities, parameter entities are used to assign names to + reusable chunks of text. However, where as general entities can only + be used within your document, parameter entities can only be used + within an SGML + context. + + Parameter entities are defined in a similar way to general + entities. However, instead of using + &entity-name; to + refer to them, use + %entity-name; + Parameter entities use the + Percent symbol. + . The definition also includes the % + between the ENTITY keyword and the name of the + entity. + + + Defining parameter entities + + + + + + +]>]]> + + + This may not seem particularly useful. It will be. + + + + For you to do… + + + + Add a general entity to + example.sgml. + + +]> + + + + An example HTML file + + + + + +

This is a paragraph containing some text.

+ +

This paragraph contains some more text.

+ +

This paragraph might be right-justified.

+ +

The current version of this document is: &version;

+ +]]>
+
+ + + Validate the document using nsgmls. + + + + Load example.sgml into your web browser + (you may need to copy it to example.html + before your browser recognizes it as an HTML document). + + Unless your browser is very advanced, you will not see the entity + reference &version; replaced with the + version number. Most web browsers have very simplistic parsers + which do not handle proper SGML + This is a shame. Imagine all the problems and hacks (such + as Server Side Includes) that could be avoided if they + did. + . + + + + The solution is to normalize your + document using an SGML normalizer. The normalizer reads in valid + SGML and outputs equally valid SGML which has been transformed in + some way. One of the ways in which the normalizer transforms the + SGML is to expand all the entity references in the document, + replacing the entities with the text that they represent. + + You can use sgmlnorm to do this. + + &prompt.user; sgmlnorm example.sgml > example.html + + You should find a normalized (i.e., entity references + expanded) copy of your document in + example.html, ready to load into your web + browser. + + + + If you look at the output from sgmlnorm + you will see that it does not include a DOCTYPE declaration at + the start. To include this you need to use the + option: + + &prompt.user; sgmlnorm -d example.sgml > example.html + +
+
+
+ + + Using entities to include files + + Entities (both general and parameter) are + particularly useful when used to include one file inside another. + + + Using general entities to include files + + Suppose you have some content for an SGML book organized into + files, one file per chapter, called + chapter1.sgml, + chapter2.sgml, and so forth, with a + book.sgml file that will contain these + chapters. + + In order to use the contents of these files as the values for your + entities, you declare them with the SYSTEM keyword. + This directs the SGML parser to use the contents of the named file as + the value of the entity. + + + Using general entities to include files + + + + + +]> + + + + + &chapter.1; + &chapter.2; + &chapter.3; +]]> + + + + When using general entities to include other files within a + document, the files being included + (chapter1.sgml, + chapter2.sgml, and so on) must + not start with a DOCTYPE declaration. This is a syntax + error. + + + + + Using parameter entities to include files + + Recall that parameter entities can only be used inside an SGML + context. Why then would you want to include a file within an SGML + context? + + You can use this to ensure that you can reuse your general + entities. + + Suppose that you had many chapters in your document, and you + reused these chapters in two different books, each book organizing the + chapters in a different fashion. + + You could list the entities at the top of each book, but this + quickly becomes cumbersome to manage. + + Instead, place the general entity definitions inside one file, + and use a parameter entity to include that file within your + document. + + + Using parameter entities to include files + + First, place your entity definitions in a separate file, called + chapters.ent. This file contains the + following: + + + +]]> + + Now create a parameter entity to refer to the contents of the + file. Then use the parameter entity to load the file into the + document, which will then make all the general entities available + for use. Then use the general entities as before: + + + + + +%chapters; +]> + + + &chapter.1; + &chapter.2; + &chapter.3; +]]> + + + + + For you to do… + + + Use general entities to include files + + + + Create three files, para1.sgml, + para2.sgml, and + para3.sgml. + + Put content similar to the following in each file: + + This is the first paragraph.

]]>
+
+ + + Edit example.sgml so that it looks like + this: + + + + + +]> + + + + An example HTML file + + + +

The current version of this document is: &version;

+ + ¶1; + ¶2; + ¶3; + +]]>
+
+ + + Produce example.html by normalizing + example.sgml. + + &prompt.user; sgmlnorm -d example.sgml > example.html + + + + Load example.html into your web + browser, and confirm that the + paran.sgml files + have been included in example.html. + +
+
+ + + Use parameter entities to include files + + + You must have taken the previous steps first. + + + + + Edit example.sgml so that it looks like + this: + + %entities; +]> + + + + An example HTML file + + + +

The current version of this document is: &version;

+ + ¶1; + ¶2; + ¶3; + +]]>
+
+ + + Create a new file, entities.sgml, with + this content: + + + + +]]> + + + + Produce example.html by normalizing + example.sgml. + + &prompt.user; sgmlnorm -d example.sgml > example.html + + + + Load example.html into your web + browser, and confirm that the + paran.sgml files + have been included in example.html. + +
+
+
+
+ + + Marked sections + + SGML provides a mechanism to indicate that particular pieces of the + document should be processed in a special way. These are termed + marked sections. + + + Structure of a marked section + + <![ KEYWORD [ + Contents of marked section +]]> + + + As you would expect, being an SGML construct, a marked section + starts with <!. + + The first square bracket begins to delimit the marked + section. + + KEYWORD describes how this marked + section should be processed by the parser. + + The second square bracket indicates that the content of the marked + section starts here. + + The marked section is finished by closing the two square brackets, + and then returning to the document context from the SGML context with + >. + + + Marked section keywords + + + <literal>CDATA</literal>, <literal>RCDATA</literal> + + These keywords denote the marked sections content + model, and allow you to change it from the + default. + + When an SGML parser is processing a document it keeps track + of what is called the content model. + + Briefly, the content model describes what sort of content the + parser is expecting to see, and what it will do with it when it + finds it. + + The two content models you will probably find most useful are + CDATA and RCDATA. + + CDATA is for Character Data. + If the parser is in this content model then it is expecting to see + characters, and characters only. In this model the + < and & + symbols lose their special status, and will be treated as ordinary + characters. + + RCDATA is for Entity references and + character data If the parser is in this content model then it + is expecting to see characters and entities. + < loses its special status, but + & will still be treated as + starting the beginning of a general entity. + + This is particularly useful if you are including some verbatim + text that contains lots of < and + & characters. While you + could go through the text ensuring that every + < is converted to a + &lt; and every & + is converted to a &amp;, it can be + easier to mark the section as only containing CDATA. When the SGML + parser encounters this it will ignore the + < and & symbols + embedded in the content. + + + When you use CDATA or + RCDATA in examples of text marked up in SGML, + keep in mind that the content of CDATA is not + validated. You have to check the included SGML text using other + means. You could, for example, write the example in another + document, validate the example code, and then paste it to your + CDATA content. + + + + + Using a CDATA marked section + + <para>Here is an example of how you would include some text + that contained many <literal>&lt;</literal> + and <literal>&amp;</literal> symbols. The sample + text is a fragment of HTML. The surrounding text (<para> and + <programlisting>) are from DocBook.</para> + +<programlisting> + <![ CDATA [ This is a sample that shows you some of the elements within + HTML. Since the angle brackets are used so many times, it is + simpler to say the whole example is a CDATA marked section + than to use the entity names for the left and right angle + brackets throughout.

+ +
    +
  • This is a listitem
  • +
  • This is a second listitem
  • +
  • This is a third listitem
  • +
+ +

This is the end of the example.

]]> + ]]> +</programlisting>
+ + If you look at the source for this document you will see this + technique used throughout. +
+
+ + + <literal>INCLUDE</literal> and + <literal>IGNORE</literal> + + If the keyword is INCLUDE then the contents + of the marked section will be processed. If the keyword is + IGNORE then the marked section is ignored and + will not be processed. It will not appear in the output. + + + Using <literal>INCLUDE</literal> and + <literal>IGNORE</literal> in marked sections + + <![ INCLUDE [ + This text will be processed and included. +]]> + +<![ IGNORE [ + This text will not be processed or included. +]]> + + + By itself, this is not too useful. If you wanted to remove text + from your document you could cut it out, or wrap it in + comments. + + It becomes more useful when you realize you can use parameter entities + to control this. Remember that parameter entities can only be used + in SGML contexts, and the keyword of a marked section + is an SGML context. + + For example, suppose that you produced a hard-copy version of + some documentation and an electronic version. In the electronic + version you wanted to include some extra content that was not to + appear in the hard-copy. + + Create a parameter entity, and set its value to + INCLUDE. Write your document, using marked + sections to delimit content that should only appear in the + electronic version. In these marked sections use the parameter + entity in place of the keyword. + + When you want to produce the hard-copy version of the document, + change the parameter entity's value to IGNORE and + reprocess the document. + + + Using a parameter entity to control a marked + section + + <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ +<!ENTITY % electronic.copy "INCLUDE"> +]]> + +... + +<![ %electronic.copy [ + This content should only appear in the electronic + version of the document. +]]> + + When producing the hard-copy version, change the entity's + definition to: + + <!ENTITY % electronic.copy "IGNORE"> + + On reprocessing the document, the marked sections that use + %electronic.copy as their keyword will be + ignored. + + +
+ + + For you to do… + + + + Create a new file, section.sgml, that + contains the following: + + <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ +<!ENTITY % text.output "INCLUDE"> +]> + +<html> + <head> + <title>An example using marked sections</title> + </head> + + <body> + <p>This paragraph <![ CDATA [contains many < + characters (< < < < <) so it is easier + to wrap it in a CDATA marked section ]]></p> + + <![ IGNORE [ + <p>This paragraph will definitely not be included in the + output.</p> + ]]> + + <![ [ + <p>This paragraph might appear in the output, or it + might not.</p> + + <p>Its appearance is controlled by the + parameter entity.</p> + ]]> + </body> +</html> + + + + Normalize this file using &man.sgmlnorm.1; and examine the + output. Notice which paragraphs have appeared, which have + disappeared, and what has happened to the content of the CDATA + marked section. + + + + Change the definition of the text.output + entity from INCLUDE to + IGNORE. Re-normalize the file, and examine the + output to see what has changed. + + + +
+ + + Conclusion + + That is the conclusion of this SGML primer. For reasons of space + and complexity several things have not been covered in depth (or at + all). However, the previous sections cover enough SGML for you to be + able to follow the organization of the FDP documentation. + +
+ + diff --git a/zh_TW.Big5/books/fdp-primer/structure/chapter.sgml b/zh_TW.Big5/books/fdp-primer/structure/chapter.sgml new file mode 100644 index 0000000000..6c0953a65c --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/structure/chapter.sgml @@ -0,0 +1,294 @@ + + + + Structuring documents under <filename>doc/</filename> + + The doc/ tree is organized in a particular + fashion, and the documents that are part of the FDP are in turn organized + in a particular fashion. The aim is to make it simple to add new + documentation into the tree and: + + + + make it easy to automate converting the document to other formats; + + + + promote consistency between the different documentation + organizations, to make it easier to switch between working on + different documents; + + + + make it easy to decide where in the tree new documentation should + be placed. + + + + In addition, the documentation tree has to accommodate documentation + that could be in many different languages and in many different + encodings. It is important that the structure of the documentation tree + does not enforce any particular defaults or cultural preferences. + + + The top level, <filename>doc/</filename> + + There are two types of directory under doc/, + each with very specific directory names and meanings. + + + Directory + + Meaning + + + share/ + + Contains files that are not specific to the various translations + and encodings of the documentation. Contains subdirectories to + further categorize the information. For example, the files that + comprise the &man.make.1; infrastructure are in + share/mk, while the additional SGML support + files (such as the FreeBSD extended DocBook DTD) are in + share/sgml. + + + + lang.encoding/ + + One directory exists for each available translation and encoding + of the documentation, for example + en_US.ISO8859-1/ and + zh_TW.Big5/. The names are long, but by fully + specifying the language and encoding we prevent any future headaches + should a translation team want to provide the documentation in the + same language but in more than one encoding. This also completely + isolates us from any problems that might be caused by a switch to + Unicode. + + + + + + The + <filename><replaceable>lang</replaceable>.<replaceable>encoding</replaceable>/</filename> directories + + These directories contain the documents themselves. The + documentation is split into up to three more categories at this + level, indicated by the different directory names. + + + Directory + + Contents + + + articles + + Documentation marked up as a DocBook article + (or equivalent). Reasonably short, and broken up into sections. + Normally only available as one HTML file. + + + + books + + Documentation marked up as a DocBook book (or + equivalent). Book length, and broken up into chapters. Normally + available as both one large HTML file (for people with fast + connections, or who want to print it easily from a browser) and + as a collection of linked, smaller files. + + + + man + + For translations of the system manual pages. This directory will + contain one or more + mann directories, + corresponding to the sections that have been translated. + + + + Not every + lang.encoding directory will contain all of these directories. It depends + on how much translation has been accomplished by that translation + team. + + + + Document specific information + + This section contains specific notes about particular documents + managed by the FDP. + + + The Handbook + + books/handbook/ + + The Handbook is written to comply with the FreeBSD DocBook + extended DTD. + + The Handbook is organized as a DocBook book. + It is then divided into parts, each of which may + contain several chapters. + chapters are further subdivided into sections + (sect1) and subsections (sect2, + sect3) and so on. + + + Physical organization + + There are a number of files and directories within the + handbook directory. + + + The Handbook's organization may change over time, and this + document may lag in detailing the organizational changes. If you + have any questions about how the Handbook is organized, please + contact the &a.doc;. + + + + <filename>Makefile</filename> + + The Makefile defines some variables that + affect how the SGML source is converted to other formats, and + lists the various source files that make up the Handbook. It then + includes the standard doc.project.mk file, to + bring in the rest of the code that handles converting documents + from one format to another. + + + + <filename>book.sgml</filename> + + This is the top level document in the Handbook. It contains + the Handbook's DOCTYPE + declaration, as well as the elements that describe the + Handbook's structure. + + book.sgml uses parameter + entities to load in the files with the + .ent extension. These files (described later) + then define general + entities that are used throughout the rest of the + Handbook. + + + + <filename><replaceable>directory</replaceable>/chapter.sgml</filename> + + Each chapter in the Handbook is stored in a file called + chapter.sgml in a separate directory from the + other chapters. Each directory is named after the value of the + id attribute on the chapter + element. + + For example, if one of the chapter files contains: + + +... +]]> + + then it will be called chapter.sgml in + the kernelconfiguration directory. In + general, the entire contents of the chapter will be held in this + file. + + When the HTML version of the Handbook is produced, this will + yield kernelconfiguration.html. This is + because of the id value, and is not related to + the name of the directory. + + In earlier versions of the Handbook the files were stored in + the same directory as book.sgml, and named + after the value of the id attribute on the + file's chapter element. Moving them into + separate directories prepares for future plans for the Handbook. + Specifically, it will soon be possible to include images in each + chapter. It makes more sense for each image to be stored in a + directory with the text for the chapter than to try to keep the + text for all the chapters, and all the images, in one large + directory. Namespace collisions would be inevitable, and it is + easier to work with several directories with a few files in them + than it is to work with one directory that has many files in + it. + + A brief look will show that there are many directories with + individual chapter.sgml files, including + basics/chapter.sgml, + introduction/chapter.sgml, and + printing/chapter.sgml. + + + Chapters and/or directories should not be named in a fashion + that reflects their ordering within the Handbook. This ordering + might change as the content within the Handbook is reorganized; + this sort of reorganization should not (generally) include the + need to rename files (unless entire chapters are being promoted + or demoted within the hierarchy). + + + Each chapter.sgml file will not be a + complete SGML document. In particular, they will not have their + own DOCTYPE lines at the start of the files. + + This is unfortunate as + it makes it impossible to treat these as generic SGML + files and simply convert them to HTML, RTF, PS, and other + formats in the same way the main Handbook is generated. This + would force you to rebuild the Handbook + every time you want to see the effect a change has had on just + one chapter. + + + + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/stylesheets/chapter.sgml b/zh_TW.Big5/books/fdp-primer/stylesheets/chapter.sgml new file mode 100644 index 0000000000..3b7626e5df --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/stylesheets/chapter.sgml @@ -0,0 +1,102 @@ + + + + * Stylesheets + + SGML says nothing about how a document should be displayed to the + user, or rendered on paper. To do that, various languages have been + developed to describe stylesheets, including DynaText, Panorama, SPICE, + JSSS, FOSI, CSS, and DSSSL. + + For DocBook, we are using stylesheets written in DSSSL. For HTML we + are using CSS. + + + * DSSSL + + The Documentation Project uses a slightly customized version of + Norm Walsh's modular DocBook stylesheets. + + These can be found in + textproc/dsssl-docbook-modular. + + The modified stylesheets are not in the ports system. Instead they + are part of the Documentation Project source repository, and can be + found in doc/share/sgml/freebsd.dsl. It is well + commented, and pending completion of this section you are encouraged to + examine that file to see how some of the available options in the + standard stylesheets have been configured in order to customize the + output for the FreeBSD Documentation Project. That file also contains + examples showing how to extend the elements that the stylesheet + understands, which is how the FreeBSD specific elements have been + formatted. + + + + CSS + + Cascading Stylesheets (CSS) are a mechanism for attaching style + information (font, weight, size, color, and so forth) to elements in an + HTML document without abusing HTML to do so. + + + The Web site (HTML documents) + + The FreeBSD web site does not currently use CSS. Unfortunately, + the look and feel is constructed using abuses of HTML of varying + degrees. This should be fixed, and would be a good project for + someone looking to contribute to the documentation project. + + + + The DocBook documents + + The FreeBSD DSSSL stylesheets include a reference to a stylesheet, + docbook.css, which is expected to appear in the + same directory as the HTML files. The project-wide CSS file is copied + from doc/share/misc/docbook.css when documents + are converted to HTML, and is installed automatically. + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/the-website/chapter.sgml b/zh_TW.Big5/books/fdp-primer/the-website/chapter.sgml new file mode 100644 index 0000000000..f1f5ab7a7d --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/the-website/chapter.sgml @@ -0,0 +1,207 @@ + + + + The Website + + + Preparation + + Get 200MB free disk space. You will need the disk space for the + SGML tools, a subset of the CVS tree, temporary build space and the + installed web pages. If you already have installed the SGML tools and + the CVS tree, you need only ~100MB free disk space. + + + Make sure your documentation ports are up to date! When in + doubt, remove the old ports using &man.pkg.delete.1; command before + installing the port. For example, we currently depend on + jade-1.2 and if you have installed jade-1.1, please do: + + &prompt.root; pkg_delete jade-1.1 + + + Set up a CVS repository. You need the directories www, doc and + ports in the CVS tree (plus the CVSROOT of course). Please read the + CVSup introduction + on how to mirror a CVS tree or parts of a CVS tree. + + The essential cvsup collections are: www, + doc-all, cvs-base, and + ports-base. + + These collections require ~105MB free disk space. + + A full CVS tree - including src, + doc, www, and + ports - is currently 940MB. + + + + Build the web pages from scratch + + + + Create and change directory into a build directory with at least 60MB of free + space. + + &prompt.root; mkdir /var/tmp/webbuild +&prompt.root; cd /var/tmp/webbuild + + + + Checkout the SGML files from the CVS tree. + + &prompt.root; cvs -R co www doc + + + + Change into the www/en directory, and run + the &man.make.1; all target, to create + the web pages. + + &prompt.root; cd en +&prompt.root; make all + + + + + + Install the web pages into your web server + + + + If you have moved out of the en + directory, change back to it. + + &prompt.root; cd path/www/en + + + + Run the &man.make.1; install target, + setting the DESTDIR variable to the name of the + directory you want to install the files to. + + &prompt.root; make DESTDIR=/usr/local/www install + + + + If you have previously installed the web pages into the same + directory the install process will not have deleted any old or + outdated pages. For example, if you build and install a new copy + of the site every day, this command will find and delete all + files that have not been updated in three days. + + &prompt.root; find /usr/local/www -ctime 3 -print0 | xargs -0 rm + + + + + + Environment variables + + + + CVSROOT + + + Location of the CVS tree. Essential. + + &prompt.root; CVSROOT=/home/ncvs; export CVSROOT + + + + + ENGLISH_ONLY + + + If set and not empty, the makefiles will build and + install only the English documents. All translations will be + ignored. E.g.: + + &prompt.root; make ENGLISH_ONLY=YES all install + + If you want to unset the variable + ENGLISH_ONLY and build all pages, including + translations, set the variable ENGLISH_ONLY + to an empty value: + + &prompt.root; make ENGLISH_ONLY="" all install clean + + + + + WEB_ONLY + + + If set and not empty, the makefiles will build and install + only the HTML pages from the www directory. All documents from + the doc directory (Handbook, FAQ, Tutorials) will be ignored. + E.g.: + + &prompt.root; make WEB_ONLY=YES all install + + + + + NOPORTSCVS + + + If set, the makefiles will not checkout files from the ports + cvs repository. Instead, it will copy the files from + /usr/ports (or where the variable + PORTSBASE points to). + + + + + CVSROOT is an environment variable. You must set it + on the command line or in your dot files (e.g., ~/.profile). + + WEB_ONLY, ENGLISH_ONLY and + NOPORTSCVS are makefile variables. You can set the + variables in /etc/make.conf, + Makefile.inc, as environment variables on the + command line, or in your dot files. + + + + diff --git a/zh_TW.Big5/books/fdp-primer/tools/chapter.sgml b/zh_TW.Big5/books/fdp-primer/tools/chapter.sgml new file mode 100644 index 0000000000..2b1275d1af --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/tools/chapter.sgml @@ -0,0 +1,276 @@ + + + + ¤u¨ã + + FDP ¨Ï¥Î¤@°ï¤u¨ã¨Ó¨ó§UºÞ²z FreeBSD ¤å¥ó¡BÂà´«¤å¥ó®æ¦¡µ¥µ¥¡C + ¦]¦¹¡A­Y­n¶i¦æ FDP ¤u§@ªº¸Ü¡A¥i¯à¥²¶·­n¾Ç·|³o¨Ç¤u¨ã¤~¦æ¡C + + ³o¨Ç¤u¨ã³£¥i¥H¥Î Ports ©Î Packages ¨Ó¦w¸Ë¡A¥H¸`¬Ù³\¦h¦w¸Ëªº¤u¤Ò¡C + + ±z¥²¶·¦w¸Ë³o¨Ç¤u¨ã¡A¤~¯à¨Ï¥Î±µ¤U¨Ó¦U³¹¸`·|¤¶²Ð¨ìªº¨Ò¤l¡C ³o¨Ç¤u¨ãªº¥Îªk¡A·|¦b«áÄò¬ÛÃö³¹¸`½Í¨ì¡C + + + Use <filename role="package">textproc/docproj</filename> if possible + + You can save yourself a lot of time if you install the + textproc/docproj port. This is a + meta-port which does not contain any software + itself. Instead, it depends on various other ports being installed + correctly. Installing this port should + automatically download and install all of the packages listed in this + chapter that you need. + + One of the packages that you might need is the JadeTeX macro set. + In turn, this macro set requires &tex; to be installed. &tex; is a large + package, and you only need it if you want to produce Postscript or PDF + output. + + To save yourself time and space you must specify whether or not you + want JadeTeX (and therefore &tex;) installed when you install this port. + Either do: + + &prompt.root; make JADETEX=yes install + + or + + &prompt.root; make JADETEX=no install + + as necessary. Alternatively you may install textproc/docproj-jadetex or textproc/docproj-nojadetex. These slave ports + define the JADETEX variable for you, therefore they + will install the same suite of applications on your machine. + Note that you can produce only HTML or ASCII + text output if you do not install JadeTeX. + PostScript or PDF output require &tex;. + + + + ¥²³Æ¤u¨ã + + + ³nÅé + + These programs are required before you can usefully work with the + FreeBSD documentation, and they will allow you to convert the + documentation to HTML, plain text, and RTF formats. They are all + included in textproc/docproj. + + + + Jade + (textproc/jade) + + + A DSSSL implementation. Used for converting marked up + documents to other formats, including HTML and &tex;. + + + + + Tidy + (www/tidy) + + + An HTML pretty printer, used to reformat some of the + automatically generated HTML so that it is easier to + follow. + + + + + Links + (www/links) + + + A text-mode WWW browser that can also convert + HTML files to plain text. + + + + + peps + (graphics/peps) + + + Some of the documentation includes images, some of which are + stored as EPS files. These must be converted to PNG before most + web browsers will display them. + + + + + + + DTDs ¤Î Entities + + These are the DTDs and entity sets used by the FDP. They need to + be installed before you can work with any of the documentation. + + + + HTML DTD (textproc/html) + + + HTML is the markup language of choice for the World Wide + Web, and is used throughout the FreeBSD web site. + + + + + DocBook DTD (textproc/docbook) + + + DocBook is designed for marking up technical documentation. + All the FreeBSD documentation is written in DocBook. + + + + + ISO 8879 entities + (textproc/iso8879) + + + 19 of the ISO 8879:1986 character entity sets used by many + DTDs. Includes named mathematical symbols, additional + characters in the Latin character set (accents, diacriticals, + and so on), and Greek symbols. + + + + + + + ¼Ë¦¡ªí(Stylesheets) + + The stylesheets are used when converting and formatting the + documentation for display on screen, printing, and so on. + + + + Modular DocBook Stylesheets + (textproc/dsssl-docbook-modular) + + + The Modular DocBook Stylesheets are used when converting + documentation marked up in DocBook to other formats, such as + HTML or RTF. + + + + + + + + Optional tools + + You do not need to have any of the following installed. However, + you may find it easier to work with the documentation if you do, and + they may give you more flexibility in the output formats that can be + generated. + + + Software + + + + JadeTeX and + teTeX + (print/jadetex and + print/teTeX) + + + Jade and + teTeX are used to convert DocBook + documents to DVI, Postscript, and PDF formats. The + JadeTeX macros are needed in order to + do this. + + If you do not intend to convert your documentation to one of + these formats (i.e., HTML, plain text, and RTF are sufficient) + then you do not need to install + JadeTeX and + teTeX. This can be a significant + space and time saver, as teTeX is + over 30MB in size. + + + If you decide to install + JadeTeX and + teTeX then you will need to + configure teTeX after + JadeTeX has been installed. + print/jadetex/pkg-message contains + detailed instructions explaining what you need to do. + + + + + + Emacs or + XEmacs + (editors/emacs or + editors/xemacs) + + + Both these editors include a special mode for editing + documents marked up according to an SGML DTD. This mode + includes commands to reduce the amount of typing you need, and + help reduce the possibility of errors. + + You do not need to use them; any text editor can be used to + edit marked up documents. You may find they make you more + efficient. + + + + + If anyone has recommendations for other software that is useful + when manipulating SGML documents, please let &a.doceng; know, so they + can be added to this list. + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/translations/chapter.sgml b/zh_TW.Big5/books/fdp-primer/translations/chapter.sgml new file mode 100644 index 0000000000..bc31238a92 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/translations/chapter.sgml @@ -0,0 +1,458 @@ + + + + Translations + + This is the FAQ for people translating the FreeBSD documentation + (FAQ, Handbook, tutorials, manual pages, and others) to different + languages. + + It is very heavily based on the translation FAQ + from the FreeBSD German Documentation Project, originally written by Frank + Gründer elwood@mc5sys.in-berlin.de and translated back to + English by Bernd Warken bwarken@mayn.de. + + The FAQ is maintained by the &a.doceng;. + + + + + Why a FAQ? + + + + More and more people are approaching the freebsd-doc mailing + list and volunteering to translate FreeBSD documentation to other + languages. This FAQ aims to answer their questions so they can start + translating documentation as quickly as possible. + + + + + + What do i18n and l10n + mean? + + + + i18n means + internationalization and l10n + means localization. They are just a convenient + shorthand. + + i18n can be read as i followed by + 18 letters, followed by n. Similarly, + l10n is l followed by 10 letters, + followed by n. + + + + + + Is there a mailing list for translators? + + + + Yes. Different translation groups have their own mailing + lists. The list + of translation projects has more information about the + mailing lists and web sites run by each translation project. + + + + + + Are more translators needed? + + + + Yes. The more people work on translation the faster it gets + done, and the faster changes to the English documentation are + mirrored in the translated documents. + + You do not have to be a professional translator to be able to + help. + + + + + + What languages do I need to know? + + + + Ideally, you will have a good knowledge of written English, and + obviously you will need to be fluent in the language you are + translating to. + + English is not strictly necessary. For example, you could do a + Hungarian translation of the FAQ from the Spanish + translation. + + + + + + What software do I need to know? + + + + It is strongly recommended that you maintain a local copy of the + FreeBSD CVS repository (at least the documentation part) either + using CTM or + CVSup. The "Staying current with FreeBSD" + chapter in the Handbook explains how to use these + applications. + + You should be comfortable using CVS. + This will allow you to see what has changed between different + versions of the files that make up the documentation. + + [XXX To Do -- write a tutorial that shows how to use CVSup to + get just the documentation, check it out, and see what has changed + between two arbitrary revisions] + + + + + + How do I find out who else might be translating to the same + language? + + + + The Documentation + Project translations page lists the translation efforts + that are currently known about. If others are already working + on translating documentation to your language, please do not + duplicate their efforts. Instead, contact them to see how you can + help. + + If no one is listed on that page as translating for your + language, then send a message to the &a.doc; in case someone else + is thinking of doing a translation, but has not announced it yet. + + + + + + + No one else is translating to my language. What do I do? + + + + Congratulations, you have just started the FreeBSD + your-language-here Documentation + Translation Project. Welcome aboard. + + First, decide whether or not you have got the time to spare. Since + you are the only person working on your language at the moment it is + going to be your responsibility to publicize your work and + coordinate any volunteers that might want to help you. + + Write an email to the Documentation Project mailing list, + announcing that you are going to translate the documentation, so the + Documentation Project translations page can be maintained. + + If there is already someone in your country providing FreeBSD + mirroring services you should contact them and ask if you can + have some webspace for your project, and possibly an email + address or mailing list services. + + Then pick a document and start translating. It is best to start + with something fairly small—either the FAQ, or one of the + tutorials. + + + + + + I have translated some documentation, where do I send it? + + + + That depends. If you are already working with a translation team + (such as the Japanese team, or the German team) then they will have + their own procedures for handling submitted documentation, and these + will be outlined on their web pages. + + If you are the only person working on a particular language (or + you are responsible for a translation project and want to submit + your changes back to the FreeBSD project) then you should send your + translation to the FreeBSD project (see the next question). + + + + + + I am the only person working on translating to this language, how + do I submit my translation? + + or + + We are a translation team, and want to submit documentation that + our members have translated for us? + + + + First, make sure your translation is organized properly. This + means that it should drop into the existing documentation tree and + build straight away. + + Currently, the FreeBSD documentation is stored in a top level + directory called doc/. Directories below this + are named according to the language code they are written in, as + defined in ISO639 (/usr/share/misc/iso639 on a + version of FreeBSD newer than 20th January 1999). + + If your language can be encoded in different ways (for example, + Chinese) then there should be directories below this, one for each + encoding format you have provided. + + Finally, you should have directories for each document. + + For example, a hypothetical Swedish translation might look + like: + + doc/ + sv_SE.ISO8859-1/ + Makefile + books/ + faq/ + Makefile + book.sgml + + sv_SE.ISO8859-1 is the name of the + translation, in + lang.encoding + form. Note the + two Makefiles, which will be used to build the documentation. + + Use &man.tar.1; and &man.gzip.1; to compress up your + documentation, and send it to the project. + + &prompt.user; cd doc +&prompt.user; tar cf swedish-docs.tar sv +&prompt.user; gzip -9 swedish-docs.tar + + Put swedish-docs.tar.gz somewhere. If you + do not have access to your own webspace (perhaps your ISP does not + let you have any) then you can email &a.doceng;, and arrange to email + the files when it is convenient. + + Either way, you should use &man.send-pr.1; to submit a report + indicating that you have submitted the documentation. It would be + very helpful if you could get other people to look over your + translation and double check it first, since it is unlikely that the + person committing it will be fluent in the language. + + Someone (probably the Documentation Project Manager, currently + &a.doceng;) will then take your translation and confirm that it builds. + In particular, the following things will be looked at: + + + + Do all your files use RCS strings (such as "ID")? + + + + Does make all in the + sv_SE.ISO8859-1 directory work correctly? + + + + Does make install work correctly? + + + + If there are any problems then whoever is looking at the + submission will get back to you to work them out. + + If there are no problems your translation will be committed + as soon as possible. + + + + + + Can I include language or country specific text in my + translation? + + + + We would prefer that you did not. + + For example, suppose that you are translating the Handbook to + Korean, and want to include a section about retailers in Korea in + your Handbook. + + There is no real reason why that information should not be in the + English (or German, or Spanish, or Japanese, or …) versions + as well. It is feasible that an English speaker in Korea might try + and pick up a copy of FreeBSD whilst over there. It also helps + increase FreeBSD's perceived presence around the globe, which is not + a bad thing. + + If you have country specific information, please submit it as a + change to the English Handbook (using &man.send-pr.1;) and then + translate the change back to your language in the translated + Handbook. + + Thanks. + + + + + + How should language specific characters be included? + + + + Non-ASCII characters in the documentation should be included + using SGML entities. + + Briefly, these look like an ampersand (&), the name of the + entity, and a semi-colon (;). + + The entity names are defined in ISO8879, which is in the ports + tree as textproc/iso8879. + + A few examples include: + + + Entity + + Appearance + + Description + + + &eacute; + é + Small e with an acute accent + + + + &Eacute; + É + Large E with an acute accent + + + + &uuml; + ü + Small u with an umlaut + + + + After you have installed the iso8879 port, the files in + /usr/local/share/sgml/iso8879 contain the + complete list. + + + + + + Addressing the reader + + + + In the English documents, the reader is addressed as + you, there is no formal/informal distinction as there + is in some languages. + + If you are translating to a language which does distinguish, use + whichever form is typically used in other technical documentation in + your language. If in doubt, use a mildly polite form. + + + + + + Do I need to include any additional information in my + translations? + + + + Yes. + + The header of the English version of each document will look + something like this: + + <!-- + The FreeBSD Documentation Project + + $FreeBSD: doc/en_US.ISO8859-1/books/fdp-primer/translations/chapter.sgml,v 1.5 2000/07/07 18:38:38 dannyboy Exp $ +--> + + The exact boilerplate may change, but it will always include a + $FreeBSD$ line and the phrase The FreeBSD Documentation + Project. + Note that the $FreeBSD part is expanded automatically by + CVS, so it should be empty (just + $FreeBSD$) for new files. + + Your translated documents should include their own + $FreeBSD$ line, and change the + FreeBSD Documentation Project line to + The FreeBSD language + Documentation Project. + + In addition, you should add a third line which indicates which + revision of the English text this is based on. + + So, the Spanish version of this file might start: + + <!-- + The FreeBSD Spanish Documentation Project + + $FreeBSD: doc/es_ES.ISO8859-1/books/fdp-primer/translations/chapter.sgml,v 1.3 1999/06/24 19:12:32 jesusr Exp $ + Original revision: 1.11 +--> + + + + + + diff --git a/zh_TW.Big5/books/fdp-primer/writing-style/chapter.sgml b/zh_TW.Big5/books/fdp-primer/writing-style/chapter.sgml new file mode 100644 index 0000000000..af0e4c0572 --- /dev/null +++ b/zh_TW.Big5/books/fdp-primer/writing-style/chapter.sgml @@ -0,0 +1,489 @@ + + + + ¤å¥óªº¼¶¼g­·®æ + + In order to promote consistency between the myriad authors of the + FreeBSD documentation, some guidelines have been drawn up for authors to + follow. + + + + Use American English spelling + + + There are several variants of English, with different spellings + for the same word. Where spellings differ, use the American English + variant. color, not colour, + rationalize, not rationalise, and so + on. + + + The use of British English may be accepted in the case + of a contributed article, however the spelling must be + consistent within the whole document. The other documents + such as books, web site, manual pages, etc. will have to use + American English. + + + + + + Do not use contractions + + + Do not use contractions. Always spell the phrase out in full. + Don't use contractions would be wrong. + + Avoiding contractions makes for a more formal tone, is more + precise, and is slightly easier for translators. + + + + + Use the serial comma + + + In a list of items within a paragraph, separate each item from + the others with a comma. Separate the last item from the others with + a comma and the word and. + + For example, look at the following: + +
+ This is a list of one, two and three items. +
+ + Is this a list of three items, one, + two, and three, or a list of two items, + one and two and three? + + It is better to be explicit and include a serial comma: + +
+ This is a list of one, two, and three items. +
+
+
+ + + Avoid redundant phrases + + + Try not to use redundant phrases. In particular, the + command, the file, and man + command are probably redundant. + + These two examples show this for commands. The second example + is preferred. + + + Use the command cvsup to update your + sources. + + + + Use cvsup to update your sources. + + + These two examples show this for filenames. The second example + is preferred. + + + … in the filename + /etc/rc.local + + + + … in + /etc/rc.local + + + These two examples show this for manual references. The second + example is preferred (the second example uses + citerefentry). + + + See man csh for more + information. + + + + See &man.csh.1;. + + + + + Two spaces at the end of sentences + + + Always use two spaces at the end of sentences, as this + improves readability, and eases use of tools such as + Emacs. + + While it may be argued that a capital letter following + a period denotes a new sentence, this is not the case, especially + in name usage. Jordan K. Hubbard is a good + example; it has a capital H following a + period and a space, and there certainly is not a new sentence + there. + + +
+ + For more information about writing style, see Elements of + Style, by William Strunk. + + + Style guide + + To keep the source for the Handbook consistent when many different + people are editing it, please follow these style conventions. + + + Letter case + + Tags are entered in lower case, <para>, + not <PARA>. + + Text that appears in SGML contexts is generally written in upper + case, <!ENTITY…>, and + <!DOCTYPE…>, not + <!entity…> and + <!doctype…>. + + + + Acronyms + + Acronyms should generally be spelled out the first time + they appear in a book, as in: "Network Time Protocol (NTP)." After the + acronym has been defined, you should generally use the acronym + only (not the whole term, unless it makes more sense + contextually to use the whole term). Usually, acronyms are + defined only one per book. But if you prefer, you can also + define them the first time they appear in each chapter. + + The first three uses of an acronym should be enclosed in + <acronym> tags, with a role attribute + with the full term defined. This allows a link to the + glossary to be created, and for mouseovers to be rendered with + the fully expanded term. + + + + Indentation + + Each file starts with indentation set at column 0, + regardless of the indentation level of the file + which might contain this one. + + Opening tags increase the indentation level by 2 spaces. + Closing tags decrease the indentation level by 2 spaces. Blocks + of 8 spaces at the start of a line should be replaced with a tab. + Do not use + spaces in front of tabs, and do not add extraneous whitespace at the + end of a line. Content + within elements should be indented by two spaces if the content runs + over more than one line. + + For example, the source for this section looks something + like: + + + ... + + + ... + + + Indentation + + Each file starts with indentation set at column 0, + regardless of the indentation level of the file + which might contain this one. + + ... + + +
]]> + + If you use Emacs or + XEmacs to edit the files then + sgml-mode should be loaded automatically, and the + Emacs local variables at the bottom of each file should enforce these + styles. + + Vim users might want to configure + their editor with: + + augroup sgmledit + autocmd FileType sgml set formatoptions=cq2l " Special formatting options + autocmd FileType sgml set textwidth=70 " Wrap lines at 70 columns + autocmd FileType sgml set shiftwidth=2 " Automatically indent + autocmd FileType sgml set softtabstop=2 " Tab key indents 2 spaces + autocmd FileType sgml set tabstop=8 " Replace 8 spaces with a tab + autocmd FileType sgml set autoindent " Automatic indentation +augroup END + + + + + Tag style + + + Tag spacing + + Tags that start at the same indent as a previous tag + should be separated by a blank line, and those that are not + at the same indent as a previous tag should not: + + + + + NIS + + October 1999 + + + ... + ... + ... + + + + + ... + + ... + + + + ... + + ... + +]]> + + + + + Separating tags + + Tags like itemizedlist which will + always have further tags inside them, and in fact do not take + character data themselves, are always on a line by + themselves. + + Tags like para and + term do not need other tags to contain + normal character data, and their contents begin immediately + after the tag, on the same line. + + The same applies to when these two types of tags + close. + + This leads to an obvious problem when mixing these + tags. + + When a starting tag which cannot contain character data + directly follows a tag of the type that requires other tags + within it to use character data, they are on separate lines. + The second tag should be properly indented. + + When a tag which can contain character data closes + directly after a tag which cannot contain character data + closes, they co-exist on the same line. + + + + + White space changes + + When committing changes, do not commit changes to the + content at the same time as changes to the + formatting. + + This is so that the teams that convert the Handbook to other + languages can quickly see what content has actually changed in your + commit, without having to decide whether a line has changed because of + the content, or just because it has been refilled. + + For example, if you have added two sentences to a paragraph, such + that the line lengths on the paragraph now go over 80 columns, first + commit your change with the too-long line lengths. Then fix the line + wrapping, and commit this second change. In the commit message for + the second change, be sure to indicate that this is a whitespace-only + change, and that the translation team can ignore it. + + + + Nonbreaking space + + Avoid line breaks in places where they look ugly + or make it difficult to follow a sentence. Line breaks depend + on the width of the chosen output medium. In particular, viewing + the HTML documentation with a text browser can lead to badly + formatted paragraphs like the next one: + + Data capacity ranges from 40 MB to 15 +GB. Hardware compression … + + The general entity &nbsp; prohibits + line breaks between parts belonging together. Use nonbreaking + spaces in the following places: + + + + between numbers and units: + + + + + between program names and version numbers: + + + + + between multiword names (use with caution when applying this + to more than 3-4 word names like The FreeBSD Brazilian + Portuguese Documentation Project): + + + + + + + + Word list + + The following is a small list of words spelled the way they + should be used in the FreeBSD Documentation Project. If the + word you are looking for is not in this list, then please + consult the O'Reilly + word list. + + + + 2.2.X + + + + 4.X-STABLE + + + + CD-ROM + + + + DoS (Denial of Service) + + + + Ports Collection + + + + IPsec + + + + Internet + + + + MHz + + + + Soft Updates + + + + Unix + + + + disk label + + + + email + + + + file system + + + + manual page + + + + mail server + + + + name server + + + + null-modem + + + + web server + + + + + + + + diff --git a/zh_TW.Big5/books/handbook/book.sgml b/zh_TW.Big5/books/handbook/book.sgml index 8e11e673be..0b65cad6ea 100644 --- a/zh_TW.Big5/books/handbook/book.sgml +++ b/zh_TW.Big5/books/handbook/book.sgml @@ -1,315 +1,316 @@ %books.ent; %chapters; %txtfiles; %pgpkeys; ]> FreeBSD ¨Ï¥Î¤â¥U FreeBSD ¤å¥ó­pµe February 1999 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 + 2006 FreeBSD ¤å¥ó­pµe &bookinfo.legalnotice; &tm-attrib.freebsd; &tm-attrib.3com; &tm-attrib.3ware; &tm-attrib.arm; &tm-attrib.adaptec; &tm-attrib.adobe; &tm-attrib.apple; &tm-attrib.corel; &tm-attrib.creative; &tm-attrib.cvsup; &tm-attrib.heidelberger; &tm-attrib.ibm; &tm-attrib.ieee; &tm-attrib.intel; &tm-attrib.intuit; &tm-attrib.linux; &tm-attrib.lsilogic; &tm-attrib.m-systems; &tm-attrib.macromedia; &tm-attrib.microsoft; &tm-attrib.netscape; &tm-attrib.nexthop; &tm-attrib.opengroup; &tm-attrib.oracle; &tm-attrib.powerquest; &tm-attrib.realnetworks; &tm-attrib.redhat; &tm-attrib.sap; &tm-attrib.sun; &tm-attrib.symantec; &tm-attrib.themathworks; &tm-attrib.thomson; &tm-attrib.usrobotics; &tm-attrib.vmware; &tm-attrib.waterloomaple; &tm-attrib.wolframresearch; &tm-attrib.xfree86; &tm-attrib.xiph; &tm-attrib.general; Åwªï¨Ï¥ÎFreeBSD¡I ¥»¨Ï¥Î¤â¥U²[»\½d³ò¥]¬A¤F FreeBSD &rel2.current;-RELEASE ©M FreeBSD &rel.current;-RELEASE ªº¦w¸Ë©M¤é±`¨Ï¥Î¡C ³o¥÷¨Ï¥Î¤â¥U¬O«Ü¦h¤Hªº¶°Åé³Ð§@¡A¦Ó¥B¤´µM¡y«ùÄò¤£Â_¡zªº¶i¦æ¤¤¡C ³\¦h³¹¸`¤´¥¼§¹¦¨¡A¤w§¹¦¨ªº³¡¥÷¤]¦³¨Ç»Ý­n§ó·s¡C ¦pªG±z¹ï¨ó§U¥»­pµeªº¶i¦æ¦³¿³½ìªº¸Ü¡A½Ð±H e-mail ¨ì &a.doc;¡C ¦b FreeBSD ºô¯¸ ¥i¥H§ä¨ì³o¥÷¤å¥óªº³Ì·sª©¥»(ª©¤å¥ó¥i±q ¨ú±o)¡A¤]¥i¥H±q FreeBSD FTP ¦øªA¾¹ ©Î¬O²³¦h mirror ¯¸»O ¤U¸ü¤£¦P®æ¦¡¤Î¤£¦PÀ£ÁY¿ï¶µªº¸ê®Æ¡C ¦pªG¤ñ¸û°¾¦n¾Ö¦³¹êÅé®Ñ­±¸ê®Æ¡A¨º¥i¥H¦b FreeBSD Mall ÁʶR¡C ¦¹¥~¡A¤]¥i¥H¦b ¨Ï¥Î¤â¥U ¤¤·j´M¸ê®Æ¡C &chap.preface; ¶}©l¨Ï¥Î FreeBSD ³o³¡¥÷¬O´£¨Ñµ¹ªì¦¸¨Ï¥Î FreeBSD ªº¨Ï¥ÎªÌ©M¨t²ÎºÞ²zªÌ¡C ³o¨Ç³¹¸`¥]¬A¡G ¤¶²Ð FreeBSD µ¹±z¡C ¦b¦w¸Ë¹Lµ{µ¹±z«ü¤Þ¡C ±Ð±z &unix; ªº°ò¦¤Î­ì²z¡C ®i¥Üµ¹±z¬Ý¦p¦ó¦w¸ËÂ×´Iªº FreeBSD ªºÀ³¥Î³nÅé ¦V±z¤¶²Ð X¡A &unix; ªºµøµ¡¨t²Î¥H¤Î¸Ô²Óªº®à­±Àô¹Ò³]©w¡AÅý±z§ó¦³¥Í²£¤O¡C §Ú­Ì¸ÕµÛ¾¨¥i¯àªºÅý³o¬q¤å¦rªº°Ñ¦Ò³sµ²¼Æ¥Ø­°¨ì³Ì§C¡AÅý±z¦bŪ¨Ï¥Î¤â¥Uªº³o³¡¥÷®É¥i¥H¤£¤Ó»Ý­n±`±`«e«á½­¶¡C ¤@¯ë©Ê¤u§@ ¬JµM°ò¦ªº³¡¤À¤w¸g´£¹L¤F¡A±µ¤U¨Óªº³o­Ó³¡¤À±N·|°Q½×¤@¨Ç±`·|¥Î¨ìªº FreeBSD ªº¯S¦â¡A³o¨Ç³¹¸`¥]¬A¡G ¤¶²Ðµ¹±z±`¨£¥B¹ê¥Îªº®à­±À³¥Î³nÅé¡Gºô­¶ÂsÄý¾¹¡B¥Í²£¤O¤u¨ã¡B¤å¥óÀ˵øµ{¦¡µ¥¡C ¤¶²Ðµ¹±z²³¦h FreeBSD ¤W¥i¥Îªº¦h´CÅé¤u¨ã¡C ¸ÑÄÀ¦p¦ó½sĶ¦Û­q FreeBSD ®Ö¤ß¥H¼W¥[ÃB¥~¨t²Î¥\¯àªº¬yµ{¡C ¸Ô²Ó´y­z¦C¦L¨t²Î¡A¥]§t®à¤W«¬¦Lªí¾÷¤Îºô¸ô¦Lªí¾÷ªº³]©w¡C ®i¥Üµ¹±z¬Ý¦p¦ó¦b±zªº FreeBSD ¨t²Î¤¤°õ¦æ Linux À³¥Î³nÅé¡C ³o¨Ç³¹¸`¤¤¦³¨Ç»Ý­n±z¹w¥ý¾\Ū¨Ç¬ÛÃö¤å¥ó¡A¦b¦U³¹¸`¶}ÀYªº·§­n¤º·|´£¤Î¡C ¨t²ÎºÞ²z FreeBSD ¨Ï¥Î¤â¥U³Ñ¤Uªº³o¨Ç³¹¸`²[»\¤F¥þ¤è¦ìªº FreeBSD ¨t²ÎºÞ²z¡C ¨C­Ó³¹¸`ªº¶}ÀY·|¥ý´y­z¦b¸Ó±zŪ§¹¸Ó³¹¸`«á±z·|¾Ç¨ì¤°»ò¡A¤]·|¸Ô­z¦b±z¦b¬Ý³o¨Ç¸ê®Æ®ÉÀ³¸Ó­n¦³ªº¤@¨Ç­I´ºª¾ÃÑ¡C ³o¨Ç³¹¸`¬OÅý±z¦b»Ý­n¬d¸ê®Æªº®É­Ô½¾\¥Îªº¡C ±z¤£»Ý­n¨Ì·Ó¯S©wªº¶¶§Ç¨ÓŪ¡A¤]¤£»Ý­n±N³o¨Ç³¹¸`¥þ³¡¹LŪ¤§«á¤~¶}©l¥Î FreeBSD¡C ºô¸ô³q°T FreeBSD ¬O¤@ºØ¼sªxªº³Q¨Ï¥Î¦b°ª®Ä¯àªººô¸ô¦øªA¾¹¤¤ªº§@·~¨t²Î¡A³o¨Ç³¹¸`¥]§t¤F¡G §Ç¦C°ð³q°T PPP ©M PPPoE ¹q¤l¶l¥ó °õ¦æºô¸ô¦øªAµ{¦¡ ¨¾¤õÀð ¨ä¥Lªº¶i¶¥ºô¸ô¥DÃD ³o¨Ç³¹¸`¬OÅý±z¦b»Ý­n¬d¸ê®Æªº®É­Ô½¾\¥Îªº¡C ±z¤£»Ý­n¨Ì·Ó¯S©wªº¶¶§Ç¨ÓŪ¡A¤]¤£»Ý­n±N³o¨Ç³¹¸`¥þ³¡Åª¹L¤§«á¤~±N FreeBSD ¥Î¦bºô¸ôÀô¹Ò¤U¡C ªþ¿ý &chap.colophon; diff --git a/zh_TW.Big5/books/handbook/boot/chapter.sgml b/zh_TW.Big5/books/handbook/boot/chapter.sgml index 557c013b29..79441aa5dc 100644 --- a/zh_TW.Big5/books/handbook/boot/chapter.sgml +++ b/zh_TW.Big5/books/handbook/boot/chapter.sgml @@ -1,821 +1,821 @@ - The FreeBSD Booting Process + FreeBSD ¶}¾÷µ{§Ç - Synopsis + ·§­z booting bootstrap The process of starting a computer and loading the operating system is referred to as the bootstrap process, or simply booting. FreeBSD's boot process provides a great deal of flexibility in customizing what happens when you start the system, allowing you to select from different operating systems installed on the same computer, or even different versions of the same operating system or installed kernel. This chapter details the configuration options you can set and how to customize the FreeBSD boot process. This includes everything that happens until the FreeBSD kernel has started, probed for devices, and started &man.init.8;. If you are not quite sure when this happens, it occurs when the text color changes from bright white to grey. - After reading this chapter, you will know: + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡G What the components of the FreeBSD bootstrap system are, and how they interact. The options you can give to the components in the FreeBSD bootstrap to control the boot process. - The basics of &man.device.hints.5;. + &man.device.hints.5; ªº°ò¥»·§©À¡C x86 Only This chapter only describes the boot process for FreeBSD running on Intel x86 systems. - The Booting Problem + Booting °ÝÃD Turning on a computer and starting the operating system poses an interesting dilemma. By definition, the computer does not know how to do anything until the operating system is started. This includes running programs from the disk. So if the computer can not run a program from the disk without the operating system, and the operating system programs are on the disk, how is the operating system started? This problem parallels one in the book The Adventures of Baron Munchausen. A character had fallen part way down a manhole, and pulled himself out by grabbing his bootstraps, and lifting. In the early days of computing the term bootstrap was applied to the mechanism used to load the operating system, which has become shortened to booting. BIOS Basic Input/Output SystemBIOS On x86 hardware the Basic Input/Output System (BIOS) is responsible for loading the operating system. To do this, the BIOS looks on the hard disk for the Master Boot Record (MBR), which must be located on a specific place on the disk. The BIOS has enough knowledge to load and run the MBR, and assumes that the MBR can then carry out the rest of the tasks involved in loading the operating system, possibly with the help of the BIOS. Master Boot Record (MBR) Boot Manager Boot Loader The code within the MBR is usually referred to as a boot manager, especially when it interacts with the user. In this case the boot manager usually has more code in the first track of the disk or within some OS's file system. (A boot manager is sometimes also called a boot loader, but FreeBSD uses that term for a later stage of booting.) Popular boot managers include boot0 (a.k.a. Boot Easy, the standard &os; boot manager), Grub, GAG, and LILO. (Only boot0 fits within the MBR.) If you have only one operating system installed on your disks then a standard PC MBR will suffice. This MBR searches for the first bootable (a.k.a. active) slice on the disk, and then runs the code on that slice to load the remainder of the operating system. The MBR installed by &man.fdisk.8;, by default, is such an MBR. It is based on /boot/mbr. If you have installed multiple operating systems on your disks then you can install a different boot manager, one that can display a list of different operating systems, and allows you to choose the one to boot from. Two of these are discussed in the next subsection. The remainder of the FreeBSD bootstrap system is divided into three stages. The first stage is run by the MBR, which knows just enough to get the computer into a specific state and run the second stage. The second stage can do a little bit more, before running the third stage. The third stage finishes the task of loading the operating system. The work is split into these three stages because the PC standards put limits on the size of the programs that can be run at stages one and two. Chaining the tasks together allows FreeBSD to provide a more flexible loader. kernel init The kernel is then started and it begins to probe for devices and initialize them for use. Once the kernel boot process is finished, the kernel passes control to the user process &man.init.8;, which then makes sure the disks are in a usable state. &man.init.8; then starts the user-level resource configuration which mounts file systems, sets up network cards to communicate on the network, and generally starts all the processes that usually are run on a FreeBSD system at startup. The Boot Manager and Boot Stages Boot Manager The Boot Manager Master Boot Record (MBR) The code in the MBR or boot manager is sometimes referred to as stage zero of the boot process. This subsection discusses two of the boot managers previously mentioned: boot0 and LILO. The <application>boot0</application> Boot Manager: The MBR installed by FreeBSD's installer or &man.boot0cfg.8;, by default, is based on /boot/boot0. (The boot0 program is very simple, since the program in the MBR can only be 446 bytes long because of the slice table and 0x55AA identifier at the end of the MBR.) If you have installed boot0 and multiple operating systems on your hard disks, then you will see a display similar to this one at boot time: <filename>boot0</filename> Screenshot F1 DOS F2 FreeBSD F3 Linux F4 ?? F5 Drive 1 Default: F2 Other operating systems, in particular &windows;, have been known to overwrite an existing MBR with their own. If this happens to you, or you want to replace your existing MBR with the FreeBSD MBR then use the following command: &prompt.root; fdisk -B -b /boot/boot0 device where device is the device that you boot from, such as ad0 for the first IDE disk, ad2 for the first IDE disk on a second IDE controller, da0 for the first SCSI disk, and so on. Or, if you want a custom configuration of the MBR, use &man.boot0cfg.8;. The LILO Boot Manager: To install this boot manager so it will also boot FreeBSD, first start Linux and add the following to your existing /etc/lilo.conf configuration file: other=/dev/hdXY table=/dev/hdX loader=/boot/chain.b label=FreeBSD In the above, specify FreeBSD's primary partition and drive using Linux specifiers, replacing X with the Linux drive letter and Y with the Linux primary partition number. If you are using a SCSI drive, you will need to change /dev/hd to read something similar to /dev/sd. The line can be omitted if you have both operating systems on the same drive. Now run /sbin/lilo -v to commit your new changes to the system; this should be verified by checking its screen messages. Stage One, <filename>/boot/boot1</filename>, and Stage Two, <filename>/boot/boot2</filename> Conceptually the first and second stages are part of the same program, on the same area of the disk. Because of space constraints they have been split into two, but you would always install them together. They are copied from the combined file /boot/boot by the installer or disklabel (see below). They are located outside file systems, in the first track of the boot slice, starting with the first sector. This is where boot0, or any other boot manager, expects to find a program to run which will continue the boot process. The number of sectors used is easily determined from the size of /boot/boot. boot1 is very simple, since it can only be 512 bytes in size, and knows just enough about the FreeBSD disklabel, which stores information about the slice, to find and execute boot2. boot2 is slightly more sophisticated, and understands the FreeBSD file system enough to find files on it, and can provide a simple interface to choose the kernel or loader to run. Since the loader is much more sophisticated, and provides a nice easy-to-use boot configuration, boot2 usually runs it, but previously it was tasked to run the kernel directly. <filename>boot2</filename> Screenshot >> FreeBSD/i386 BOOT Default: 0:ad(0,a)/kernel boot: If you ever need to replace the installed boot1 and boot2 use &man.disklabel.8;: &prompt.root; disklabel -B diskslice where diskslice is the disk and slice you boot from, such as ad0s1 for the first slice on the first IDE disk. Dangerously Dedicated Mode If you use just the disk name, such as ad0, in the &man.disklabel.8; command you will create a dangerously dedicated disk, without slices. This is almost certainly not what you want to do, so make sure you double check the &man.disklabel.8; command before you press Return. Stage Three, <filename>/boot/loader</filename> boot-loader The loader is the final stage of the three-stage bootstrap, and is located on the file system, usually as /boot/loader. The loader is intended as a user-friendly method for configuration, using an easy-to-use built-in command set, backed up by a more powerful interpreter, with a more complex command set. Loader Program Flow During initialization, the loader will probe for a console and for disks, and figure out what disk it is booting from. It will set variables accordingly, and an interpreter is started where user commands can be passed from a script or interactively. loader loader configuration The loader will then read /boot/loader.rc, which by default reads in /boot/defaults/loader.conf which sets reasonable defaults for variables and reads /boot/loader.conf for local changes to those variables. loader.rc then acts on these variables, loading whichever modules and kernel are selected. Finally, by default, the loader issues a 10 second wait for key presses, and boots the kernel if it is not interrupted. If interrupted, the user is presented with a prompt which understands the easy-to-use command set, where the user may adjust variables, unload all modules, load modules, and then finally boot or reboot. Loader Built-In Commands These are the most commonly used loader commands. For a complete discussion of all available commands, please see &man.loader.8;. autoboot seconds Proceeds to boot the kernel if not interrupted within the time span given, in seconds. It displays a countdown, and the default time span is 10 seconds. boot -options kernelname Immediately proceeds to boot the kernel, with the given options, if any, and with the kernel name given, if it is. boot-conf Goes through the same automatic configuration of modules based on variables as what happens at boot. This only makes sense if you use unload first, and change some variables, most commonly kernel. help topic Shows help messages read from /boot/loader.help. If the topic given is index, then the list of available topics is given. include filename Processes the file with the given filename. The file is read in, and interpreted line by line. An error immediately stops the include command. load type filename Loads the kernel, kernel module, or file of the type given, with the filename given. Any arguments after filename are passed to the file. ls path Displays a listing of files in the given path, or the root directory, if the path is not specified. If is specified, file sizes will be shown too. lsdev Lists all of the devices from which it may be possible to load modules. If is specified, more details are printed. lsmod Displays loaded modules. If is specified, more details are shown. more filename Displays the files specified, with a pause at each LINES displayed. reboot Immediately reboots the system. set variable set variable=value Sets the loader's environment variables. unload Removes all loaded modules. Loader Examples Here are some practical examples of loader usage: single-user mode To simply boot your usual kernel, but in single-user mode: boot -s To unload your usual kernel and modules, and then load just your old (or another) kernel: kernel.old unload load kernel.old You can use kernel.GENERIC to refer to the generic kernel that comes on the install disk, or kernel.old to refer to your previously installed kernel (when you have upgraded or configured your own kernel, for example). Use the following to load your usual modules with another kernel: unload set kernel="kernel.old" boot-conf To load a kernel configuration script (an automated script which does the things you would normally do in the kernel boot-time configurator): load -t userconfig_script /boot/kernel.conf Kernel Interaction During Boot kernel boot interaction Once the kernel is loaded by either loader (as usual) or boot2 (bypassing the loader), it examines its boot flags, if any, and adjusts its behavior as necessary. kernel bootflags Kernel Boot Flags Here are the more common boot flags: during kernel initialization, ask for the device to mount as the root file system. boot from CDROM. run UserConfig, the boot-time kernel configurator boot into single-user mode be more verbose during kernel startup There are other boot flags, read &man.boot.8; for more information on them. Tom Rhodes Contributed by device.hints Device Hints This is a FreeBSD 5.0 and later feature which does not exist in earlier versions. During initial system startup, the boot &man.loader.8; will read the &man.device.hints.5; file. This file stores kernel boot information known as variables, sometimes referred to as device hints. These device hints are used by device drivers for device configuration. Device hints may also be specified at the Stage 3 boot loader prompt. Variables can be added using set, removed with unset, and viewed with the show commands. Variables set in the /boot/device.hints file can be overridden here also. Device hints entered at the boot loader are not permanent and will be forgotten on the next reboot. Once the system is booted, the &man.kenv.1; command can be used to dump all of the variables. The syntax for the /boot/device.hints file is one variable per line, using the standard hash # as comment markers. Lines are constructed as follows: hint.driver.unit.keyword="value" The syntax for the Stage 3 boot loader is: set hint.driver.unit.keyword=value driver is the device driver name, unit is the device driver unit number, and keyword is the hint keyword. The keyword may consist of the following options: at: specifies the bus which the device is attached to. port: specifies the start address of the I/O to be used. irq: specifies the interrupt request number to be used. drq: specifies the DMA channel number. maddr: specifies the physical memory address occupied by the device. flags: sets various flag bits for the device. disabled: if set to 1 the device is disabled. Device drivers may accept (or require) more hints not listed here, viewing their manual page is recommended. For more information, consult the &man.device.hints.5;, &man.kenv.1;, &man.loader.conf.5;, and &man.loader.8; manual pages. init Init: Process Control Initialization Once the kernel has finished booting, it passes control to the user process &man.init.8;, which is located at /sbin/init, or the program path specified in the init_path variable in loader. Automatic Reboot Sequence The automatic reboot sequence makes sure that the file systems available on the system are consistent. If they are not, and &man.fsck.8; cannot fix the inconsistencies, &man.init.8; drops the system into single-user mode for the system administrator to take care of the problems directly. Single-User Mode single-user mode console This mode can be reached through the automatic reboot sequence, or by the user booting with the option or setting the boot_single variable in loader. It can also be reached by calling &man.shutdown.8; without the reboot () or halt () options, from multi-user mode. If the system console is set to insecure in /etc/ttys, then the system prompts for the root password before initiating single-user mode. An Insecure Console in <filename>/etc/ttys</filename> # name getty type status comments # # If console is marked "insecure", then init will ask for the root password # when going to single-user mode. console none unknown off insecure An insecure console means that you consider your physical security to the console to be insecure, and want to make sure only someone who knows the root password may use single-user mode, and it does not mean that you want to run your console insecurely. Thus, if you want security, choose insecure, not secure. Multi-User Mode multi-user mode If &man.init.8; finds your file systems to be in order, or once the user has finished in single-user mode, the system enters multi-user mode, in which it starts the resource configuration of the system. rc files Resource Configuration (rc) The resource configuration system reads in configuration defaults from /etc/defaults/rc.conf, and system-specific details from /etc/rc.conf, and then proceeds to mount the system file systems mentioned in /etc/fstab, start up networking services, start up miscellaneous system daemons, and finally runs the startup scripts of locally installed packages. The &man.rc.8; manual page is a good reference to the resource configuration system, as is examining the scripts themselves. Shutdown Sequence shutdown Upon controlled shutdown, via &man.shutdown.8;, &man.init.8; will attempt to run the script /etc/rc.shutdown, and then proceed to send all processes the TERM signal, and subsequently the KILL signal to any that do not terminate timely. To power down a FreeBSD machine on architectures and systems that support power management, simply use the command shutdown -p now to turn the power off immediately. To just reboot a FreeBSD system, just use shutdown -r now. You need to be root or a member of operator group to run &man.shutdown.8;. The &man.halt.8; and &man.reboot.8; commands can also be used, please refer to their manual pages and to &man.shutdown.8;'s one for more information. Power management requires &man.acpi.4; support in the kernel or loaded as module for FreeBSD 5.X and &man.apm.4; support for FreeBSD 4.X. diff --git a/zh_TW.Big5/books/handbook/config/chapter.sgml b/zh_TW.Big5/books/handbook/config/chapter.sgml index f2411afab5..e44551db7a 100644 --- a/zh_TW.Big5/books/handbook/config/chapter.sgml +++ b/zh_TW.Big5/books/handbook/config/chapter.sgml @@ -1,3173 +1,3143 @@ Chern Lee Written by Mike Smith Based on a tutorial written by Matt Dillon Also based on tuning(7) written by - Configuration and Tuning + ³]©w»P®Ä¯à½Õ®Õ(Tuning) - Synopsis + ·§­z system configuration system optimization One of the important aspects of &os; is system configuration. Correct system configuration will help prevent headaches during future upgrades. This chapter will explain much of the &os; configuration process, including some of the parameters which can be set to tune a &os; system. - After reading this chapter, you will know: + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡G How to efficiently work with file systems and swap partitions. - The basics of rc.conf configuration and - /usr/local/etc/rc.d startup systems. + rc.conf ªº³]©w»P /usr/local/etc/rc.d ªº±Ò°Ê¬[ºc¡F - How to configure and test a network card. + ¦p¦ó³]©w¡B´ú¸Õºô¸ô¥d¡F How to configure virtual hosts on your network devices. - How to use the various configuration files in - /etc. + ¦p¦ó³]©w /etc ¤ºªº¦UºØ³]©wÀÉ¡C - How to tune &os; using sysctl - variables. + ¦p¦ó¥H sysctl ¨Ó½Õ¾ã &os; ªº¨t²Î®Ä¯à¡F - How to tune disk performance and modify kernel - limitations. + ¦p¦ó½Õ¾ãµwºÐ®Ä¯à¡A¥H¤Î§ó§ï kernel ­­¨î¡C - Before reading this chapter, you should: + ¦b¾\Ū³o³¹¤§«e¡A±zÀ³·í¤F¸Ñ¡G Understand &unix; and &os; basics (). Be familiar with the basics of kernel configuration/compilation (). - Initial Configuration + ¤@¶}©lªº³W¹º - Partition Layout + ³W¹º¤À³Î°Ï(Partition) partition layout /etc /var /usr Base Partitions When laying out file systems with &man.disklabel.8; or &man.sysinstall.8;, remember that hard drives transfer data faster from the outer tracks to the inner. Thus smaller and heavier-accessed file systems should be closer to the outside of the drive, while larger partitions like /usr should be placed toward the inner. It is a good idea to create partitions in a similar order to: root, swap, /var, /usr. The size of /var reflects the intended machine usage. /var is used to hold mailboxes, log files, and printer spools. Mailboxes and log files can grow to unexpected sizes depending on how many users exist and how long log files are kept. Most users would never require a gigabyte, but remember that /var/tmp must be large enough to contain packages. The /usr partition holds much of the files required to support the system, the &man.ports.7; collection (recommended) and the source code (optional). Both of which are optional at install time. At least 2 gigabytes would be recommended for this partition. When selecting partition sizes, keep the space requirements in mind. Running out of space in one partition while barely using another can be a hassle. Some users have found that &man.sysinstall.8;'s Auto-defaults partition sizer will sometimes select smaller than adequate /var and / partitions. Partition wisely and generously. Swap Partition swap sizing swap partition As a rule of thumb, the swap partition should be about double the size of system memory (RAM). For example, if the machine has 128 megabytes of memory, the swap file should be 256 megabytes. Systems with less memory may perform better with more swap. Less than 256 megabytes of swap is not recommended and memory expansion should be considered. The kernel's VM paging algorithms are tuned to perform best when the swap partition is at least two times the size of main memory. Configuring too little swap can lead to inefficiencies in the VM page scanning code and might create issues later if more memory is added. On larger systems with multiple SCSI disks (or multiple IDE disks operating on different controllers), it is recommend that a swap is configured on each drive (up to four drives). The swap partitions should be approximately the same size. The kernel can handle arbitrary sizes but internal data structures scale to 4 times the largest swap partition. Keeping the swap partitions near the same size will allow the kernel to optimally stripe swap space across disks. Large swap sizes are fine, even if swap is not used much. It might be easier to recover from a runaway program before being forced to reboot. - Why Partition? + ¬°¦ó­n³W¹º Partition¡H Several users think a single large partition will be fine, but there are several reasons why this is a bad idea. First, each partition has different operational characteristics and separating them allows the file system to tune accordingly. For example, the root and /usr partitions are read-mostly, without much writing. While a lot of reading and writing could occur in /var and /var/tmp. By properly partitioning a system, fragmentation introduced in the smaller write heavy partitions will not bleed over into the mostly-read partitions. Keeping the write-loaded partitions closer to the disk's edge, will increase I/O performance in the partitions where it occurs the most. Now while I/O performance in the larger partitions may be needed, shifting them more toward the edge of the disk will not lead to a significant performance improvement over moving /var to the edge. Finally, there are safety concerns. A smaller, neater root partition which is mostly read-only has a greater chance of surviving a bad crash. - Core Configuration + ³Ì¥D­nªº³]©wÀÉ rc files rc.conf The principal location for system configuration information is within /etc/rc.conf. This file contains a wide range of configuration information, principally used at system startup to configure the system. Its name directly implies this; it is configuration information for the rc* files. An administrator should make entries in the rc.conf file to override the default settings from /etc/defaults/rc.conf. The defaults file should not be copied verbatim to /etc - it contains default values, not examples. All system-specific changes should be made in the rc.conf file itself. A number of strategies may be applied in clustered applications to separate site-wide configuration from system-specific configuration in order to keep administration overhead down. The recommended approach is to place site-wide configuration into another file, such as /etc/rc.conf.site, and then include this file into /etc/rc.conf, which will contain only system-specific information. As rc.conf is read by &man.sh.1; it is trivial to achieve this. For example: rc.conf: . /etc/rc.conf.site hostname="node15.example.com" network_interfaces="fxp0 lo0" ifconfig_fxp0="inet 10.1.1.1" rc.conf.site: defaultrouter="10.1.1.254" saver="daemon" blanktime="100" The rc.conf.site file can then be distributed to every system using rsync or a similar program, while the rc.conf file remains unique. Upgrading the system using &man.sysinstall.8; or make world will not overwrite the rc.conf file, so system configuration information will not be lost. - Application Configuration + ¦U¦¡À³¥Îµ{¦¡ªº³]©wÀÉ Typically, installed applications have their own configuration files, with their own syntax, etc. It is important that these files be kept separate from the base system, so that they may be easily located and managed by the package management tools. /usr/local/etc Typically, these files are installed in /usr/local/etc. In the case where an application has a large number of configuration files, a subdirectory will be created to hold them. Normally, when a port or package is installed, sample configuration files are also installed. These are usually identified with a .default suffix. If there are no existing configuration files for the application, they will be created by copying the .default files. For example, consider the contents of the directory /usr/local/etc/apache: -rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf -rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf.default -rw-r--r-- 1 root wheel 9555 May 20 1998 httpd.conf -rw-r--r-- 1 root wheel 9555 May 20 1998 httpd.conf.default -rw-r--r-- 1 root wheel 12205 May 20 1998 magic -rw-r--r-- 1 root wheel 12205 May 20 1998 magic.default -rw-r--r-- 1 root wheel 2700 May 20 1998 mime.types -rw-r--r-- 1 root wheel 2700 May 20 1998 mime.types.default -rw-r--r-- 1 root wheel 7980 May 20 1998 srm.conf -rw-r--r-- 1 root wheel 7933 May 20 1998 srm.conf.default The file sizes show that only the srm.conf file has been changed. A later update of the Apache port would not overwrite this changed file. Tom Rhodes Contributed by - Starting Services + ¦UºØ Services ªº±Ò°Ê¤è¦¡ services Many users choose to install third party software on &os; from the Ports Collection. In many of these situations it may be necessary to configure the software in a manner which will allow it to be started upon system initialization. Services, such as mail/postfix or www/apache13 are just two of the many software packages which may be started during system initialization. This section explains the procedures available for starting third party software. In &os;, most included services, such as &man.cron.8;, are started through the system start up scripts. These scripts may differ depending on &os; or vendor version; however, the most important aspect to consider is that their start up configuration can be handled through simple startup scripts. - Before the advent of rcNG, applications would drop a + Before the advent of rc.d, applications would drop a simple start up script into the /usr/local/etc/rc.d directory which would be read by the system initialization scripts. These scripts would then be executed during the latter stages of system start up. While many individuals have spent hours trying to merge the old configuration style into the new system, the fact remains that some third party utilities still require a script simply dropped into the aforementioned directory. The subtle differences - in the scripts depend whether or not rcNG is being used. Prior + in the scripts depend whether or not rc.d is being used. Prior to &os; 5.1 the old configuration style is used and in almost all cases a new style script would do just fine. While every script must meet some minimal requirements, most of the time these requirements are &os; version agnostic. Each script must have a .sh extension appended to the end and every script must be executable by the system. The latter may be achieved by using the chmod command and setting the unique permissions of 755. There should also be, at minimal, an option to start the application and an option to stop the application. The simplest start up script would probably look a little bit like this one: #!/bin/sh echo -n ' utility' case "$1" in start) /usr/local/bin/utility ;; stop) kill -9 `cat /var/run/utility.pid` ;; *) echo "Usage: `basename $0` {start|stop}" >&2 exit 64 ;; esac exit 0 This script provides for a stop and start option for the application hereto referred simply as utility. Could be started manually with: &prompt.root; /usr/local/etc/rc.d/utility.sh start While not all third party software requires the line in rc.conf, almost every day a new port will be modified to accept this configuration. Check the final output of the installation for more information on a specific application. Some third party software will provide start up scripts which permit the application to be used with - rcNG; although, this will be discussed in the next section. + rc.d; although, this will be discussed in the next section. Extended Application Configuration - Now that &os; includes rcNG, configuration of application - start up has become more optimal; indeed, it has become a bit - more in depth. Using the key words discussed in the - rcNG section, + Now that &os; includes rc.d, configuration + of application startup has become easier, and more + featureful. Using the key words discussed in the + rc.d section, applications may now be set to start after certain other services for example DNS; may permit extra flags to be passed through rc.conf in place of hard coded flags in the start up script, etc. A basic script may look similar to the following: #!/bin/sh # # PROVIDE: utility # REQUIRE: DAEMON -# BEFORE: LOGIN -# KEYWORD: FreeBSD shutdown +# KEYWORD: shutdown # # DO NOT CHANGE THESE DEFAULT VALUES HERE # SET THEM IN THE /etc/rc.conf FILE # utility_enable=${utility_enable-"NO"} utility_flags=${utility_flags-""} utility_pidfile=${utility_pidfile-"/var/run/utility.pid"} . /etc/rc.subr name="utility" rcvar=`set_rcvar` command="/usr/local/sbin/utility" load_rc_config $name pidfile="${utility_pidfile}" start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}" run_rc_command "$1" This script will ensure that the provided - utility will be started before the - login service but after the + utility will be started after the daemon service. It also provides a method for setting and tracking the PID, or process ID file. This application could then have the following line placed in /etc/rc.conf: utility_enable="YES" This new method also allows for easier manipulation of the command line arguments, inclusion of the default functions provided in /etc/rc.subr, compatibility - with the &man.rcorder.8; utility and provide for easier - configuration via the rc.conf file. In - essence, this script could even be placed in - /etc/rc.d directory. - Yet, that has the potential to upset the &man.mergemaster.8; - utility when used in conjunction with software upgrades. + with the &man.rcorder.8; utility and provides for easier + configuration via the rc.conf file. - Using Services to Start Services + ¥H Services ¨Ó±Ò°Ê¦U¦¡ Services Other services, such as POP3 server daemons, IMAP, etc. could be started using the &man.inetd.8;. This involves installing the service utility from the Ports Collection with a configuration line appended to the /etc/inetd.conf file, or uncommenting one of the current configuration lines. Working with inetd and its configuration is described in depth in the inetd section. In some cases, it may be more plausible to use the &man.cron.8; daemon to start system services. This approach has a number of advantages because cron runs these processes as the crontab's file owner. This allows regular users to start and maintain some applications. The cron utility provides a unique feature, @reboot, which may be used in place of the time specification. This will cause the job to be run when &man.cron.8; is started, normally during system initialization. Tom Rhodes Contributed by - Configuring the <command>cron</command> Utility + ³]©w <command>cron</command> cron configuration - One of the most useful utilities in &os; is &man.cron.8;. The - cron utility runs in the background and constantly - checks the /etc/crontab file. The cron - utility also checks the /var/cron/tabs directory, in - search of new crontab files. These - crontab files store information about specific - functions which cron is supposed to perform at - certain times. - - The cron utility uses two different - types of configuration files, the system crontab and user crontabs. The - only difference between these two formats is the sixth field. In the + &os; ³Ì¦n¥Îªº¤u¨ã¤§¤@´N¬O &man.cron.8;¡C + cron ·|¦b­I´º¤U¹B§@¡A¨Ã¤£Â_Àˬd + /etc/crontab ÀÉ¥H¤Î /var/cron/tabs ¥Ø¿ý¡A¨Ó·j´M¬O§_¦³·s crontab ÀɮסC + ³o¨Ç crontab ÀÉ·|¦s©ñ¤@¨Ç±Æµ{¤u§@ªº³]©w¡A¨Óµ¹ cron °õ¦æ¡C + + cron µ{¦¡¡A¥i¦P®É±Ä¥Î¨âºØ¤£¦PÃþ«¬ªº³]©wÀÉ¡G¨t²Î¥»¨­ªº crontab + ¤Î¨Ï¥ÎªÌ¥»¨­ªº crontab¡C¦Ó¨âºØ®æ¦¡°ß¤@®t§O¦b©ó²Ä¤»Ä檺¤£¦P¡FIn the system crontab, the sixth field is the name of a user for the command to run as. This gives the system crontab the ability to run commands as any user. In a user crontab, the sixth field is the command to run, and all commands run as the user who created the crontab; this is an important security feature. User crontabs allow individual users to schedule tasks without the need for root privileges. Commands in a user's crontab run with the permissions of the user who owns the crontab. The root user can have a user crontab just like any other user. This one is different from /etc/crontab (the system crontab). Because of the system crontab, there is usually no need to create a user crontab for root. Let us take a look at the /etc/crontab file (the system crontab): # /etc/crontab - root's crontab for &os; # # $&os;: src/etc/crontab,v 1.32 2002/11/22 16:13:39 tom Exp $ # # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin HOME=/var/log # # #minute hour mday month wday who command # # */5 * * * * root /usr/libexec/atrun Like most &os; configuration files, the # character represents a comment. A comment can be placed in the file as a reminder of what and why a desired action is performed. Comments cannot be on the same line as a command or else they will be interpreted as part of the command; they must be on a new line. Blank lines are ignored. First, the environment must be defined. The equals (=) character is used to define any environment settings, as with this example where it is used for the SHELL, PATH, and HOME options. If the shell line is omitted, cron will use the default, which is sh. If the PATH variable is omitted, no default will be used and file locations will need to be absolute. If HOME is omitted, cron will use the invoking users home directory. This line defines a total of seven fields. Listed here are the values minute, hour, mday, month, wday, who, and command. These are almost all self explanatory. minute is the time in minutes the command will be run. hour is similar to the minute option, just in hours. mday stands for day of the month. month is similar to hour and minute, as it designates the month. The wday option stands for day of the week. All these fields must be numeric values, and follow the twenty-four hour clock. The who field is special, and only exists in the /etc/crontab file. This field specifies which user the command should be run as. When a user installs his or her crontab file, they will not have this option. Finally, the command option is listed. This is the last field, so naturally it should designate the command to be executed. This last line will define the values discussed above. Notice here we have a */5 listing, followed by several more * characters. These * characters mean first-last, and can be interpreted as every time. So, judging by this line, it is apparent that the atrun command is to be invoked by root every five minutes regardless of what day or month it is. For more information on the atrun command, see the &man.atrun.8; manual page. Commands can have any number of flags passed to them; however, commands which extend to multiple lines need to be broken with the backslash \ continuation character. This is the basic set up for every crontab file, although there is one thing different about this one. Field number six, where we specified the username, only exists in the system /etc/crontab file. This field should be omitted for individual user crontab files. - Installing a Crontab + ¤u§@±Æµ{(Crontab)ªº±Æ©w»PºÞ²z You must not use the procedure described here to edit/install the system crontab. Simply use your favorite editor: the cron utility will notice that the file has changed and immediately begin using the updated version. See this FAQ entry for more information. To install a freshly written user crontab, first use your favorite editor to create a file in the proper format, and then use the crontab utility. The most common usage is: &prompt.user; crontab crontab-file In this example, crontab-file is the filename of a crontab that was previously created. There is also an option to list installed crontab files: just pass the option to crontab and look over the output. For users who wish to begin their own crontab file from scratch, without the use of a template, the crontab -e option is available. This will invoke the selected editor with an empty file. When the file is saved, it will be automatically installed by the crontab command. If you later want to remove your user crontab completely, use crontab with the option. - + Tom Rhodes Contributed by - Using rc under &os; 5.X and newer + ¦b &os; 5.X (§t¤§«á) ¨Ï¥Î rc - &os; has recently integrated the NetBSD - rc.d system for system initialization. - Users should notice the files listed in the - /etc/rc.d directory. Many of these files - are for basic services which can be controlled with the - , , - and options. - For instance, &man.sshd.8; can be restarted with the following - command: + ±q 2002 ¦~°_¡A&os; ¾ã¦X¤F NetBSD ªº rc.d ¾÷¨î¨Ó§@¬°¨t²ÎªA°È±Ò°Ê¾÷¨î¡C + ¥i¥H¨ì /etc/rc.d ¥Ø¿ý¤U¥h¬Ý¡A«Ü¦hÀɮ׳£¬O°ò¥»ªA°È¡A¥i¥H¥Î , + ¤Î §@¬°¨Ï¥Î®Éªº¿ï¶µ¡C + Á|­Ó¨Ò¤l¡A¥i¥H¥Î¤U¦C«ü¥O¨Ó­«·s±Ò°Ê &man.sshd.8;¡G &prompt.root; /etc/rc.d/sshd restart - This procedure is similar for other services. Of course, - services are usually started automatically as specified in - &man.rc.conf.5;. For example, enabling the Network Address - Translation daemon at startup is as simple as adding the - following line to /etc/rc.conf: + ¨ä¥LªA°È¤]¬OÃþ¦ü§@ªk¡C·íµM¡A + ªA°È³q±`¥u­n¦b &man.rc.conf.5; ¤º¦³«ü©wªº¸Ü¡A³£·|¦b¶}¾÷®É´N¦Û°Ê±Ò°Ê¡CÁ|¨Ò¨Ó»¡¡A­Y­n¶}¾÷®É±Ò°Ê NAT(Network Address + Translation) daemon ªº¸Ü¡A¥u­n¦b /etc/rc.conf ¤º¥[¤W¤U¦C³o¦æ§Y¥i¡G natd_enable="YES" - If a line is already - present, then simply change the to - . The rc scripts will automatically load - any other dependent services during the next reboot, as - described below. + ­Y­ì¥»¼gªº¬O ¨º»ò¥u­n§â §ï¬° + ´N¦n¤F¡Crc scripts ·|¦b¤U¦¸­«¶}¾÷®É¡A¦Û°Ê¸ü¤J¬ÛÃö(¦³¬Û¨Ì)ªºªA°È¡A¥H¤U§Ú­Ì·|Á¿¨ì³o³¡¤À¡C Since the rc.d system is primarily intended to start/stop services at system startup/shutdown time, the standard , and options will only perform their action if the appropriate /etc/rc.conf variables are set. For instance the above sshd restart command will only work if sshd_enable is set to in /etc/rc.conf. To , or a service regardless of the settings in /etc/rc.conf, the commands should be prefixed with force. For instance to restart sshd regardless of the current /etc/rc.conf setting, execute the following command: &prompt.root; /etc/rc.d/sshd forcerestart It is easy to check if a service is enabled in /etc/rc.conf by running the appropriate rc.d script with the option . Thus, an administrator can check that sshd is in fact enabled in /etc/rc.conf by running: &prompt.root; /etc/rc.d/sshd rcvar # sshd $sshd_enable=YES The second line (# sshd) is the output from the sshd command, not a root console. - To determine if a service is running, a - option is available. For instance to - verify that sshd is actually started: + ­Y­nÀˬdªA°È¬O§_¦³¦b¹B§@¡A¥i¥H¥Î ¿ï¶µ¨Ó¬d¸ß¡C¤ñ¦p¡G­Y­n½T»{ + sshd ¬O§_¯uªº¦³±Ò°Êªº¸Ü¡A¨º»ò¥´¡G &prompt.root; /etc/rc.d/sshd status sshd is running as pid 433. - It is also possible to a service. + In some cases it is also possible to a service. This will attempt to send a signal to an individual service, forcing the service to reload its configuration files. In most cases this means sending the service a SIGHUP - signal. + signal. Support for this feature is not included for every service. The rc.d system is not only used for network services, it also contributes to most of the system initialization. For instance, consider the bgfsck file. When this script is executed, it will print out the following message: Starting background file system checks in 60 seconds. Therefore this file is used for background file system checks, which are done only during system initialization. Many system services depend on other services to function properly. For example, NIS and other RPC-based services may fail to start until after the rpcbind (portmapper) service has started. To resolve this issue, information about dependencies and other meta-data is included in the comments at the top of each startup script. The &man.rcorder.8; program is then used to parse these comments during system initialization to determine the order in which system services should be invoked to satisfy the dependencies. The following words may be included at the top of each startup file: PROVIDE: Specifies the services this file provides. REQUIRE: Lists services which are required for this service. This file will run after the specified services. BEFORE: Lists services which depend on this service. This file will run before the specified services. - - - KEYWORD: &os; or NetBSD. This is used for *BSD dependent features. - By using this method, an administrator can easily control system services without the hassle of runlevels like some other &unix; operating systems. Additional information about the rc.d system can be found in the &man.rc.8; and &man.rc.subr.8; manual pages. Marc Fonvieille Contributed by - Setting Up Network Interface Cards + ³]©wºô¸ô¥d network cards configuration Nowadays we can not think about a computer without thinking about a network connection. Adding and configuring a network card is a common task for any &os; administrator. - Locating the Correct Driver + ¿ï¾Ü¥¿½T¡B¥i¥ÎªºÅX°Êµ{¦¡(Driver) network cards driver Before you begin, you should know the model of the card you have, the chip it uses, and whether it is a PCI or ISA card. &os; supports a wide variety of both PCI and ISA cards. Check the Hardware Compatibility List for your release to see if your card is supported. Once you are sure your card is supported, you need to determine the proper driver for the card. /usr/src/sys/conf/NOTES and /usr/src/sys/arch/conf/NOTES will give you the list of network interface drivers with some information about the supported chipsets/cards. If you have doubts about which driver is the correct one, read the manual page of the driver. The manual page will give you more information about the supported hardware and even the possible problems that could occur. NOTES does not exist on &os; 4.X. Instead, check the LINT file for information about various network interfaces. See for a more detailed summary of NOTES versus LINT. If you own a common card, most of the time you will not have to look very hard for a driver. Drivers for common network cards are present in the GENERIC kernel, so your card should show up during boot, like so: dc0: <82c169 PNIC 10/100BaseTX> port 0xa000-0xa0ff mem 0xd3800000-0xd38 000ff irq 15 at device 11.0 on pci0 dc0: Ethernet address: 00:a0:cc:da:da:da miibus0: <MII bus> on dc0 ukphy0: <Generic IEEE 802.3u media interface> on miibus0 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto dc1: <82c169 PNIC 10/100BaseTX> port 0x9800-0x98ff mem 0xd3000000-0xd30 000ff irq 11 at device 12.0 on pci0 dc1: Ethernet address: 00:a0:cc:da:da:db miibus1: <MII bus> on dc1 ukphy1: <Generic IEEE 802.3u media interface> on miibus1 ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto In this example, we see that two cards using the &man.dc.4; driver are present on the system. If the driver for your NIC is not present in GENERIC, you will need to load the proper driver to use your NIC. This may be accomplished in one of two ways: The easiest way is to simply load a kernel module for your network card with &man.kldload.8;. Not all NIC drivers are available as modules; notable examples of devices for which modules do not exist are ISA cards. Alternatively, you may statically compile the support for your card into your kernel. Check /usr/src/sys/conf/NOTES, /usr/src/sys/arch/conf/NOTES and the manual page of the driver to know what to add in your kernel configuration file. For more information about recompiling your kernel, please see . If your card was detected at boot by your kernel (GENERIC) you do not have to build a new kernel. - Configuring the Network Card + ³]©wºô¸ô¥d network cards configuration Once the right driver is loaded for the network card, the card needs to be configured. As with many other things, the network card may have been configured at installation time by sysinstall. To display the configuration for the network interfaces on your system, enter the following command: &prompt.user; ifconfig dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255 ether 00:a0:cc:da:da:da media: Ethernet autoselect (100baseTX <full-duplex>) status: active dc1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255 ether 00:a0:cc:da:da:db media: Ethernet 10baseT/UTP status: no carrier lp0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet 127.0.0.1 netmask 0xff000000 tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500 Old versions of &os; may require the option following &man.ifconfig.8;, for more details about the correct syntax of &man.ifconfig.8;, please refer to the manual page. Note also that entries concerning IPv6 (inet6 etc.) were omitted in this example. In this example, the following devices were displayed: dc0: The first Ethernet interface dc1: The second Ethernet interface lp0: The parallel port interface lo0: The loopback device tun0: The tunnel device used by ppp &os; uses the driver name followed by the order in which one the card is detected at the kernel boot to name the network card. For example sis2 would be the third network card on the system using the &man.sis.4; driver. In this example, the dc0 device is up and running. The key indicators are: UP means that the card is configured and ready. The card has an Internet (inet) address (in this case 192.168.1.3). It has a valid subnet mask (netmask; 0xffffff00 is the same as 255.255.255.0). It has a valid broadcast address (in this case, 192.168.1.255). The MAC address of the card (ether) is 00:a0:cc:da:da:da The physical media selection is on autoselection mode (media: Ethernet autoselect (100baseTX <full-duplex>)). We see that dc1 was configured to run with 10baseT/UTP media. For more information on available media types for a driver, please refer to its manual page. The status of the link (status) is active, i.e. the carrier is detected. For dc1, we see status: no carrier. This is normal when an Ethernet cable is not plugged into the card. If the &man.ifconfig.8; output had shown something similar to: dc0: flags=8843<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 ether 00:a0:cc:da:da:da it would indicate the card has not been configured. To configure your card, you need root privileges. The network card configuration can be done from the command line with &man.ifconfig.8; but you would have to do it after each reboot of the system. The file /etc/rc.conf is where to add the network card's configuration. Open /etc/rc.conf in your favorite editor. You need to add a line for each network card present on the system, for example in our case, we added these lines: ifconfig_dc0="inet 192.168.1.3 netmask 255.255.255.0" ifconfig_dc1="inet 10.0.0.1 netmask 255.255.255.0 media 10baseT/UTP" You have to replace dc0, dc1, and so on, with the correct device for your cards, and the addresses with the proper ones. You should read the card driver and &man.ifconfig.8; manual pages for more details about the allowed options and also &man.rc.conf.5; manual page for more information on the syntax of /etc/rc.conf. If you configured the network during installation, some lines about the network card(s) may be already present. Double check /etc/rc.conf before adding any lines. You will also have to edit the file /etc/hosts to add the names and the IP addresses of various machines of the LAN, if they are not already there. For more information please refer to &man.hosts.5; and to /usr/share/examples/etc/hosts. - Testing and Troubleshooting + ´ú¸Õ»PºÃÃø±Æ°£ Once you have made the necessary changes in /etc/rc.conf, you should reboot your system. This will allow the change(s) to the interface(s) to be applied, and verify that the system restarts without any configuration errors. Once the system has been rebooted, you should test the network interfaces. - Testing the Ethernet Card + ´ú¸Õ¤A¤Óºô¸ô¥d(Ethernet Card) network cards testing To verify that an Ethernet card is configured correctly, you have to try two things. First, ping the interface itself, and then ping another machine on the LAN. First test the local interface: &prompt.user; ping -c5 192.168.1.3 PING 192.168.1.3 (192.168.1.3): 56 data bytes 64 bytes from 192.168.1.3: icmp_seq=0 ttl=64 time=0.082 ms 64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=0.074 ms 64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=0.076 ms 64 bytes from 192.168.1.3: icmp_seq=3 ttl=64 time=0.108 ms 64 bytes from 192.168.1.3: icmp_seq=4 ttl=64 time=0.076 ms --- 192.168.1.3 ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.074/0.083/0.108/0.013 ms Now we have to ping another machine on the LAN: &prompt.user; ping -c5 192.168.1.2 PING 192.168.1.2 (192.168.1.2): 56 data bytes 64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0.726 ms 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.766 ms 64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.700 ms 64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.747 ms 64 bytes from 192.168.1.2: icmp_seq=4 ttl=64 time=0.704 ms --- 192.168.1.2 ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.700/0.729/0.766/0.025 ms You could also use the machine name instead of 192.168.1.2 if you have set up the /etc/hosts file. - Troubleshooting + ºÃÃø±Æ°£ network cards troubleshooting Troubleshooting hardware and software configurations is always a pain, and a pain which can be alleviated by checking the simple things first. Is your network cable plugged in? Have you properly configured the network services? Did you configure the firewall correctly? Is the card you are using supported by &os;? Always check the hardware notes before sending off a bug report. Update your version of &os; to the latest STABLE version. Check the mailing list archives, or perhaps search the Internet. If the card works, yet performance is poor, it would be worthwhile to read over the &man.tuning.7; manual page. You can also check the network configuration as incorrect network settings can cause slow connections. Some users experience one or two device timeout messages, which is normal for some cards. If they continue, or are bothersome, you may wish to be sure the device is not conflicting with another device. Double check the cable connections. Perhaps you may just need to get another card. At times, users see a few watchdog timeout errors. The first thing to do here is to check your network cable. Many cards require a PCI slot which supports Bus Mastering. On some old motherboards, only one PCI slot allows it (usually slot 0). Check the network card and the motherboard documentation to determine if that may be the problem. No route to host messages occur if the system is unable to route a packet to the destination host. This can happen if no default route is specified, or if a cable is unplugged. Check the output of netstat -rn and make sure there is a valid route to the host you are trying to reach. If there is not, read on to . ping: sendto: Permission denied error messages are often caused by a misconfigured firewall. If ipfw is enabled in the kernel but no rules have been defined, then the default policy is to deny all traffic, even ping requests! Read on to for more information. Sometimes performance of the card is poor, or below average. In these cases it is best to set the media selection mode from autoselect to the correct media selection. While this usually works for most hardware, it may not resolve this issue for everyone. Again, check all the network settings, and read over the &man.tuning.7; manual page. - Virtual Hosts + µêÀÀ¥D¾÷(Virtual Hosts) virtual hosts IP aliases A very common use of &os; is virtual site hosting, where one server appears to the network as many servers. This is achieved by assigning multiple network addresses to a single interface. A given network interface has one real address, and may have any number of alias addresses. These aliases are normally added by placing alias entries in /etc/rc.conf. An alias entry for the interface fxp0 looks like: ifconfig_fxp0_alias0="inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx" Note that alias entries must start with alias0 and proceed upwards in order, (for example, _alias1, _alias2, and so on). The configuration process will stop at the first missing number. The calculation of alias netmasks is important, but fortunately quite simple. For a given interface, there must be one address which correctly represents the network's netmask. Any other addresses which fall within this network must have a netmask of all 1s (expressed as either 255.255.255.255 or 0xffffffff). For example, consider the case where the fxp0 interface is connected to two networks, the 10.1.1.0 network with a netmask of 255.255.255.0 and the 202.0.75.16 network with a netmask of 255.255.255.240. We want the system to appear at 10.1.1.1 through 10.1.1.5 and at 202.0.75.17 through 202.0.75.20. As noted above, only the first address in a given network range (in this case, 10.0.1.1 and 202.0.75.17) should have a real netmask; all the rest (10.1.1.2 through 10.1.1.5 and 202.0.75.18 through 202.0.75.20) must be configured with a netmask of 255.255.255.255. The following /etc/rc.conf entries configure the adapter correctly for this arrangement: ifconfig_fxp0="inet 10.1.1.1 netmask 255.255.255.0" ifconfig_fxp0_alias0="inet 10.1.1.2 netmask 255.255.255.255" ifconfig_fxp0_alias1="inet 10.1.1.3 netmask 255.255.255.255" ifconfig_fxp0_alias2="inet 10.1.1.4 netmask 255.255.255.255" ifconfig_fxp0_alias3="inet 10.1.1.5 netmask 255.255.255.255" ifconfig_fxp0_alias4="inet 202.0.75.17 netmask 255.255.255.240" ifconfig_fxp0_alias5="inet 202.0.75.18 netmask 255.255.255.255" ifconfig_fxp0_alias6="inet 202.0.75.19 netmask 255.255.255.255" ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255.255.255" - Configuration Files + ÁÙ¦³­þ¨Ç¥D­n³]©wÀÉ©O¡H <filename>/etc</filename> Layout There are a number of directories in which configuration information is kept. These include: /etc Generic system configuration information; data here is system-specific. /etc/defaults Default versions of system configuration files. /etc/mail Extra &man.sendmail.8; configuration, other MTA configuration files. /etc/ppp Configuration for both user- and kernel-ppp programs. /etc/namedb Default location for &man.named.8; data. Normally named.conf and zone files are stored here. /usr/local/etc Configuration files for installed applications. May contain per-application subdirectories. /usr/local/etc/rc.d Start/stop scripts for installed applications. /var/db Automatically generated system-specific database files, such as the package database, the locate database, and so on Hostnames hostname DNS <filename>/etc/resolv.conf</filename> resolv.conf /etc/resolv.conf dictates how &os;'s resolver accesses the Internet Domain Name System (DNS). The most common entries to resolv.conf are: nameserver The IP address of a name server the resolver should query. The servers are queried in the order listed with a maximum of three. search Search list for hostname lookup. This is normally determined by the domain of the local hostname. domain The local domain name. A typical resolv.conf: search example.com nameserver 147.11.1.11 nameserver 147.11.100.30 Only one of the search and domain options should be used. If you are using DHCP, &man.dhclient.8; usually rewrites resolv.conf with information received from the DHCP server. <filename>/etc/hosts</filename> hosts /etc/hosts is a simple text database reminiscent of the old Internet. It works in conjunction with DNS and NIS providing name to IP address mappings. Local computers connected via a LAN can be placed in here for simplistic naming purposes instead of setting up a &man.named.8; server. Additionally, /etc/hosts can be used to provide a local record of Internet names, reducing the need to query externally for commonly accessed names. # $&os;$ # # Host Database # This file should contain the addresses and aliases # for local hosts that share this file. # In the presence of the domain name service or NIS, this file may # not be consulted at all; see /etc/nsswitch.conf for the resolution order. # # ::1 localhost localhost.my.domain myname.my.domain 127.0.0.1 localhost localhost.my.domain myname.my.domain # # Imaginary network. #10.0.0.2 myname.my.domain myname #10.0.0.3 myfriend.my.domain myfriend # # According to RFC 1918, you can use the following IP networks for # private nets which will never be connected to the Internet: # # 10.0.0.0 - 10.255.255.255 # 172.16.0.0 - 172.31.255.255 # 192.168.0.0 - 192.168.255.255 # # In case you want to be able to connect to the Internet, you need # real official assigned numbers. PLEASE PLEASE PLEASE do not try # to invent your own network numbers but instead get one from your # network provider (if any) or from the Internet Registry (ftp to # rs.internic.net, directory `/templates'). # /etc/hosts takes on the simple format of: [Internet address] [official hostname] [alias1] [alias2] ... For example: 10.0.0.1 myRealHostname.example.com myRealHostname foobar1 foobar2 Consult &man.hosts.5; for more information. Log File Configuration log files <filename>syslog.conf</filename> syslog.conf syslog.conf is the configuration file for the &man.syslogd.8; program. It indicates which types of syslog messages are logged to particular log files. # $&os;$ # # Spaces ARE valid field separators in this file. However, # other *nix-like systems still insist on using tabs as field # separators. If you are sharing this file between systems, you # may want to use only tabs as field separators here. # Consult the syslog.conf(5) manual page. *.err;kern.debug;auth.notice;mail.crit /dev/console *.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages security.* /var/log/security mail.info /var/log/maillog lpr.info /var/log/lpd-errs cron.* /var/log/cron *.err root *.notice;news.err root *.alert root *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log #console.info /var/log/console.log # uncomment this to enable logging of all log messages to /var/log/all.log #*.* /var/log/all.log # uncomment this to enable logging to a remote log host named loghost #*.* @loghost # uncomment these if you're running inn # news.crit /var/log/news/news.crit # news.err /var/log/news/news.err # news.notice /var/log/news/news.notice !startslip *.* /var/log/slip.log !ppp *.* /var/log/ppp.log Consult the &man.syslog.conf.5; manual page for more information. <filename>newsyslog.conf</filename> newsyslog.conf newsyslog.conf is the configuration file for &man.newsyslog.8;, a program that is normally scheduled to run by &man.cron.8;. &man.newsyslog.8; determines when log files require archiving or rearranging. logfile is moved to logfile.0, logfile.0 is moved to logfile.1, and so on. Alternatively, the log files may be archived in &man.gzip.1; format causing them to be named: logfile.0.gz, logfile.1.gz, and so on. newsyslog.conf indicates which log files are to be managed, how many are to be kept, and when they are to be touched. Log files can be rearranged and/or archived when they have either reached a certain size, or at a certain periodic time/date. # configuration file for newsyslog # $&os;$ # # filename [owner:group] mode count size when [ZB] [/pid_file] [sig_num] /var/log/cron 600 3 100 * Z /var/log/amd.log 644 7 100 * Z /var/log/kerberos.log 644 7 100 * Z /var/log/lpd-errs 644 7 100 * Z /var/log/maillog 644 7 * @T00 Z /var/log/sendmail.st 644 10 * 168 B /var/log/messages 644 5 100 * Z /var/log/all.log 600 7 * @T00 Z /var/log/slip.log 600 3 100 * Z /var/log/ppp.log 600 3 100 * Z /var/log/security 600 10 100 * Z /var/log/wtmp 644 3 * @01T05 B /var/log/daily.log 640 7 * @T00 Z /var/log/weekly.log 640 5 1 $W6D0 Z /var/log/monthly.log 640 12 * $M1D0 Z /var/log/console.log 640 5 100 * Z Consult the &man.newsyslog.8; manual page for more information. <filename>sysctl.conf</filename> sysctl.conf sysctl sysctl.conf looks much like rc.conf. Values are set in a variable=value form. The specified values are set after the system goes into multi-user mode. Not all variables are settable in this mode. A sample sysctl.conf turning off logging of fatal signal exits and letting Linux programs know they are really running under &os;: kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11) compat.linux.osname=&os; compat.linux.osrelease=4.3-STABLE Tuning with sysctl sysctl tuning with sysctl &man.sysctl.8; is an interface that allows you to make changes to a running &os; system. This includes many advanced options of the TCP/IP stack and virtual memory system that can dramatically improve performance for an experienced system administrator. Over five hundred system variables can be read and set using &man.sysctl.8;. At its core, &man.sysctl.8; serves two functions: to read and to modify system settings. To view all readable variables: &prompt.user; sysctl -a To read a particular variable, for example, kern.maxproc: &prompt.user; sysctl kern.maxproc kern.maxproc: 1044 To set a particular variable, use the intuitive variable=value syntax: &prompt.root; sysctl kern.maxfiles=5000 kern.maxfiles: 2088 -> 5000 Settings of sysctl variables are usually either strings, numbers, or booleans (a boolean being 1 for yes or a 0 for no). If you want to set automatically some variables each time the machine boots, add them to the /etc/sysctl.conf file. For more information see the &man.sysctl.conf.5; manual page and the . Tom Rhodes Contributed by &man.sysctl.8; Read-only In some cases it may be desirable to modify read-only &man.sysctl.8; values. While this is sometimes unavoidable, it can only be done on (re)boot. For instance on some laptop models the &man.cardbus.4; device will not probe memory ranges, and fail with errors which look similar to: cbb0: Could not map register memory device_probe_and_attach: cbb0 attach returned 12 Cases like the one above usually require the modification of some default &man.sysctl.8; settings which are set read only. To overcome these situations a user can put &man.sysctl.8; OIDs in their local /boot/loader.conf. Default settings are located in the /boot/defaults/loader.conf file. Fixing the problem mentioned above would require a user to set in the aforementioned file. Now &man.cardbus.4; will work properly. Tuning Disks Sysctl Variables <varname>vfs.vmiodirenable</varname> vfs.vmiodirenable The vfs.vmiodirenable sysctl variable may be set to either 0 (off) or 1 (on); it is 1 by default. This variable controls how directories are cached by the system. Most directories are small, using just a single fragment (typically 1 K) in the file system and less (typically 512 bytes) in the buffer cache. With this variable turned off (to 0), the buffer cache will only cache a fixed number of directories even if you have a huge amount of memory. When turned on (to 1), this sysctl allows the buffer cache to use the VM Page Cache to cache the directories, making all the memory available for caching directories. However, the minimum in-core memory used to cache a directory is the physical page size (typically 4 K) rather than 512  bytes. We recommend keeping this option on if you are running any services which manipulate large numbers of files. Such services can include web caches, large mail systems, and news systems. Keeping this option on will generally not reduce performance even with the wasted memory but you should experiment to find out. <varname>vfs.write_behind</varname> vfs.write_behind The vfs.write_behind sysctl variable defaults to 1 (on). This tells the file system to issue media writes as full clusters are collected, which typically occurs when writing large sequential files. The idea is to avoid saturating the buffer cache with dirty buffers when it would not benefit I/O performance. However, this may stall processes and under certain circumstances you may wish to turn it off. <varname>vfs.hirunningspace</varname> vfs.hirunningspace The vfs.hirunningspace sysctl variable determines how much outstanding write I/O may be queued to disk controllers system-wide at any given instance. The default is usually sufficient but on machines with lots of disks you may want to bump it up to four or five megabytes. Note that setting too high a value (exceeding the buffer cache's write threshold) can lead to extremely bad clustering performance. Do not set this value arbitrarily high! Higher write values may add latency to reads occurring at the same time. There are various other buffer-cache and VM page cache related sysctls. We do not recommend modifying these values. As of &os; 4.3, the VM system does an extremely good job of automatically tuning itself. <varname>vm.swap_idle_enabled</varname> vm.swap_idle_enabled The vm.swap_idle_enabled sysctl variable is useful in large multi-user systems where you have lots of users entering and leaving the system and lots of idle processes. Such systems tend to generate a great deal of continuous pressure on free memory reserves. Turning this feature on and tweaking the swapout hysteresis (in idle seconds) via vm.swap_idle_threshold1 and vm.swap_idle_threshold2 allows you to depress the priority of memory pages associated with idle processes more quickly then the normal pageout algorithm. This gives a helping hand to the pageout daemon. Do not turn this option on unless you need it, because the tradeoff you are making is essentially pre-page memory sooner rather than later; thus eating more swap and disk bandwidth. In a small system this option will have a determinable effect but in a large system that is already doing moderate paging this option allows the VM system to stage whole processes into and out of memory easily. <varname>hw.ata.wc</varname> hw.ata.wc &os; 4.3 flirted with turning off IDE write caching. This reduced write bandwidth to IDE disks but was considered necessary due to serious data consistency issues introduced by hard drive vendors. The problem is that IDE drives lie about when a write completes. With IDE write caching turned on, IDE hard drives not only write data to disk out of order, but will sometimes delay writing some blocks indefinitely when under heavy disk loads. A crash or power failure may cause serious file system corruption. &os;'s default was changed to be safe. Unfortunately, the result was such a huge performance loss that we changed write caching back to on by default after the release. You should check the default on your system by observing the hw.ata.wc sysctl variable. If IDE write caching is turned off, you can turn it back on by setting the kernel variable back to 1. This must be done from the boot loader at boot time. Attempting to do it after the kernel boots will have no effect. For more information, please see &man.ata.4;. <literal>SCSI_DELAY</literal> (<varname>kern.cam.scsi_delay</varname>) kern.cam.scsi_delay kernel options SCSI_DELAY The SCSI_DELAY kernel config may be used to reduce system boot times. The defaults are fairly high and can be responsible for 15 seconds of delay in the boot process. Reducing it to 5 seconds usually works (especially with modern drives). Newer versions of &os; (5.0 and higher) should use the kern.cam.scsi_delay boot time tunable. The tunable, and kernel config option accept values in terms of milliseconds and not seconds. Soft Updates Soft Updates tunefs The &man.tunefs.8; program can be used to fine-tune a file system. This program has many different options, but for now we are only concerned with toggling Soft Updates on and off, which is done by: &prompt.root; tunefs -n enable /filesystem &prompt.root; tunefs -n disable /filesystem A filesystem cannot be modified with &man.tunefs.8; while it is mounted. A good time to enable Soft Updates is before any partitions have been mounted, in single-user mode. As of &os; 4.5, it is possible to enable Soft Updates at filesystem creation time, through use of the -U option to &man.newfs.8;. Soft Updates drastically improves meta-data performance, mainly file creation and deletion, through the use of a memory cache. We recommend to use Soft Updates on all of your file systems. There are two downsides to Soft Updates that you should be aware of: First, Soft Updates guarantees filesystem consistency in the case of a crash but could very easily be several seconds (even a minute!) behind updating the physical disk. If your system crashes you may lose more work than otherwise. Secondly, Soft Updates delays the freeing of filesystem blocks. If you have a filesystem (such as the root filesystem) which is almost full, performing a major update, such as make installworld, can cause the filesystem to run out of space and the update to fail. More Details about Soft Updates Soft Updates details There are two traditional approaches to writing a file systems meta-data back to disk. (Meta-data updates are updates to non-content data like inodes or directories.) Historically, the default behavior was to write out meta-data updates synchronously. If a directory had been changed, the system waited until the change was actually written to disk. The file data buffers (file contents) were passed through the buffer cache and backed up to disk later on asynchronously. The advantage of this implementation is that it operates safely. If there is a failure during an update, the meta-data are always in a consistent state. A file is either created completely or not at all. If the data blocks of a file did not find their way out of the buffer cache onto the disk by the time of the crash, &man.fsck.8; is able to recognize this and repair the filesystem by setting the file length to 0. Additionally, the implementation is clear and simple. The disadvantage is that meta-data changes are slow. An rm -r, for instance, touches all the files in a directory sequentially, but each directory change (deletion of a file) will be written synchronously to the disk. This includes updates to the directory itself, to the inode table, and possibly to indirect blocks allocated by the file. Similar considerations apply for unrolling large hierarchies (tar -x). The second case is asynchronous meta-data updates. This is the default for Linux/ext2fs and mount -o async for *BSD ufs. All meta-data updates are simply being passed through the buffer cache too, that is, they will be intermixed with the updates of the file content data. The advantage of this implementation is there is no need to wait until each meta-data update has been written to disk, so all operations which cause huge amounts of meta-data updates work much faster than in the synchronous case. Also, the implementation is still clear and simple, so there is a low risk for bugs creeping into the code. The disadvantage is that there is no guarantee at all for a consistent state of the filesystem. If there is a failure during an operation that updated large amounts of meta-data (like a power failure, or someone pressing the reset button), the filesystem will be left in an unpredictable state. There is no opportunity to examine the state of the filesystem when the system comes up again; the data blocks of a file could already have been written to the disk while the updates of the inode table or the associated directory were not. It is actually impossible to implement a fsck which is able to clean up the resulting chaos (because the necessary information is not available on the disk). If the filesystem has been damaged beyond repair, the only choice is to use &man.newfs.8; on it and restore it from backup. The usual solution for this problem was to implement dirty region logging, which is also referred to as journaling, although that term is not used consistently and is occasionally applied to other forms of transaction logging as well. Meta-data updates are still written synchronously, but only into a small region of the disk. Later on they will be moved to their proper location. Because the logging area is a small, contiguous region on the disk, there are no long distances for the disk heads to move, even during heavy operations, so these operations are quicker than synchronous updates. Additionally the complexity of the implementation is fairly limited, so the risk of bugs being present is low. A disadvantage is that all meta-data are written twice (once into the logging region and once to the proper location) so for normal work, a performance pessimization might result. On the other hand, in case of a crash, all pending meta-data operations can be quickly either rolled-back or completed from the logging area after the system comes up again, resulting in a fast filesystem startup. Kirk McKusick, the developer of Berkeley FFS, solved this problem with Soft Updates: all pending meta-data updates are kept in memory and written out to disk in a sorted sequence (ordered meta-data updates). This has the effect that, in case of heavy meta-data operations, later updates to an item catch the earlier ones if the earlier ones are still in memory and have not already been written to disk. So all operations on, say, a directory are generally performed in memory before the update is written to disk (the data blocks are sorted according to their position so that they will not be on the disk ahead of their meta-data). If the system crashes, this causes an implicit log rewind: all operations which did not find their way to the disk appear as if they had never happened. A consistent filesystem state is maintained that appears to be the one of 30 to 60 seconds earlier. The algorithm used guarantees that all resources in use are marked as such in their appropriate bitmaps: blocks and inodes. After a crash, the only resource allocation error that occurs is that resources are marked as used which are actually free. &man.fsck.8; recognizes this situation, and frees the resources that are no longer used. It is safe to ignore the dirty state of the filesystem after a crash by forcibly mounting it with mount -f. In order to free resources that may be unused, &man.fsck.8; needs to be run at a later time. This is the idea behind the background fsck: at system startup time, only a snapshot of the filesystem is recorded. The fsck can be run later on. All file systems can then be mounted dirty, so the system startup proceeds in multiuser mode. Then, background fscks will be scheduled for all file systems where this is required, to free resources that may be unused. (File systems that do not use Soft Updates still need the usual foreground fsck though.) The advantage is that meta-data operations are nearly as fast as asynchronous updates (i.e. faster than with logging, which has to write the meta-data twice). The disadvantages are the complexity of the code (implying a higher risk for bugs in an area that is highly sensitive regarding loss of user data), and a higher memory consumption. Additionally there are some idiosyncrasies one has to get used to. After a crash, the state of the filesystem appears to be somewhat older. In situations where the standard synchronous approach would have caused some zero-length files to remain after the fsck, these files do not exist at all with a Soft Updates filesystem because neither the meta-data nor the file contents have ever been written to disk. Disk space is not released until the updates have been written to disk, which may take place some time after running rm. This may cause problems when installing large amounts of data on a filesystem that does not have enough free space to hold all the files twice. Tuning Kernel Limits tuning kernel limits File/Process Limits <varname>kern.maxfiles</varname> kern.maxfiles kern.maxfiles can be raised or lowered based upon your system requirements. This variable indicates the maximum number of file descriptors on your system. When the file descriptor table is full, file: table is full will show up repeatedly in the system message buffer, which can be viewed with the dmesg command. Each open file, socket, or fifo uses one file descriptor. A large-scale production server may easily require many thousands of file descriptors, depending on the kind and number of services running concurrently. kern.maxfile's default value is dictated by the option in your kernel configuration file. kern.maxfiles grows proportionally to the value of . When compiling a custom kernel, it is a good idea to set this kernel configuration option according to the uses of your system. From this number, the kernel is given most of its pre-defined limits. Even though a production machine may not actually have 256 users connected at once, the resources needed may be similar to a high-scale web server. Starting with &os; 4.5, the system will auto-tune maxusers for you if you explicitly set it to 0 The auto-tuning algorithm sets maxusers equal to the amount of memory in the system, with a minimum of 32, and a maximum of 384. . In &os; 5.X and above, maxusers will default to 0 if not specified. If you are using an version of &os; earlier than 4.5, or you want to manage it yourself you will want to set maxusers to at least 4, especially if you are using the X Window System or compiling software. The reason is that the most important table set by maxusers is the maximum number of processes, which is set to 20 + 16 * maxusers, so if you set maxusers to 1, then you can only have 36 simultaneous processes, including the 18 or so that the system starts up at boot time and the 15 or so you will probably create when you start the X Window System. Even a simple task like reading a manual page will start up nine processes to filter, decompress, and view it. Setting maxusers to 64 will allow you to have up to 1044 simultaneous processes, which should be enough for nearly all uses. If, however, you see the dreaded proc table full error when trying to start another program, or are running a server with a large number of simultaneous users (like ftp.FreeBSD.org), you can always increase the number and rebuild. maxusers does not limit the number of users which can log into your machine. It simply sets various table sizes to reasonable values considering the maximum number of users you will likely have on your system and how many processes each of them will be running. One keyword which does limit the number of simultaneous remote logins and X terminal windows is pseudo-device pty 16. With &os; 5.X, you do not have to worry about this number since the &man.pty.4; driver is auto-cloning; you simply use the line device pty in your configuration file. <varname>kern.ipc.somaxconn</varname> kern.ipc.somaxconn The kern.ipc.somaxconn sysctl variable limits the size of the listen queue for accepting new TCP connections. The default value of 128 is typically too low for robust handling of new connections in a heavily loaded web server environment. For such environments, it is recommended to increase this value to 1024 or higher. The service daemon may itself limit the listen queue size (e.g. &man.sendmail.8;, or Apache) but will often have a directive in its configuration file to adjust the queue size. Large listen queues also do a better job of avoiding Denial of Service (DoS) attacks. Network Limits The NMBCLUSTERS kernel configuration option dictates the amount of network Mbufs available to the system. A heavily-trafficked server with a low number of Mbufs will hinder &os;'s ability. Each cluster represents approximately 2 K of memory, so a value of 1024 represents 2 megabytes of kernel memory reserved for network buffers. A simple calculation can be done to figure out how many are needed. If you have a web server which maxes out at 1000 simultaneous connections, and each connection eats a 16 K receive and 16 K send buffer, you need approximately 32 MB worth of network buffers to cover the web server. A good rule of thumb is to multiply by 2, so 2x32 MB / 2 KB = 64 MB / 2 kB = 32768. We recommend values between 4096 and 32768 for machines with greater amounts of memory. Under no circumstances should you specify an arbitrarily high value for this parameter as it could lead to a boot time crash. The option to &man.netstat.1; may be used to observe network cluster use. kern.ipc.nmbclusters loader tunable should be used to tune this at boot time. Only older versions of &os; will require you to use the NMBCLUSTERS kernel &man.config.8; option. For busy servers that make extensive use of the &man.sendfile.2; system call, it may be necessary to increase the number of &man.sendfile.2; buffers via the NSFBUFS kernel configuration option or by setting its value in /boot/loader.conf (see &man.loader.8; for details). A common indicator that this parameter needs to be adjusted is when processes are seen in the sfbufa state. The sysctl variable kern.ipc.nsfbufs is a read-only glimpse at the kernel configured variable. This parameter nominally scales with kern.maxusers, however it may be necessary to tune accordingly. Even though a socket has been marked as non-blocking, calling &man.sendfile.2; on the non-blocking socket may result in the &man.sendfile.2; call blocking until enough struct sf_buf's are made available. <varname>net.inet.ip.portrange.*</varname> net.inet.ip.portrange.* The net.inet.ip.portrange.* sysctl variables control the port number ranges automatically bound to TCP and UDP sockets. There are three ranges: a low range, a default range, and a high range. Most network programs use the default range which is controlled by the net.inet.ip.portrange.first and net.inet.ip.portrange.last, which default to 1024 and 5000, respectively. Bound port ranges are used for outgoing connections, and it is possible to run the system out of ports under certain circumstances. This most commonly occurs when you are running a heavily loaded web proxy. The port range is not an issue when running servers which handle mainly incoming connections, such as a normal web server, or has a limited number of outgoing connections, such as a mail relay. For situations where you may run yourself out of ports, it is recommended to increase net.inet.ip.portrange.last modestly. A value of 10000, 20000 or 30000 may be reasonable. You should also consider firewall effects when changing the port range. Some firewalls may block large ranges of ports (usually low-numbered ports) and expect systems to use higher ranges of ports for outgoing connections — for this reason it is not recommended that net.inet.ip.portrange.first be lowered. TCP Bandwidth Delay Product TCP Bandwidth Delay Product Limiting net.inet.tcp.inflight.enable The TCP Bandwidth Delay Product Limiting is similar to TCP/Vegas in NetBSD. It can be enabled by setting net.inet.tcp.inflight.enable sysctl variable to 1. The system will attempt to calculate the bandwidth delay product for each connection and limit the amount of data queued to the network to just the amount required to maintain optimum throughput. This feature is useful if you are serving data over modems, Gigabit Ethernet, or even high speed WAN links (or any other link with a high bandwidth delay product), especially if you are also using window scaling or have configured a large send window. If you enable this option, you should also be sure to set net.inet.tcp.inflight.debug to 0 (disable debugging), and for production use setting net.inet.tcp.inflight.min to at least 6144 may be beneficial. However, note that setting high minimums may effectively disable bandwidth limiting depending on the link. The limiting feature reduces the amount of data built up in intermediate route and switch packet queues as well as reduces the amount of data built up in the local host's interface queue. With fewer packets queued up, interactive connections, especially over slow modems, will also be able to operate with lower Round Trip Times. However, note that this feature only effects data transmission (uploading / server side). It has no effect on data reception (downloading). Adjusting net.inet.tcp.inflight.stab is not recommended. This parameter defaults to 20, representing 2 maximal packets added to the bandwidth delay product window calculation. The additional window is required to stabilize the algorithm and improve responsiveness to changing conditions, but it can also result in higher ping times over slow links (though still much lower than you would get without the inflight algorithm). In such cases, you may wish to try reducing this parameter to 15, 10, or 5; and may also have to reduce net.inet.tcp.inflight.min (for example, to 3500) to get the desired effect. Reducing these parameters should be done as a last resort only. In 4.X and earlier releases of &os; the inflight sysctl variables are directly under net.inet.tcp. Their names were (in alphabetic order): net.inet.tcp.inflight_debug, net.inet.tcp.inflight_enable, net.inet.tcp.inflight_max, net.inet.tcp.inflight_min, net.inet.tcp.inflight_stab. Virtual Memory <varname>kern.maxvnodes</varname> A vnode is the internal representation of a file or directory. So increasing the number of vnodes available to the operating system cuts down on disk I/O. Normally this is handled by the operating system and does not need to be changed. In some cases where disk I/O is a bottleneck and the system is running out of vnodes, this setting will need to be increased. The amount of inactive and free RAM will need to be taken into account. To see the current number of vnodes in use: &prompt.root; sysctl vfs.numvnodes vfs.numvnodes: 91349 To see the maximum vnodes: &prompt.root; sysctl kern.maxvnodes kern.maxvnodes: 100000 If the current vnode usage is near the maximum, increasing kern.maxvnodes by a value of 1,000 is probably a good idea. Keep an eye on the number of vfs.numvnodes. If it climbs up to the maximum again, kern.maxvnodes will need to be increased further. A shift in your memory usage as reported by &man.top.1; should be visible. More memory should be active. Adding Swap Space No matter how well you plan, sometimes a system does not run as you expect. If you find you need more swap space, it is simple enough to add. You have three ways to increase swap space: adding a new hard drive, enabling swap over NFS, and creating a swap file on an existing partition. Swap on a New Hard Drive The best way to add swap, of course, is to use this as an excuse to add another hard drive. You can always use another hard drive, after all. If you can do this, go reread the discussion of swap space in of the Handbook for some suggestions on how to best arrange your swap. Swapping over NFS Swapping over NFS is only recommended if you do not have a local hard disk to swap to. Swapping over NFS is slow and inefficient in versions of &os; prior to 4.X. It is reasonably fast and efficient in 4.0-RELEASE and newer. Even with newer versions of &os;, NFS swapping will be limited by the available network bandwidth and puts an additional burden on the NFS server. Swapfiles You can create a file of a specified size to use as a swap file. In our example here we will use a 64MB file called /usr/swap0. You can use any name you want, of course. Creating a Swapfile on &os; 4.X Be certain that your kernel configuration includes the vnode driver. It is not in recent versions of GENERIC. pseudo-device vn 1 #Vnode driver (turns a file into a device) Create a vn-device: &prompt.root; cd /dev &prompt.root; sh MAKEDEV vn0 Create a swapfile (/usr/swap0): &prompt.root; dd if=/dev/zero of=/usr/swap0 bs=1024k count=64 Set proper permissions on (/usr/swap0): &prompt.root; chmod 0600 /usr/swap0 Enable the swap file in /etc/rc.conf: swapfile="/usr/swap0" # Set to name of swapfile if aux swapfile desired. Reboot the machine or to enable the swap file immediately, type: &prompt.root; vnconfig -e /dev/vn0b /usr/swap0 swap Creating a Swapfile on &os; 5.X Be certain that your kernel configuration includes the memory disk driver (&man.md.4;). It is default in GENERIC kernel. device md # Memory "disks" Create a swapfile (/usr/swap0): &prompt.root; dd if=/dev/zero of=/usr/swap0 bs=1024k count=64 Set proper permissions on (/usr/swap0): &prompt.root; chmod 0600 /usr/swap0 Enable the swap file in /etc/rc.conf: swapfile="/usr/swap0" # Set to name of swapfile if aux swapfile desired. Reboot the machine or to enable the swap file immediately, type: &prompt.root; mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0 Hiten Pandya Written by Tom Rhodes Power and Resource Management It is very important to utilize hardware resources in an efficient manner. Before ACPI was introduced, it was very difficult and inflexible for operating systems to manage the power usage and thermal properties of a system. The hardware was controlled by some sort of BIOS embedded interface, such as Plug and Play BIOS (PNPBIOS), or Advanced Power Management (APM) and so on. Power and Resource Management is one of the key components of a modern operating system. For example, you may want an operating system to monitor system limits (and possibly alert you) in case your system temperature increased unexpectedly. In this section of the &os; Handbook, we will provide comprehensive information about ACPI. References will be provided for further reading at the end. Please be aware that ACPI is available on &os; 5.X and above systems as a default kernel module. For &os; 4.9, ACPI can be enabled by adding the line device acpica to a kernel configuration and rebuilding. What Is ACPI? ACPI APM Advanced Configuration and Power Interface (ACPI) is a standard written by an alliance of vendors to provide a standard interface for hardware resources and power management (hence the name). It is a key element in Operating System-directed configuration and Power Management, i.e.: it provides more control and flexibility to the operating system (OS). Modern systems stretched the limits of the current Plug and Play interfaces (such as APM, which is used in &os; 4.X), prior to the introduction of ACPI. ACPI is the direct successor to APM (Advanced Power Management). Shortcomings of Advanced Power Management (APM) The Advanced Power Management (APM) facility controls the power usage of a system based on its activity. The APM BIOS is supplied by the (system) vendor and it is specific to the hardware platform. An APM driver in the OS mediates access to the APM Software Interface, which allows management of power levels. There are four major problems in APM. Firstly, power management is done by the (vendor-specific) BIOS, and the OS does not have any knowledge of it. One example of this, is when the user sets idle-time values for a hard drive in the APM BIOS, that when exceeded, it (BIOS) would spin down the hard drive, without the consent of the OS. Secondly, the APM logic is embedded in the BIOS, and it operates outside the scope of the OS. This means users can only fix problems in their APM BIOS by flashing a new one into the ROM; which is a very dangerous procedure with the potential to leave the system in an unrecoverable state if it fails. Thirdly, APM is a vendor-specific technology, which means that there is a lot of parity (duplication of efforts) and bugs found in one vendor's BIOS, may not be solved in others. Last but not the least, the APM BIOS did not have enough room to implement a sophisticated power policy, or one that can adapt very well to the purpose of the machine. Plug and Play BIOS (PNPBIOS) was unreliable in many situations. PNPBIOS is 16-bit technology, so the OS has to use 16-bit emulation in order to interface with PNPBIOS methods. The &os; APM driver is documented in the &man.apm.4; manual page. Configuring <acronym>ACPI</acronym> The acpi.ko driver is loaded by default at start up by the &man.loader.8; and should not be compiled into the kernel. The reasoning behind this is that modules are easier to work with, say if switching to another acpi.ko without doing a kernel rebuild. This has the advantage of making testing easier. Another reason is that starting ACPI after a system has been brought up is not too useful, and in some cases can be fatal. In doubt, just disable ACPI all together. This driver should not and can not be unloaded because the system bus uses it for various hardware interactions. ACPI can be disabled with the &man.acpiconf.8; utility. In fact most of the interaction with ACPI can be done via &man.acpiconf.8;. Basically this means, if anything about ACPI is in the &man.dmesg.8; output, then most likely it is already running. ACPI and APM cannot coexist and should be used separately. The last one to load will terminate if the driver notices the other running. In the simplest form, ACPI can be used to put the system into a sleep mode with &man.acpiconf.8;, the flag, and a 1-5 option. Most users will only need 1. Option 5 will do a soft-off which is the same action as: &prompt.root; halt -p The other options are available. Check out the &man.acpiconf.8; manual page for more information. Nate Lawson Written by Peter Schultz With contributions from Tom Rhodes Using and Debugging &os; <acronym>ACPI</acronym> ACPI problems ACPI is a fundamentally new way of discovering devices, managing power usage, and providing standardized access to various hardware previously managed by the BIOS. Progress is being made toward ACPI working on all systems, but bugs in some motherboards' ACPI Machine Language (AML) bytecode, incompleteness in &os;'s kernel subsystems, and bugs in the &intel; ACPI-CA interpreter continue to appear. This document is intended to help you assist the &os; ACPI maintainers in identifying the root cause of problems you observe and debugging and developing a solution. Thanks for reading this and we hope we can solve your system's problems. Submitting Debugging Information Before submitting a problem, be sure you are running the latest BIOS version and, if available, embedded controller firmware version. For those of you that want to submit a problem right away, please send the following information to freebsd-acpi@FreeBSD.org: Description of the buggy behavior, including system type and model and anything that causes the bug to appear. Also, please note as accurately as possible when the bug began occurring if it is new for you. The &man.dmesg.8; output after boot -v, including any error messages generated by you exercising the bug. The &man.dmesg.8; output from boot -v with ACPI disabled, if disabling it helps fix the problem. Output from sysctl hw.acpi. This is also a good way of figuring out what features your system offers. URL where your ACPI Source Language (ASL) can be found. Do not send the ASL directly to the list as it can be very large. Generate a copy of your ASL by running this command: &prompt.root; acpidump -t -d > name-system.asl (Substitute your login name for name and manufacturer/model for system. Example: njl-FooCo6000.asl) Most of the developers watch the &a.current; but please submit problems to &a.acpi.name; to be sure it is seen. Please be patient, all of us have full-time jobs elsewhere. If your bug is not immediately apparent, we will probably ask you to submit a PR via &man.send-pr.1;. When entering a PR, please include the same information as requested above. This will help us track the problem and resolve it. Do not send a PR without emailing &a.acpi.name; first as we use PRs as reminders of existing problems, not a reporting mechanism. It is likely that your problem has been reported by someone before. Background ACPI ACPI is present in all modern computers that conform to the ia32 (x86), ia64 (Itanium), and amd64 (AMD) architectures. The full standard has many features including CPU performance management, power planes control, thermal zones, various battery systems, embedded controllers, and bus enumeration. Most systems implement less than the full standard. For instance, a desktop system usually only implements the bus enumeration parts while a laptop might have cooling and battery management support as well. Laptops also have suspend and resume, with their own associated complexity. An ACPI-compliant system has various components. The BIOS and chipset vendors provide various fixed tables (e.g., FADT) in memory that specify things like the APIC map (used for SMP), config registers, and simple configuration values. Additionally, a table of bytecode (the Differentiated System Description Table DSDT) is provided that specifies a tree-like name space of devices and methods. The ACPI driver must parse the fixed tables, implement an interpreter for the bytecode, and modify device drivers and the kernel to accept information from the ACPI subsystem. For &os;, &intel; has provided an interpreter (ACPI-CA) that is shared with Linux and NetBSD. The path to the ACPI-CA source code is src/sys/contrib/dev/acpica. The glue code that allows ACPI-CA to work on &os; is in src/sys/dev/acpica/Osd. Finally, drivers that implement various ACPI devices are found in src/sys/dev/acpica. Common Problems ACPI problems For ACPI to work correctly, all the parts have to work correctly. Here are some common problems, in order of frequency of appearance, and some possible workarounds or fixes. Mouse Issues In some cases, resuming from a suspend operation will cause the mouse to fail. A known work around is to add hint.psm.0.flags="0x3000" to the /boot/loader.conf file. If this does not work then please consider sending a bug report as described above. Suspend/Resume ACPI has three suspend to RAM (STR) states, S1-S3, and one suspend to disk state (STD), called S4. S5 is soft off and is the normal state your system is in when plugged in but not powered up. S4 can actually be implemented two separate ways. S4BIOS is a BIOS-assisted suspend to disk. S4OS is implemented entirely by the operating system. Start by checking sysctl hw.acpi for the suspend-related items. Here are the results for a Thinkpad: hw.acpi.supported_sleep_state: S3 S4 S5 hw.acpi.s4bios: 0 This means that we can use acpiconf -s to test S3, S4OS, and S5. If was one (1), we would have S4BIOS support instead of S4 OS. When testing suspend/resume, start with S1, if supported. This state is most likely to work since it does not require much driver support. No one has implemented S2 but if you have it, it is similar to S1. The next thing to try is S3. This is the deepest STR state and requires a lot of driver support to properly reinitialize your hardware. If you have problems resuming, feel free to email the &a.acpi.name; list but do not expect the problem to be resolved since there are a lot of drivers/hardware that need more testing and work. To help isolate the problem, remove as many drivers from your kernel as possible. If it works, you can narrow down which driver is the problem by loading drivers until it fails again. Typically binary drivers like nvidia.ko, X11 display drivers, and USB will have the most problems while Ethernet interfaces usually work fine. If you can properly load/unload the drivers, you can automate this by putting the appropriate commands in /etc/rc.suspend and /etc/rc.resume. There is a commented-out example for unloading and loading a driver. Try setting to zero (0) if your display is messed up after resume. Try setting longer or shorter values for to see if that helps. Another thing to try is load a recent Linux distribution with ACPI support and test their suspend/resume support on the same hardware. If it works on Linux, it is likely a &os; driver problem and narrowing down which driver causes the problems will help us fix the problem. Note that the ACPI maintainers do not usually maintain other drivers (e.g sound, ATA, etc.) so any work done on tracking down a driver problem should probably eventually be posted to the &a.current.name; list and mailed to the driver maintainer. If you are feeling adventurous, go ahead and start putting some debugging &man.printf.3;s in a problematic driver to track down where in its resume function it hangs. Finally, try disabling ACPI and enabling APM instead. If suspend/resume works with APM, you may be better off sticking with APM, especially on older hardware (pre-2000). It took vendors a while to get ACPI support correct and older hardware is more likely to have BIOS problems with ACPI. System Hangs (temporary or permanent) Most system hangs are a result of lost interrupts or an interrupt storm. Chipsets have a lot of problems based on how the BIOS configures interrupts before boot, correctness of the APIC (MADT) table, and routing of the System Control Interrupt (SCI). interrupt storms Interrupt storms can be distinguished from lost interrupts by checking the output of vmstat -i and looking at the line that has acpi0. If the counter is increasing at more than a couple per second, you have an interrupt storm. If the system appears hung, try breaking to DDB (CTRL ALTESC on console) and type show interrupts. APIC disabling Your best hope when dealing with interrupt problems is to try disabling APIC support with hint.apic.0.disabled="1" in loader.conf. Panics Panics are relatively rare for ACPI and are the top priority to be fixed. The first step is to isolate the steps to reproduce the panic (if possible) and get a backtrace. Follow the advice for enabling options DDB and setting up a serial console (see ) or setting up a &man.dump.8; partition. You can get a backtrace in DDB with tr. If you have to handwrite the backtrace, be sure to at least get the lowest five (5) and top five (5) lines in the trace. Then, try to isolate the problem by booting with ACPI disabled. If that works, you can isolate the ACPI subsystem by using various values of . See the &man.acpi.4; manual page for some examples. System Powers Up After Suspend or Shutdown First, try setting hw.acpi.disable_on_poweroff="0" in &man.loader.conf.5;. This keeps ACPI from disabling various events during the shutdown process. Some systems need this value set to 1 (the default) for the same reason. This usually fixes the problem of a system powering up spontaneously after a suspend or poweroff. Other Problems If you have other problems with ACPI (working with a docking station, devices not detected, etc.), please email a description to the mailing list as well; however, some of these issues may be related to unfinished parts of the ACPI subsystem so they might take a while to be implemented. Please be patient and prepared to test patches we may send you. <acronym>ASL</acronym>, <command>acpidump</command>, and <acronym>IASL</acronym> ACPI ASL The most common problem is the BIOS vendors providing incorrect (or outright buggy!) bytecode. This is usually manifested by kernel console messages like this: ACPI-1287: *** Error: Method execution failed [\\_SB_.PCI0.LPC0.FIGD._STA] \\ (Node 0xc3f6d160), AE_NOT_FOUND Often, you can resolve these problems by updating your BIOS to the latest revision. Most console messages are harmless but if you have other problems like battery status not working, they are a good place to start looking for problems in the AML. The bytecode, known as AML, is compiled from a source language called ASL. The AML is found in the table known as the DSDT. To get a copy of your ASL, use &man.acpidump.8;. You should use both the (show contents of the fixed tables) and (disassemble AML to ASL) options. See the Submitting Debugging Information section for an example syntax. The simplest first check you can do is to recompile your ASL to check for errors. Warnings can usually be ignored but errors are bugs that will usually prevent ACPI from working correctly. To recompile your ASL, issue the following command: &prompt.root; iasl your.asl Fixing Your <acronym>ASL</acronym> ACPI ASL In the long run, our goal is for almost everyone to have ACPI work without any user intervention. At this point, however, we are still developing workarounds for common mistakes made by the BIOS vendors. The µsoft; interpreter (acpi.sys and acpiec.sys) does not strictly check for adherence to the standard, and thus many BIOS vendors who only test ACPI under &windows; never fix their ASL. We hope to continue to identify and document exactly what non-standard behavior is allowed by µsoft;'s interpreter and replicate it so &os; can work without forcing users to fix the ASL. As a workaround and to help us identify behavior, you can fix the ASL manually. If this works for you, please send a &man.diff.1; of the old and new ASL so we can possibly work around the buggy behavior in ACPI-CA and thus make your fix unnecessary. ACPI error messages Here is a list of common error messages, their cause, and how to fix them: _OS dependencies Some AML assumes the world consists of various &windows; versions. You can tell &os; to claim it is any OS to see if this fixes problems you may have. An easy way to override this is to set hw.acpi.osname="Windows 2001" in /boot/loader.conf or other similar strings you find in the ASL. Missing Return statements Some methods do not explicitly return a value as the standard requires. While ACPI-CA does not handle this, &os; has a workaround that allows it to return the value implicitly. You can also add explicit Return statements where required if you know what value should be returned. To force iasl to compile the ASL, use the flag. Overriding the Default <acronym>AML</acronym> After you customize your.asl, you will want to compile it, run: &prompt.root; iasl your.asl You can add the flag to force creation of the AML, even if there are errors during compilation. Remember that some errors (e.g., missing Return statements) are automatically worked around by the interpreter. DSDT.aml is the default output filename for iasl. You can load this instead of your BIOS's buggy copy (which is still present in flash memory) by editing /boot/loader.conf as follows: acpi_dsdt_load="YES" acpi_dsdt_name="/boot/DSDT.aml" Be sure to copy your DSDT.aml to the /boot directory. Getting Debugging Output From <acronym>ACPI</acronym> ACPI problems ACPI debugging The ACPI driver has a very flexible debugging facility. It allows you to specify a set of subsystems as well as the level of verbosity. The subsystems you wish to debug are specified as layers and are broken down into ACPI-CA components (ACPI_ALL_COMPONENTS) and ACPI hardware support (ACPI_ALL_DRIVERS). The verbosity of debugging output is specified as the level and ranges from ACPI_LV_ERROR (just report errors) to ACPI_LV_VERBOSE (everything). The level is a bitmask so multiple options can be set at once, separated by spaces. In practice, you will want to use a serial console to log the output if it is so long it flushes the console message buffer. A full list of the individual layers and levels is found in the &man.acpi.4; manual page. Debugging output is not enabled by default. To enable it, add options ACPI_DEBUG to your kernel configuration file if ACPI is compiled into the kernel. You can add ACPI_DEBUG=1 to your /etc/make.conf to enable it globally. If it is a module, you can recompile just your acpi.ko module as follows: &prompt.root; cd /sys/modules/acpi/acpi && make clean && make ACPI_DEBUG=1 Install acpi.ko in /boot/kernel and add your desired level and layer to loader.conf. This example enables debug messages for all ACPI-CA components and all ACPI hardware drivers (CPU, LID, etc.) It will only output error messages, the least verbose level. debug.acpi.layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS" debug.acpi.level="ACPI_LV_ERROR" If the information you want is triggered by a specific event (say, a suspend and then resume), you can leave out changes to loader.conf and instead use sysctl to specify the layer and level after booting and preparing your system for the specific event. The sysctls are named the same as the tunables in loader.conf. References More information about ACPI may be found in the following locations: The &a.acpi; The ACPI Mailing List Archives The old ACPI Mailing List Archives The ACPI 2.0 Specification &os; Manual pages: &man.acpi.4;, &man.acpi.thermal.4;, &man.acpidump.8;, &man.iasl.8;, &man.acpidb.8; DSDT debugging resource. (Uses Compaq as an example but generally useful.) diff --git a/zh_TW.Big5/books/handbook/disks/chapter.sgml b/zh_TW.Big5/books/handbook/disks/chapter.sgml index 0ee4475317..d767f4a0d1 100644 --- a/zh_TW.Big5/books/handbook/disks/chapter.sgml +++ b/zh_TW.Big5/books/handbook/disks/chapter.sgml @@ -1,3904 +1,4130 @@ - Storage + Àx¦s´CÅé - Synopsis + ·§­z - This chapter covers the use of disks in FreeBSD. This - includes memory-backed disks, network-attached disks, - standard SCSI/IDE storage devices, and devices using the USB - interface. + ¥»³¹²[»\¦p¦ó¦b FreeBSD ¤U¨Ï¥ÎºÐ¤ù¸Ë¸m¡A¥]§t + memory-backed disk (¥Î°O¾ÐÅé§@¬°µwºÐ¨Ï¥Î)¡B¸óºô¸ô¨Ï¥ÎªºµwºÐ¡B + ¼Ð·Ç SCSI/IDE µwºÐ¡BUSB ¤¶­±ªº³]³Æµ¥¡C - After reading this chapter, you will know: + ¾\Ū¥»³¹«á¡A±z¸Ë¾Ç·|¡G - The terminology FreeBSD uses to describe the - organization of data on a physical disk (partitions and slices). + FreeBSD ¦p¦ó´y­z¸ê®Æ¦bµwºÐ¤Wªº¹º¤À±¡§Î + (partition ©M slices)¡C - How to add additional hard disks to your system. + ¦p¦ó¦b¨t²Î¤W¥[¤JµwºÐ - How to configure &os; to use USB storage devices. + ¦p¦ó³]©w &os; ¨Ó¨Ï¥Î USB ¸Ë¸m¡C - How to set up virtual file systems, such as memory - disks. + ¦p¦ó³]©wµêÀÀÀɮרt²Î (virtual file systems), + ¨Ò¦p memory disks (¥Î°O¾ÐÅé§@¬°µwºÐ¨Ï¥Î)¡C - How to use quotas to limit disk space usage. + ¦p¦ó¥Î quota ¨Ó­­¨îµwºÐªÅ¶¡ªº¨Ï¥Î¡C - How to encrypt disks to secure them against attackers. + ¦p¦ó¹ïµwºÐ¥[±K¥HÀ³¥I§ðÀ»¡C - How to create and burn CDs and DVDs on FreeBSD. + ¦p¦ó¦b FreeBSD ¤U«Ø¥ß¡B¿N¿ý CD ©M DVD¡C - The various storage media options for backups. + ¦UºØ¤£¦Pªº³Æ¥÷³]³Æ¡C - How to use backup programs available under FreeBSD. + ¦p¦ó¨Ï¥Î FreeBSD ´£¨Ñªº³Æ¥÷¤u¨ã¡C - How to backup to floppy disks. + ¦p¦ó³Æ¥÷¨ì³nºÐ¡C - What snapshots are and how to use them efficiently. + ¤°»ò¬O snapshots ¡A¥B¦p¦ó¦³®Ä²v¦a¨Ï¥Î¤§¡C - Before reading this chapter, you should: + ¦b¾\Ū¤§«e¡A±zÀ³¸Ó¡G - Know how to configure and install a new FreeBSD kernel + ª¾¹D¦p¦ó°t¸m¡B¦w¸Ë·sªº FreeBSD ®Ö¤ß¡C (). - Device Names + ¸Ë¸m¦WºÙ - The following is a list of physical storage devices - supported in FreeBSD, and the device names associated with - them. + ¤U­±¬O FreeBSD ¤ä´©ªºÀx¦s´CÅé¦Cªí¡A¤Î¥¦­Ì¹ïÀ³ªº¸Ë¸m¦WºÙ¡C - Physical Disk Naming Conventions + ©R¦W³W«h - Drive type - Drive device name + ¸Ë¸mÃþ«¬ + ¸Ë¸m¦WºÙ - IDE hard drives + IDE µwºÐ¾÷ ad - IDE CDROM drives + IDE ¥úºÐ¾÷ acd - SCSI hard drives and USB Mass storage devices + SCSI µwºÐ¾÷©M USB ºÐ da - SCSI CDROM drives + SCSI ¥úºÐ¾÷ cd - Assorted non-standard CDROM drives - mcd for Mitsumi CD-ROM, - scd for Sony CD-ROM, - matcd for Matsushita/Panasonic CD-ROM + «D¼Ð·Ç³W®æ¥úºÐ¾÷ + Mitsumi ¥úºÐ¾÷¥Î mcd¡A + Sony ¥úºÐ¾÷¥Î scd¡A + Matsushita/Pansonic ¥úºÐ¾÷¥Î matcd - The &man.matcd.4; driver has been removed - in FreeBSD 4.X branch since October 5th, - 2002 and does not exist in FreeBSD 5.0 and - later releases. + 2002 ¦~ 10 ¤ë 5 ¤é FreeBSD 4.X ²¾°£¤F &man.matcd.4; ÅX°Êµ{¦¡¡A + ¦]¦¹ FreeBSD 5.0 ¤Î¥H«áªºª©¥»¤£¦A¤ä´©¡C - Floppy drives + ³nºÐ¾÷ fd - SCSI tape drives + SCSI ºÐ±a¾÷ sa - IDE tape drives + IDE ºÐ±a¾÷ ast - Flash drives - fla for &diskonchip; Flash device + Flash ºÏºÐ¾÷ + &diskonchip; Flash ºÏºÐ¾÷¥Î fla - RAID drives - aacd for &adaptec; AdvancedRAID, - mlxd and mlyd - for &mylex;, - amrd for AMI &megaraid;, - idad for Compaq Smart RAID, - twed for &tm.3ware; RAID. + RAID ºÏºÐ¾÷ + &adaptec; AdvancedRAID ¥Îaacd¡A + &mylex; ¥Î mlxd ©M mlyd¡A + AMI &megaraid; ¥Î amrd¡A + Compaq Smart RAID ¥Î idad¡A + &tm.3ware; RAID ¥Î twed¡C
David O'Brien Originally contributed by - Adding Disks + ·s¼WµwºÐ - disks + disk adding - Lets say we want to add a new SCSI disk to a machine that - currently only has a single drive. First turn off the computer - and install the drive in the computer following the instructions - of the computer, controller, and drive manufacturer. Due to the - wide variations of procedures to do this, the details are beyond - the scope of this document. - - Login as user root. After you have installed the - drive, inspect /var/run/dmesg.boot to ensure the new - disk was found. Continuing with our example, the newly added drive will - be da1 and we want to mount it on - /1 (if you are adding an IDE drive, the device name - will be wd1 in pre-4.0 systems, or - ad1 in 4.X and 5.X systems). + °²³]§Ú­Ì·Q·s¼W SCSI µwºÐ¨ì¤@»O­ì¥ý¥u¦³¤@ÁûµwºÐªº¾÷¾¹¤W¡A + ­º¥ý±N¹q¸£Ãö¾÷¡A¨Ì»s³y°Óªº«ü¥Ü±NµwºÐ¸Ë¤W¥h¡A + ¸Ô²Óªº¾Þ§@¤è¦¡½Ð°Ñ¦Ò»s³y°Óªº»¡©ú¤å¥ó¡C + + ¦w¸Ë¦nµwºÐ«á¡A¥Î root µn¤J¨t²Î¡A + ¬Ý¤@¤U /var/run/dmesg.boot ¥H½T»{¨t²Î¬O§_§ì¨ì·sµwºÐ¡C + Ä~Äò­è¤~ªº½d¨Ò¡A·s¼WªºµwºÐ·|¬O da1¡A + °²³]§Ú­Ì·Q±N¥¦±¾¸ü¨ì /1 ³o­Ó¦ì¸m + (¦pªG±z·s¼Wªº¬O IDE µwºÐªº¸Ü¡A4.0 ¤§«eªº¨t²Î¬O + wd1¡A4.X ¤Î¤§«áªº¨t²Î«h¬O + ad1)¡C partitions slices fdisk - FreeBSD runs on IBM-PC compatible computers, therefore it must - take into account the PC BIOS partitions. These are different - from the traditional BSD partitions. A PC disk has up to four - BIOS partition entries. If the disk is going to be truly - dedicated to FreeBSD, you can use the - dedicated mode. Otherwise, FreeBSD will - have to live within one of the PC BIOS partitions. FreeBSD - calls the PC BIOS partitions slices so as - not to confuse them with traditional BSD partitions. You may - also use slices on a disk that is dedicated to FreeBSD, but used - in a computer that also has another operating system installed. - This is a good way to avoid confusing the fdisk utility of - other, non-FreeBSD operating systems. - - In the slice case the drive will be added as - /dev/da1s1e. This is read as: SCSI disk, - unit number 1 (second SCSI disk), slice 1 (PC BIOS partition 1), - and e BSD partition. In the dedicated - case, the drive will be added simply as - /dev/da1e. - - Due to the use of 32-bit integers to store the number of sectors, - &man.bsdlabel.8; (called &man.disklabel.8; in &os; 4.X) is - limited to 2^32-1 sectors per disk or 2TB in most cases. The - &man.fdisk.8; format allows a starting sector of no more than - 2^32-1 and a length of no more than 2^32-1, limiting partitions to - 2TB and disks to 4TB in most cases. The &man.sunlabel.8; format - is limited to 2^32-1 sectors per partition and 8 partitions for - a total of 16TB. For larger disks, &man.gpt.8; partitions may be - used. + FreeBSD ¬°¤F¦b IBM-PC ¬Û®e¹q¸£¤W°õ¦æ¡A + ¥²¶·°t¦X PC BIOS partition¡A¦]¦¹©M¶Ç²Îªº BSD partition ¦³«Ü¤jªº¤£¦P¡C + ¦b PC ¸ÌµwºÐ³Ì¦h¥i¥H¦³¥|µ§ BIOS partition ¸ê°T(¥ç§Y³Ì¦h¥i¤À³Î¦¨¥|­Ó + partition)¡C¦pªG³o­ÓµwºÐ¥´ºâ¥þ³¡Åý FreeBSD ¨Ï¥Î¡A¥i¿ï¾Ü + dedicated ¼Ò¦¡¡A + ¤£µMªº¸Ü FreeBSD ¥²¶·¸m¨­©ó¨ä¤¤¤@­Ó PC BIOS partition ¤¤¡C + ¦b FreeBSD ¸Ì¡APC BIOS partition ºÙ¬° slice¡A + ³o¬O¬°¤F¤£­n©M¶Ç²Îªº BSD partition ·d²V¤F¡C + ¤£½×¬O§¹¥þ¥Ñ FreeBSD ¨Ï¥ÎªºµwºÐ¡AÁÙ¬O¦w¸Ë¤F¨ä¥¦§@·~¨t²ÎªºµwºÐ¡A + ±z³£¥i¥H¨Ï¥Î slice¡C³o¼Ëªº¦n³B¬O¡A¨ä¥¦«D FreeBSD §@·~¨t²Îªº + fdisk ¤u¨ã¥i¥H¶¶§Q¾Þ§@¡C + + ¦pªG¨Ï¥Î slice¡A³o­Ó·s¼WªºµwºÐ·|¬O + /dev/da1s1e¡C¥i¥H³o¼Ë¨Ó¸ÑŪ¥¦¡GSCSI µwºÐ¡B + unit number 1(²Ä¤G­Ó SCSI µwºÐ)¡Bslice 1(²Ä¤@­Ó PC BIOS partition)¡B + ¤Î e BSD partition¡C¦b dedicated ¼Ò¦¡ªº¸Ü¡A + ·sµwºÐ«h¬O /dev/da1e¡C + + ¦]¬° &man.bsdlabel.8;(¦b &os; 4.X ºÙ¬° &man.disklabel.8;) + ¥Î 32-bit ¾ã¼Æ¨ÓÀx¦s sector(ºÏ°Ï) ¼Æ¡A + ¦]¦¹­­¨î¤@­ÓµwºÐ³Ì¤j¥u¯à¦³ 2^32-1 ­Ó sector¡A¥ç§Y 2TB ªºªÅ¶¡¡C + ¦Ó &man.fdisk.8; ªº®æ¦¡®e³\°_©l sector ½s¸¹¤£¶W¹L 2^32-1¡A + ªø«×¤]¤£¶W¹L 2^32-1¡A¦]¦¹ partition ³Ì¤jªÅ¶¡¬O 2TB¡A¦ÓµwºÐ³Ì¤j¬O 4TB¡C + &man.sunlabel.8; «h­­¨î partition ³Ì¤j¬O 2TB¡AµwºÐ³Ì¦h¥i¦³ 8 ­Ó partition¡A + ¦]¦¹³Ì¤j¬O 16TB¡C¦pªG­n¨Ï¥Î§ó¤jªºµwºÐ¡A½Ð¨Ï¥Î &man.gpt.8;¡C Using &man.sysinstall.8; sysinstall adding disks su Navigating <application>Sysinstall</application> You may use sysinstall (/stand/sysinstall in &os; versions older than 5.2) to partition and label a new disk using its easy to use menus. Either login as user root or use the su command. Run sysinstall and enter the Configure menu. Within the FreeBSD Configuration Menu, scroll down and select the Fdisk option. <application>fdisk</application> Partition Editor Once inside fdisk, typing A will use the entire disk for FreeBSD. When asked if you want to remain cooperative with any future possible operating systems, answer YES. Write the changes to the disk using W. Now exit the FDISK editor by typing q. Next you will be asked about the Master Boot Record. Since you are adding a disk to an already running system, choose None. Disk Label Editor BSD partitions Next, you need to exit sysinstall and start it again. Follow the directions above, although this time choose the Label option. This will enter the Disk Label Editor. This is where you will create the traditional BSD partitions. A disk can have up to eight partitions, labeled a-h. A few of the partition labels have special uses. The a partition is used for the root partition (/). Thus only your system disk (e.g, the disk you boot from) should have an a partition. The b partition is used for swap partitions, and you may have many disks with swap partitions. The c partition addresses the entire disk in dedicated mode, or the entire FreeBSD slice in slice mode. The other partitions are for general use. sysinstall's Label editor favors the e partition for non-root, non-swap partitions. Within the Label editor, create a single file system by typing C. When prompted if this will be a FS (file system) or swap, choose FS and type in a mount point (e.g, /mnt). When adding a disk in post-install mode, sysinstall will not create entries in /etc/fstab for you, so the mount point you specify is not important. You are now ready to write the new label to the disk and create a file system on it. Do this by typing W. Ignore any errors from sysinstall that it could not mount the new partition. Exit the Label Editor and sysinstall completely. Finish The last step is to edit /etc/fstab to add an entry for your new disk. Using Command Line Utilities Using Slices This setup will allow your disk to work correctly with other operating systems that might be installed on your computer and will not confuse other operating systems' fdisk utilities. It is recommended to use this method for new disk installs. Only use dedicated mode if you have a good reason to do so! &prompt.root; dd if=/dev/zero of=/dev/da1 bs=1k count=1 &prompt.root; fdisk -BI da1 #Initialize your new disk &prompt.root; disklabel -B -w -r da1s1 auto #Label it. &prompt.root; disklabel -e da1s1 # Edit the disklabel just created and add any partitions. &prompt.root; mkdir -p /1 &prompt.root; newfs /dev/da1s1e # Repeat this for every partition you created. &prompt.root; mount /dev/da1s1e /1 # Mount the partition(s) &prompt.root; vi /etc/fstab # Add the appropriate entry/entries to your /etc/fstab. If you have an IDE disk, substitute ad for da. On pre-4.X systems use wd. Dedicated OS/2 If you will not be sharing the new drive with another operating system, you may use the dedicated mode. Remember this mode can confuse Microsoft operating systems; however, no damage will be done by them. IBM's &os2; however, will appropriate any partition it finds which it does not understand. &prompt.root; dd if=/dev/zero of=/dev/da1 bs=1k count=1 &prompt.root; disklabel -Brw da1 auto &prompt.root; disklabel -e da1 # create the `e' partition &prompt.root; newfs -d0 /dev/da1e &prompt.root; mkdir -p /1 &prompt.root; vi /etc/fstab # add an entry for /dev/da1e &prompt.root; mount /1 An alternate method is: &prompt.root; dd if=/dev/zero of=/dev/da1 count=2 &prompt.root; disklabel /dev/da1 | disklabel -BrR da1 /dev/stdin &prompt.root; newfs /dev/da1e &prompt.root; mkdir -p /1 &prompt.root; vi /etc/fstab # add an entry for /dev/da1e &prompt.root; mount /1 Since &os; 5.1-RELEASE, the &man.bsdlabel.8; utility replaces the old &man.disklabel.8; program. With &man.bsdlabel.8; a number of obsolete options and parameters have been retired; in the examples above the option should be removed with &man.bsdlabel.8;. For more information, please refer to the &man.bsdlabel.8; manual page. RAID Software RAID Christopher Shumway Original work by Jim Brown Revised by RAIDsoftware RAIDCCD Concatenated Disk Driver (CCD) Configuration When choosing a mass storage solution the most important factors to consider are speed, reliability, and cost. It is rare to have all three in balance; normally a fast, reliable mass storage device is expensive, and to cut back on cost either speed or reliability must be sacrificed. In designing the system described below, cost was chosen as the most important factor, followed by speed, then reliability. Data transfer speed for this system is ultimately constrained by the network. And while reliability is very important, the CCD drive described below serves online data that is already fully backed up on CD-R's and can easily be replaced. Defining your own requirements is the first step in choosing a mass storage solution. If your requirements prefer speed or reliability over cost, your solution will differ from the system described in this section. Installing the Hardware In addition to the IDE system disk, three Western Digital 30GB, 5400 RPM IDE disks form the core of the CCD disk described below providing approximately 90GB of online storage. Ideally, each IDE disk would have its own IDE controller and cable, but to minimize cost, additional IDE controllers were not used. Instead the disks were configured with jumpers so that each IDE controller has one master, and one slave. Upon reboot, the system BIOS was configured to automatically detect the disks attached. More importantly, FreeBSD detected them on reboot: ad0: 19574MB <WDC WD205BA> [39770/16/63] at ata0-master UDMA33 ad1: 29333MB <WDC WD307AA> [59598/16/63] at ata0-slave UDMA33 ad2: 29333MB <WDC WD307AA> [59598/16/63] at ata1-master UDMA33 ad3: 29333MB <WDC WD307AA> [59598/16/63] at ata1-slave UDMA33 If FreeBSD does not detect all the disks, ensure that you have jumpered them correctly. Most IDE drives also have a Cable Select jumper. This is not the jumper for the master/slave relationship. Consult the drive documentation for help in identifying the correct jumper. Next, consider how to attach them as part of the file system. You should research both &man.vinum.8; () and &man.ccd.4;. In this particular configuration, &man.ccd.4; was chosen. Setting Up the CCD The &man.ccd.4; driver allows you to take several identical disks and concatenate them into one logical file system. In order to use &man.ccd.4;, you need a kernel with &man.ccd.4; support built in. Add this line to your kernel configuration file, rebuild, and reinstall the kernel: pseudo-device ccd 4 On 5.X systems, you have to use instead the following line: device ccd In FreeBSD 5.X, it is not necessary to specify a number of &man.ccd.4; devices, as the &man.ccd.4; device driver is now self-cloning — new device instances will automatically be created on demand. The &man.ccd.4; support can also be loaded as a kernel loadable module in FreeBSD 3.0 or later. To set up &man.ccd.4;, you must first use &man.disklabel.8; to label the disks: disklabel -r -w ad1 auto disklabel -r -w ad2 auto disklabel -r -w ad3 auto This creates a disklabel for ad1c, ad2c and ad3c that spans the entire disk. Since &os; 5.1-RELEASE, the &man.bsdlabel.8; utility replaces the old &man.disklabel.8; program. With &man.bsdlabel.8; a number of obsolete options and parameters have been retired; in the examples above the option should be removed. For more information, please refer to the &man.bsdlabel.8; manual page. The next step is to change the disk label type. You can use &man.disklabel.8; to edit the disks: disklabel -e ad1 disklabel -e ad2 disklabel -e ad3 This opens up the current disk label on each disk with the editor specified by the EDITOR environment variable, typically &man.vi.1;. An unmodified disk label will look something like this: 8 partitions: # size offset fstype [fsize bsize bps/cpg] c: 60074784 0 unused 0 0 0 # (Cyl. 0 - 59597) Add a new e partition for &man.ccd.4; to use. This can usually be copied from the c partition, but the must be 4.2BSD. The disk label should now look something like this: 8 partitions: # size offset fstype [fsize bsize bps/cpg] c: 60074784 0 unused 0 0 0 # (Cyl. 0 - 59597) e: 60074784 0 4.2BSD 0 0 0 # (Cyl. 0 - 59597) Building the File System The device node for ccd0c may not exist yet, so to create it, perform the following commands: cd /dev sh MAKEDEV ccd0 In FreeBSD 5.0, &man.devfs.5; will automatically manage device nodes in /dev, so use of MAKEDEV is not necessary. Now that you have all the disks labeled, you must build the &man.ccd.4;. To do that, use &man.ccdconfig.8;, with options similar to the following: ccdconfig ccd0 32 0 /dev/ad1e /dev/ad2e /dev/ad3e The use and meaning of each option is shown below: The first argument is the device to configure, in this case, /dev/ccd0c. The /dev/ portion is optional. The interleave for the file system. The interleave defines the size of a stripe in disk blocks, each normally 512 bytes. So, an interleave of 32 would be 16,384 bytes. Flags for &man.ccdconfig.8;. If you want to enable drive mirroring, you can specify a flag here. This configuration does not provide mirroring for &man.ccd.4;, so it is set at 0 (zero). The final arguments to &man.ccdconfig.8; are the devices to place into the array. Use the complete pathname for each device. After running &man.ccdconfig.8; the &man.ccd.4; is configured. A file system can be installed. Refer to &man.newfs.8; for options, or simply run: newfs /dev/ccd0c Making it All Automatic Generally, you will want to mount the &man.ccd.4; upon each reboot. To do this, you must configure it first. Write out your current configuration to /etc/ccd.conf using the following command: ccdconfig -g > /etc/ccd.conf During reboot, the script /etc/rc runs ccdconfig -C if /etc/ccd.conf exists. This automatically configures the &man.ccd.4; so it can be mounted. If you are booting into single user mode, before you can &man.mount.8; the &man.ccd.4;, you need to issue the following command to configure the array: ccdconfig -C To automatically mount the &man.ccd.4;, place an entry for the &man.ccd.4; in /etc/fstab so it will be mounted at boot time: /dev/ccd0c /media ufs rw 2 2 The Vinum Volume Manager RAIDsoftware RAID Vinum The Vinum Volume Manager is a block device driver which implements virtual disk drives. It isolates disk hardware from the block device interface and maps data in ways which result in an increase in flexibility, performance and reliability compared to the traditional slice view of disk storage. &man.vinum.8; implements the RAID-0, RAID-1 and RAID-5 models, both individually and in combination. See for more information about &man.vinum.8;. Hardware RAID RAID hardware FreeBSD also supports a variety of hardware RAID controllers. These devices control a RAID subsystem without the need for FreeBSD specific software to manage the array. Using an on-card BIOS, the card controls most of the disk operations itself. The following is a brief setup description using a Promise IDE RAID controller. When this card is installed and the system is started up, it displays a prompt requesting information. Follow the instructions to enter the card's setup screen. From here, you have the ability to combine all the attached drives. After doing so, the disk(s) will look like a single drive to FreeBSD. Other RAID levels can be set up accordingly. Rebuilding ATA RAID1 Arrays FreeBSD allows you to hot-replace a failed disk in an array. This requires that you catch it before you reboot. You will probably see something like the following in /var/log/messages or in the &man.dmesg.8; output: ad6 on monster1 suffered a hard error. ad6: READ command timeout tag=0 serv=0 - resetting ad6: trying fallback to PIO mode ata3: resetting devices .. done ad6: hard error reading fsbn 1116119 of 0-7 (ad6 bn 1116119; cn 1107 tn 4 sn 11)\\ status=59 error=40 ar0: WARNING - mirror lost Using &man.atacontrol.8;, check for further information: &prompt.root; atacontrol list ATA channel 0: Master: no device present Slave: acd0 <HL-DT-ST CD-ROM GCR-8520B/1.00> ATA/ATAPI rev 0 ATA channel 1: Master: no device present Slave: no device present ATA channel 2: Master: ad4 <MAXTOR 6L080J4/A93.0500> ATA/ATAPI rev 5 Slave: no device present ATA channel 3: Master: ad6 <MAXTOR 6L080J4/A93.0500> ATA/ATAPI rev 5 Slave: no device present &prompt.root; atacontrol status ar0 ar0: ATA RAID1 subdisks: ad4 ad6 status: DEGRADED You will first need to detach the ata channel with the failed disk so you can safely remove it: &prompt.root; atacontrol detach ata3 Replace the disk. Reattach the ata channel: &prompt.root; atacontrol attach ata3 Master: ad6 <MAXTOR 6L080J4/A93.0500> ATA/ATAPI rev 5 Slave: no device present Add the new disk to the array as a spare: &prompt.root; atacontrol addspare ar0 ad6 Rebuild the array: &prompt.root; atacontrol rebuild ar0 It is possible to check on the progress by issuing the following command: &prompt.root; dmesg | tail -10 [output removed] ad6: removed from configuration ad6: deleted from ar0 disk1 ad6: inserted into ar0 disk1 as spare &prompt.root; atacontrol status ar0 ar0: ATA RAID1 subdisks: ad4 ad6 status: REBUILDING 0% completed Wait until this operation completes. Marc Fonvieille Contributed by USB Storage Devices USB disks A lot of external storage solutions, nowadays, use the Universal Serial Bus (USB): hard drives, USB thumbdrives, CD-R burners, etc. &os; provides support for these devices. Configuration The USB mass storage devices driver, &man.umass.4;, provides the support for USB storage devices. If you use the GENERIC kernel, you do not have to change anything in your configuration. If you use a custom kernel, be sure that the following lines are present in your kernel configuration file: device scbus device da device pass device uhci device ohci device usb device umass The &man.umass.4; driver uses the SCSI subsystem to access to the USB storage devices, your USB device will be seen as a SCSI device by the system. Depending on the USB chipset on your motherboard, you only need either device uhci or device ohci, however having both in the kernel configuration file is harmless. Do not forget to compile and install the new kernel if you added any lines. If your USB device is a CD-R or DVD burner, the SCSI CD-ROM driver, &man.cd.4;, must be added to the kernel via the line: device cd Since the burner is seen as a SCSI drive, the driver &man.atapicam.4; should not be used in the kernel configuration. Support for USB 2.0 controllers is provided on &os; 5.X, and on the 4.X branch since &os; 4.10-RELEASE. You have to add: device ehci to your configuration file for USB 2.0 support. Note &man.uhci.4; and &man.ohci.4; drivers are still needed if you want USB 1.X support. On &os; 4.X, the USB daemon (&man.usbd.8;) must be running to be able to see some USB devices. To enable it, add usbd_enable="YES" to your /etc/rc.conf file and reboot the machine. Testing the Configuration The configuration is ready to be tested: plug in your USB device, and in the system message buffer (&man.dmesg.8;), the drive should appear as something like: umass0: USB Solid state disk, rev 1.10/1.00, addr 2 GEOM: create disk da0 dp=0xc2d74850 da0 at umass-sim0 bus 0 target 0 lun 0 da0: <Generic Traveling Disk 1.11> Removable Direct Access SCSI-2 device da0: 1.000MB/s transfers da0: 126MB (258048 512 byte sectors: 64H 32S/T 126C) Of course, the brand, the device node (da0) and other details can differ according to your configuration. Since the USB device is seen as a SCSI one, the camcontrol command can be used to list the USB storage devices attached to the system: &prompt.root; camcontrol devlist <Generic Traveling Disk 1.11> at scbus0 target 0 lun 0 (da0,pass0) If the drive comes with a file system, you should be able to mount it. The will help you to format and create partitions on the USB drive if needed. If you unplug the device (the disk must be unmounted before), you should see, in the system message buffer, something like the following: umass0: at uhub0 port 1 (addr 2) disconnected (da0:umass-sim0:0:0:0): lost device (da0:umass-sim0:0:0:0): removing device entry GEOM: destroy disk da0 dp=0xc2d74850 umass0: detached Further Reading Beside the Adding Disks and Mounting and Unmounting File Systems sections, reading various manual pages may be also useful: &man.umass.4;, &man.camcontrol.8;, and &man.usbdevs.8;. Mike Meyer Contributed by Creating and Using Optical Media (CDs) CDROMs creating Introduction CDs have a number of features that differentiate them from conventional disks. Initially, they were not writable by the user. They are designed so that they can be read continuously without delays to move the head between tracks. They are also much easier to transport between systems than similarly sized media were at the time. CDs do have tracks, but this refers to a section of data to be read continuously and not a physical property of the disk. To produce a CD on FreeBSD, you prepare the data files that are going to make up the tracks on the CD, then write the tracks to the CD. ISO 9660 file systems ISO 9660 The ISO 9660 file system was designed to deal with these differences. It unfortunately codifies file system limits that were common then. Fortunately, it provides an extension mechanism that allows properly written CDs to exceed those limits while still working with systems that do not support those extensions. sysutils/cdrtools The sysutils/cdrtools port includes &man.mkisofs.8;, a program that you can use to produce a data file containing an ISO 9660 file system. It has options that support various extensions, and is described below. CD burner ATAPI Which tool to use to burn the CD depends on whether your CD burner is ATAPI or something else. ATAPI CD burners use the burncd program that is part of the base system. SCSI and USB CD burners should use cdrecord from the sysutils/cdrtools port. burncd has a limited number of supported drives. To find out if a drive is supported, see the CD-R/RW supported drives list. CD burner ATAPI/CAM driver If you run &os; 5.X, &os; 4.8-RELEASE version or higher, it will be possible to use cdrecord and other tools for SCSI drives on an ATAPI hardware with the ATAPI/CAM module. If you want a CD burning software with a graphical user interface, you should have a look to X-CD-Roast or K3b. These tools are available as packages or from the sysutils/xcdroast and sysutils/k3b ports. X-CD-Roast and K3b require the ATAPI/CAM module with ATAPI hardware. mkisofs The &man.mkisofs.8; program, which is part of the sysutils/cdrtools port, produces an ISO 9660 file system that is an image of a directory tree in the &unix; file system name space. The simplest usage is: &prompt.root; mkisofs -o imagefile.iso /path/to/tree file systems ISO 9660 This command will create an imagefile.iso containing an ISO 9660 file system that is a copy of the tree at /path/to/tree. In the process, it will map the file names to names that fit the limitations of the standard ISO 9660 file system, and will exclude files that have names uncharacteristic of ISO file systems. file systems HFS file systems Joliet A number of options are available to overcome those restrictions. In particular, enables the Rock Ridge extensions common to &unix; systems, enables Joliet extensions used by Microsoft systems, and can be used to create HFS file systems used by &macos;. For CDs that are going to be used only on FreeBSD systems, can be used to disable all filename restrictions. When used with , it produces a file system image that is identical to the FreeBSD tree you started from, though it may violate the ISO 9660 standard in a number of ways. CDROMs creating bootable The last option of general use is . This is used to specify the location of the boot image for use in producing an El Torito bootable CD. This option takes an argument which is the path to a boot image from the top of the tree being written to the CD. By default, &man.mkisofs.8; creates an ISO image in the so-called floppy disk emulation mode, and thus expects the boot image to be exactly 1200, 1440 or 2880 KB in size. Some boot loaders, like the one used by the FreeBSD distribution disks, do not use emulation mode; in this case, the option should be used. So, if /tmp/myboot holds a bootable FreeBSD system with the boot image in /tmp/myboot/boot/cdboot, you could produce the image of an ISO 9660 file system in /tmp/bootable.iso like so: &prompt.root; mkisofs -R -no-emul-boot -b boot/cdboot -o /tmp/bootable.iso /tmp/myboot Having done that, if you have vn (FreeBSD 4.X), or md (FreeBSD 5.X) configured in your kernel, you can mount the file system with: &prompt.root; vnconfig -e vn0c /tmp/bootable.iso &prompt.root; mount -t cd9660 /dev/vn0c /mnt for FreeBSD 4.X, and for FreeBSD 5.X: &prompt.root; mdconfig -a -t vnode -f /tmp/bootable.iso -u 0 &prompt.root; mount -t cd9660 /dev/md0 /mnt At which point you can verify that /mnt and /tmp/myboot are identical. There are many other options you can use with &man.mkisofs.8; to fine-tune its behavior. In particular: modifications to an ISO 9660 layout and the creation of Joliet and HFS discs. See the &man.mkisofs.8; manual page for details. burncd CDROMs burning If you have an ATAPI CD burner, you can use the burncd command to burn an ISO image onto a CD. burncd is part of the base system, installed as /usr/sbin/burncd. Usage is very simple, as it has few options: &prompt.root; burncd -f cddevice data imagefile.iso fixate Will burn a copy of imagefile.iso on cddevice. The default device is /dev/acd0 (or /dev/acd0c under &os; 4.X). See &man.burncd.8; for options to set the write speed, eject the CD after burning, and write audio data. cdrecord If you do not have an ATAPI CD burner, you will have to use cdrecord to burn your CDs. cdrecord is not part of the base system; you must install it from either the port at sysutils/cdrtools or the appropriate package. Changes to the base system can cause binary versions of this program to fail, possibly resulting in a coaster. You should therefore either upgrade the port when you upgrade your system, or if you are tracking -STABLE, upgrade the port when a new version becomes available. While cdrecord has many options, basic usage is even simpler than burncd. Burning an ISO 9660 image is done with: &prompt.root; cdrecord dev=device imagefile.iso The tricky part of using cdrecord is finding the to use. To find the proper setting, use the flag of cdrecord, which might produce results like this: CDROMs burning &prompt.root; cdrecord -scanbus Cdrecord 1.9 (i386-unknown-freebsd4.2) Copyright (C) 1995-2000 Jörg Schilling Using libscg version 'schily-0.1' scsibus0: 0,0,0 0) 'SEAGATE ' 'ST39236LW ' '0004' Disk 0,1,0 1) 'SEAGATE ' 'ST39173W ' '5958' Disk 0,2,0 2) * 0,3,0 3) 'iomega ' 'jaz 1GB ' 'J.86' Removable Disk 0,4,0 4) 'NEC ' 'CD-ROM DRIVE:466' '1.26' Removable CD-ROM 0,5,0 5) * 0,6,0 6) * 0,7,0 7) * scsibus1: 1,0,0 100) * 1,1,0 101) * 1,2,0 102) * 1,3,0 103) * 1,4,0 104) * 1,5,0 105) 'YAMAHA ' 'CRW4260 ' '1.0q' Removable CD-ROM 1,6,0 106) 'ARTEC ' 'AM12S ' '1.06' Scanner 1,7,0 107) * This lists the appropriate value for the devices on the list. Locate your CD burner, and use the three numbers separated by commas as the value for . In this case, the CRW device is 1,5,0, so the appropriate input would be . There are easier ways to specify this value; see &man.cdrecord.1; for details. That is also the place to look for information on writing audio tracks, controlling the speed, and other things. Duplicating Audio CDs You can duplicate an audio CD by extracting the audio data from the CD to a series of files, and then writing these files to a blank CD. The process is slightly different for ATAPI and SCSI drives. SCSI Drives Use cdda2wav to extract the audio. &prompt.user; cdda2wav -v255 -D2,0 -B -Owav Use cdrecord to write the .wav files. &prompt.user; cdrecord -v dev=2,0 -dao -useinfo *.wav Make sure that 2,0 is set appropriately, as described in . ATAPI Drives The ATAPI CD driver makes each track available as /dev/acddtnn, where d is the drive number, and nn is the track number written with two decimal digits, prefixed with zero as needed. So the first track on the first disk is /dev/acd0t01, the second is /dev/acd0t02, the third is /dev/acd0t03, and so on. Make sure the appropriate files exist in - /dev. + /dev. If the entries are missing, + force the system to retaste the media: + + &prompt.root; dd if=/dev/acd0 of=/dev/null count=1 + + In &os; 4.X, the entries are not prefixed with + zero. If the necessary entries in /dev + are missing, use MAKEDEV to create + them: &prompt.root; cd /dev &prompt.root; sh MAKEDEV acd0t99 + - In FreeBSD 5.0, &man.devfs.5; will automatically - create and manage entries in /dev - for you, so it is not necessary to use - MAKEDEV. Extract each track using &man.dd.1;. You must also use a specific block size when extracting the files. &prompt.root; dd if=/dev/acd0t01 of=track1.cdr bs=2352 &prompt.root; dd if=/dev/acd0t02 of=track2.cdr bs=2352 ... Burn the extracted files to disk using burncd. You must specify that these are audio files, and that burncd should fixate the disk when finished. &prompt.root; burncd -f /dev/acd0 audio track1.cdr track2.cdr ... fixate Duplicating Data CDs You can copy a data CD to a image file that is functionally equivalent to the image file created with &man.mkisofs.8;, and you can use it to duplicate any data CD. The example given here assumes that your CDROM device is acd0. Substitute your correct CDROM device. Under &os; 4.X, a c must be appended to the end of the device name to indicate the entire partition or, in the case of CDROMs, the entire disc. &prompt.root; dd if=/dev/acd0 of=file.iso bs=2048 Now that you have an image, you can burn it to CD as described above. Using Data CDs Now that you have created a standard data CDROM, you probably want to mount it and read the data on it. By default, &man.mount.8; assumes that a file system is of type ufs. If you try something like: &prompt.root; mount /dev/cd0 /mnt you will get a complaint about Incorrect super block, and no mount. The CDROM is not a UFS file system, so attempts to mount it as such will fail. You just need to tell &man.mount.8; that the file system is of type ISO9660, and everything will work. You do this by specifying the option &man.mount.8;. For example, if you want to mount the CDROM device, /dev/cd0, under /mnt, you would execute: &prompt.root; mount -t cd9660 /dev/cd0 /mnt Note that your device name (/dev/cd0 in this example) could be different, depending on the interface your CDROM uses. Also, the option just executes &man.mount.cd9660.8;. The above example could be shortened to: &prompt.root; mount_cd9660 /dev/cd0 /mnt You can generally use data CDROMs from any vendor in this way. Disks with certain ISO 9660 extensions might behave oddly, however. For example, Joliet disks store all filenames in two-byte Unicode characters. The FreeBSD kernel does not speak Unicode (yet!), so non-English characters show up as question marks. (If you are running FreeBSD 4.3 or later, the CD9660 driver includes hooks to load an appropriate Unicode conversion table on the fly. Modules for some of the common encodings are available via the sysutils/cd9660_unicode port.) Occasionally, you might get Device not configured when trying to mount a CDROM. This usually means that the CDROM drive thinks that there is no disk in the tray, or that the drive is not visible on the bus. It can take a couple of seconds for a CDROM drive to realize that it has been fed, so be patient. Sometimes, a SCSI CDROM may be missed because it did not have enough time to answer the bus reset. If you have a SCSI CDROM please add the following option to your kernel configuration and rebuild your kernel. options SCSI_DELAY=15000 This tells your SCSI bus to pause 15 seconds during boot, to give your CDROM drive every possible chance to answer the bus reset. Burning Raw Data CDs You can choose to burn a file directly to CD, without creating an ISO 9660 file system. Some people do this for backup purposes. This runs more quickly than burning a standard CD: &prompt.root; burncd -f /dev/acd1 -s 12 data archive.tar.gz fixate In order to retrieve the data burned to such a CD, you must read data from the raw device node: &prompt.root; tar xzvf /dev/acd1 You cannot mount this disk as you would a normal CDROM. Such a CDROM cannot be read under any operating system except FreeBSD. If you want to be able to mount the CD, or share data with another operating system, you must use &man.mkisofs.8; as described above. Marc Fonvieille Contributed by CD burner ATAPI/CAM driver Using the ATAPI/CAM Driver This driver allows ATAPI devices (CD-ROM, CD-RW, DVD drives etc...) to be accessed through the SCSI subsystem, and so allows the use of applications like sysutils/cdrdao or &man.cdrecord.1;. To use this driver, you will need to add the following line to your kernel configuration file: device atapicam You also need the following lines in your kernel configuration file: device ata device scbus device cd device pass which should already be present. Then rebuild, install your new kernel, and reboot your machine. During the boot process, your burner should show up, like so: acd0: CD-RW <MATSHITA CD-RW/DVD-ROM UJDA740> at ata1-master PIO4 cd0 at ata1 bus 0 target 0 lun 0 cd0: <MATSHITA CDRW/DVD UJDA740 1.00> Removable CD-ROM SCSI-0 device cd0: 16.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed The drive could now be accessed via the /dev/cd0 device name, for example to mount a CD-ROM on /mnt, just type the following: &prompt.root; mount -t cd9660 /dev/cd0 /mnt As root, you can run the following command to get the SCSI address of the burner: &prompt.root; camcontrol devlist <MATSHITA CDRW/DVD UJDA740 1.00> at scbus1 target 0 lun 0 (pass0,cd0) So 1,0,0 will be the SCSI address to use with &man.cdrecord.1; and other SCSI application. For more information about ATAPI/CAM and SCSI system, refer to the &man.atapicam.4; and &man.cam.4; manual pages. Marc Fonvieille Contributed by Andy Polyakov With inputs from Creating and Using Optical Media (DVDs) DVD burning Introduction Compared to the CD, the DVD is the next generation of optical media storage technology. The DVD can hold more data than any CD and is nowadays the standard for video publishing. Five physical recordable formats can be defined for what we will call a recordable DVD: DVD-R: This was the first DVD recordable format available. The DVD-R standard is defined by the DVD Forum. This format is write once. DVD-RW: This is the rewriteable version of the DVD-R standard. A DVD-RW can be rewritten about 1000 times. DVD-RAM: This is also a rewriteable format supported by the DVD Forum. A DVD-RAM can be seen as a removable hard drive. However, this media is not compatible with most DVD-ROM drives and DVD-Video players; only a few DVD writers support the DVD-RAM format. DVD+RW: This is a rewriteable format defined by the DVD+RW Alliance. A DVD+RW can be rewritten about 1000 times. DVD+R: This format is the write once variation of the DVD+RW format. A single layer recordable DVD can hold up to 4,700,000,000 bytes which is actually 4.38 GB or 4485 MB (1 kilobyte is 1024 bytes). A distinction must be made between the physical media and the application. For example, a DVD-Video is a specific file layout that can be written on any recordable DVD physical media: DVD-R, DVD+R, DVD-RW etc. Before choosing the type of media, you must be sure that both the burner and the DVD-Video player (a standalone player or a DVD-ROM drive on a computer) are compatible with the media under consideration. Configuration The program &man.growisofs.1; will be used to perform DVD recording. This command is part of the dvd+rw-tools utilities (sysutils/dvd+rw-tools). The dvd+rw-tools support all DVD media types. These tools use the SCSI subsystem to access to the devices, therefore the ATAPI/CAM support must be added to your kernel. If your burner uses the USB interface this addition is useless, and you should read the for more details on USB devices configuration. You also have to enable DMA access for ATAPI devices, this can be done in adding the following line to the /boot/loader.conf file: hw.ata.atapi_dma="1" Before attempting to use the dvd+rw-tools you should consult the dvd+rw-tools' hardware compatibility notes for any information related to your DVD burner. If you want a graphical user interface, you should have a look to K3b (sysutils/k3b) which provides a user friendly interface to &man.growisofs.1; and many others burning tools. Burning Data DVDs The &man.growisofs.1; command is a frontend to mkisofs, it will invoke &man.mkisofs.8; to create the file system layout and will perform the write on the DVD. This means you do not need to create an image of the data before the burning process. To burn onto a DVD+R or a DVD-R the data from the /path/to/data directory, use the following command: &prompt.root; growisofs -dvd-compat -Z /dev/cd0 -J -R /path/to/data The options are passed to &man.mkisofs.8; for the file system creation (in this case: an ISO 9660 file system with Joliet and Rock Ridge extensions), consult the &man.mkisofs.8; manual page for more details. The option is used for the initial session recording in any case: multiple sessions or not. The DVD device, /dev/cd0, must be changed according to your configuration. The parameter will close the disk, the recording will be unappendable. In return this should provide better media compatibility with DVD-ROM drives. It is also possible to burn a pre-mastered image, for example to burn the image imagefile.iso, we will run: &prompt.root; growisofs -dvd-compat -Z /dev/cd0=imagefile.iso The write speed should be detected and automatically set according to the media and the drive being used. If you want to force the write speed, use the parameter. For more information, read the &man.growisofs.1; manual page. DVD DVD-Video Burning a DVD-Video A DVD-Video is a specific file layout based on ISO 9660 and the micro-UDF (M-UDF) specifications. The DVD-Video also presents a specific data structure hierarchy, it is the reason why you need a particular program such as multimedia/dvdauthor to author the DVD. If you already have an image of the DVD-Video file system, just burn it in the same way as for any image, see the previous section for an example. If you have made the DVD authoring and the result is in, for example, the directory /path/to/video, the following command should be used to burn the DVD-Video: &prompt.root; growisofs -Z /dev/cd0 -dvd-video /path/to/video The option will be passed down to &man.mkisofs.8; and will instruct it to create a DVD-Video file system layout. Beside this, the option implies &man.growisofs.1; option. DVD DVD+RW Using a DVD+RW Unlike CD-RW, a virgin DVD+RW needs to be formatted before first use. The &man.growisofs.1; program will take care of it automatically whenever appropriate, which is the recommended way. However you can use the dvd+rw-format command to format the DVD+RW: &prompt.root; dvd+rw-format /dev/cd0 You need to perform this operation just once, keep in mind that only virgin DVD+RW medias need to be formatted. Then you can burn the DVD+RW in the way seen in previous sections. If you want to burn new data (burn a totally new file system not append some data) onto a DVD+RW, you do not need to blank it, you just have to write over the previous recording (in performing a new initial session), like this: &prompt.root; growisofs -Z /dev/cd0 -J -R /path/to/newdata DVD+RW format offers the possibility to easily append data to a previous recording. The operation consists in merging a new session to the existing one, it is not multisession writing, &man.growisofs.1; will grow the ISO 9660 file system present on the media. For example, if we want to append data to our previous DVD+RW, we have to use the following: &prompt.root; growisofs -M /dev/cd0 -J -R /path/to/nextdata The same &man.mkisofs.8; options we used to burn the initial session should be used during next writes. You may want to use the option if you want better media compatibility with DVD-ROM drives. In the DVD+RW case, this will not prevent you from adding data. If for any reason you really want to blank the media, do the following: &prompt.root; growisofs -Z /dev/cd0=/dev/zero DVD DVD-RW Using a DVD-RW A DVD-RW accepts two disc formats: the incremental sequential one and the restricted overwrite. By default DVD-RW discs are in sequential format. A virgin DVD-RW can be directly written without the need of a formatting operation, however a non-virgin DVD-RW in sequential format needs to be blanked before to be able to write a new initial session. To blank a DVD-RW in sequential mode, run: &prompt.root; dvd+rw-format -blank=full /dev/cd0 A full blanking () will take about one hour on a 1x media. A fast blanking can be performed using the option if the DVD-RW will be recorded in Disk-At-Once (DAO) mode. To burn the DVD-RW in DAO mode, use the command: &prompt.root; growisofs -use-the-force-luke=dao -Z /dev/cd0=imagefile.iso The option should not be required since &man.growisofs.1; attempts to detect minimally (fast blanked) media and engage DAO write. In fact one should use restricted overwrite mode with any DVD-RW, this format is more flexible than the default incremental sequential one. To write data on a sequential DVD-RW, use the same instructions as for the other DVD formats: &prompt.root; growisofs -Z /dev/cd0 -J -R /path/to/data If you want to append some data to your previous recording, you will have to use the &man.growisofs.1; option. However, if you perform data addition on a DVD-RW in incremental sequential mode, a new session will be created on the disc and the result will be a multi-session disc. A DVD-RW in restricted overwrite format does not need to be blanked before a new initial session, you just have to overwrite the disc with the option, this is similar to the DVD+RW case. It is also possible to grow an existing ISO 9660 file system written on the disc in a same way as for a DVD+RW with the option. The result will be a one-session DVD. To put a DVD-RW in the restricted overwrite format, the following command must be used: &prompt.root; dvd+rw-format /dev/cd0 To change back to the sequential format use: &prompt.root; dvd+rw-format -blank=full /dev/cd0 Multisession Very few DVD-ROM drives support multisession DVDs, they will most of time, hopefully, only read the first session. DVD+R, DVD-R and DVD-RW in sequential format can accept multiple sessions, the notion of multiple sessions does not exist for the DVD+RW and the DVD-RW restricted overwrite formats. Using the following command after an initial (non-closed) session on a DVD+R, DVD-R, or DVD-RW in sequential format, will add a new session to the disc: &prompt.root; growisofs -M /dev/cd0 -J -R /path/to/nextdata Using this command line with a DVD+RW or a DVD-RW in restricted overwrite mode, will append data in merging the new session to the existing one. The result will be a single-session disc. This is the way used to add data after an initial write on these medias. Some space on the media is used between each session for end and start of sessions. Therefore, one should add sessions with large amount of data to optimize media space. The number of sessions is limited to 154 for a DVD+R, about 2000 for a DVD-R, and 127 for a DVD+R Double Layer. For More Information To obtain more information about a DVD, the dvd+rw-mediainfo /dev/cd0 command can be ran with the disc in the drive. More information about the dvd+rw-tools can be found in the &man.growisofs.1; manual page, on the dvd+rw-tools web site and in the cdwrite mailing list archives. The dvd+rw-mediainfo output of the resulting recording or the media with issues is mandatory for any problem report. Without this output, it will be quite impossible to help you. Julio Merino Original work by Martin Karlsson Rewritten by Creating and Using Floppy Disks Storing data on floppy disks is sometimes useful, for example when one does not have any other removable storage media or when one needs to transfer small amounts of data to another computer. This section will explain how to use floppy disks in FreeBSD. It will primarily cover formatting and usage of 3.5inch DOS floppies, but the concepts are similar for other floppy disk formats. Formatting Floppies The Device Floppy disks are accessed through entries in /dev, just like other devices. To access the raw floppy disk in 4.X and earlier releases, one uses /dev/fdN, where N stands for the drive number, usually 0, or /dev/fdNX, where X stands for a letter. In 5.0 or newer releases, simply use /dev/fdN. The Disk Size in 4.X and Earlier Releases There are also /dev/fdN.size devices, where size is a floppy disk size in kilobytes. These entries are used at low-level format time to determine the disk size. 1440kB is the size that will be used in the following examples. Sometimes the entries under /dev will have to be (re)created. To do that, issue: - &prompt.root; cd /dev && ./MAKEDEV "fd*" + &prompt.root; cd /dev && ./MAKEDEV "fd*" The Disk Size in 5.0 and Newer Releases In 5.0, &man.devfs.5; will automatically manage device nodes in /dev, so use of MAKEDEV is not necessary. The desired disk size is passed to &man.fdformat.1; through the flag. Supported sizes are listed in &man.fdcontrol.8;, but be advised that 1440kB is what works best. Formatting A floppy disk needs to be low-level formated before it can be used. This is usually done by the vendor, but formatting is a good way to check media integrity. Although it is possible to force larger (or smaller) disk sizes, 1440kB is what most floppy disks are designed for. To low-level format the floppy disk you need to use &man.fdformat.1;. This utility expects the device name as an argument. Make note of any error messages, as these can help determine if the disk is good or bad. Formatting in 4.X and Earlier Releases Use the /dev/fdN.size devices to format the floppy. Insert a new 3.5inch floppy disk in your drive and issue: &prompt.root; /usr/sbin/fdformat /dev/fd0.1440 Formatting in 5.0 and Newer Releases Use the /dev/fdN devices to format the floppy. Insert a new 3.5inch floppy disk in your drive and issue: &prompt.root; /usr/sbin/fdformat -f 1440 /dev/fd0 The Disk Label After low-level formatting the disk, you will need to place a disk label on it. This disk label will be destroyed later, but it is needed by the system to determine the size of the disk and its geometry later. The new disk label will take over the whole disk, and will contain all the proper information about the geometry of the floppy. The geometry values for the disk label are listed in /etc/disktab. You can run now &man.disklabel.8; like so: &prompt.root; /sbin/disklabel -B -r -w /dev/fd0 fd1440 Since &os; 5.1-RELEASE, the &man.bsdlabel.8; utility replaces the old &man.disklabel.8; program. With &man.bsdlabel.8; a number of obsolete options and parameters have been retired; in the example above the option should be removed. For more information, please refer to the &man.bsdlabel.8; manual page. The File System Now the floppy is ready to be high-level formated. This will place a new file system on it, which will let FreeBSD read and write to the disk. After creating the new file system, the disk label is destroyed, so if you want to reformat the disk, you will have to recreate the disk label. The floppy's file system can be either UFS or FAT. FAT is generally a better choice for floppies. To put a new file system on the floppy, issue: &prompt.root; /sbin/newfs_msdos /dev/fd0 The disk is now ready for use. Using the Floppy To use the floppy, mount it with &man.mount.msdos.8; (in 4.X and earlier releases) or &man.mount.msdosfs.8; (in 5.0 or newer releases). One can also use emulators/mtools from the ports collection. Creating and Using Data Tapes tape media The major tape media are the 4mm, 8mm, QIC, mini-cartridge and DLT. 4mm (DDS: Digital Data Storage) tape media DDS (4mm) tapes tape media QIC tapes 4mm tapes are replacing QIC as the workstation backup media of choice. This trend accelerated greatly when Conner purchased Archive, a leading manufacturer of QIC drives, and then stopped production of QIC drives. 4mm drives are small and quiet but do not have the reputation for reliability that is enjoyed by 8mm drives. The cartridges are less expensive and smaller (3 x 2 x 0.5 inches, 76 x 51 x 12 mm) than 8mm cartridges. 4mm, like 8mm, has comparatively short head life for the same reason, both use helical scan. Data throughput on these drives starts ~150 kB/s, peaking at ~500 kB/s. Data capacity starts at 1.3 GB and ends at 2.0 GB. Hardware compression, available with most of these drives, approximately doubles the capacity. Multi-drive tape library units can have 6 drives in a single cabinet with automatic tape changing. Library capacities reach 240 GB. The DDS-3 standard now supports tape capacities up to 12 GB (or 24 GB compressed). 4mm drives, like 8mm drives, use helical-scan. All the benefits and drawbacks of helical-scan apply to both 4mm and 8mm drives. Tapes should be retired from use after 2,000 passes or 100 full backups. 8mm (Exabyte) tape media Exabyte (8mm) tapes 8mm tapes are the most common SCSI tape drives; they are the best choice of exchanging tapes. Nearly every site has an Exabyte 2 GB 8mm tape drive. 8mm drives are reliable, convenient and quiet. Cartridges are inexpensive and small (4.8 x 3.3 x 0.6 inches; 122 x 84 x 15 mm). One downside of 8mm tape is relatively short head and tape life due to the high rate of relative motion of the tape across the heads. Data throughput ranges from ~250 kB/s to ~500 kB/s. Data sizes start at 300 MB and go up to 7 GB. Hardware compression, available with most of these drives, approximately doubles the capacity. These drives are available as single units or multi-drive tape libraries with 6 drives and 120 tapes in a single cabinet. Tapes are changed automatically by the unit. Library capacities reach 840+ GB. The Exabyte Mammoth model supports 12 GB on one tape (24 GB with compression) and costs approximately twice as much as conventional tape drives. Data is recorded onto the tape using helical-scan, the heads are positioned at an angle to the media (approximately 6 degrees). The tape wraps around 270 degrees of the spool that holds the heads. The spool spins while the tape slides over the spool. The result is a high density of data and closely packed tracks that angle across the tape from one edge to the other. QIC tape media QIC-150 QIC-150 tapes and drives are, perhaps, the most common tape drive and media around. QIC tape drives are the least expensive serious backup drives. The downside is the cost of media. QIC tapes are expensive compared to 8mm or 4mm tapes, up to 5 times the price per GB data storage. But, if your needs can be satisfied with a half-dozen tapes, QIC may be the correct choice. QIC is the most common tape drive. Every site has a QIC drive of some density or another. Therein lies the rub, QIC has a large number of densities on physically similar (sometimes identical) tapes. QIC drives are not quiet. These drives audibly seek before they begin to record data and are clearly audible whenever reading, writing or seeking. QIC tapes measure (6 x 4 x 0.7 inches; 152 x 102 x 17 mm). Data throughput ranges from ~150 kB/s to ~500 kB/s. Data capacity ranges from 40 MB to 15 GB. Hardware compression is available on many of the newer QIC drives. QIC drives are less frequently installed; they are being supplanted by DAT drives. Data is recorded onto the tape in tracks. The tracks run along the long axis of the tape media from one end to the other. The number of tracks, and therefore the width of a track, varies with the tape's capacity. Most if not all newer drives provide backward-compatibility at least for reading (but often also for writing). QIC has a good reputation regarding the safety of the data (the mechanics are simpler and more robust than for helical scan drives). Tapes should be retired from use after 5,000 backups. DLT tape media DLT DLT has the fastest data transfer rate of all the drive types listed here. The 1/2" (12.5mm) tape is contained in a single spool cartridge (4 x 4 x 1 inches; 100 x 100 x 25 mm). The cartridge has a swinging gate along one entire side of the cartridge. The drive mechanism opens this gate to extract the tape leader. The tape leader has an oval hole in it which the drive uses to hook the tape. The take-up spool is located inside the tape drive. All the other tape cartridges listed here (9 track tapes are the only exception) have both the supply and take-up spools located inside the tape cartridge itself. Data throughput is approximately 1.5 MB/s, three times the throughput of 4mm, 8mm, or QIC tape drives. Data capacities range from 10 GB to 20 GB for a single drive. Drives are available in both multi-tape changers and multi-tape, multi-drive tape libraries containing from 5 to 900 tapes over 1 to 20 drives, providing from 50 GB to 9 TB of storage. With compression, DLT Type IV format supports up to 70 GB capacity. Data is recorded onto the tape in tracks parallel to the direction of travel (just like QIC tapes). Two tracks are written at once. Read/write head lifetimes are relatively long; once the tape stops moving, there is no relative motion between the heads and the tape. AIT tape media AIT AIT is a new format from Sony, and can hold up to 50 GB (with compression) per tape. The tapes contain memory chips which retain an index of the tape's contents. This index can be rapidly read by the tape drive to determine the position of files on the tape, instead of the several minutes that would be required for other tapes. Software such as SAMS:Alexandria can operate forty or more AIT tape libraries, communicating directly with the tape's memory chip to display the contents on screen, determine what files were backed up to which tape, locate the correct tape, load it, and restore the data from the tape. Libraries like this cost in the region of $20,000, pricing them a little out of the hobbyist market. Using a New Tape for the First Time The first time that you try to read or write a new, completely blank tape, the operation will fail. The console messages should be similar to: sa0(ncr1:4:0): NOT READY asc:4,1 sa0(ncr1:4:0): Logical unit is in process of becoming ready The tape does not contain an Identifier Block (block number 0). All QIC tape drives since the adoption of QIC-525 standard write an Identifier Block to the tape. There are two solutions: mt fsf 1 causes the tape drive to write an Identifier Block to the tape. Use the front panel button to eject the tape. Re-insert the tape and dump data to the tape. dump will report DUMP: End of tape detected and the console will show: HARDWARE FAILURE info:280 asc:80,96. rewind the tape using: mt rewind. Subsequent tape operations are successful. Backups to Floppies Can I Use Floppies for Backing Up My Data? backup floppies floppy disks Floppy disks are not really a suitable media for making backups as: The media is unreliable, especially over long periods of time. Backing up and restoring is very slow. They have a very limited capacity (the days of backing up an entire hard disk onto a dozen or so floppies has long since passed). However, if you have no other method of backing up your data then floppy disks are better than no backup at all. If you do have to use floppy disks then ensure that you use good quality ones. Floppies that have been lying around the office for a couple of years are a bad choice. Ideally use new ones from a reputable manufacturer. So How Do I Backup My Data to Floppies? The best way to backup to floppy disk is to use &man.tar.1; with the (multi volume) option, which allows backups to span multiple floppies. To backup all the files in the current directory and sub-directory use this (as root): &prompt.root; tar Mcvf /dev/fd0 * When the first floppy is full &man.tar.1; will prompt you to insert the next volume (because &man.tar.1; is media independent it refers to volumes; in this context it means floppy disk). Prepare volume #2 for /dev/fd0 and hit return: This is repeated (with the volume number incrementing) until all the specified files have been archived. Can I Compress My Backups? tar gzip compression Unfortunately, &man.tar.1; will not allow the option to be used for multi-volume archives. You could, of course, &man.gzip.1; all the files, &man.tar.1; them to the floppies, then &man.gunzip.1; the files again! How Do I Restore My Backups? To restore the entire archive use: &prompt.root; tar Mxvf /dev/fd0 There are two ways that you can use to restore only specific files. First, you can start with the first floppy and use: &prompt.root; tar Mxvf /dev/fd0 filename The utility &man.tar.1; will prompt you to insert subsequent floppies until it finds the required file. Alternatively, if you know which floppy the file is on then you can simply insert that floppy and use the same command as above. Note that if the first file on the floppy is a continuation from the previous one then &man.tar.1; will warn you that it cannot restore it, even if you have not asked it to! Lowell Gilbert Original work by Backup Strategies The first requirement in devising a backup plan is to make sure that all of the following problems are covered: Disk failure Accidental file deletion Random file corruption Complete machine destruction (e.g. fire), including destruction of any on-site backups. It is perfectly possible that some systems will be best served by having each of these problems covered by a completely different technique. Except for strictly personal systems with very low-value data, it is unlikely that one technique would cover all of them. Some of the techniques in the toolbox are: Archives of the whole system, backed up onto permanent media offsite. This actually provides protection against all of the possible problems listed above, but is slow and inconvenient to restore from. You can keep copies of the backups onsite and/or online, but there will still be inconveniences in restoring files, especially for non-privileged users. Filesystem snapshots. This is really only helpful in the accidental file deletion scenario, but it can be very helpful in that case, and is quick and easy to deal with. Copies of whole filesystems and/or disks (e.g. periodic rsync of the whole machine). This is generally most useful in networks with unique requirements. For general protection against disk failure, it is usually inferior to RAID. For restoring accidentally deleted files, it can be comparable to UFS snapshots, but that depends on your preferences. RAID. Minimizes or avoids downtime when a disk fails. At the expense of having to deal with disk failures more often (because you have more disks), albeit at a much lower urgency. Checking fingerprints of files. The &man.mtree.8; utility is very useful for this. Although it is not a backup technique, it helps guarantee that you will notice when you need to resort to your backups. This is particularly important for offline backups, and should be checked periodically. It is quite easy to come up with even more techniques, many of them variations on the ones listed above. Specialized requirements will usually lead to specialized techniques (for example, backing up a live database usually requires a method particular to the database software as an intermediate step). The important thing is to know what dangers you want to protect against, and how you will handle each. Backup Basics The three major backup programs are &man.dump.8;, &man.tar.1;, and &man.cpio.1;. Dump and Restore backup software dump / restore dump restore The traditional &unix; backup programs are dump and restore. They operate on the drive as a collection of disk blocks, below the abstractions of files, links and directories that are created by the file systems. dump backs up an entire file system on a device. It is unable to backup only part of a file system or a directory tree that spans more than one file system. dump does not write files and directories to tape, but rather writes the raw data blocks that comprise files and directories. If you use dump on your root directory, you would not back up /home, /usr or many other directories since these are typically mount points for other file systems or symbolic links into those file systems. dump has quirks that remain from its early days in Version 6 of AT&T UNIX (circa 1975). The default parameters are suitable for 9-track tapes (6250 bpi), not the high-density media available today (up to 62,182 ftpi). These defaults must be overridden on the command line to utilize the capacity of current tape drives. .rhosts It is also possible to backup data across the network to a tape drive attached to another computer with rdump and rrestore. Both programs rely upon &man.rcmd.3; and &man.ruserok.3; to access the remote tape drive. Therefore, the user performing the backup must be listed in the .rhosts file on the remote computer. The arguments to rdump and rrestore must be suitable to use on the remote computer. When rdumping from a FreeBSD computer to an Exabyte tape drive connected to a Sun called komodo, use: &prompt.root; /sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nsa8 /dev/da0a 2>&1 Beware: there are security implications to allowing .rhosts authentication. Evaluate your situation carefully. It is also possible to use dump and restore in a more secure fashion over ssh. Using <command>dump</command> over <application>ssh</application> &prompt.root; /sbin/dump -0uan -f - /usr | gzip -2 | ssh -c blowfish \ targetuser@targetmachine.example.com dd of=/mybigfiles/dump-usr-l0.gz Or using dump's built-in method, setting the environment variable RSH: Using <command>dump</command> over <application>ssh</application> with <envar>RSH</envar> set &prompt.root; RSH=/usr/bin/ssh /sbin/dump -0uan -f targetuser@targetmachine.example.com:/dev/sa0 /usr <command>tar</command> backup software tar &man.tar.1; also dates back to Version 6 of AT&T UNIX (circa 1975). tar operates in cooperation with the file system; it writes files and directories to tape. tar does not support the full range of options that are available from &man.cpio.1;, but it does not require the unusual command pipeline that cpio uses. tar On FreeBSD 5.3 and later, both GNU tar and the default bsdtar are available. The GNU version can be invoked with gtar. It supports remote devices using the same syntax as rdump. To tar to an Exabyte tape drive connected to a Sun called komodo, use: &prompt.root; /usr/bin/gtar cf komodo:/dev/nsa8 . 2>&1 The same could be accomplished with bsdtar by using a pipeline and rsh to send the data to a remote tape drive. &prompt.root; tar cf - . | rsh hostname dd of=tape-device obs=20b If you are worried about the security of backing up over a network you should use the ssh command instead of rsh. <command>cpio</command> backup software cpio &man.cpio.1; is the original &unix; file interchange tape program for magnetic media. cpio has options (among many others) to perform byte-swapping, write a number of different archive formats, and pipe the data to other programs. This last feature makes cpio an excellent choice for installation media. cpio does not know how to walk the directory tree and a list of files must be provided through stdin. cpio cpio does not support backups across the network. You can use a pipeline and rsh to send the data to a remote tape drive. &prompt.root; for f in directory_list; do -find $f >> backup.list +find $f >> backup.list done -&prompt.root; cpio -v -o --format=newc < backup.list | ssh user@host "cat > backup_device" +&prompt.root; cpio -v -o --format=newc < backup.list | ssh user@host "cat > backup_device" Where directory_list is the list of directories you want to back up, user@host is the user/hostname combination that will be performing the backups, and backup_device is where the backups should be written to (e.g., /dev/nsa0). <command>pax</command> backup software pax pax POSIX IEEE &man.pax.1; is IEEE/&posix;'s answer to tar and cpio. Over the years the various versions of tar and cpio have gotten slightly incompatible. So rather than fight it out to fully standardize them, &posix; created a new archive utility. pax attempts to read and write many of the various cpio and tar formats, plus new formats of its own. Its command set more resembles cpio than tar. <application>Amanda</application> backup software Amanda Amanda Amanda (Advanced Maryland Network Disk Archiver) is a client/server backup system, rather than a single program. An Amanda server will backup to a single tape drive any number of computers that have Amanda clients and a network connection to the Amanda server. A common problem at sites with a number of large disks is that the length of time required to backup to data directly to tape exceeds the amount of time available for the task. Amanda solves this problem. Amanda can use a holding disk to backup several file systems at the same time. Amanda creates archive sets: a group of tapes used over a period of time to create full backups of all the file systems listed in Amanda's configuration file. The archive set also contains nightly incremental (or differential) backups of all the file systems. Restoring a damaged file system requires the most recent full backup and the incremental backups. The configuration file provides fine control of backups and the network traffic that Amanda generates. Amanda will use any of the above backup programs to write the data to tape. Amanda is available as either a port or a package, it is not installed by default. Do Nothing Do nothing is not a computer program, but it is the most widely used backup strategy. There are no initial costs. There is no backup schedule to follow. Just say no. If something happens to your data, grin and bear it! If your time and your data is worth little to nothing, then Do nothing is the most suitable backup program for your computer. But beware, &unix; is a useful tool, you may find that within six months you have a collection of files that are valuable to you. Do nothing is the correct backup method for /usr/obj and other directory trees that can be exactly recreated by your computer. An example is the files that comprise the HTML or &postscript; version of this Handbook. These document formats have been created from SGML input files. Creating backups of the HTML or &postscript; files is not necessary. The SGML files are backed up regularly. Which Backup Program Is Best? LISA &man.dump.8; Period. Elizabeth D. Zwicky torture tested all the backup programs discussed here. The clear choice for preserving all your data and all the peculiarities of &unix; file systems is dump. Elizabeth created file systems containing a large variety of unusual conditions (and some not so unusual ones) and tested each program by doing a backup and restore of those file systems. The peculiarities included: files with holes, files with holes and a block of nulls, files with funny characters in their names, unreadable and unwritable files, devices, files that change size during the backup, files that are created/deleted during the backup and more. She presented the results at LISA V in Oct. 1991. See torture-testing Backup and Archive Programs. Emergency Restore Procedure Before the Disaster There are only four steps that you need to perform in preparation for any disaster that may occur. disklabel First, print the disklabel from each of your disks (e.g. disklabel da0 | lpr), your file system table (/etc/fstab) and all boot messages, two copies of each. fix-it floppies Second, determine that the boot and fix-it floppies (boot.flp and fixit.flp) have all your devices. The easiest way to check is to reboot your machine with the boot floppy in the floppy drive and check the boot messages. If all your devices are listed and functional, skip on to step three. Otherwise, you have to create two custom bootable floppies which have a kernel that can mount all of your disks and access your tape drive. These floppies must contain: fdisk, disklabel, newfs, mount, and whichever backup program you use. These programs must be statically linked. If you use dump, the floppy must contain restore. Third, create backup tapes regularly. Any changes that you make after your last backup may be irretrievably lost. Write-protect the backup tapes. Fourth, test the floppies (either boot.flp and fixit.flp or the two custom bootable floppies you made in step two.) and backup tapes. Make notes of the procedure. Store these notes with the bootable floppy, the printouts and the backup tapes. You will be so distraught when restoring that the notes may prevent you from destroying your backup tapes (How? In place of tar xvf /dev/sa0, you might accidentally type tar cvf /dev/sa0 and over-write your backup tape). For an added measure of security, make bootable floppies and two backup tapes each time. Store one of each at a remote location. A remote location is NOT the basement of the same office building. A number of firms in the World Trade Center learned this lesson the hard way. A remote location should be physically separated from your computers and disk drives by a significant distance. A Script for Creating a Bootable Floppy /mnt/sbin/init -gzip -c -best /sbin/fsck > /mnt/sbin/fsck -gzip -c -best /sbin/mount > /mnt/sbin/mount -gzip -c -best /sbin/halt > /mnt/sbin/halt -gzip -c -best /sbin/restore > /mnt/sbin/restore +gzip -c -best /sbin/init > /mnt/sbin/init +gzip -c -best /sbin/fsck > /mnt/sbin/fsck +gzip -c -best /sbin/mount > /mnt/sbin/mount +gzip -c -best /sbin/halt > /mnt/sbin/halt +gzip -c -best /sbin/restore > /mnt/sbin/restore -gzip -c -best /bin/sh > /mnt/bin/sh -gzip -c -best /bin/sync > /mnt/bin/sync +gzip -c -best /bin/sh > /mnt/bin/sh +gzip -c -best /bin/sync > /mnt/bin/sync cp /root/.profile /mnt/root cp -f /dev/MAKEDEV /mnt/dev chmod 755 /mnt/dev/MAKEDEV chmod 500 /mnt/sbin/init chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt chmod 555 /mnt/bin/sh /mnt/bin/sync chmod 6555 /mnt/sbin/restore # # create the devices nodes # cd /mnt/dev ./MAKEDEV std ./MAKEDEV da0 ./MAKEDEV da1 ./MAKEDEV da2 ./MAKEDEV sa0 ./MAKEDEV pty0 cd / # # create minimum file system table # -cat > /mnt/etc/fstab < /mnt/etc/passwd < /mnt/etc/master.passwd < After the Disaster The key question is: did your hardware survive? You have been doing regular backups so there is no need to worry about the software. If the hardware has been damaged, the parts should be replaced before attempting to use the computer. If your hardware is okay, check your floppies. If you are using a custom boot floppy, boot single-user (type -s at the boot: prompt). Skip the following paragraph. If you are using the boot.flp and fixit.flp floppies, keep reading. Insert the boot.flp floppy in the first floppy drive and boot the computer. The original install menu will be displayed on the screen. Select the Fixit--Repair mode with CDROM or floppy. option. Insert the fixit.flp when prompted. restore and the other programs that you need are located in /mnt2/rescue (/mnt2/stand for &os; versions older than 5.2). Recover each file system separately. mount root partition disklabel newfs Try to mount (e.g. mount /dev/da0a /mnt) the root partition of your first disk. If the disklabel was damaged, use disklabel to re-partition and label the disk to match the label that you printed and saved. Use newfs to re-create the file systems. Re-mount the root partition of the floppy read-write (mount -u -o rw /mnt). Use your backup program and backup tapes to recover the data for this file system (e.g. restore vrf /dev/sa0). Unmount the file system (e.g. umount /mnt). Repeat for each file system that was damaged. Once your system is running, backup your data onto new tapes. Whatever caused the crash or data loss may strike again. Another hour spent now may save you from further distress later. * I Did Not Prepare for the Disaster, What Now? ]]> Marc Fonvieille Reorganized and enhanced by Network, Memory, and File-Backed File Systems virtual disks disks virtual Aside from the disks you physically insert into your computer: floppies, CDs, hard drives, and so forth; other forms of disks are understood by FreeBSD - the virtual disks. NFS Coda disks memory These include network file systems such as the Network File System and Coda, memory-based file systems and file-backed file systems. According to the FreeBSD version you run, you will have to use different tools for creation and use of file-backed and memory-based file systems. The FreeBSD 4.X users will have to use &man.MAKEDEV.8; to create the required devices. FreeBSD 5.0 and later use &man.devfs.5; to allocate device nodes transparently for the user. File-Backed File System under FreeBSD 4.X disks file-backed (4.X) The utility &man.vnconfig.8; configures and enables vnode pseudo-disk devices. A vnode is a representation of a file, and is the focus of file activity. This means that &man.vnconfig.8; uses files to create and operate a file system. One possible use is the mounting of floppy or CD images kept in files. To use &man.vnconfig.8;, you need &man.vn.4; support in your kernel configuration file: pseudo-device vn To mount an existing file system image: Using vnconfig to Mount an Existing File System Image under FreeBSD 4.X &prompt.root; vnconfig vn0 diskimage &prompt.root; mount /dev/vn0c /mnt To create a new file system image with &man.vnconfig.8;: Creating a New File-Backed Disk with <command>vnconfig</command> &prompt.root; dd if=/dev/zero of=newimage bs=1k count=5k 5120+0 records in 5120+0 records out &prompt.root; vnconfig -s labels -c vn0 newimage &prompt.root; disklabel -r -w vn0 auto &prompt.root; newfs vn0c Warning: 2048 sector(s) in last cylinder unallocated /dev/vn0c: 10240 sectors in 3 cylinders of 1 tracks, 4096 sectors 5.0MB in 1 cyl groups (16 c/g, 32.00MB/g, 1280 i/g) super-block backups (for fsck -b #) at: 32 &prompt.root; mount /dev/vn0c /mnt &prompt.root; df /mnt Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/vn0c 4927 1 4532 0% /mnt File-Backed File System under FreeBSD 5.X disks file-backed (5.X) The utility &man.mdconfig.8; is used to configure and enable memory disks, &man.md.4;, under FreeBSD 5.X. To use &man.mdconfig.8;, you have to load &man.md.4; module or to add the support in your kernel configuration file: device md The &man.mdconfig.8; command supports three kinds of memory backed virtual disks: memory disks allocated with &man.malloc.9;, memory disks using a file or swap space as backing. One possible use is the mounting of floppy or CD images kept in files. To mount an existing file system image: Using <command>mdconfig</command> to Mount an Existing File System Image under FreeBSD 5.X &prompt.root; mdconfig -a -t vnode -f diskimage -u 0 &prompt.root; mount /dev/md0 /mnt To create a new file system image with &man.mdconfig.8;: Creating a New File-Backed Disk with <command>mdconfig</command> &prompt.root; dd if=/dev/zero of=newimage bs=1k count=5k 5120+0 records in 5120+0 records out &prompt.root; mdconfig -a -t vnode -f newimage -u 0 &prompt.root; disklabel -r -w md0 auto &prompt.root; newfs md0c /dev/md0c: 5.0MB (10240 sectors) block size 16384, fragment size 2048 using 4 cylinder groups of 1.27MB, 81 blks, 256 inodes. super-block backups (for fsck -b #) at: 32, 2624, 5216, 7808 &prompt.root; mount /dev/md0c /mnt &prompt.root; df /mnt Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md0c 4846 2 4458 0% /mnt If you do not specify the unit number with the option, &man.mdconfig.8; will use the &man.md.4; automatic allocation to select an unused device. The name of the allocated unit will be output on stdout like md4. For more details about &man.mdconfig.8;, please refer to the manual page. Since &os; 5.1-RELEASE, the &man.bsdlabel.8; utility replaces the old &man.disklabel.8; program. With &man.bsdlabel.8; a number of obsolete options and parameters have been retired; in the example above the option should be removed. For more information, please refer to the &man.bsdlabel.8; manual page. The utility &man.mdconfig.8; is very useful, however it asks many command lines to create a file-backed file system. FreeBSD 5.0 also comes with a tool called &man.mdmfs.8;, this program configures a &man.md.4; disk using &man.mdconfig.8;, puts a UFS file system on it using &man.newfs.8;, and mounts it using &man.mount.8;. For example, if you want to create and mount the same file system image as above, simply type the following: Configure and Mount a File-Backed Disk with <command>mdmfs</command> &prompt.root; dd if=/dev/zero of=newimage bs=1k count=5k 5120+0 records in 5120+0 records out &prompt.root; mdmfs -F newimage -s 5m md0 /mnt &prompt.root; df /mnt Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md0 4846 2 4458 0% /mnt If you use the option without unit number, &man.mdmfs.8; will use &man.md.4; auto-unit feature to automatically select an unused device. For more details about &man.mdmfs.8;, please refer to the manual page. Memory-Based File System under FreeBSD 4.X disks memory file system (4.X) The &man.md.4; driver is a simple, efficient means to create memory file systems under FreeBSD 4.X. &man.malloc.9; is used to allocate the memory. Simply take a file system you have prepared with, for example, &man.vnconfig.8;, and: md Memory Disk under FreeBSD 4.X &prompt.root; dd if=newimage of=/dev/md0 5120+0 records in 5120+0 records out &prompt.root; mount /dev/md0c /mnt &prompt.root; df /mnt Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md0c 4927 1 4532 0% /mnt For more details, please refer to &man.md.4; manual page. Memory-Based File System under FreeBSD 5.X disks memory file system (5.X) The same tools are used for memory-based and file-backed file systems: &man.mdconfig.8; or &man.mdmfs.8;. The storage for memory-based file system is allocated with &man.malloc.9;. Creating a New Memory-Based Disk with <command>mdconfig</command> &prompt.root; mdconfig -a -t malloc -s 5m -u 1 &prompt.root; newfs -U md1 /dev/md1: 5.0MB (10240 sectors) block size 16384, fragment size 2048 using 4 cylinder groups of 1.27MB, 81 blks, 256 inodes. with soft updates super-block backups (for fsck -b #) at: 32, 2624, 5216, 7808 &prompt.root; mount /dev/md1 /mnt &prompt.root; df /mnt Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md1 4846 2 4458 0% /mnt Creating a New Memory-Based Disk with <command>mdmfs</command> &prompt.root; mdmfs -M -s 5m md2 /mnt &prompt.root; df /mnt Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md2 4846 2 4458 0% /mnt Instead of using a &man.malloc.9; backed file system, it is possible to use swap, for that just replace with in the command line of &man.mdconfig.8;. The &man.mdmfs.8; utility by default (without ) creates a swap-based disk. For more details, please refer to &man.mdconfig.8; and &man.mdmfs.8; manual pages. Detaching a Memory Disk from the System disks detaching a memory disk When a memory-based or file-based file system is not used, you should release all resources to the system. The first thing to do is to unmount the file system, then use &man.mdconfig.8; to detach the disk from the system and release the resources. For example to detach and free all resources used by /dev/md4: &prompt.root; mdconfig -d -u 4 It is possible to list information about configured &man.md.4; devices in using the command mdconfig -l. For FreeBSD 4.X, &man.vnconfig.8; is used to detach the device. For example to detach and free all resources used by /dev/vn4: &prompt.root; vnconfig -u vn4 Tom Rhodes Contributed by File System Snapshots file systems snapshots FreeBSD 5.0 offers a new feature in conjunction with Soft Updates: File system snapshots. Snapshots allow a user to create images of specified file systems, and treat them as a file. Snapshot files must be created in the file system that the action is performed on, and a user may create no more than 20 snapshots per file system. Active snapshots are recorded in the superblock so they are persistent across unmount and remount operations along with system reboots. When a snapshot is no longer required, it can be removed with the standard &man.rm.1; command. Snapshots may be removed in any order, however all the used space may not be acquired because another snapshot will possibly claim some of the released blocks. The un-alterable file flag is set by &man.mksnap.ffs.8; after initial creation of a snapshot file. The &man.unlink.1; command makes an exception for snapshot files since it allows them to be removed. Snapshots are created with the &man.mount.8; command. To place a snapshot of /var in the file /var/snapshot/snap use the following command: &prompt.root; mount -u -o snapshot /var/snapshot/snap /var Alternatively, you can use &man.mksnap.ffs.8; to create a snapshot: &prompt.root; mksnap_ffs /var /var/snapshot/snap One can find snapshot files on a file system (e.g. /var) by using the &man.find.1; command: &prompt.root; find /var -flags snapshot Once a snapshot has been created, it has several uses: Some administrators will use a snapshot file for backup purposes, because the snapshot can be transfered to CDs or tape. File integrity, &man.fsck.8; may be ran on the snapshot. Assuming that the file system was clean when it was mounted, you should always get a clean (and unchanging) result. This is essentially what the background &man.fsck.8; process does. Run the &man.dump.8; utility on the snapshot. A dump will be returned that is consistent with the file system and the timestamp of the snapshot. &man.dump.8; can also take a snapshot, create a dump image and then remove the snapshot in one command using the flag. &man.mount.8; the snapshot as a frozen image of the file system. To &man.mount.8; the snapshot /var/snapshot/snap run: &prompt.root; mdconfig -a -t vnode -f /var/snapshot/snap -u 4 &prompt.root; mount -r /dev/md4 /mnt You can now walk the hierarchy of your frozen /var file system mounted at /mnt. Everything will initially be in the same state it was during the snapshot creation time. The only exception is that any earlier snapshots will appear as zero length files. When the use of a snapshot has delimited, it can be unmounted with: &prompt.root; umount /mnt &prompt.root; mdconfig -d -u 4 For more information about and file system snapshots, including technical papers, you can visit Marshall Kirk McKusick's website at . File System Quotas accounting disk space disk quotas Quotas are an optional feature of the operating system that allow you to limit the amount of disk space and/or the number of files a user or members of a group may allocate on a per-file system basis. This is used most often on timesharing systems where it is desirable to limit the amount of resources any one user or group of users may allocate. This will prevent one user or group of users from consuming all of the available disk space. Configuring Your System to Enable Disk Quotas Before attempting to use disk quotas, it is necessary to make sure that quotas are configured in your kernel. This is done by adding the following line to your kernel configuration file: options QUOTA The stock GENERIC kernel does not have this enabled by default, so you will have to configure, build and install a custom kernel in order to use disk quotas. Please refer to for more information on kernel configuration. Next you will need to enable disk quotas in /etc/rc.conf. This is done by adding the line: enable_quotas="YES" disk quotas checking For finer control over your quota startup, there is an additional configuration variable available. Normally on bootup, the quota integrity of each file system is checked by the &man.quotacheck.8; program. The &man.quotacheck.8; facility insures that the data in the quota database properly reflects the data on the file system. This is a very time consuming process that will significantly affect the time your system takes to boot. If you would like to skip this step, a variable in /etc/rc.conf is made available for the purpose: check_quotas="NO" Finally you will need to edit /etc/fstab to enable disk quotas on a per-file system basis. This is where you can either enable user or group quotas or both for all of your file systems. To enable per-user quotas on a file system, add the option to the options field in the /etc/fstab entry for the file system you want to enable quotas on. For example: /dev/da1s2g /home ufs rw,userquota 1 2 Similarly, to enable group quotas, use the option instead of . To enable both user and group quotas, change the entry as follows: /dev/da1s2g /home ufs rw,userquota,groupquota 1 2 By default, the quota files are stored in the root directory of the file system with the names quota.user and quota.group for user and group quotas respectively. See &man.fstab.5; for more information. Even though the &man.fstab.5; manual page says that you can specify an alternate location for the quota files, this is not recommended because the various quota utilities do not seem to handle this properly. At this point you should reboot your system with your new kernel. /etc/rc will automatically run the appropriate commands to create the initial quota files for all of the quotas you enabled in /etc/fstab, so there is no need to manually create any zero length quota files. In the normal course of operations you should not be required to run the &man.quotacheck.8;, &man.quotaon.8;, or &man.quotaoff.8; commands manually. However, you may want to read their manual pages just to be familiar with their operation. Setting Quota Limits disk quotas limits Once you have configured your system to enable quotas, verify that they really are enabled. An easy way to do this is to run: &prompt.root; quota -v You should see a one line summary of disk usage and current quota limits for each file system that quotas are enabled on. You are now ready to start assigning quota limits with the &man.edquota.8; command. You have several options on how to enforce limits on the amount of disk space a user or group may allocate, and how many files they may create. You may limit allocations based on disk space (block quotas) or number of files (inode quotas) or a combination of both. Each of these limits are further broken down into two categories: hard and soft limits. hard limit A hard limit may not be exceeded. Once a user reaches his hard limit he may not make any further allocations on the file system in question. For example, if the user has a hard limit of 500 kbytes on a file system and is currently using 490 kbytes, the user can only allocate an additional 10 kbytes. Attempting to allocate an additional 11 kbytes will fail. soft limit Soft limits, on the other hand, can be exceeded for a limited amount of time. This period of time is known as the grace period, which is one week by default. If a user stays over his or her soft limit longer than the grace period, the soft limit will turn into a hard limit and no further allocations will be allowed. When the user drops back below the soft limit, the grace period will be reset. The following is an example of what you might see when you run the &man.edquota.8; command. When the &man.edquota.8; command is invoked, you are placed into the editor specified by the EDITOR environment variable, or in the vi editor if the EDITOR variable is not set, to allow you to edit the quota limits. &prompt.root; edquota -u test Quotas for user test: /usr: kbytes in use: 65, limits (soft = 50, hard = 75) inodes in use: 7, limits (soft = 50, hard = 60) /usr/var: kbytes in use: 0, limits (soft = 50, hard = 75) inodes in use: 0, limits (soft = 50, hard = 60) You will normally see two lines for each file system that has quotas enabled. One line for the block limits, and one line for inode limits. Simply change the value you want updated to modify the quota limit. For example, to raise this user's block limit from a soft limit of 50 and a hard limit of 75 to a soft limit of 500 and a hard limit of 600, change: /usr: kbytes in use: 65, limits (soft = 50, hard = 75) to: /usr: kbytes in use: 65, limits (soft = 500, hard = 600) The new quota limits will be in place when you exit the editor. Sometimes it is desirable to set quota limits on a range of UIDs. This can be done by use of the option on the &man.edquota.8; command. First, assign the desired quota limit to a user, and then run edquota -p protouser startuid-enduid. For example, if user test has the desired quota limits, the following command can be used to duplicate those quota limits for UIDs 10,000 through 19,999: &prompt.root; edquota -p test 10000-19999 For more information see &man.edquota.8; manual page. Checking Quota Limits and Disk Usage disk quotas checking You can use either the &man.quota.1; or the &man.repquota.8; commands to check quota limits and disk usage. The &man.quota.1; command can be used to check individual user or group quotas and disk usage. A user may only examine his own quota, and the quota of a group he is a member of. Only the super-user may view all user and group quotas. The &man.repquota.8; command can be used to get a summary of all quotas and disk usage for file systems with quotas enabled. The following is some sample output from the quota -v command for a user that has quota limits on two file systems. Disk quotas for user test (uid 1002): Filesystem usage quota limit grace files quota limit grace /usr 65* 50 75 5days 7 50 60 /usr/var 0 50 75 0 50 60 grace period On the /usr file system in the above example, this user is currently 15 kbytes over the soft limit of 50 kbytes and has 5 days of the grace period left. Note the asterisk * which indicates that the user is currently over his quota limit. Normally file systems that the user is not using any disk space on will not show up in the output from the &man.quota.1; command, even if he has a quota limit assigned for that file system. The option will display those file systems, such as the /usr/var file system in the above example. Quotas over NFS NFS Quotas are enforced by the quota subsystem on the NFS server. The &man.rpc.rquotad.8; daemon makes quota information available to the &man.quota.1; command on NFS clients, allowing users on those machines to see their quota statistics. Enable rpc.rquotad in /etc/inetd.conf like so: rquotad/1 dgram rpc/udp wait root /usr/libexec/rpc.rquotad rpc.rquotad Now restart inetd: &prompt.root; kill -HUP `cat /var/run/inetd.pid` Lucky Green Contributed by
shamrock@cypherpunks.to
Encrypting Disk Partitions disks encrypting FreeBSD offers excellent online protections against unauthorized data access. File permissions and Mandatory Access Control (MAC) (see ) help prevent unauthorized third-parties from accessing data while the operating system is active and the computer is powered up. However, the permissions enforced by the operating system are irrelevant if an attacker has physical access to a computer and can simply move the computer's hard drive to another system to copy and analyze the sensitive data. Regardless of how an attacker may have come into possession of - a hard drive or powered-down computer, GEOM Based Disk - Encryption (gbde) can protect the data on the - computer's file systems against even highly-motivated attackers - with significant resources. Unlike cumbersome encryption methods - that encrypt only individual files, gbde - transparently encrypts entire file systems. No cleartext ever - touches the hard drive's platter. + a hard drive or powered-down computer, both GEOM + Based Disk Encryption (gbde) and + geli cryptographic subsystems in &os; are able + to protect the data on the computer's file systems against even + highly-motivated attackers with significant resources. Unlike + cumbersome encryption methods that encrypt only individual files, + gbde and geli transparently + encrypt entire file systems. No cleartext ever touches the hard + drive's platter. - Enabling gbde in the Kernel + Disk Encryption with <application>gbde</application> Become <username>root</username> Configuring gbde requires super-user privileges. &prompt.user; su - Password: Verify the Operating System Version &man.gbde.4; requires FreeBSD 5.0 or higher. &prompt.root; uname -r 5.0-RELEASE Add &man.gbde.4; Support to the Kernel Configuration File - Using your favorite text editor, add the following - line to your kernel configuration file: + Add the following line to the kernel configuration + file: options GEOM_BDE - Configure, recompile, and install the FreeBSD kernel. - This process is described in Rebuild the kernel as described in . Reboot into the new kernel. - - - + Preparing the Encrypted Hard Drive The following example assumes that you are adding a new hard drive to your system that will hold a single encrypted partition. This partition will be mounted as /private. gbde can also be used to encrypt /home and /var/mail, but this requires more complex instructions which exceed the scope of this introduction. Add the New Hard Drive Install the new drive to the system as explained in . For the purposes of this example, a new hard drive partition has been added as /dev/ad4s1c. The /dev/ad0s1* devices represent existing standard FreeBSD partitions on the example system. &prompt.root; ls /dev/ad* /dev/ad0 /dev/ad0s1b /dev/ad0s1e /dev/ad4s1 /dev/ad0s1 /dev/ad0s1c /dev/ad0s1f /dev/ad4s1c /dev/ad0s1a /dev/ad0s1d /dev/ad4 Create a Directory to Hold gbde Lock Files &prompt.root; mkdir /etc/gbde The gbde lock file contains information that gbde requires to access encrypted partitions. Without access to the lock file, gbde will not be able to decrypt the data contained in the encrypted partition without significant manual intervention which is not supported by the software. Each encrypted partition uses a separate lock file. Initialize the gbde Partition A gbde partition must be initialized before it can be used. This initialization needs to be performed only once: &prompt.root; gbde init /dev/ad4s1c -i -L /etc/gbde/ad4s1c &man.gbde.8; will open your editor, permitting you to set various configuration options in a template. For use with UFS1 or UFS2, set the sector_size to 2048: $FreeBSD: src/sbin/gbde/template.txt,v 1.1 2002/10/20 11:16:13 phk Exp $ # # Sector size is the smallest unit of data which can be read or written. # Making it too small decreases performance and decreases available space. # Making it too large may prevent filesystems from working. 512 is the # minimum and always safe. For UFS, use the fragment size # sector_size = 2048 [...] &man.gbde.8; will ask you twice to type the passphrase that should be used to secure the data. The passphrase must be the same both times. gbde's ability to protect your data depends entirely on the quality of the passphrase that you choose. For tips on how to select a secure passphrase that is easy to remember, see the Diceware Passphrase website. The gbde init command creates a lock file for your gbde partition that in this example is stored as /etc/gbde/ad4s1c. gbde lock files must be backed up together with the contents of any encrypted partitions. While deleting a lock file alone cannot prevent a determined attacker from decrypting a gbde partition, without the lock file, the legitimate owner will be unable to access the data on the encrypted partition without a significant amount of work that is totally unsupported by &man.gbde.8; and its designer. Attach the Encrypted Partition to the Kernel &prompt.root; gbde attach /dev/ad4s1c -l /etc/gbde/ad4s1c You will be asked to provide the passphrase that you selected during the initialization of the encrypted partition. The new encrypted device will show up in /dev as /dev/device_name.bde: &prompt.root; ls /dev/ad* /dev/ad0 /dev/ad0s1b /dev/ad0s1e /dev/ad4s1 /dev/ad0s1 /dev/ad0s1c /dev/ad0s1f /dev/ad4s1c /dev/ad0s1a /dev/ad0s1d /dev/ad4 /dev/ad4s1c.bde Create a File System on the Encrypted Device Once the encrypted device has been attached to the kernel, you can create a file system on the device. To create a file system on the encrypted device, use &man.newfs.8;. Since it is much faster to initialize a new UFS2 file system than it is to initialize the old UFS1 file system, using &man.newfs.8; with the option is recommended. The option is the default with &os; 5.1-RELEASE and later. &prompt.root; newfs -U -O2 /dev/ad4s1c.bde The &man.newfs.8; command must be performed on an attached gbde partition which is identified by a *.bde extension to the device name. Mount the Encrypted Partition Create a mount point for the encrypted file system. &prompt.root; mkdir /private Mount the encrypted file system. &prompt.root; mount /dev/ad4s1c.bde /private Verify That the Encrypted File System is Available The encrypted file system should now be visible to &man.df.1; and be available for use. &prompt.user; df -H Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1a 1037M 72M 883M 8% / /devfs 1.0K 1.0K 0B 100% /dev /dev/ad0s1f 8.1G 55K 7.5G 0% /home /dev/ad0s1e 1037M 1.1M 953M 0% /tmp /dev/ad0s1d 6.1G 1.9G 3.7G 35% /usr /dev/ad4s1c.bde 150G 4.1K 138G 0% /private - + - + Mounting Existing Encrypted File Systems After each boot, any encrypted file systems must be re-attached to the kernel, checked for errors, and mounted, before the file systems can be used. The required commands must be executed as user root. Attach the gbde Partition to the Kernel &prompt.root; gbde attach /dev/ad4s1c -l /etc/gbde/ad4s1c You will be asked to provide the passphrase that you - selected during initialization of the encrypted gbde - partition. + selected during initialization of the encrypted + gbde partition. Check the File System for Errors Since encrypted file systems cannot yet be listed in /etc/fstab for automatic mounting, the file systems must be checked for errors by running &man.fsck.8; manually before mounting. &prompt.root; fsck -p -t ffs /dev/ad4s1c.bde Mount the Encrypted File System &prompt.root; mount /dev/ad4s1c.bde /private The encrypted file system is now available for use. - + Automatically Mounting Encrypted Partitions It is possible to create a script to automatically attach, check, and mount an encrypted partition, but for security reasons the script should not contain the &man.gbde.8; password. Instead, it is recommended that such scripts be run manually while providing the password via the console or &man.ssh.1;. - - - + As of &os; 5.2-RELEASE, there is a new rc.d script + provided. Arguments for this script can be passed via + &man.rc.conf.5;, for example: + + gbde_autoattach_all="YES" +gbde_devices="ad4s1c" + + This will require that the gbde + passphrase be entered at boot time. After typing the correct + passphrase, the gbde encrypted + partition will be mounted automatically. This can be very + useful when using gbde on + notebooks. + + + + Cryptographic Protections Employed by gbde &man.gbde.8; encrypts the sector payload using 128-bit AES in CBC mode. Each sector on the disk is encrypted with a different AES key. For more information on gbde's cryptographic design, including how the sector keys are derived from the user-supplied passphrase, see &man.gbde.4;. - + - + Compatibility Issues &man.sysinstall.8; is incompatible with gbde-encrypted devices. All *.bde devices must be detached from the kernel before starting &man.sysinstall.8; or it will crash during its initial probing for devices. To detach the encrypted device used in our example, use the following command: &prompt.root; gbde detach /dev/ad4s1c Also note that, as &man.vinum.4; does not use the &man.geom.4; subsystem, you cannot use gbde with vinum volumes. - + + + + + + + + + Daniel + Gerzo + Contributed by + + + + + + Disk Encryption with <command>geli</command> + + A new cryptographic GEOM class is available as of &os; 6.0 - + geli. It is currently being developed by + &a.pjd;. Geli is different to + gbde; it offers different features and uses + a different scheme for doing cryptographic work. + + The most important features of &man.geli.8; are: + + + + Utilizes the &man.crypto.9; framework — when + cryptographic hardware is available, geli + will use it automatically. + + + Supports multiple cryptographic algorithms (currently + AES, Blowfish, and 3DES). + + + Allows the root partition to be encrypted. The + passphrase used to access the encrypted root partition will + be requested during the system boot. + + + Allows the use of two independent keys (e.g. a + key and a company key). + + + geli is fast - performs simple + sector-to-sector encryption. + + + Allows backup and restore of Master Keys. When a user + has to destroy his keys, it will be possible to get access + to the data again by restoring keys from the backup. + + + Allows to attach a disk with a random, one-time key + — useful for swap partitions and temporary file + systems. + + + + More geli features can be found in the + &man.geli.8; manual page. + + The next steps will describe how to enable support for + geli in the &os; kernel and will explain how + to create a new geli encryption provider. At + the end it will be demonstrated how to create an encrypted swap + partition using features provided by geli. + + In order to use geli, you must be running + &os; 6.0-RELEASE or later. Super-user privileges will be + required since modifications to the kernel are necessary. + + + + Adding <command>geli</command> Support to the Kernel + Configuration File + + Add the following lines to the kernel configuration + file: + + options GEOM_ELI +device crypto + + Rebuild the kernel as described in . + + Alternatively, the geli module can + be loaded at boot time. Add the following line to the + /boot/loader.conf: + + geom_eli_load="YES" + + &man.geli.8; should now be supported by the kernel. + + + + Generating the Master Key + + The following example will describe how to generate a + key file, which will be used as part of the Master Key for + the encrypted provider mounted under + /private. The key + file will provide some random data used to encrypt the + Master Key. The Master Key will be protected by a + passphrase as well. Provider's sector size will be 4kB big. + Furthermore, the discussion will describe how to attach the + geli provider, create a file system on + it, how to mount it, how to work with it, and finally how to + detach it. + + It is recommended to use a bigger sector size (like 4kB) for + better performance. + + The Master Key will be protected with a passphrase and + the data source for key file will be + /dev/random. The sector size of + /dev/da2.eli, which we call provider, + will be 4kB. + + &prompt.root; dd if=/dev/random of=/root/da2.key bs=64 count=1 +&prompt.root; geli init -s 4096 -K /root/da2.key /dev/da2 +Enter new passphrase: +Reenter new passphrase: + + It is not mandatory that both a passphrase and a key + file are used; either method of securing the Master Key can + be used in isolation. + + If key file is given as -, standard + input will be used. This example shows how more than one + key file can be used. + + &prompt.root; cat keyfile1 keyfile2 keyfile3 | geli init -K - /dev/da2 + + + + Attaching the Provider with the generated Key + + &prompt.root; geli attach -k /root/da2.key /dev/da2 +Enter passphrase: + The new plaintext device will be named + /dev/da2.eli. + + &prompt.root; ls /dev/da2* +/dev/da2 /dev/da2.eli + + + + Creating the new File System + + &prompt.root; dd if=/dev/random of=/dev/da2.eli bs=1m +&prompt.root; newfs /dev/da2.eli +&prompt.root; mount /dev/da2.eli /private + + The encrypted file system should be visible to &man.df.1; + and be available for use now. + + &prompt.root; df -H +Filesystem Size Used Avail Capacity Mounted on +/dev/ad0s1a 248M 89M 139M 38% / +/devfs 1.0K 1.0K 0B 100% /dev +/dev/ad0s1f 7.7G 2.3G 4.9G 32% /usr +/dev/ad0s1d 989M 1.5M 909M 0% /tmp +/dev/ad0s1e 3.9G 1.3G 2.3G 35% /var +/dev/da2.eli 150G 4.1K 138G 0% /private + + + + + Unmounting and Detaching the Provider + + Once the work on the encrypted partition is done, and + the /private partition + is no longer needed, it is prudent to consider unmounting + and detaching the geli encrypted + partition from the kernel. + + &prompt.root; umount /private +&prompt.root; geli detach da2.eli + + + + More information about the use of &man.geli.8; can be + found in the manual page. + + + Encrypting a Swap Partition + + The following example demonstrates how to create a + geli encrypted swap partition. + + &prompt.root; dd if=/dev/random of=/dev/ad0s1b bs=1m +&prompt.root; geli onetime -d -a 3des ad0s1b +&prompt.root; swapon /dev/ad0s1b.eli + + + + Using the <filename>geli</filename> <filename>rc.d</filename> Script + + geli comes with a rc.d script which + can be used to simplify the usage of geli. + An example of configuring geli through + &man.rc.conf.5; follows: + + geli_devices="da2" +geli_da2_flags="-p -k /root/da2.key" + + This will configure /dev/da2 as a + geli provider of which the Master Key file + is located in /root/da2.key, and + geli will not use a passphrase when + attaching the provider (note that this can only be used if -P + was given during the geli init phase). The + system will detach the geli provider from + the kernel before the system shuts down. + + More information about configuring rc.d is provided in the + rc.d section of the + Handbook. + +
diff --git a/zh_TW.Big5/books/handbook/geom/chapter.sgml b/zh_TW.Big5/books/handbook/geom/chapter.sgml index b8909b3eb9..1e6d087bde 100644 --- a/zh_TW.Big5/books/handbook/geom/chapter.sgml +++ b/zh_TW.Big5/books/handbook/geom/chapter.sgml @@ -1,402 +1,378 @@ Tom Rhodes Written by GEOM: Modular Disk Transformation Framework - Synopsis + ·§­z GEOM GEOM Disk Framework GEOM ¥»³¹²[»\¦p¦ó¦b &os; ªº GEOM ¬[ºc¤U¨Ï¥ÎºÏºÐ¡A ¥]§t¥Î¨Ó³]©w´XºØ±`¥Îªº RAID ªº±±¨î¤u¨ã¡C¥»³¹¤£·|²`¤J±´°Q GEOM ¦p¦ó³B²z©³¼hªº I/O¡A³oÃþ¸ê°T½Ð°Ñ¦Ò &man.geom.4; ¤Î¬ÛÃöªº SEE ALSO ³¡¥÷¡C¥»³¹¤]«D RAID ³]©w«ü«n¡A¦b³o¸Ì¥u·|°Q½×¥Ø«e GEOM ¤ä´©ªº RAID ¼Ò¦¡¡C - ¾\Ū¥»³¹«á¡A±z·|ª¾¹D³o¨Ç¸ê°T¡G + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡J ³z¹L GEOM ¥i¤ä´©­þ¨Ç¼Ò¦¡ªº RAID¡C ¦p¦ó¨Ï¥Î°ò¥»¤u¨ã¨Ó°t¸m¡B¾Þ§@¡BºûÅ@¤£¦P¼Ò¦¡ªº RAID¡C - ¦p¦ó³z¹L GEOM ¨Ó§¹¦¨Ãè®g (mirror)¡B¤À´²³sµ² (stripe)¡B¥[±K (encryp) + ¦p¦ó³z¹L GEOM ¨Ó§¹¦¨Ãè®g(mirror)¡B¤À´²³sµ²(stripe)¡B¥[±K(encrypt) ¡B»·ºÝ³s±µºÏºÐµ¥¡C ·í GEOM ¬[ºc¤UªººÏºÐµo¥Í°ÝÃD¡A¦p¦ó±Æ°£¡C - Before reading this chapter, you should: - ¦b¶}©l¤§«e¡A½Ð±z½T¥ô¤U¦C­I´ºª¾ÃÑ¡G + ¦b¶}©l¾\Ū³o³¹¤§«e¡A±z»Ý­n¡J - ¤F¸Ñ &os; ¦p¦ó¬Ý«ÝºÏºÐ () ¡C + ¤F¸Ñ &os; ¦p¦ó¬Ý«ÝºÏºÐ() ¡C ª¾¹D¦p¦ó³]©w¡B¦w¸Ë·sªº &os; ®Ö¤ß () ¡C GEOM ¾É½× - GEOM ³z¹L privoder (§Y /dev/ - ¤Uªº¯S®í¸Ë¸mÀÉ®×) ¨Ó¾Þ±± classes (¦p Master Boot Records¡B + GEOM ³z¹L privoder(§Y /dev/ + ¤Uªº¯S®í¸Ë¸mÀÉ®×) ¨Ó¾Þ±± classes(¦p Master Boot Records¡B BSD labels µ¥) ¡CGEOM ¤ä´©¦hºØ³nÅé RAID °t¸m¡A³z¹L GEOM ¦s¨ú®É¡A §@·~¨t²Î©MÀ³¥Îµ{¦¡¤£·|·NÃѨì GEOM ¦s¦b¡C Tom Rhodes Written by Murray Stokely - RAID0 - ¤À´²³sµ² (striping) + RAID0 - ¤À´²³sµ²(striping) GEOM - ¤À´²³sµ² (Striping) + ¤À´²³sµ²(Striping) - ¤À´²³sµ² (striping) ¥i¥Î¨Ó³sµ²¦h­ÓºÏºÐ¦¨¬°¤@¤j¶ôªÅ¶¡¡C + ¤À´²³sµ²(striping) ¥i¥Î¨Ó³sµ²¦h­ÓºÏºÐ¦¨¬°¤@¤j¶ôªÅ¶¡¡C «Ü¦h®É­ÔµwÅé±±¨î¾¹¥i¥H§¹¦¨³o¥ó¨Æ¡A¤£¹L GEOM ¤]´£¨Ñ¤F³nÅ骩¥»ªº - RAID0¡A¤]´N¬O¤À´²³sµ² (striping)¡C + RAID0¡A¤]´N¬O¤À´²³sµ²(striping)¡C ¦b RAID0 ¸Ì¡A¸ê®Æ·|³Q¤Á¤À¦¨«Ü¦h¶ô¡A ¦A¤À´²¼g¤J¥þ³¡ªººÏºÐ¡C¨Ò¦p­n¼g¤J 256k ªº¸ê®Æ¨ì³æ¤@ºÏºÐ¡A¦b ¥|­ÓºÏºÐªº RAID0 ¤¤¥i¦P®É¼g¤J 64k ¨ì¥|­ÓºÏºÐ¸Ì¡A ¦]¦¹¥i¤j´T´£¤É I/O ®Ä¯à¡C¦pªG¨Ï¥Î§ó¦hªººÏºÐ±±¨î¾¹¡A I/O ®Ä¯à¥i¦A´£¤É¡C ¥Ñ©óŪ©Î¼g®É·|¦P¨B¥æ¿ù¹ï³\¦hºÏºÐ¶i¦æ I/O ³B²z¡A¦]¦¹ - RAID0 ªº¨C­ÓºÏºÐ¥²»Ý¤j¤p¤@¼Ë¡C + RAID0 ªº¨C­ÓºÏºÐ¥²¶·¤j¤p¤@¼Ë¡C Disk Striping Illustration - ¥Î¥¼®æ¦¡¤Æªº ATA ºÏºÐ¨Ó«Ø¥ß¤À´²³sµ² + ¥Î¥¼®æ¦¡¤Æªº ATA ºÏºÐ¨Ó«Ø¥ß¤À´²³sµ²(striping) ¸ü¤J geom_stripe - ®Ö¤ß¼Ò²Õ¡G + kernel module¡G &prompt.root; kldload geom_stripe.ko - ½T©w±¾¸üÂI (mount point) ¦s¦b¡C - ¦pªG·Q¥Î¤À´²³sµ²ªºªÅ¶¡°µ¬°®Ú¥Ø¿ý (root partition¡A§Y /)¡A + ½T©w±¾¸üÂI(mount point)¦s¦b¡C + ¦pªG·Q¥Î¤À´²³sµ²(striping)ªºªÅ¶¡°µ¬°®Ú¥Ø¿ý(root partition¡A§Y / )¡A «h¥ý¥Î­Ó¼È®Éªº±¾¸üÂI¡A¦p /mnt¡G &prompt.root; mkdir /mnt - ½T»{­n¥Î¨Ó¤À´²³sµ²ªº¸Ë¸m¦WºÙ¡A±µµÛ«Ø·s·sªº¤À´²³sµ²¸Ë¸m¡C - ¨Ò¦p¤U­±ªº«ü¥O·|¤À´²³sµ²¨â­Ó¥¼¨Ï¥Î¡B©|¥¼¤À°Ïªº ATA - ºÏºÐ (/dev/ad2 ©M + +½T»{­n¥Î¨Ó¤À´²³sµ²(striping)ªº¸Ë¸m¦WºÙ¡A±µµÛ«Ø¥ß·sªº¤À´²³sµ²(striping)¡C + ¨Ò¦p¤U­±ªº«ü¥O·|¤À´²³sµ²(striping)¨â­Ó¥¼¨Ï¥Î¡B©|¥¼¤À³Î°Ïªº ATA + ºÏºÐ(/dev/ad2 ©M /dev/ad3) ¡G &prompt.root; gstripe label -v st0 /dev/ad2 /dev/ad3 &prompt.root; gstripe label -v st0 /dev/ad2 /dev/ad3 - ¥Î¤U­±ªº«ü¥O¨Ó«Ø¥ß¤À°Ïªí (partition table)¡G + ¥Î¤U­±ªº«ü¥O¨Ó«Ø¥ß¤À³Î°Ïªí(partition table)¡G &prompt.root; bsdlabel -wB /dev/stripe/st0 - °£¤F¥ý«e«Ø¥ßªº st0 ¡A³o­Ó¨BÆJÁÙ·|¦b + °£¤F¥ý«e«Ø¥ßªº st0 ¡A³o­Ó¨BÆJÁÙ·|¦b /dev/stripe ¤U·s¼W¨â­Ó¸Ë¸m¡G st0a ©M st0c¡C §Q¥Î newfs «ü¥O¥i¥H¦b st0a «Ø¥ßÀɮרt²Î¡G &prompt.root; newfs -U /dev/stripe/st0a ¿Ã¹õ¤W·|¦³¤@°ï¼Æ¦r¶ÉÂm¦Ó¹L¡A´X¬íÄÁ«á´N·|§¹¦¨¡C¦¹®ÉªÅ¶¡¤w«Ø¥ß¡A ¥i¥Î¨Ó±¾¸ü¨Ï¥Î¤F¡C - ¤U­±«ü¥O¥i¥Î¨Ó¤â°Ê±¾¸ü¤À´²³sµ²ªÅ¶¡¡G + ¤U­±«ü¥O¥i¥Î¨Ó¤â°Ê±¾¸ü¤À´²³sµ²(striping)ªÅ¶¡¡G &prompt.root; mount /dev/stripe/st0a /mnt ¦pªG­n¦b¶}¾÷®É¦Û°Ê±¾¸ü¡A¦b /etc/fstab ¥[¤J³o¶ôªÅ¶¡ªº¸ê°T¡G &prompt.root; echo "/dev/stripe/st0a /mnt ufs rw 2 2" \ >> /etc/fstab - ¦Ó geom ®Ö¤ß¼Ò²Õ¥²»Ý¦b¨t²Îªì©l¤Æ®É¦Û°Ê¸ü¤J¡A - ¦]¦¹¦b /boot/lodaer.conf ¥[¤J¤@¦æ¡G + ¦Ó geom kernel module ¥²¶·¦b¨t²Îªì©l¤Æ®É¦Û°Ê¸ü¤J¡A + ¦]¦¹¦b /boot/lodaer.conf ¥[¤J¤@¦æ¡G &prompt.root; echo 'geom_stripe_load="YES"' >> /boot/loader.conf - RAID1 - Mirroring + RAID1 - Ãè®g(Mirroring) GEOM - Disk Mirroring + ºÏºÐÃè®g(Disk Mirroring) - Mirroring is a technology used by many corporations and home - users to back up data without interruption. When a mirror exists, - it simply means that diskB replicates diskA. Or, perhaps diskC+D - replicates diskA+B. Regardless of the disk configuration, the - important aspect is that information on one disk or partition is - being replicated. Later, that information could be more easily - restored, backed up without causing service or access - interruption, and even be physically stored in a data - safe. - - To begin, ensure the system has two disk drives of equal size, - this exercise assumes they are direct access (&man.da.4;) - SCSI disks. - - Begin by installing &os; on the first disk with only two - partitions. One should be a swap partition, double the - RAM size and all remaining space devoted to - the root (/) file system. - It is possible to have separate partitions for other mount points; - however, this will increase the difficulty level ten fold due to - manual alteration of the &man.bsdlabel.8; and &man.fdisk.8; - settings. - - Reboot and wait for the system to fully initialize. Once this - process has completed, log in as the root - user. - - Create the /dev/mirror/gm device and link - it with /dev/da1: + ³\¦h¥ø·~©Î­Ó¤H¥Î¤á¥ÎÃè®g(mirroring) ¨Ó¤£¤¤Â_¨t²Î¶i¦æ³Æ¥÷¡C + Ãè®g²³æ¨Ó»¡´N¬O¦b B ºÏºÐ¤W­«ÂФ@¥÷ A ºÏºÐªº¸ê®Æ¡A + ©ÎªÌ C+D ºÏºÐ­«ÂÐ A+B ºÏºÐªº¸ê®Æ¡C¤£½×³]©w¦p¦ó¡A + ³Ì­«­nªº¬O©Ò¦³ºÏºÐ©Î¤À³Î°Ï(partition) ¤Wªº¸ê®Æ³£·|³Q½Æ»s¡A + ¤§«á¥i¦b¤£¤¤Â_ªA°Èªº±¡ªp¤U´_­ì¡B³Æ¥÷¸ê®Æ¡A¨ÏÀx¦sªº¸ê®Æ§ó¦w¥þ¡C + + ¶}©l¤§«e¡A½Ð¥ý½T©w¨t²Î¤W¦³¨â­Ó®e¶q¬Û¦PªººÏºÐ¡A + «á­±ªº½d¨Ò°²³]³o¨âÁûºÏºÐ¬O direct access(&man.da.4;) + SCSI ºÏºÐ¡C + + ­º¥ý§Ú­Ì°²³] &os; ¦w¸Ë¦b²Ä¤@­ÓºÏºÐ¤W¡A¥B¥u¦³¨â­Ó¤À³Î°Ï(partition)¡C + ¨ä¤¤¤@­Ó¬O¥æ´«¤À³Î°Ï(swap partition¡A¤j¤p¬° RAM + ªº¨â­¿)¡A¦Ó³Ñ¤Uªº¥þ¥Î©ó®Ú¥Ø¿ý(§Y /¡A + root file system)¡C·íµM­n¦b¤£¦P±¾¸üÂI(mount point) ¤Á¥X§ó¦h¤À³Î°Ï + (partition) ¤]¥i¥H¡A¤£¹LÃø«×·|¤j´T´£¤É¡A¦]¬°¥²¶·¤â°Ê¾Þ§@ &man.bsdlabel.8; + ©M &man.fdisk.8; ¤u¨ã¡C + + ­«¶}¾÷¨Ãµ¥¨ì¨t²Î§¹¥þªì©l¤Æ§¹²¦¡A¥Î root + µn¤J¡C + + «Ø¥ß /dev/mirror/gm ¸Ë¸m¨Ã¥H + /dev/da1 ³sµ²¡G &prompt.root; gmirror label -vnb round-robin gm0 /dev/da1 - The system should respond with: + ³o®É¨t²ÎÀ³¸Ó·|¦^À³¡G Metadata value stored on /dev/da1. Done. - Initialize GEOM, this will load the - /boot/kernel/geom_mirror.ko kernel - module: + ªì©l¤Æ GEOM¡A³o°Ê§@·|¦Û°Ê¸ü¤J + /boot/kernel/geom_mirror.ko kernel module¡G &prompt.root; gmirror load - This command should have created the - gm0, device node under the - /dev/mirror - directory. + ³o°Ê§@À³¸Ó·|¦b /dev/mirror + ¤U«Ø¥ß gm0 ¸Ë¸mµ²ÂI(device node)¡C - Install a generic fdisk label and boot code - to newly created gm0 device: + ¦b³o­Ó·s«Øªº gm0 ¸Ë¸m¤W¦w¸m¤@¯ëªº + fdisk label ©M¶}¾÷ºÏ°Ï¡G &prompt.root; fdisk -vBI /dev/mirror/gm0 - Now install generic bsdlabel - information: + ±µµÛ¦w¸m bsdlabel ¸ê°T¡G &prompt.root; bsdlabel -wB /dev/mirror/gm0s1 - If multiple slices and partitions exist, the flags for the - previous two commands will require alteration. They must match - the slice and partition size of the other disk. + ¦pªG¦s¦b¦h­Ó slice ©M¤À³Î°Ï(partition)¡A + °O±o­×§ï¤W¨â«ü¥Oªº°Ñ¼Æ¡A¥B¥t¤@­ÓºÏºÐ¤Wªº slice ©M¤À³Î°Ï(partition) + ¤j¤p¥²¶·¬Û¦P¡C - Use the &man.newfs.8; utility to create a default file - system on the gm0s1a device node: + ¥Î &man.newfs.8; ¤u¨ã¦b gm0s1a + ¸Ë¸mµ²ÂI«Ø¥ß¹w³]ªºÀɮרt²Î¡G &prompt.root; newfs -U /dev/mirror/gm0s1a - This should have caused the system to spit out some - information and a bunch of numbers. This is good. Examine the - screen for any error messages and mount the device to the - /mnt mount point: + ¨t²Î·|¦L¥X³\¦h¸ê°T©M¤@¤j°ï¼Æ¦r¡A³o¬O¥¿±`ªº¡C + ½T»{¬O§_¦³»{¦ó¿ù»~¡A±µµÛ´N¥i¥H±N³o­Ó¸Ë¸m±¾¸ü¨ì + /mnt ±¾¸üÂI(mount mount)¡G &prompt.root; mount /dev/mirror/gm0s1a /mnt - Now move all data from the boot disk over to this new file - system. This example uses the &man.dump.8; and &man.restore.8; - commands; however, &man.dd.1; would also work with this - scenario. + ±µµÛ±N­ì¥»¶}¾÷ºÏºÐªº¸ê®Æ·h²¾¨ì·sªºÀɮרt²Î + (/mnt)¡C½d¨Ò¬O¥Î + &man.dump.8; ©M &man.restore.8; ¡A¤£¹L¥Î &man.dd.1; ¤]¥i¥H¡C - &prompt.root; dump -L -0 -f- / |(cd /mnt && restore -r -v -f-) + &prompt.root; dump -L -0 -f- / |(cd /mnt && restore -r -v -f-) - This must be done for each file system. Simply place the - appropriate file system in the correct location when running the - aforementioned command. + °õ¦æ¤W­z«ü¥O®É¡A¥u­n±N«ê·íªºÀɮרt²Î±¾¦b¥¿½Tªº¦ì¸m¡AÀ³¸Ó´N¯à¦¨¥\¡C + - Now edit the replicated /mnt/etc/fstab - file and remove or comment out the swap file + ±µµÛ½s¿è /mnt/etc/fstab + ÀɱN swap file ¨º¦æ²¾°£©Îµù¸Ñ°_¨Ó¡C - It should be noted that commenting out the swap file entry - in fstab will most likely require you to - re-establish a different way of enabling swap space. Please - refer to for more - information. - . Change the other file system information to use the - new disk. See the following example: + ½Ðª`·N¡A±N fstab ªº swap file + ¨º¦æµù¸Ñ°_¨Ó¡A³q±`ªí¥Ü¡G±z±o¥Î§Oªº¤èªk¨Ó­««Ø swap¡C¸Ô±¡½Ð°Ñ¦Ò + ¡C + ½Ð°Ñ¦Ò¤U­±½d¨Ò¡A¨Ã®Ú¾Ú·sºÏºÐ­×§ï¨ä¥¦ªºÀɮרt²Î¸ê°T¡G # Device Mountpoint FStype Options Dump Pass# #/dev/da0s2b none swap sw 0 0 /dev/mirror/gm0s1a / ufs rw 1 1 - Now create a boot.conf file on both the - current and new root partitions. This file will - help the system BIOS - boot the correct drive: + ¦b¥Ø«eªº®Ú¥Ø¿ý¤Î·sªº®Ú¥Ø¿ý«Ø¥ß boot.conf ÀɮסA + ³o­ÓÀÉ®×¥i¥H¡yÀ°§U¡z¨t²Î BIOS ¶}¾÷¡G &prompt.root; echo "1:da(1,a)/boot/loader" > /boot.config &prompt.root; echo "1:da(1,a)/boot/loader" > /mnt/boot.config - We have placed it on both root partitions to ensure proper - boot up. If for some reason the system cannot read from the - new root partition, a failsafe is available. + ¦b¨â­Ó®Ú¥Ø¿ý¤W³£·s¼WÀɮ׬O¬°¤F¦w¥þ°_¨£¡A + ¦pªG¦]¬°¬Y¨Ç­ì¦]·sªº®Ú¥Ø¿ýµLªk¶}¾÷¡A¦Ü¤ÖÁÙ¥i¥Î­ì¥»ªº®Ú¥Ø¿ý¡C - Now add the following line to the new - /boot/loader.conf: + ±µµÛ¦b /boot/loader.conf ·s¼W¨â¦æ¡G &prompt.root; echo 'geom_mirror_load="YES"' >> /mnt/boot/loader.conf - This will instruct &man.loader.8; utility to load the - geom_mirror.ko module during system - initialization. + ³o·|«ü¥Ü &man.loader.8; ¦b¶}¾÷®É¸ü¤J + geom_mirror.ko kernel module¡C - Reboot the system: + ­«¶}¾÷¡G &prompt.root; shutdown -r now - If all has gone well, the system should have booted from the - gm0s1a device and a login - prompt should be waiting. If something went wrong, see review - the forthcoming troubleshooting section. Now add the - da0 disk to gm0 - device: + ¦pªG¤@¤Á¶¶§Q¡A¨t²ÎÀ³¸Ó·|±q gm0s1a ¸Ë¸m¶}¾÷¡A + ±µ¤U¨Ó¥X²{ login ´£¥Üµe­±¡C¦pªG¥X¿ù¤F¡A + ½Ð°Ñ¾\¤U­± Troubleshooting ¨º¤@¸`¡C ²{¦b¥i¥H±N + da0 ºÏºÐ¥[¤J gm0 + ¸Ë¸m¡G &prompt.root; gmirror configure -a gm0 &prompt.root; gmirror insert gm0 /dev/da0 - The flag tells &man.gmirror.8; to use - automatic synchronization; i.e., mirror the disk writes - automatically. The manual page explains how to rebuild and - replace disks, although it uses data - in place of gm0. + ¨ä¤¤ ºX¼Ð§i¶D &man.gmirror.8; + ¨Ï¥Î¡u¦Û°Ê¦P¨B(automatic synchronization)¡v¡A¨Ò¦p¦Û°Ê¦P¨B¼g¤JºÏºÐªº°Ê§@¡C + manual »¡©ú¤F¦p¦ó­««Ø¡B¨ú¥NºÏºÐµ¥¡A¤£¹L manual ¸Ìªº½d¨Ò¬O¥Î + data ¦Ó¤£¬O gm0¡C Troubleshooting - System refuses to boot + ¨t²ÎµLªk¶}¾÷ - If the system boots up to a prompt similar to: + ¦pªG¶}¾÷´£¥ÜÃþ¦ü³o¼Ë¡G ffs_mountroot: can't find rootvp Root mount failed: 6 mountroot> - Reboot the machine using the power or reset button. At - the boot menu, select option six (6). This will drop the - system to a &man.loader.8; prompt. Load the kernel module - manually: + ½Ð¥Î¾÷¾¹­±ªO¤Wªº Power «ö¶s©Î reset «ö¶s¨Ó­«¶}¾÷¡A¨Ã¦b¶}¾÷¿ï³æ¿ï (6)¡A + ³o¼Ë¤l¡A¨t²Î´N·|¶i¤J &man.loader.8; + ¥æ½Í¼Ò¦¡¡C³o®É­Ô¡A½Ð·Ó¤U­±«ü¥O¨Ó¤â°Ê¸ü¤J©Ò»Ýªº kernel module + ¡A¤]´N¬O geom_mirror.ko¡G OK? load geom_mirror.ko OK? boot - If this works then for whatever reason the module was not - being loaded properly. Place: + ¦pªG³o¼Ë¦¨¥\¤Fªº¸Ü¡Aªí¥Ü¦]¬°¬Y¨Ç­ì¦]µLªk¦Û°Ê¸ü¤J kernel module¡C + ½Ð±N¡G options GEOM_MIRROR - in the kernel configuration file, rebuild and reinstall. - That should remedy this issue. + ¥[¤J¨ì®Ö¤ß³]©wÀÉ(kernel configuration file)¡A­«½s¨Ã¦w¸Ë®Ö¤ß¡C + ³oÀ³¸Ó¯à¸Ñ¨M³o­Ó°ÝÃD¡C diff --git a/zh_TW.Big5/books/handbook/install/chapter.sgml b/zh_TW.Big5/books/handbook/install/chapter.sgml index 3304ba6ab3..4938e607c1 100644 --- a/zh_TW.Big5/books/handbook/install/chapter.sgml +++ b/zh_TW.Big5/books/handbook/install/chapter.sgml @@ -1,5683 +1,5522 @@ Jim Mock Restructured, reorganized, and parts rewritten by Randy Pratt The sysinstall walkthrough, screenshots, and general copy by ¦w¸Ë FreeBSD - Synopsis + ·§­z installation - FreeBSD is provided with a text-based, easy to use installation - program called sysinstall. This is the - default installation program for FreeBSD, although vendors are free to - provide their own installation suite if they wish. This chapter - describes how to use sysinstall to install - FreeBSD. + FreeBSD ´£¨Ñ¤@­Ó²³æ¦n¥Îªº¤å¦r¤¶­±¦w¸Ëµ{¦¡¡A¥s°µ sysinstall¡C + ³o¬O FreeBSD ¹w³]¨Ï¥Îªº¦w¸Ëµ{¦¡¡C¨ó¤O¼t°Ó¦pªG·Q¡A¤]¥i¥H§ï¥Î¦Û¤vªº¦w¸Ëµ{¦¡¡C + ¥»³¹±N»¡©ú¦p¦ó¨Ï¥Î sysinstall ¨Ó¦w¸Ë FreeBSD¡C - After reading this chapter, you will know: + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡J - How to create the FreeBSD installation disks. + ¦p¦ó»s§@ FreeBSD ¦w¸Ë¤ù - How FreeBSD refers to, and subdivides, your hard disks. + FreeBSD ¹ïµwºÐªº¨Ï¥Î¤Î°t¸m¡C - How to start sysinstall. + ¦p¦ó±Ò°Ê sysinstall µ{¦¡¡C - The questions sysinstall will ask - you, what they mean, and how to answer them. + ¦b°õ¦æ sysinstall ®É·|°Ýªº¬ÛÃö°ÝÃD¦³­þ¨Ç¡B + ³o¨Ç°ÝÃDªº·N«ä¬°¦ó¡B¥H¤Î¸Ó¦p¦ó¦^µª¡C - Before reading this chapter, you should: + ¦b¶}©l¾\Ū³o³¹¤§«e¡A±z»Ý­n¡J - Read the supported hardware list that shipped with the version - of FreeBSD you are installing, and verify that your hardware is - supported. + ¾\Ū­n¦w¸Ëªº FreeBSD ª©¥»©Òªþ¤§µwÅé¤ä´©ªí¡A¥H½T©w±zªºµwÅ馳¨S¦³³Q¤ä´©¡C - In general, these installation instructions are written - for &i386; (PC compatible) architecture - computers. Where applicable, instructions specific to other - platforms (for example, Alpha) will be listed. Although this - guide is kept as up to date as possible, you may find minor - differences between the installer and what is shown here. It is - suggested that you use this chapter as a general guide rather - than a literal installation manual. + ¤@¯ë¨Ó»¡¡A¦¹¦w¸Ë»¡©ú¬O°w¹ï &i386; (¬Û®eªº PC ¾÷ºØ) + ¬[ºcªº¹q¸£¡C ¦pªG¦³¨ä¥L¬[ºc(¤ñ¦p Alpha)ªº¦w¸Ë»¡©ú¡A§Ú­Ì·|¤@¨Ö¦C¥X¡C + ÁöµM¥»¤å¥ó·|±`±`§ó·s¡A¦ý¦³¥i¯à»P±z¦w¸Ëª©¥»¤W©Òªþªº»¡©ú¤å¥ó¦³¨Ç³\¥X¤J¡C + ¦b¦¹¡A§Ú­Ì«ØÄ³±z§â¥»»¡©ú¤å³¹·í§@¤@¯ëªº¦w¸Ë°Ñ¦Ò­ì«h´N¦n¡C - Pre-installation Tasks + ¦w¸Ë«eªº·Ç³Æ¤u§@ - Inventory Your Computer - - Before installing FreeBSD you should attempt to inventory the - components in your computer. The FreeBSD installation routines will - show you the components (hard disks, network cards, CDROM drives, and - so forth) with their model number and manufacturer. FreeBSD will also - attempt to determine the correct configuration for these devices, - which includes information about IRQ and IO port usage. Due to the - vagaries of PC hardware this process is not always completely - successful, and you may need to correct FreeBSD's determination of - your configuration. - - If you already have another operating system installed, such as - &windows; or Linux, it is a good idea to use the facilities provided - by those operating systems to see how your hardware is already - configured. If you are not sure what settings an expansion - card is using, you may find it printed on the card itself. Popular IRQ - numbers are 3, 5, and 7, and IO port addresses are normally written as - hexadecimal numbers, such as 0x330. - - We recommend you print or write down this information before - installing FreeBSD. It may help to use a table, like this: + ¦C¥X±z¹q¸£ªºµwÅé²M³æ + + ¦b¦w¸Ë FreeBSD ¤§«e¡A±zÀ³¸Ó¸ÕµÛ±N±z¹q¸£¤¤ªºµwÅé²M³æ¦C¥X¨Ó¡C + FreeBSD ¦w¸Ëµ{¦¡·|±N³o¨ÇµwÅé(µwºÐ¡Bºô¸ô¥d¡B¥úºÐ¾÷µ¥µ¥)¥H«¬¸¹¤Î»s³y¼t°Ó¦C¥X¨Ó¡C + FreeBSD ¤]·|¹Á¸Õ¬°³o¨ÇµwÅé§ä¥X³Ì¾A·íªº IRQ ¤Î IO port ªº³]©w¡C + ¦ý¬O¦]¬° PC ªºµwÅéºØÃþ¹ê¦b¤Ó¹L½ÆÂø¡A³o­Ó¨BÆJ¤£¤@©w«OÃÒµ´¹ï¦¨¥\¡C + ³o®É¡A±z´N¥i¯à»Ý­n¤â°Ê§ó§ï¦³°ÝÃDªº³]©w­È­ù¡C + + ¦pªG±z¤w¸Ë¤F¨ä¥¦ªº§@·~¨t²Î¡A¦p¡G + &windows; ©Î Linux¡A¨º»ò¥i¥ý¥Ñ³o¨Ç¨t²Î©Ò´£¨Ñªº¤u¨ã¡A¨Ó¬d¬Ý³o¨ÇµwÅé³]©w­È¬O«ç»ò³]©wªº¡C + ­Y¯uªº¨S¿ìªk½T©w¬Y¨Ç¥d¥Î¤°»ò³]©w­È¡A¨º»ò¥i¥HÀˬd¬Ý¬Ý¥d¤W­±©Ò¼Ð¥ÜªºªF¦è¡A»¡¤£©w¥¦ªº³]©w¤w¦³¼Ð¥Ü¦b¥d¤W¡C + ±`¥Îªº IRQ ¸¹½X¬° 3¡B5 ¥H¤Î 7¡F¦Ó IO °ðªº­È³q±`¥H 16 ¶i¦ìªí¥Ü¡A¨Ò¦p 0x330¡C + + «ØÄ³±z¦b¦w¸Ë FreeBSD ¤§«e¡A§â³o¨Ç¸ê®Æ¦C¦L©Î§Û¿ý¤U¨Ó¡A°µ¦¨ªí®æªº¼Ë¤l¤]³\·|¸û¦³¥Î³á¡A¨Ò¦p¡G - Sample Device Inventory + µwÅé²M³æ(Á|¨Ò) - Device Name + µwÅé¦WºÙ IRQ IO port(s) - Notes + ³Æµù - First hard disk + ²Ä¤@Áû IDE µwºÐ N/A N/A - 40 GB, made by Seagate, first IDE master + 40 GB¡ASeagate »s³y¡Afirst IDE master CDROM N/A N/A First IDE slave - Second hard disk + ²Ä¤GÁûµwºÐ N/A N/A - 20 GB, made by IBM, second IDE master + 20 GB¡AIBM »s³y¡A second IDE master - First IDE controller + ²Ä¤@­Ó IDE controller 14 0x1f0 - Network card + ºô¸ô¥d N/A N/A &intel; 10/100 - Modem + ¼Æ¾Ú¾÷ N/A N/A - &tm.3com; 56K faxmodem, on COM1 + &tm.3com; 56K faxmodem¡A±µ¦b COM1
- Backup Your Data + ³Æ¥÷±zªº¸ê®Æ - If the computer you will be installing FreeBSD on contains - valuable data, then ensure you have it backed up, and that you have - tested the backups before installing FreeBSD. The FreeBSD - installation routine will prompt you before writing any - data to your disk, but once that process has started it cannot be - undone. + ¦pªG­n¸Ëªº¹q¸£¤W­±¦s¦³­«­n¸ê®Æ¡A¨º»ò¦b¦w¸Ë FreeBSD «e¡A + ½Ð½T©w±z¤w¸g±N³o¨Ç¸ê®Æ³Æ¥÷¤F¡A¨Ã¥B¥ý´ú¸Õ¹L³o¨Ç³Æ¥÷ÀɬO§_¨S¦³°ÝÃD¡C + FreeBSD ¦w¸Ëµ{¦¡¦b­n¼g¤J¥ô¦ó¸ê®Æ¨ì±zªºµwºÐ«e¡A³£·|¥ý´£¿ô±z½T»{¡A + ¤@¥¹±z½T©w­n¼g¤J¡A¨º»ò¤§«á´N¦A¤]¨S¦³¤Ï®¬ªº¾÷·|Åo¡C - Decide Where to Install FreeBSD + ¨M©w­n±N FreeBSD ¦w¸Ë¨ì­þ¸Ì - If you want FreeBSD to use your entire hard disk, then there is nothing - more to concern yourself with at this point — you can skip this - section. + ¦pªG±z·QÅý FreeBSD ª½±µ¨Ï¥Î¾ãÁûµwºÐ¡A¨º»ò½Ðª½±µ¸õ¨ì¤U¤@¸`¡C - However, if you need FreeBSD to co-exist with other operating - systems then you need to have a rough understanding of how data is - laid out on the disk, and how this affects you. + µM¦Ó¡A¦pªG±z·Q­n FreeBSD ¸ò¬J¦³ªº¨t²Î¨Ã¦s¡A¨º»ò¡A±z¥²¶·¹ïµwºÐªº¸ê®Æ¤À§G¤è¦¡¦³²`¤Jªº¤F¸Ñ¡A + ¥H¤Î¨ä©Ò³y¦¨ªº¼vÅT¡C - Disk Layouts for the &i386; - - A PC disk can be divided into discrete chunks. These chunks are - called partitions. By design, the PC only - supports four partitions per disk. These partitions are called - primary partitions. To work around this - limitation and allow more than four partitions, a new partition type - was created, the extended partition. A disk - may contain only one extended partition. Special partitions, called - logical partitions, can be created inside this - extended partition. - - Each partition has a partition ID, which is - a number used to identify the type of data on the partition. FreeBSD - partitions have the partition ID of 165. - - In general, each operating system that you use will identify - partitions in a particular way. For example, DOS, and its - descendants, like &windows;, assign each primary and logical partition a - drive letter, starting with - C:. - - FreeBSD must be installed into a primary partition. FreeBSD can - keep all its data, including any files that you create, on this one - partition. However, if you have multiple disks, then you can create a - FreeBSD partition on all, or some, of them. When you install FreeBSD, - you must have one partition available. This might be a blank - partition that you have prepared, or it might be an existing partition - that contains data that you no longer care about. - - If you are already using all the partitions on all your disks, then - you will have to free one of them for FreeBSD using the tools - provided by the other operating systems you use (e.g., - fdisk on DOS or &windows;). - - If you have a spare partition then you can use that. However, you - may need to shrink one or more of your existing partitions - first. - - A minimal installation of FreeBSD takes as little as 100 MB of disk - space. However, that is a very minimal install, - leaving almost no space for your own files. A more realistic minimum - is 250 MB without a graphical environment, and 350 MB or more if you - want a graphical user interface. If you intend to install a lot of - third party software as well, then you will need more space. - - You can use a commercial tool such as &partitionmagic; - to resize your partitions to make space for - FreeBSD. The tools directory on the CDROM - contains two free software tools which can carry out this task, namely - FIPS and - PResizer. Documentation for both - of these is available in the same directory. + &i386; ¬[ºcªºµwºÐ°t¸m¼Ò¦¡ + + PC ¤WªºµwºÐ¥i¥H³Q²Ó¤À¬°³\¦h¤À´²ªº°Ï°ì¡C³o¨Ç°Ï°ì¥s°µ ¤À³Î°Ï(Partitions)¡C + ¦]¬°³]­pªº¤è¦¡¡A¨C­ÓµwºÐ³Ì¦h¥i¥H¦³ 4 ­Ó¤À³Î°Ï¡A¦Ó³o¨Ç¤À³Î¥s°µ + ¥D­n¤À³Î°Ï(Primary Partitions)¡C + ¬°¤F¬ð¯}³o­Ó­­¨î¡A¥H«K¯à¨Ï¥Î§ó¦hªº¤À³Î°Ï¡A´N¦³¤F·sªº¤À³Î°ÏÃþ«¬¡A¥s§@¡G + ©µ¦ù¤À³Î°Ï(Extended Partition)¡C + ¨C­ÓµwºÐ´N¥u¯à¦³¤@­Ó©µ¦ù¤À³Î°Ï¡CµM¦Ó¡A¦b©µ¦ù¤À³Î°Ï¸Ì­±¥i¥H«Ø¥ß³\¦h­Ó¯S®í¤À³Î°Ï¡A¥s§@ + ÅÞ¿è¤À³Î°Ï(Logical Partitions)¡C + + ¨CºØ¤À³Î°Ï³£¦³¨ä ¤À³Î°Ï¥N¸¹(Partition ID) + ¥Î¥H°Ï§O¨CºØ¤À³Î°Ïªº¸ê®ÆÃþ«¬¡C¦Ó FreeBSD ¤À³Î°Ï¥N¸¹¬O 165¡C + + ¤@¯ë¨ÓÁ¿¡A¨CºØ§@·~¨t²Î³£·|¦³¦Û¤v¿W¯Sªº¤è¦¡¨Ó°Ï§O¤À³Î°Ï¡CÁ|¨Ò¡G DOS ¤Î¨ä¤§«áªº§@·~¨t²Î¡A¤ñ¦p + &windows; ¡A·|¤À°tµ¹¨C­Ó¥D­n¤À³Î°Ï¤ÎÅÞ¿è¤À³Î°Ï 1 ­Ó + ºÏºÐ¥N¸¹(drive letter)¡A±q C: ¶}©l¡C + + FreeBSD ¥²¶·¦w¸Ë¦b¥D­n¤À³Î°Ï¡CFreeBSD ¥i¥H¦b³o­Ó¤À³Î°Ï¤W­±¦s©ñ¸ê®Æ©Î¬O±z«Ø¥ßªº¥ô¦óÀɮסC + µM¦Ó¡A¦pªG±z¦³«Ü¦hÁûµwºÐ¡A¤]¥i¥H¦b³o¨Ç(©Î³¡¥÷)µwºÐ«Ø¥ß FreeBSD ¤À³Î°Ï¡C + ¦w¸Ë FreeBSD ªº®É­Ô¡A¥²¶·¦Ü¤Ö­n¦³ 1 ­Ó¤À³Î°Ïµ¹ FreeBSD ¨Ï¥Î¡A + ³o­Ó¤À³Î°Ï¥i¥H¬O©|¥¼¨Ï¥Îªº¤À³Î°Ï¡A©Î¬O²{¦sªº¤À³Î°Ï¡C(¦ý¤W­±ªº¸ê®Æ¤£¥´ºâÄ~Äò¨Ï¥Î) + + ¦pªG±z¤w¸g¥Î§¹¤F±zºÏºÐ¤W©Ò¦³ªº¤À³Î°Ï¡A¨º»ò±z¥²¶·¨Ï¥Î¨ä¥L§@·~¨t²Î©Ò´£¨Ñªº¤u¨ã + (¹³¬O DOS or &windows; ¤Wªº fdisk)¨ÓÄË¥X¤@­Ó¤À³Î°Ïµ¹ FreeBSD ¥Î¡C + + ¦pªG¦³¦h¾lªº¤À³Î°Ï¡A¤]¥i¥H¨Ï¥Î¥¦¡C¦ý¨Ï¥Î«e¡A±z¥i¯à»Ý­n¥ý¾ã²z¤@¤U³o¨Ç¤À³Î°Ï¡C + + FreeBSD³Ì¤p¦w¸Ë»Ý­n¬ù 100 MB ªºªÅ¶¡¡A¦ý¬O³o¥u¬O¡y³Ì¤p¦w¸Ë¡z¡A + ´X¥G¨S³Ñ¤U¦h¤ÖªÅ¶¡¨Ó¦s©ñ±z¦Û¤vªºÀɮסC ¸û²z·Qªº(¤£§t¹Ï§Î¤¶­±)³Ì¤p¦w¸Ë¬O¬ù + 250 MB¡A©ÎªÌ¬O 350 MB ¥ª¥k(¥]§t¹Ï§Î¤¶­±)¡C + Áٻݭn¦w¸Ë¨ä¥Lªº®M¥ó³nÅé¡A¨º»ò±N»Ý­n§ó¦hªºµwºÐªÅ¶¡¡C + + ±z¥i¥H¨Ï¥Î°Ó·~³nÅé¡A¨Ò¦p &partitionmagic; + ¨Ó­«·s½Õ¾ã¤À³Î°ÏªÅ¶¡¡A¨Óµ¹ FreeBSD ¥ÎªºªÅ¶¡¡CFreeBSD ¥úºÐ¡BFTP ¤W­±ªº tools + ¥Ø¿ý¥]§t¨â­Ó§K¶Oªº¤u¨ã¡A¤]¥i¥H¹F¦¨³o­Ó¤u§@¡A¥s§@¡G + FIPS ¤Î + PResizer¡C³o¨Ç¤u¨ãªº»¡©ú¤å¥ó¥i¥H¦b¦P­Ó¥Ø¿ý¤º§ä¨ì¡C FIPS, - PResizer, and - &partitionmagic; can resize - FAT16 and FAT32 - partitions — used in &ms-dos; through &windows; ME. - &partitionmagic; is the only one of - the above applications that can resize NTFS - partitions. + PResizer ©M + &partitionmagic; ¥i¥H­«·s½Õ¾ã¦b &ms-dos; ¨ì &windows; ME ©Ò¨Ï¥Îªº + FAT16 ¤Î FAT32 + ¤À³Î°Ï¤j¤p¡C¥t¥~¡A + &partitionmagic; «h¬O¤W­z³nÅ餤°ß¤@¥i¥H­«·s½Õ¾ã + NTFS ¤À³Î°Ï¤j¤p¡C - Incorrect use of these tools can delete the data on your disk. - Be sure that you have recent, working backups before using - them. + ¤£·íªº¨Ï¥Î³o¨Ç¤u¨ã¡A¥i¯à·|§R°£©Ò¦³µwºÐ¤Wªº¸ê®Æ¡C + ¦b¨Ï¥Î³o¨Ç¤u¨ã«e¡A½Ð½T©w±z¤w¦³¥ý³Æ¥÷¦n¸ê®Æ¡C - Using an Existing Partition Unchanged - - Suppose that you have a computer with a single 4 GB disk that - already has a version of &windows; installed, and you have split the - disk into two drive letters, C: and - D:, each of which is 2 GB in size. You have - 1 GB of data on C:, and 0.5 GB of data on - D:. - - This means that your disk has two partitions on it, one per - drive letter. You can copy all your existing data from - D: to C:, which - will free up the second partition, ready for FreeBSD. + ¨Ï¥Î²{¦³ªº¤À³Î°Ï + + °²³]±z¥u¦³¤@­Ó 4 GB ªºµwºÐ¡A¦Ó¥B¤w¸g¸Ë¤F &windows; + ¡AµM«á±N³oÁûµwºÐ¤À¦¨¨â­ÓºÏºÐ¥N¸¹¡GC: ¤Î + D:¡A¨C­Ó¤j¤p¬° 2 GB ¡C + C: ¼Ñ¤W©ñ¤F 1 GB ªº¸ê®Æ¡A¦Ó D: + ¼Ñ¤W©ñ¤F 0.5 GB ªº¸ê®Æ¡C + + ³oªí¥ÜµwºÐ¤W¦³¨â­Ó¤À³Î°Ï¡A¨C­ÓºÏºÐ¥N¸¹¼Ñ³£¬O¤À³Î°Ï¡C±z¥i¥H§â©Ò¦³©ñ¦b + D: ªº¸ê®Æ¡A³£²¾°Ê¨ì C: + ¡A³o¼Ë´NªÅ¥X¤F²Ä¤G­Ó¤À³Î°Ï¥i¥Hµ¹ FreeBSD ¨Ï¥Î¡C - Shrinking an Existing Partition + ÁY´î²{¦³ªº¤À³Î°Ï - Suppose that you have a computer with a single 4 GB disk that - already has a version of &windows; installed. When you installed - &windows; you created one large partition, giving you a - C: drive that is 4 GB in size. You are - currently using 1.5 GB of space, and want FreeBSD to have 2 GB of - space. + °²³]±z¥u¦³¤@­Ó 4 GB µwºÐ¡A¦Ó¥B¤w¸g¸Ë¤F &windows; ¡C¦b¦w¸Ë + &windows; ®É§â 4 GB ³£µ¹ C: ¼Ñ¡A¨Ã¥B²{¦b¤w¸g¥Î¤F 1.5 GB + ªÅ¶¡¡A¦Ó§A·Q±N³Ñ¤UªÅ¶¡ªº 2 GB µ¹ FreeBSD ¨Ï¥Î¡C - In order to install FreeBSD you will need to either: + ¦p¦¹¤@¨Ó¡A¬°¤F¸Ë FreeBSD ¡A§A¥²¶·¦b¥H¤U¨âºØ¤è¦¡¤G¿ï¤@¡G - Backup your &windows; data, and then reinstall &windows;, - asking for a 2 GB partition at install time. + ³Æ¥÷ &windows; ¸ê®Æ¡AµM«á­«¸Ë &windows;¡A¨Ã¦b¦w¸Ë &windows; ®Éµ¹ 2 GB ªº¤À³ÎªÅ¶¡¡C - Use one of the tools such as &partitionmagic;, - described above, to shrink your &windows; - partition. + ¨Ï¥Î¤W­zªº¤u¨ã¡A¹³¬O &partitionmagic;¡A¨Ó­«·s½Õ¾ã &windows; + ©Ò¥Îªº¤À³Î°Ï¤j¤p¡C - Disk Layouts for the Alpha + Alpha ¬[ºcªººÏºÐ°t¸m¼Ò¦¡ Alpha - You will need a dedicated disk for FreeBSD on the - Alpha. It is not possible to share a disk with another - operating system at this time. Depending on the specific - Alpha machine you have, this disk can either be a SCSI disk - or an IDE disk, as long as your machine is capable of - booting from it. + ¦b Alpha ¤W¡A±z¥²¶·¨Ï¥Î¤@¾ãÁûµwºÐµ¹ FreeBSD + ¡A¨S¦³¿ìªk¦b¦PÁûµwºÐ¤W¸ò¨ä¥L§@·~¨t²Î¦@¦s¡C®Ú¾Ú¤£¦P«¬¸¹ªº Alpha + ¾÷¾¹¡A±zªºµwºÐ¥i¥H¬O SCSI ©Î IDE µwºÐ¡A¥u­n±zªº¾÷¾¹¥i¥H±q³o¨ÇµwºÐ¶}¾÷´N¥i¥H¡C - Following the conventions of the Digital / Compaq - manuals all SRM input is shown in uppercase. SRM is case - insensitive. + «ö·Ó Digital / Compaq ¨Ï¥Î¤â¥Uªº½s±Æ­·®æ¡A©Ò¦³ SRM ¿é¤Jªº³¡¤À³£¥Î¤j¼gªí¥Ü¡C + ª`·N¡ASRM ¤j¤p¼g¦³§O¡C - To find the names and types of disks in your machine, use - the SHOW DEVICE command from the SRM - console prompt: + ­n±oª¾±zºÏºÐªº¦WºÙ¥H¤Î«¬¸¹¡A¥i¥H¦b SRM console ´£¥Ü¤U¨Ï¥Î + SHOW DEVICE ©R¥O¡G >>>SHOW DEVICE dka0.0.0.4.0 DKA0 TOSHIBA CD-ROM XM-57 3476 dkc0.0.0.1009.0 DKC0 RZ1BB-BS 0658 dkc100.1.0.1009.0 DKC100 SEAGATE ST34501W 0015 dva0.0.0.0.1 DVA0 ewa0.0.0.3.0 EWA0 00-00-F8-75-6D-01 pkc0.7.0.1009.0 PKC0 SCSI Bus ID 7 5.27 pqa0.0.0.4.0 PQA0 PCI EIDE pqb0.0.1.4.0 PQB0 PCI EIDE - This example is from a Digital Personal Workstation - 433au and shows three disks attached to the machine. The - first is a CDROM drive called DKA0 and - the other two are disks and are called - DKC0 and - DKC100 respectively. - - Disks with names of the form DKx - are SCSI disks. For example DKA100 - refers to a SCSI disk with SCSI target ID 1 on the first SCSI bus (A), - whereas DKC300 refers to a SCSI disk - with SCSI ID 3 on the third SCSI bus (C). Devicename - PKx refers to the SCSI host bus adapter. As - seen in the SHOW DEVICE output SCSI - CDROM drives are treated as any other SCSI hard disk drive. - - IDE disks have names similar to DQx, - while PQx is the associated IDE - controller. + ¨Ò¤l¤¤¾÷¾¹¬° Digital Personal Workstation + 433au ¨Ã¥BÅã¥Ü¥X¦¹¾÷¾¹¦³³s±µ¤T­ÓºÏºÐ¾÷¡C²Ä¤@­Ó¬O CDROM¡A¥s°µ DKA0 + ¡F¥t¥~¨â­Ó¬OºÏºÐ¾÷¡A ¤À§O¥s°µ¡G + DKC0 ¤Î + DKC100 ¡C + + ºÏºÐ¾÷ªº¦WºÙ¤¤¦³ DKx + ¦r¼Ëªº¬O SCSI µwºÐ¡C¨Ò¦p¡G DKA100 + ªí¥Ü¬O SCSI µwºÐ¡A¨ä SCSI ID ¬° 1¡A ¦ì¦b²Ä¤@­Ó SCSI ¶×¬y±Æ(A)¡F + ¦Ó DKC300 ªí¥Ü¬O SCSI µwºÐ¡A¨ä SCSI ID ¬° 3 + ¡A¦ì©ó²Ä¤T­Ó SCSI ¶×¬y±Æ(C)¡C¸Ë¸m¦WºÙ + PKx ªí¥Ü SCSI ±±¨î¥d¡C¥Ñ¤W­z SHOW DEVICE ªºµ²ªG¬Ý¨Ó¡A + SCSI ¥úºÐ¾÷¤]³Qµø¬°¬O SCSI µwºÐªº¤@ºØ¡C + + ­Y¬° IDE µwºÐªº¸Ü¡A¦WºÙ·|¦³ DQx ¦r¼Ë¡A¦Ó + PQx «hªí¥Ü¬Û¹ïÀ³ªº IDE ºÏºÐ±±¨î¾¹¡C - Collect Your Network Configuration Details + ¾ã²z§Aªººô¸ô³]©w¸ê®Æ - If you intend to connect to a network as part of your FreeBSD - installation (for example, if you will be installing from an FTP - site or an - NFS server), then you need to know your network configuration. You - will be prompted for this information during the installation so that - FreeBSD can connect to the network to complete the install. + ¦pªG·Q³z¹Lºô¸ô( FTP ¯¸©Î NFS)¦w¸Ë FreeBSD¡A¨º»ò´N¥²¶·ª¾¹D±zªººô¸ô²ÕºA¡C + ¦b¦w¸Ë FreeBSD ªº¹Lµ{¤¤±N·|´£¥Ü±z¿é¤J³o¨Ç¸ê°T¡A¥H¶¶§Q§¹¦¨¦w¸Ë¹Lµ{¡C - Connecting to an Ethernet Network or Cable/DSL Modem + ¨Ï¥Î¤A¤Óºô¸ô(Ethernet)©Î Cable/DSL ¼Æ¾Ú¾÷¤Wºô - If you connect to an Ethernet network, or you have an Internet - connection using an Ethernet adapter via cable or DSL, then you will need the following - information: + ­Y¨Ï¥Î¤A¤Óºô¸ô¡A©Î¬O­n³z¹L Cable/DSL ¼Æ¾Ú¾÷¤Wºô¡A¨º»ò±z¥²¶··Ç³Æ ¤U­±ªº¸ê°T¡G - IP address + IP ¦ì§} - IP address of the default gateway + ¹w³] Gateway(¹h¹D) ªº IP ¦ì§} - Hostname + Hostname(¾÷¾¹¦WºÙ) - DNS server IP addresses + DNS ¦øªA¾¹ªº IP ¦ì§} Subnet Mask - If you do not know this information, then ask your system - administrator or service provider. They may say that this - information is assigned automatically, using - DHCP. If so, make a note of this. + ­Y¤£ª¾¹D³o¨Ç¸ê°T¡A±z¥i¥H¸ß°Ý¨t²ÎºÞ²zªÌ©Î¬O±zªº ISP ·~ªÌ¡C + ¥L­Ì¥i¯à·|»¡³o¨Ç¸ê°T·|¥Ñ DHCP ¦Û°Ê«ü¬£¡F¦pªG¬O³o¼Ëªº¸Ü¡A ½Ð°O¦í³o¤@ÂI´N¥i¥H¤F¡C - Connecting Using a Modem + ¨Ï¥Î¼Æ¾Ú¾÷¤Wºô - If you dial up to an ISP using a regular modem then you can - still install FreeBSD over the Internet, it will just take a very - long time. + ­Y¥Ñ¤@¯ëªº¼Æ¾Ú¾÷¼·±µ¤Wºô¡A±z¤´µM¥i¥H¦w¸Ë FreeBSD¡A¥u¬O·|»Ý­n«Üªøªº®É¶¡¡C - You will need to know: + ±z¥²¶·ª¾¹D¡G - The phone number to dial for your ISP + ¼·±µ¨ì ISP ªº¹q¸Ü¸¹½X¡C - The COM: port your modem is connected to + ±zªº¼Æ¾Ú¾÷¬O³s¨ì­þ­Ó COM °ð¡C - The username and password for your ISP account + ±z¼·±µ¨ì ISP ©Ò¥Îªº±b¸¹¸ò±K½X¡C - Check for FreeBSD Errata + ¬d¾\ FreeBSD °É»~ªí(Errata) - Although the FreeBSD project strives to ensure that each release - of FreeBSD is as stable as possible, bugs do occasionally creep into - the process. On very rare occasions those bugs affect the - installation process. As these problems are discovered and fixed, they - are noted in the FreeBSD Errata, which is found on the FreeBSD web site. You - should check the errata before installing to make sure that there are - no late-breaking problems which you should be aware of. - - Information about all the releases, including the errata for each - release, can be found on the - release - information section of the + ÁöµM§Ú­ÌºÉ¤O¨Ï±o¨C­Ó FreeBSD µo¦æª©¥»³£«Üí©w¡A¦ý¬O¹Lµ{¤¤¤´µM¤£§K¦³®É·|µo¥Í¿ù»~¡C + ¦b«Ü¨u¨£ªº±¡§Î¤U¡A³o¨Ç¿ù»~·|¼vÅT¨ì¦w¸Ëªº¹Lµ{¡C·íµo²{³o¨Ç¿ù»~¥B­×¥¿«á¡A·|±N¥¦­Ì¦C¦b + + FreeBSD °É»~ªí(Errata) ¤¤¡C¦b±z¦w¸Ë FreeBSD + «e¡AÀ³¸Ó¥ý¬Ý¬Ý°É»~ªí¤¤¦³¨S¦³¤°»ò°ÝÃD·|¼vÅT¨ì±zªº¦w¸Ë¡C + + Ãö©ó©Ò¦³µo¦æª©¥»ªº¸ê°T¡A¥]¬A°É»~ªí¡A¥i¥H¦b FreeBSD ºô¯¸ ªº FreeBSD web site. + url="&url.base;/releases/index.html">µo¦æ±¡³ø(release information) §ä¨ì¡C - Obtain the FreeBSD Installation Files + ·Ç³Æ¦n FreeBSD ¦w¸ËÀÉ®× - The FreeBSD installation process can install FreeBSD from files - located in any of the following places: + FreeBSD ¥i¥H³z¹L¤U­±¥ô¦ó¤@ºØ¦w¸Ë¨Ó·½¶i¦æ¦w¸Ë¡J Local Media - A CDROM or DVD + CDROM ©Î DVD - A DOS partition on the same computer + ²{¦³ªº DOS ¤À³Î°Ï - A SCSI or QIC tape + SCSI ©Î QIC ºÏ±a¡C - Floppy disks + ³nºÐºÏ¤ù Network - An FTP site, going through a firewall, or using an HTTP proxy, - as necessary + FTP ¯¸¡B¤ä´© Passvie ¼Ò¦¡ªº FTP ¯¸(­Y±z¾÷¾¹¦b NAT ¤º)¡B¬Æ¦Ü HTTP proxy ³£¥i¥H¡C - An NFS server + NFS ¦øªA¾¹ - A dedicated parallel or serial connection + ±M¥Î(dedicated)ªº parallel ©Î serial ³s½u - If you have purchased FreeBSD on CD or DVD then you already have - everything you need, and should proceed to the next section - (). + ­Y¤w¸g¦³ FreeBSD ªº CD ©Î DVD¡A¦ý¾÷¾¹¤£¤ä´©±q¥úºÐ¶}¾÷ªº¸Ü¡A¨º»ò½Ðª½±µ¶i¤U¤@¸` + ()¡C - If you have not obtained the FreeBSD installation files you should - skip ahead to which explains how - to prepare to install FreeBSD from any of the above. After reading - that section, you should come back here, and read on to - . + ­Y¨S¦³ FreeBSD ¦w¸Ë¤ùªº¸Ü¡A¨º»ò½Ð¥ý¬Ý + ³o¸Ì·|¤¶²Ð¦p¦ó·Ç³Æ©Ò»Ý­nªº¦w¸Ë¤ù¡A·Ó¸Ó¸`¨BÆJ§Ë¦n«á¡A´N¥i¥HÄ~Äò¤U¤@¨B + ¡C - Prepare the Boot Media + ·Ç³Æ¦n¶}¾÷ºÏ¤ù - The FreeBSD installation process is started by booting your - computer into the FreeBSD installer—it is not a program you run - within another operating system. Your computer normally boots using - the operating system installed on your hard disk, but it can also be - configured to use a bootable floppy disk. - Most modern computers can also - boot from a CDROM in the CDROM drive. + FreeBSD ¦w¸Ë¬yµ{¬O­n±q¹q¸£¶}¾÷«á¡A¶i¤J FreeBSD ¦w¸Ëµe­± ¡X¡X ¦Ó¤£¬O¦b¨ä¥L§@·~¨t²Î¤W°õ¦æµ{¦¡¡C + ¤@¯ë¨ÓÁ¿¡A¹q¸£³£¬O¥Î¸Ë¦bµwºÐ¤Wªº§@·~¨t²Î¨Ó¶}¾÷¡A¤]¥i¥H¥Î¶}¾÷ºÏ¤ù¨Ó¶}¾÷¡F + ¦¹¥~¡A²{¦b¤j¦h¼Æ¹q¸£³£¥i¥H±q¥úºÐ¶}¾÷¡C - If you have FreeBSD on CDROM or DVD (either one you purchased - or you prepared yourself), and your computer allows you to boot from - the CDROM or DVD (typically a BIOS option called Boot - Order or similar), then you can skip this section. The - FreeBSD CDROM and DVD images are bootable and can be used to install - FreeBSD without any other special preparation. + ¦pªG±z¦³ FreeBSD ªº CDROM ©Î DVD(µL½×¬O¥Î¶Rªº©Î¬O¦Û¤v¿N¿ýªº)¡A ¥B±zªº¹q¸£¥i¤ä´©¥Ñ¥úºÐ¶}¾÷¡A + (³q±`¦b BIOS ¤¤·|¦³ Boot + Order ©ÎÃþ¦ü¿ï¶µ)¡A¨º»ò±z´N¥i¥H¸õ¹L¦¹¤p¸`¡C¦]¬° FreeBSD CDROM ©Î DVD ³£¥i¥H¥Î¨Ó¶}¾÷¡C - To create boot floppy images, follow these steps: + ½Ð«ö·Ó¤U­±¨BÆJ¡A¥H»s§@¶}¾÷¤ù¡G - Acquire the Boot Floppy Images + ¨ú±o¶}¾÷¤ùªº¬M¹³ÀÉ(images) - The boot disks are available on your installation media - in the floppies/ directory, and - can also be downloaded from the floppies directory, ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/<arch>/<version>-RELEASE/floppies/. - Replace <arch> and - <version> - with the architecture and the version number - which you want to install, respectively. - For example, the boot floppy images for - &os; &rel.current;-RELEASE for &i386; are available - from . - - The floppy images have a .flp extension. - The floppies/ directory contains a number of - different images, and the ones you will need to use depends on the - version of FreeBSD you are installing, and in some cases, the - hardware you are installing to. If you are installing - FreeBSD 4.X in most cases you will just need - two files, kern.flp and - mfsroot.flp. If you are - installing FreeBSD 5.X in most cases you will need three - floppies, boot.flp, - kern1.flp, and - kern2.flp. Check - README.TXT in the same directory for the - most up to date information about these floppy images. - - Additional device drivers may - be necessary for 5.X systems older than &os; 5.3. - These drivers are provided on the - drivers.flp image. + ¶}¾÷ºÏ¤ù¥Îªº¬M¹³ÀÉ(images)³q±`·|©ñ¦b¥úºÐ¤ù¤Wªº floppies/ ¥Ø¿ý¤º¡A¥t¥~¤]¥i¥H±q¹³¬O¤U­± FTP ¯¸ªº floppies + ¥Ø¿ý¤U¸ü¡G + ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/<arch>/<version>-RELEASE/floppies/ + ¡C½Ð±N¡yarch¡z¡B¡yversion¡z´À´«¬°¥´ºâ¦w¸Ëªº¹q¸£¬[ºc¡BOS ª©¥»¡C¨Ò¦p¡G­n¸Ëªº¹q¸£ÄÝ &i386 ¬[ºc¡A¦Ó­n¸Ëªº¬O + &os; &rel.current;-RELEASE ¡A¨º»ò¥i¥H¨ì ¤U¸ü¡C + + ¬M¹³ÀÉ(images)ªºªþÀɦW³£¬O .flp ¡C¦Ó + floppies/ ¥Ø¿ý¤º¥]§t¤@¨Ç¤£¦P¥Î³~ªº¬M¹³ÀÉ(images)¡A³o¨ú¨M©ó±z­n¸Ëªº FreeBSD ª©¥»¡B»Ý¨D¡BµwÅé°t³Æ¬°¦ó¡C + ­Y­n¸Ëªº¬O + FreeBSD 4.X ¨º»ò³q±`¥u»Ý­n 2 ­Ó¬M¹³ÀÉ¡A¤]´N¬O kern.flp »P + mfsroot.flp¡C¦Ó­Y­n¸Ëªº¬O FreeBSD 5.X + ¡A¨º»ò³q±`­n 3 ­Ó¬M¹³ÀÉ¡A¤]´N¬O¡G boot.flp¡B + kern1.flp¡B + kern2.flp¡C­Y¦³ºÃ°Ýªº¸Ü¡A½Ð½¾\¦P¤@¥Ø¿ý¤Uªº + README.TXT ¤å¥óÀÉ¡A¥HÁA¸Ñ¬ÛÃö³Ì·sª`·N¨Æ¶µ¡C + + ¦w¸Ë &os; 5.3 ¤§«eªº 5.X ¨t²Î®É¡A¦³¨ÇµwÅé³]³Æ¥i¯à»Ý­nÃB¥~ªºÅX°Êµ{¦¡¤~¯à¨Ï¥Î¡C + ³o¨ÇÅX°Êµ{¦¡³£·|©ñ¦b drivers.flp ³o­Ó¬M¹³Àɤº¡C - Your FTP program must use binary mode - to download these disk images. Some web browsers have been - known to use text (or - ASCII) mode, which will be apparent if you - cannot boot from the disks. + ¦b¨Ï¥Î FTP ¤U¸ü®É¡A¥²¶·¨Ï¥Î binary ¼Ò¦¡ ¶i¦æ¶Ç¿é¡C¦³¨ÇÂsÄý¾¹¹w³]¬O¥H text (©Î + ASCII) ¼Ò¦¡¨Ó¶Ç¿é¸ê®Æ¡A©Ò¥H³o¨Ç¿ù»~¶Ç¿é¼Ò¦¡¤U¸üªº¬M¹³ÀɩҰµ¦¨ªººÏ¤ù¡A·|µLªk¨Ï¥Î¡C - Prepare the Floppy Disks + ·Ç³Æ¶}¾÷ºÏ¤ù - You must prepare one floppy disk per image file you had to - download. It is imperative that these disks are free from - defects. The easiest way to test this is to format the disks - for yourself. Do not trust pre-formatted floppies. The format - utility in &windows; will not tell about the presence of - bad blocks, it simply marks them as bad - and ignores them. It is advised that you use brand new - floppies if choosing this installation route. + ¨C­Ó¬M¹³Àɳ£»Ý­n¤@±iºÏ¤ù¡A¨Ã¥B½ÐÁ×§K¨Ï¥Î¨ìÃaªººÏ¤ù¡C³Ì²³æªºÀË´ú¤è¦¡´N¬O¦Û¤v¥ý§â³o¨ÇºÏ¤ù¦A­«·s®æ¦¡¤Æ(format) + ¦Ó¤£­n¬Û«H©Ò¿×ªº¤w®æ¦¡¤ÆªººÏ¤ù¡A&windows; ¤ºªº format + ¦b®æ¦¡¤Æ®É¡A¨Ã¤£·|§i¶D§A¬O§_¦³Ãa­y¡A¦Ó¥u·|ª½±µ±N¥¦­Ì¼Ð¥ÜÃa­y¦Ó¤£¨Ï¥ÎÃa­y³¡¤À¦Ó¤w¡C + ¦¹¥~¡A«ØÄ³±Ä¥Î¥þ·sªººÏ¤ù¨Ó»s§@¦w¸Ë¤ù¤ñ¸û«OÀI¡C - If you try to install FreeBSD and the installation - program crashes, freezes, or otherwise misbehaves, one of - the first things to suspect is the floppies. Try writing - the floppy image files to new disks and try - again. + ­Y¦b¦w¸Ë FreeBSD ªº¹Lµ{¤¤µo¥Í·í¾÷¡Bµe­±­áµ²©Î¬O¨ä¥L©Ç²§ªº²{¶H¡A­º¥ý­nÃhºÃªº´N¬O¶}¾÷ºÏ¤ù¬O§_Ãa±¼¡C + ½Ð¥Î¨ä¥LªººÏ¤ù»s§@¬M¹³ÀɦA¸Õ¸Õ¬Ý¡C - Write the Image Files to the Floppy Disks + ±N¬M¹³ÀÉ(images)¼g¤J¨ìºÏ¤ù¤º - The .flp files are - not regular files you copy to the disk. - They are images of the complete contents of the - disk. This means that you cannot simply - copy files from one disk to another. - Instead, you must use specific tools to write the - images directly to the disk. + .flp ÀɨëD¤@¯ëÀɮסA¤£¯àª½±µ§â¥¦½Æ»s¨ìºÏ¤ù¤W¡C + ¨Æ¹ê¤W¥¦¬O¥]§t¾ã±iºÏ¤ù©Ò¦³¤º®eªº¬M¹³ÀÉ(image)¡C¤]´N¬O»¡¡A¤£¯à¯Âºé½Æ»sÀɮרìºÏ¤ù¤W¡A + ¦Ó¥²¶·¨Ï¥Î¯S§Oªº¤u¨ãµ{¦¡¡A¨Ó±N¬M¹³Àɪ½±µ¼g¨ìºÏ¤ù¤W¡C DOS - If you are creating the floppies on a computer running - &ms-dos;/&windows;, then we provide a tool to do - this called fdimage. + ­Y­n¥Î &ms-dos;/&windows; ¨Ó§@¦w¸Ë¤ùªº¸Ü¡A¨º»ò¥i¥H¥Î fdimage + ¤u¨ãµ{¦¡¨Ó±N¬M¹³ÀÉ¡A¼g¨ìºÏ¤ù¤W¡C - If you are using the floppies from the CDROM, and your - CDROM is the E: drive, then you would - run this: + ­Y±z¥Îªº¬O FreeBSD ¥úºÐªº¸Ü(°²³]¥úºÐ¾÷¥N¸¹¬° E: ¡A¨º»ò½Ð°õ¦æÃþ¦ü¤U­±ªº«ü¥O¡G E:\> tools\fdimage floppies\kern.flp A: - Repeat this command for each .flp - file, replacing the floppy disk each time, being sure to label - the disks with the name of the file that you copied to them. - Adjust the command line as necessary, depending on where you have - placed the .flp files. If you do not have - the CDROM, then fdimage can be downloaded from - the ½Ð°w¹ï¨C­Ó»Ý­n¥Î¨ìªº .flp ¬M¹³ÀÉ¡A­«½Æ¤W­zªº«ü¥O(°O±o§ó§ï¬ÛÃöÀɦW)¡A¨C¦¸ªº¬M¹³Àɧ¹¦¨«á¡A + ³£»Ý­n´«¥t¥~¤@¤ù¨Ó¸Ë·sªº¬M¹³ÀÉ¡F½Ð°O±o¡A¦b§@¦nªººÏ¤ù¤Wµù©ú¬O¨Ï¥Î­þ­Ó¬M¹³Àɧ@ªº¡C­Y .flp + ¬M¹³ÀÉ©ñ¦b¤£¦P¦a¤è¡A½Ð¦Û¦æ­×§ï¤W­z«ü¥O¡C­Y¨S¦³ FreeBSD ¥úºÐªº¸Ü¡A¥i¥H¨ì FTP ¤W­±ªº tools - directory on the FreeBSD FTP site. + ¥Ø¿ý ¤U¸ü fdimage ¨Ï¥Î¡C - If you are writing the floppies on a &unix; system (such as - another FreeBSD system) you can use the &man.dd.1; command to - write the image files directly to disk. On FreeBSD, you would - run: + ¦pªG­n¥Î &unix; ¨t²Î(¤ñ¦p¨ä¥L¥x FreeBSD ¾÷¾¹)¨Ó»s§@¶}¾÷¤ùªº¸Ü¡A¥i¥H¥Î &man.dd.1; + «ü¥O¨Ó§â¬M¹³Àɪ½±µ¼g¤J¨ìºÏ¤ù¤W¡C¦b FreeBSD¤Wªº¸Ü¡A¥i¥H¥´Ãþ¦ü¤U­±ªº«ü¥O¡G &prompt.root; dd if=kern.flp of=/dev/fd0 - On FreeBSD, /dev/fd0 refers to the - first floppy disk (the A: drive). - /dev/fd1 would be the - B: drive, and so on. Other &unix; - variants might have different names for the floppy disk - devices, and you will need to check the documentation for the - system as necessary. + ¦b FreeBSD ¤¤¡A/dev/fd0 ´N¬O«ü²Ä¤@¥x³nºÐ¾÷(§Y¤@¯ë &ms-dos;/&windows; + ¤Wªº A: ºÏºÐ¾÷)¡F¦Ó /dev/fd1 «ü + B: ºÏºÐ¾÷¡A¨ä¾lªº¨Ì¦¹Ãþ±À¡C¤£¹L¨ä¥Lªº &unix; + ¨t²Î¥i¯à·|¥Î¤£¦Pªº¦WºÙ¡A³o®É´N­n¬d¾\¸Ó¨t²Îªº»¡©ú¤å¥ó¤F¡C - You are now ready to start installing FreeBSD. + ²{¦b°_¡A§Ú­Ì¥i¥H¶}©l¦w¸Ë FreeBSD Åo¡I
- Starting the Installation + ¶}©l¦w¸Ë - By default, the installation will not make any changes to your - disk(s) until you see the following message: + ¹w³]ªº±¡ªp¤U¡A¦w¸Ë¹Lµ{¨Ã¤£·|§ïÅܱzºÏºÐ¾÷¤¤ªº¥ô¦ó¸ê®Æ¡A°£«D±z¬Ý¨ì¤U­±ªº°T®§¡G Last Chance: Are you SURE you want continue the installation? If you're running this on a disk with data you wish to save then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before proceeding! We can take no responsibility for lost disk contents! - The install can be exited at any time prior to the final - warning without changing the contents of the hard drive. If you are - concerned that you have configured something incorrectly you can just - turn the computer off before this point, and no damage will be - done. + ¦b¬Ý¨ì³o³Ì«áªºÄµ§i°T®§«e¡A±z³£¥i¥HÀH®ÉÂ÷¶}¦w¸Ëµ{¦¡¦Ó¤£·|Åܧó±zªºµwºÐ¡C + ¦pªG±zµo²{¦³¥ô¦ó³]©w¿ù»~¡A³o®É±z¥i¥Hª½±µ±N¹q·½Ãö±¼¦Ó¤£·|³y¦¨¥ô¦ó¶Ë®`¡C - Booting + ¶}¾÷±Ò°Ê¬yµ{½g - Booting for the &i386; + &i386; ¥­¥xªº¶}¾÷¬yµ{ - Start with your computer turned off. + ¦b¤@¶}©l¡A¹q¸£¹q·½¶}Ãö¬OÃö³¬ªº¡C - Turn on the computer. As it starts it should display an - option to enter the system set up menu, or BIOS, commonly reached - by keys like F2, F10, - Del, or + ¥´¶}¹q¸£¹q·½¶}Ãö¡C­è¶}©lªº®É­Ô¡A¥¦À³¸Ó·|Åã¥Ü¶i¤J¨t²Î³]©w¿ï³æ©Î BIOS ­n«ö­þ­ÓÁä¡A±`¨£ªº¦³¡G F2, F10, + Del ©Î Alt S - . Use whichever keystroke is indicated on screen. In - some cases your computer may display a graphic while it starts. - Typically, pressing Esc will dismiss the graphic - and allow you to see the necessary messages. + ¡C(«öÁä½Ð¨Ì¾Ú¹ê»Ú±¡ªp¨M©w)¤£½×¬O­n«ö­þ­ÓÁä¡A½Ð«ö¥¦¶i¤J BIOS + ³]©wµe­±¡C¦³®É±zªº¹q¸£¥i¯à·|Åã¥Ü¤@­Ó¹Ï§Îµe­±¡A³q±`°µªk¬O«ö Esc + Áä±NÂ÷¶}³o­Ó¹Ï§Îµe­±¡A¥H¨Ï±z¯à°÷¬Ý¨ì¥²­nªº³]©w°T®§¡C - Find the setting that controls which devices the system boots - from. This is usually labeled as the Boot Order - and commonly shown as a list of devices, such as + §ä¥X¥i¥H³]©w¡y¶}¾÷¶¶§Ç(Boot Order)¡zªº¿ï¶µ¡A³q±`¸Ó¿ï¶µ·|¦C¥X¤@¨Ç³]³ÆÅý±z¿ï¾Ü¡A¨Ò¦p¡J Floppy, CDROM, - First Hard Disk, and so on. + First Hard Disk µ¥µ¥¡C - If you needed to prepare boot floppies, then make sure that the - floppy disk is selected. If you are booting from the CDROM then - make sure that that is selected instead. In case of doubt, you - should consult the manual that came with your computer, and/or its - motherboard. + ¦pªG­n¥Î³nºÐ¦w¸Ë¡A½Ð½T©w floppy disk ­n¦C¬°¶}¾÷¶¶§Çªº²Ä¤@­Ó¡F­Y­n¥Î¥úºÐ¦w¸Ë¡A°O±o CDROM + ­n¦C¬°¶}¾÷¶¶§Çªº²Ä¤@­Ó¡C¬°¤FÁ×§KºÃ´b¡A½Ð°Ñ¦Ò¾÷¾¹¡B¥D¾÷ªO»¡©ú¤â¥U¡C - Make the change, then save and exit. The computer should now - restart. + Àx¦s³]©w¨ÃÂ÷¶}¡A¨t²ÎÀ³¸Ó·|­«·s±Ò°Ê¡C - If you needed to prepare boot floppies, as described in - , then one of them will be the - first boot disc, probably the one containing - kern.flp. Put this disc in your floppy - drive. + ¥ÎºÏ¤ù¦w¸Ë¡A½Ð§â¦b + ¤@¸`¤¤»s§@¦nªº kern.flp ¨º±i¦w¸ËºÏ¤ù©ñ¨ì²Ä¤@¥x³nºÐ¾÷¤¤¡C - If you are booting from CDROM, then you will need to turn on - the computer, and insert the CDROM at the first - opportunity. + ¦pªG¬O±q¥úºÐ¦w¸Ë¡A¨º»ò¶}¾÷«á½Ð±N FreeBSD ¥úºÐ©ñ¤J¥úºÐ¾÷¤¤¡C - If your computer starts up as normal and loads your existing - operating system, then either: + ¦pªG¡A¶}¾÷«á¦p©¹±`¤@¼Ë¦Ó¨S¦³±q³nºÐ©Î¥úºÐ¶}¾÷¡A½ÐÀˬd¡J - The disks were not inserted early enough in the boot - process. Leave them in, and try restarting your - computer. + ¬O¤£¬OºÏ¤ù©Î¥úºÐ¤Ó±ß©ñ¤J¦Ó¿ù¥¢¶}¾÷®É¶¡¡C¦pªG¬O¡A½Ð±N¥¦­Ì©ñ¤J¡AµM«á­«·s¶}¾÷¡C - The BIOS changes earlier did not work correctly. You - should redo that step until you get the right option. + BIOS ³]©w¤£¹ï©Î§Ñ¤FÀx¦s³]©w¡A½Ð­«·sÀˬd BIOS ªº³]©w¡C - Your particular BIOS does not support booting from - the desired media. + ±zªº¹q¸£ BIOS ¤£¤ä´©±q¥úºÐ¶}¾÷¡C - FreeBSD will start to boot. If you are booting from CDROM you - will see a display similar to this (version information omitted): + ¦¹®É¡AFreeBSD ´N¶}©l±Ò°Ê¤F¡C¦pªG¬O±q¥úºÐ¶}¾÷¡A·|¨£¨ìÃþ¦ü¤U­±ªºµe­±(ª©¥»³¡¤À¬Ù²¤)¡G: Verifying DMI Pool Data ........ Boot from ATAPI CD-ROM : 1. FD 2.88MB System Type-(00) Uncompressing ... done BTX loader 1.00 BTX version is 1.01 Console: internal video/keyboard BIOS drive A: is disk0 BIOS drive B: is disk1 BIOS drive C: is disk2 BIOS drive D: is disk3 BIOS 639kB/261120kB available memory FreeBSD/i386 bootstrap loader, Revision 0.8 /kernel text=0x277391 data=0x3268c+0x332a8 | | Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 9 seconds... _ - If you are booting from floppy disc, you will see a display - similar to this (version information omitted): + ¦pªG±z±q³nºÐ¶}¾÷¡A·|¬Ý¨ìÃþ¦ü¤U­±ªºµe­±(ª©¥»³¡¤À¬Ù²¤)¡G Verifying DMI Pool Data ........ BTX loader 1.00 BTX version is 1.01 Console: internal video/keyboard BIOS drive A: is disk0 BIOS drive C: is disk1 BIOS 639kB/261120kB available memory FreeBSD/i386 bootstrap loader, Revision 0.8 /kernel text=0x277391 data=0x3268c+0x332a8 | Please insert MFS root floppy and press enter: - Follow these instructions by removing the - kern.flp disc, insert the - mfsroot.flp disc, and press - Enter. &os; 5.3 - and above provide other floppy disks set, as described - in previous - section. Boot from first floppy; - when prompted, insert the other disks as required. + ½Ð®Ú¾Ú´£¥Ü±N kern.flp ºÏ¤ù¨ú¥X¡A ¨Ã©ñ¤J mfsroot.flp + ³o±iºÏ¤ù¡AµM«á«ö Enter Áä¡C­Y¬O &os; 5.3 + (§t¤§«á)ªº¸Ü¡AÁÙ¦³¥t¥~¤@±iºÏ¤ù(¦b«e¤@¸`¤w¸g¤¶²Ð¹L¤F)¡C + Á`¤§¡A±z¥u»Ý±q²Ä¤@±iºÏ¤ù±Ò°Ê¡A µM«á®Ú¾Ú´£¥Ü¡A¦A©ñ¤J¬ÛÃöºÏ¤ù§Y¥i¡C - Whether you booted from floppy or CDROM, the - boot process will then get to this point: + ¤£½×±q³nºÐ©Î¥úºÐ¶}¾÷¡A±z³£·|¬Ý¨ì¤U­±³o¬q°T®§¡G Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 9 seconds... _ - Either wait ten seconds, or press Enter - (for &os; 4.X this - will then launch the kernel configuration menu). + ±z¥i¥Hµ¥«Ý 10 ¬í¡A©Î¬O«ö Enter Áä¡C + (­Y¬O &os; 4.X ªº¸Ü¡A«h±N¥X²{ kernel configuration ¿ï³æµe­±) - Booting for the Alpha + Alpha ¥­¥xªº¶}¾÷¬yµ{ Alpha Start with your computer turned off. Turn on the computer and wait for a boot monitor prompt. If you needed to prepare boot floppies, as described in then one of them will be the first boot disc, probably the one containing kern.flp. Put this disc in your floppy drive and type the following command to boot the disk (substituting the name of your floppy drive if necessary): >>>BOOT DVA0 -FLAGS '' -FILE '' If you are booting from CDROM, insert the CDROM into the drive and type the following command to start the installation (substituting the name of the appropriate CDROM drive if necessary): >>>BOOT DKA0 -FLAGS '' -FILE '' FreeBSD will start to boot. If you are booting from a floppy disc, at some point you will see the message: Please insert MFS root floppy and press enter: Follow these instructions by removing the kern.flp disc, insert the mfsroot.flp disc, and press Enter. Whether you booted from floppy or CDROM, the boot process will then get to this point: Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 9 seconds... _ Either wait ten seconds, or press Enter. This will then launch the kernel configuration menu. - Kernel Configuration + Kernel ªº³]©w - From FreeBSD versions 5.0 and later, userconfig has been deprecated - in favor of the new &man.device.hints.5; method. For more information - on &man.device.hints.5; please visit + ±q FreeBSD 5.0 ª©¶}©l¡A§ï¥Î·sªº &man.device.hints.5; ¤è¦¡¡A¦Ó²^¨Oªº userconfig ¤è¦¡¡C + Ãö©ó &man.device.hints.5; ¾÷¨îªº²Ó¸`¤¶²Ð¡A½Ð°Ñ¾\ ¡C The kernel is the core of the operating system. It is responsible for many things, including access to all the devices you may have on your system, such as hard disks, network cards, sound cards, and so on. Each piece of hardware supported by the FreeBSD kernel has a driver associated with it. Each driver has a two or three letter name, such as sa for the SCSI sequential access driver, or sio for the Serial I/O driver (which manages COM ports). When the kernel starts, each driver checks the system to see whether or not the hardware it supports exists on your system. If it does, then the driver configures the hardware and makes it available to the rest of the kernel. This checking is commonly referred to as device probing. Unfortunately, it is not always possible to do this in a safe way. Some hardware drivers do not co-exist well, and probing for one piece of hardware can sometimes leave another in an inconsistent state. This is a basic limitation of the PC design. Many older devices are called ISA devices—as opposed to PCI devices. The ISA specification requires each device to have some information hard coded into it, typically the Interrupt Request Line number (IRQ) and IO port address that the driver uses. This information is commonly set by using physical jumpers on the card, or by using a DOS based utility. This was often a source of problems, because it was not possible to have two devices that shared the same IRQ or port address. Newer devices follow the PCI specification, which does not require this, as the devices are supposed to cooperate with the BIOS, and are told which IRQ and IO port addresses to use. If you have any ISA devices in your computer then FreeBSD's driver for that device will need to be configured with the IRQ and port address that you have set the card to. This is why carrying out an inventory of your hardware (see ) can be useful. Unfortunately, the default IRQs and memory ports used by some drivers clash. This is because some ISA devices are shipped with IRQs or memory ports that clash. The defaults in FreeBSD's drivers are deliberately set to mirror the manufacturer's defaults, so that, out of the box, as many devices as possible will work. This is almost never an issue when running FreeBSD day-to-day. Your computer will not normally contain two pieces of hardware that clash, because one of them would not work (irrespective of the operating system you are using). It becomes an issue when you are installing FreeBSD for the first time because the kernel used to carry out the install has to contain as many drivers as possible, so that many different hardware configurations can be supported. This means that some of those drivers will have conflicting configurations. The devices are probed in a strict order, and if you own a device that is probed late in the process, but conflicted with an earlier probe, then your hardware might not function or be probed correctly when you install FreeBSD. Because of this, the first thing you have the opportunity to do when installing FreeBSD is look at the list of drivers that are configured into the kernel, and either disable some of them, if you do not own that device, or confirm (and alter) the driver's configuration if you do own the device but the defaults are wrong. This probably sounds much more complicated than it actually is. shows the first kernel configuration menu. We recommend that you choose the Start kernel configuration in full-screen visual mode option, as it presents the easiest interface for the new user.
- Kernel Configuration Menu + Kernel ³]©wµe­± &txt.install.userconfig;
The kernel configuration screen () is then divided into four sections: A collapsible list of all the drivers that are currently marked as active, subdivided into groups such as Storage, and Network. Each driver is shown as a description, its two or three letter driver name, and the IRQ and memory port used by that driver. In addition, if an active driver conflicts with another active driver then CONF is shown next to the driver name. This section also shows the total number of conflicting drivers that are currently active. Drivers that have been marked inactive. They remain in the kernel, but they will not probe for their device when the kernel starts. These are subdivided into groups in the same way as the active driver list. More detail about the currently selected driver, including its IRQ and memory port address. Information about the keystrokes that are valid at this point in time.
- The Kernel Device Configuration Visual Interface + Kernel Device ªº³]©wµe­± &txt.install.userconfig2;
Do not worry if any conflicts are listed, it is to be expected; all the drivers are enabled, and as has already been explained, some of them will conflict with one another. You now have to work through the list of drivers, resolving the conflicts. - Resolving Driver Conflicts + ¸Ñ°£¬Û½ÄªºÅX°Êµ{¦¡ Press X. This will completely expand the list of drivers, so you can see all of them. You will need to use the arrow keys to scroll back and forth through the active driver list. shows the result of pressing X.
- Expanded Driver List + ®i¶}ÅX°Êµ{¦¡¤@Äýªí
Disable all the drivers for devices that you do not have. To disable a driver, highlight it with the arrow keys and press Del. The driver will be moved to the Inactive Drivers list. If you inadvertently disable a device that you need then press Tab to switch to the Inactive Drivers list, select the driver that you disabled, and press Enter to move it back to the active list. Do not disable sc0. This controls the screen, and you will need this unless you are installing over a serial cable. Only disable atkbd0 if you are using a USB keyboard. If you have a normal keyboard then you must keep atkbd0. If there are no conflicts listed then you can skip this step. Otherwise, the remaining conflicts need to be examined. If they do not have the indication of an allowed conflict in the message area, then either the IRQ/address for device probe will need to be changed, or the IRQ/address on the hardware will need to be changed. To change the driver's configuration for IRQ and IO port address, select the device and press Enter. The cursor will move to the third section of the screen, and you can change the values. You should enter the values for IRQ and port address that you discovered when you made your hardware inventory. Press Q to finish editing the device's configuration and return to the active driver list. If you are not sure what these figures should be then you can try using -1. Some FreeBSD drivers can safely probe the hardware to discover what the correct value should be, and a value of -1 configures them to do this. The procedure for changing the address on the hardware varies from device to device. For some devices you may need to physically remove the card from your computer and adjust jumper settings or DIP switches. Other cards may have come with a DOS floppy that contains the programs used to reconfigure the card. In any case, you should refer to the documentation that came with the device. This will obviously entail restarting your computer, so you will need to boot back into the FreeBSD installation routine when you have reconfigured the card. When all the conflicts have been resolved the screen will look similar to .
- Driver Configuration With No Conflicts + ¨S¦³½Ä¬ðªºÅX°Êµ{¦¡³]©w
As you can see, the active driver list is now much smaller, with only drivers for the hardware that actually exists being listed. You can now save these changes, and move on to the next step of the install. Press Q to quit the device configuration interface. This message will appear: Save these parameters before exiting? ([Y]es/[N]o/[C]ancel) Answer Y to save the parameters to memory (it will be saved to disk if you finish the install) and the probing will start. After displaying the probe results in white on black text sysinstall will start and display its main menu ().
- Sysinstall Main Menu + Sysinstall ¥D¿ï³æ
- Reviewing the Device Probe Results + ¨º­n«ç»ò¥h½¾\°»´úµwÅ骺µ²ªG©O¡H - The last few hundred lines that have been displayed on screen are - stored and can be reviewed. + ¥ý«e¦b¿Ã¹õ¤W©ÒÅã¥Üªº³Ì«á´X¦Ê¦æ¦r¡A·|¦s¦b¼È¦s°Ï(buffer)¥H«K±z½¾\¡C - To review the buffer, press Scroll Lock. This - turns on scrolling in the display. You can then use the arrow keys, or - PageUp and PageDown to view the - results. Press Scroll Lock again to stop - scrolling. + ­Y­n½¾\¼È¦s°Ï¡A½Ð«ö Scroll Lock Áä¡A³o·|¶}±Ò±²°Êµe­±¥\¯à¡C + µM«á´N¥i¥H¨Ï¥Î¤è¦VÁä¡A©Î¬O PageUp¡BPageDown + Áä¨Ó¤W¤U½¾\¡C¦A«ö¤@¦¸ Scroll Lock Áä¡A´N·|°±¤îµe­±±²°Ê¡C Do this now, to review the text that scrolled off the screen when the kernel was carrying out the device probes. You will see text similar to , although the precise text will differ depending on the devices that you have in your computer.
- Typical Device Probe Results + °»´úµwÅ骺¨Ò¤l avail memory = 253050880 (247120K bytes) Preloaded elf kernel "kernel" at 0xc0817000. Preloaded mfs_root "/mfsroot" at 0xc0817084. md0: Preloaded image </mfsroot> 4423680 bytes at 0xc03ddcd4 md1: Malloc disk Using $PIR table, 4 entries at 0xc00fde60 npx0: <math processor> on motherboard npx0: INT 16 interface pcib0: <Host to PCI bridge> on motherboard pci0: <PCI bus> on pcib0 pcib1:<VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge> at device 1.0 on pci0 pci1: <PCI bus> on pcib1 pci1: <Matrox MGA G200 AGP graphics accelerator> at 0.0 irq 11 isab0: <VIA 82C586 PCI-ISA bridge> at device 7.0 on pci0 isa0: <iSA bus> on isab0 atapci0: <VIA 82C586 ATA33 controller> port 0xe000-0xe00f at device 7.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 uhci0 <VIA 83C572 USB controller> port 0xe400-0xe41f irq 10 at device 7.2 on pci 0 usb0: <VIA 83572 USB controller> on uhci0 usb0: USB revision 1.0 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr1 uhub0: 2 ports with 2 removable, self powered pci0: <unknown card> (vendor=0x1106, dev=0x3040) at 7.3 dc0: <ADMtek AN985 10/100BaseTX> port 0xe800-0xe8ff mem 0xdb000000-0xeb0003ff ir q 11 at device 8.0 on pci0 dc0: Ethernet address: 00:04:5a:74:6b:b5 miibus0: <MII bus> on dc0 ukphy0: <Generic IEEE 802.3u media interface> on miibus0 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto ed0: <NE2000 PCI Ethernet (RealTek 8029)> port 0xec00-0xec1f irq 9 at device 10. 0 on pci0 ed0 address 52:54:05:de:73:1b, type NE2000 (16 bit) isa0: too many dependant configs (8) isa0: unexpected small tag 14 orm0: <Option ROM> at iomem 0xc0000-0xc7fff on isa0 fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq2 on isa0 fdc0: FIFO enabled, 8 bytes threshold fd0: <1440-KB 3.5" drive> on fdc0 drive 0 atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0 atkbd0: <AT Keyboard> flags 0x1 irq1 on atkbdc0 kbd0 at atkbd0 psm0: <PS/2 Mouse> irq 12 on atkbdc0 psm0: model Generic PS/@ mouse, device ID 0 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 sc0: <System console> at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0 sio0: type 16550A sio1 at port 0x2f8-0x2ff irq 3 on isa0 sio1: type 16550A ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0 pppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/15 bytes threshold plip0: <PLIP network interface> on ppbus0 ad0: 8063MB <IBM-DHEA-38451> [16383/16/63] at ata0-master UDMA33 acd0: CD-RW <LITE-ON LTR-1210B> at ata1-slave PIO4 Mounting root from ufs:/dev/md0c /stand/sysinstall running as init on vty0
Check the probe results carefully to make sure that FreeBSD found all the devices you expected. If a device was not found, then it will not be listed. If the device's driver required configuring with the IRQ and port address then you should check that you entered them correctly. If you need to make changes to the UserConfig device probing, it is easy to exit the sysinstall program and start over again. It is also a good way to become more familiar with the process.
- Select Sysinstall Exit + Â÷¶} Sysinstall µ{¦¡
Use the arrow keys to select Exit Install from the Main Install Screen menu. The following message will display: User Confirmation Requested Are you sure you wish to exit? The system will reboot (be sure to remove any floppies from the drives). [ Yes ] No The install program will start again if the CDROM is left in the drive and &gui.yes; is selected. If you are booting from floppies it will be necessary to remove the mfsroot.flp floppy and replace it with kern.flp before rebooting.
- Introducing Sysinstall + ¤¶²Ð Sysinstall The sysinstall utility is the installation application provided by the FreeBSD Project. It is console based and is divided into a number of menus and screens that you can use to configure and control the installation process. The sysinstall menu system is controlled by the arrow keys, Enter, Space, and other keys. A detailed description of these keys and what they do is contained in sysinstall's usage information. To review this information, ensure that the Usage entry is highlighted and that the [Select] button is selected, as shown in , then press Enter. The instructions for using the menu system will be displayed. After reviewing them, press Enter to return to the Main Menu.
- Selecting Usage from Sysinstall Main Menu + ¿ï¾Ü Sysinstall ¥D¿ï³æªº¡yUsage(§Ö³t»¡©ú)¡z
- Selecting the Documentation Menu + ¿ï¾Ü¡y Documentation(»¡©ú¤å¥ó)¡z¿ï³æ From the Main Menu, select Doc with the arrow keys and press Enter.
- Selecting Documentation Menu + ¿ï¾Ü¡yDocumentation(»¡©ú¤å¥ó)¡z¿ï³æ
This will display the Documentation Menu.
- Sysinstall Documentation Menu + Sysinstall ªº»¡©ú¤å¥ó(Documentation)¿ï³æ
It is important to read the documents provided. To view a document, select it with the arrow keys and press Enter. When finished reading a document, pressing Enter will return to the Documentation Menu. To return to the Main Installation Menu, select Exit with the arrow keys and press Enter.
- Selecting the Keymap Menu + ¿ï¾Ü¡yÁä½L¹ïÀ³¡z¿ï³æ To change the keyboard mapping, use the arrow keys to select Keymap from the menu and press Enter. This is only required if you are using a non-standard or non-US keyboard.
- Sysinstall Main Menu + Sysinstall ¥D¿ï³æ
A different keyboard mapping may be chosen by selecting the menu item using up/down arrow keys and pressing Space. Pressing Space again will unselect the item. When finished, choose the &gui.ok; using the arrow keys and press Enter. Only a partial list is shown in this screen representation. Selecting &gui.cancel; by pressing Tab will use the default keymap and return to the Main Install Menu.
- Sysinstall Keymap Menu + Sysinstall Áä½L¹ïÀ³¿ï³æ
- Installation Options Screen + ¦w¸Ë¿ï¶µªº³]©wµe­± Select Options and press Enter.
- Sysinstall Main Menu + Sysinstall ¥D¿ï³æ
- Sysinstall Options + Sysinstall ¿ï¶µ³]©w
The default values are usually fine for most users and do not need to be changed. The release name will vary according to the version being installed. The description of the selected item will appear at the bottom of the screen highlighted in blue. Notice that one of the options is Use Defaults to reset all values to startup defaults. Press F1 to read the help screen about the various options. Pressing Q will return to the Main Install menu.
- Begin a Standard Installation + ¶}©l¶i¦æ¼Ð·Ç¦w¸Ë - The Standard installation is the - option recommended for those new to &unix; or FreeBSD. Use the arrow - keys to select Standard and - then press Enter to start the installation. + Standard(¼Ð·Ç)¦w¸Ë¾A¥Î©ó¨º¨Çªì±´ &unix; + ©Î FreeBSD ªº¨Ï¥ÎªÌ¡C¥Î¤è¦VÁä¿ï¾Ü Standard + µM«á«ö Enter §Y¥i¶}©l¶i¤J¼Ð·Ç¦w¸Ë¡C
- Begin Standard Installation + ¶}©l¶i¦æ¼Ð·Ç¦w¸Ë
- Allocating Disk Space + µwºÐªÅ¶¡ªº¤À°t Your first task is to allocate disk space for FreeBSD, and label that space so that sysinstall can prepare it. In order to do this you need to know how FreeBSD expects to find information on the disk. - BIOS Drive Numbering + BIOS ºÏºÐ¾÷½s¸¹ Before you install and configure FreeBSD on your system, there is an important subject that you should be aware of, especially if you have multiple hard drives. DOS Microsoft Windows In a PC running a BIOS-dependent operating system such as &ms-dos; or µsoft.windows;, the BIOS is able to abstract the normal disk drive order, and the operating system goes along with the change. This allows the user to boot from a disk drive other than the so-called primary master. This is especially convenient for some users who have found that the simplest and cheapest way to keep a system backup is to buy an identical second hard drive, and perform routine copies of the first drive to the second drive using Ghost or XCOPY . Then, if the first drive fails, or is attacked by a virus, or is scribbled upon by an operating system defect, he can easily recover by instructing the BIOS to logically swap the drives. It is like switching the cables on the drives, but without having to open the case. SCSI BIOS More expensive systems with SCSI controllers often include BIOS extensions which allow the SCSI drives to be re-ordered in a similar fashion for up to seven drives. A user who is accustomed to taking advantage of these features may become surprised when the results with FreeBSD are not as expected. FreeBSD does not use the BIOS, and does not know the logical BIOS drive mapping. This can lead to very perplexing situations, especially when drives are physically identical in geometry, and have also been made as data clones of one another. When using FreeBSD, always restore the BIOS to natural drive numbering before installing FreeBSD, and then leave it that way. If you need to switch drives around, then do so, but do it the hard way, and open the case and move the jumpers and cables. - An Illustration from the Files of Bill and Fred's Exceptional - Adventures: + ½d¨Ò¡GBill ¤Î Fred ªº¦w¸Ë¾úÀI Bill breaks-down an older Wintel box to make another FreeBSD box for Fred. Bill installs a single SCSI drive as SCSI unit zero and installs FreeBSD on it. Fred begins using the system, but after several days notices that the older SCSI drive is reporting numerous soft errors and reports this fact to Bill. After several more days, Bill decides it is time to address the situation, so he grabs an identical SCSI drive from the disk drive archive in the back room. An initial surface scan indicates that this drive is functioning well, so Bill installs this drive as SCSI unit four and makes an image copy from drive zero to drive four. Now that the new drive is installed and functioning nicely, Bill decides that it is a good idea to start using it, so he uses features in the SCSI BIOS to re-order the disk drives so that the system boots from SCSI unit four. FreeBSD boots and runs just fine. Fred continues his work for several days, and soon Bill and Fred decide that it is time for a new adventure — time to upgrade to a newer version of FreeBSD. Bill removes SCSI unit zero because it was a bit flaky and replaces it with another identical disk drive from the archive. Bill then installs the new version of FreeBSD onto the new SCSI unit zero using Fred's magic Internet FTP floppies. The installation goes well. Fred uses the new version of FreeBSD for a few days, and certifies that it is good enough for use in the engineering department. It is time to copy all of his work from the old version. So Fred mounts SCSI unit four (the latest copy of the older FreeBSD version). Fred is dismayed to find that none of his precious work is present on SCSI unit four. Where did the data go? When Bill made an image copy of the original SCSI unit zero onto SCSI unit four, unit four became the new clone. When Bill re-ordered the SCSI BIOS so that he could boot from SCSI unit four, he was only fooling himself. FreeBSD was still running on SCSI unit zero. Making this kind of BIOS change will cause some or all of the Boot and Loader code to be fetched from the selected BIOS drive, but when the FreeBSD kernel drivers take-over, the BIOS drive numbering will be ignored, and FreeBSD will transition back to normal drive numbering. In the illustration at hand, the system continued to operate on the original SCSI unit zero, and all of Fred's data was there, not on SCSI unit four. The fact that the system appeared to be running on SCSI unit four was simply an artifact of human expectations. We are delighted to mention that no data bytes were killed or harmed in any way by our discovery of this phenomenon. The older SCSI unit zero was retrieved from the bone pile, and all of Fred's work was returned to him, (and now Bill knows that he can count as high as zero). Although SCSI drives were used in this illustration, the concepts apply equally to IDE drives. - Creating Slices Using FDisk + ¥H FDisk ¨Ó«Ø¥ß¤À³ÎºÏ°Ï(Slices) No changes you make at this point will be written to the disk. If you think you have made a mistake and want to start again you can use the menus to exit sysinstall and try again or press U to use the Undo option. If you get confused and can not see how to exit you can always turn your computer off. After choosing to begin a standard installation in sysinstall you will be shown this message: Message In the next menu, you will need to set up a DOS-style ("fdisk") partitioning scheme for your hard disk. If you simply wish to devote all disk space to FreeBSD (overwriting anything else that might be on the disk(s) selected) then use the (A)ll command to select the default partitioning scheme followed by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a partition marked "unused" and use the (C)reate command. [ OK ] [ Press enter or space ] Press Enter as instructed. You will then be shown a list of all the hard drives that the kernel found when it carried out the device probes. shows an example from a system with two IDE disks. They have been called ad0 and ad2.
- Select Drive for FDisk + ¿ï¾Ü FDisk ­n¤À³ÎªºµwºÐ
You might be wondering why ad1 is not listed here. Why has it been missed? Consider what would happen if you had two IDE hard disks, one as the master on the first IDE controller, and one as the master on the second IDE controller. If FreeBSD numbered these as it found them, as ad0 and ad1 then everything would work. But if you then added a third disk, as the slave device on the first IDE controller, it would now be ad1, and the previous ad1 would become ad2. Because device names (such as ad1s1a) are used to find filesystems, you may suddenly discover that some of your filesystems no longer appear correctly, and you would need to change your FreeBSD configuration. To work around this, the kernel can be configured to name IDE disks based on where they are, and not the order in which they were found. With this scheme the master disk on the second IDE controller will always be ad2, even if there are no ad0 or ad1 devices. This configuration is the default for the FreeBSD kernel, which is why this display shows ad0 and ad2. The machine on which this screenshot was taken had IDE disks on both master channels of the IDE controllers, and no disks on the slave channels. You should select the disk on which you want to install FreeBSD, and then press &gui.ok;. FDisk will start, with a display similar to that shown in . The FDisk display is broken into three sections. The first section, covering the first two lines of the display, shows details about the currently selected disk, including its FreeBSD name, the disk geometry, and the total size of the disk. The second section shows the slices that are currently on the disk, where they start and end, how large they are, the name FreeBSD gives them, and their description and sub-type. This example shows two small unused slices, which are artifacts of disk layout schemes on the PC. It also shows one large FAT slice, which almost certainly appears as C: in &ms-dos; / &windows;, and an extended slice, which may contain other drive letters for &ms-dos; / &windows;. The third section shows the commands that are available in FDisk.
- Typical Fdisk Partitions before Editing + (Á|¨Ò)¥¼½s¿è«eªº Fdisk ¤À³Î°Ï(Partition)
What you do now will depend on how you want to slice up your disk. If you want to use FreeBSD for the entire disk (which will delete all the other data on this disk when you confirm that you want sysinstall to continue later in the installation process) then you can press A, which corresponds to the Use Entire Disk option. The existing slices will be removed, and replaced with a small area flagged as unused (again, an artifact of PC disk layout), and then one large slice for FreeBSD. If you do this, then you should select the newly created FreeBSD slice using the arrow keys, and press S to mark the slice as being bootable. The screen will then look very similar to . Note the A in the Flags column, which indicates that this slice is active, and will be booted from. If you will be deleting an existing slice to make space for FreeBSD then you should select the slice using the arrow keys, and then press D. You can then press C, and be prompted for size of slice you want to create. Enter the appropriate figure and press Enter. The default value in this box represents the largest possible slice you can make, which could be the largest contiguous block of unallocated space or the size of the entire hard disk. If you have already made space for FreeBSD (perhaps by using a tool such as &partitionmagic;) then you can press C to create a new slice. Again, you will be prompted for the size of slice you would like to create.
- Fdisk Partition Using Entire Disk + Fdisk ±Ä¥Î¾ãÁûµwºÐ§@¤À³Î°Ï(Partition)
When finished, press Q. Your changes will be saved in sysinstall, but will not yet be written to disk.
- Install a Boot Manager + ¦w¸Ë Boot Manager You now have the option to install a boot manager. In general, you should choose to install the FreeBSD boot manager if: You have more than one drive, and have installed FreeBSD onto a drive other than the first one. You have installed FreeBSD alongside another operating system on the same disk, and you want to choose whether to start FreeBSD or the other operating system when you start the computer. If FreeBSD is going to be the only operating system on this machine, installed on the first hard disk, then the Standard boot manager will suffice. Choose None if you are using a third-party boot manager capable of booting FreeBSD. Make your choice and press Enter.
- Sysinstall Boot Manager Menu + Sysinstall ªº Boot Manager ¿ï³æ
The help screen, reached by pressing F1, discusses the problems that can be encountered when trying to share the hard disk between operating systems.
- Creating Slices on Another Drive + ¦b¨ä¥LµwºÐ¤W«Ø¥ß¤À³ÎºÏ°Ï(Slices) If there is more than one drive, it will return to the Select Drives screen after the boot manager selection. If you wish to install FreeBSD on to more than one disk, then you can select another disk here and repeat the slice process using FDisk. If you are installing FreeBSD on a drive other than your first, then the FreeBSD boot manager needs to be installed on both drives.
- Exit Select Drive + Â÷¶}¡y¿ï¾ÜµwºÐ¡zµe­±
The Tab key toggles between the last drive selected, &gui.ok;, and &gui.cancel;. Press the Tab once to toggle to the &gui.ok;, then press Enter to continue with the installation.
- Creating Partitions Using - <application>Disklabel</application> + ¥H <application>Disklabel</application> ¨Ó«Ø¥ß¤À³Î°Ï(Partitions) + You must now create some partitions inside each slice that you have just created. Remember that each partition is lettered, from a through to h, and that partitions b, c, and d have conventional meanings that you should adhere to. Certain applications can benefit from particular partition schemes, especially if you are laying out partitions across more than one disk. However, for this, your first FreeBSD installation, you do not need to give too much thought to how you partition the disk. It is more important that you install FreeBSD and start learning how to use it. You can always re-install FreeBSD to change your partition scheme when you are more familiar with the operating system. This scheme features four partitions—one for swap space, and three for filesystems. - Partition Layout for First Disk + ²Ä¤@ÁûµwºÐªº¤À³Î°Ï(Partition)°t¸m Partition Filesystem Size Description a / 100 MB This is the root filesystem. Every other filesystem will be mounted somewhere under this one. 100 MB is a reasonable size for this filesystem. You will not be storing too much data on it, as a regular FreeBSD install will put about 40 MB of data here. The remaining space is for temporary data, and also leaves expansion space if future versions of FreeBSD need more space in /. b N/A 2-3 x RAM The system's swap space is kept on this partition. Choosing the right amount of swap space can be a bit of an art. A good rule of thumb is that your swap space should be two or three times as much as the available physical memory (RAM). You should also have at least 64 MB of swap, so if you have less than 32 MB of RAM in your computer then set the swap amount to 64 MB. If you have more than one disk then you can put swap space on each disk. FreeBSD will then use each disk for swap, which effectively speeds up the act of swapping. In this case, calculate the total amount of swap you need (e.g., 128 MB), and then divide this by the number of disks you have (e.g., two disks) to give the amount of swap you should put on each disk, in this example, 64 MB of swap per disk. e /var 50 MB The /var directory contains files that are constantly varying; log files, and other administrative files. Many of these files are read-from or written-to extensively during FreeBSD's day-to-day running. Putting these files on another filesystem allows FreeBSD to optimize the access of these files without affecting other files in other directories that do not have the same access pattern. f /usr Rest of disk All your other files will typically be stored in /usr and its subdirectories.
If you will be installing FreeBSD on to more than one disk then you must also create partitions in the other slices that you configured. The easiest way to do this is to create two partitions on each disk, one for the swap space, and one for a filesystem. - Partition Layout for Subsequent Disks + ¨ä¥LµwºÐªº¤À³Î°Ï(Partition)°t¸m Partition Filesystem Size Description b N/A See description As already discussed, you can split swap space across each disk. Even though the a partition is free, convention dictates that swap space stays on the b partition. e /diskn Rest of disk The rest of the disk is taken up with one big partition. This could easily be put on the a partition, instead of the e partition. However, convention says that the a partition on a slice is reserved for the filesystem that will be the root (/) filesystem. You do not have to follow this convention, but sysinstall does, so following it yourself makes the installation slightly cleaner. You can choose to mount this filesystem anywhere; this example suggests that you mount them as directories /diskn, where n is a number that changes for each disk. But you can use another scheme if you prefer.
Having chosen your partition layout you can now create it using sysinstall. You will see this message: Message Now, you need to create BSD partitions inside of the fdisk partition(s) just created. If you have a reasonable amount of disk space (200MB or more) and don't have any special requirements, simply use the (A)uto command to allocate space automatically. If you have more specific needs or just don't care for the layout chosen by (A)uto, press F1 for more information on manual layout. [ OK ] [ Press enter or space ] Press Enter to start the FreeBSD partition editor, called Disklabel. shows the display when you first start Disklabel. The display is divided in to three sections. The first few lines show the name of the disk you are currently working on, and the slice that contains the partitions you are creating (at this point Disklabel calls this the Partition name rather than slice name). This display also shows the amount of free space within the slice; that is, space that was set aside in the slice, but that has not yet been assigned to a partition. The middle of the display shows the partitions that have been created, the name of the filesystem that each partition contains, their size, and some options pertaining to the creation of the filesystem. The bottom third of the screen shows the keystrokes that are valid in Disklabel.
- Sysinstall Disklabel Editor + Sysinstall ªº Disklabel ½s¿è¾¹
Disklabel can automatically create partitions for you and assign them default sizes. Try this now, by Pressing A. You will see a display similar to that shown in . Depending on the size of the disk you are using, the defaults may or may not be appropriate. This does not matter, as you do not have to accept the defaults. Beginning with FreeBSD 4.5, the default partitioning assigns the /tmp directory its own partition instead of being part of the / partition. This helps avoid filling the / partition with temporary files.
- Sysinstall Disklabel Editor with Auto Defaults + Sysinstall ªº Disklabel ½s¿è¾¹ ¡X ¨Ï¥Î¦Û°Ê¤À°t
If you choose to not use the default partitions and wish to replace them with your own, use the arrow keys to select the first partition, and press D to delete it. Repeat this to delete all the suggested partitions. To create the first partition (a, mounted as / — root), make sure the proper disk slice at the top of the screen is selected and press C. A dialog box will appear prompting you for the size of the new partition (as shown in ). You can enter the size as the number of disk blocks you want to use, or as a number followed by either M for megabytes, G for gigabytes, or C for cylinders. Beginning with FreeBSD 5.X, users can: select UFS2 (which is default on &os; 5.1 and above) using the Custom Newfs (Z) option, create labels with Auto Defaults and modify them with the Custom Newfs option or add during the regular creation period. Do not forget to add for SoftUpdates if you use the Custom Newfs option!
Free Space for Root Partition
The default size shown will create a partition that takes up the rest of the slice. If you are using the partition sizes described in the earlier example, then delete the existing figure using Backspace, and then type in 64M, as shown in . Then press &gui.ok;.
Edit Root Partition Size
Having chosen the partition's size you will then be asked whether this partition will contain a filesystem or swap space. The dialog box is shown in . This first partition will contain a filesystem, so check that FS is selected and press Enter.
Choose the Root Partition Type
Finally, because you are creating a filesystem, you must tell Disklabel where the filesystem is to be mounted. The dialog box is shown in . The root filesystem's mount point is /, so type /, and then press Enter.
Choose the Root Mount Point
The display will then update to show you the newly created partition. You should repeat this procedure for the other partitions. When you create the swap partition, you will not be prompted for the filesystem mount point, as swap partitions are never mounted. When you create the final partition, /usr, you can leave the suggested size as is, to use the rest of the slice. Your final FreeBSD DiskLabel Editor screen will appear similar to , although your values chosen may be different. Press Q to finish.
Sysinstall Disklabel Editor
- Choosing What to Install + ¿ï¾Ü·Q­n¦w¸Ëªº - Select the Distribution Set + ¿ï¾Ü­n¦w¸Ëªº®M¥ó¶°(Distribution Set) Deciding which distribution set to install will depend largely on the intended use of the system and the amount of disk space available. The predefined options range from installing the smallest possible configuration to everything. Those who are new to &unix; and/or FreeBSD should almost certainly select one of these canned options. Customizing a distribution set is typically for the more experienced user. Press F1 for more information on the distribution set options and what they contain. When finished reviewing the help, pressing Enter will return to the Select Distributions Menu. If a graphical user interface is desired then a distribution set that is preceded by an X should be chosen. The configuration of the X server and selection of a default desktop must be done after the installation of &os;. More information regarding the configuration of a X server can be found in . The default version of X11 that is installed depends on the version of FreeBSD that you are installing. For FreeBSD versions prior to 5.3, &xfree86; 4.X is installed. For &os; 5.3 and later, &xorg; is the default. If compiling a custom kernel is anticipated, select an option which includes the source code. For more information on why a custom kernel should be built or how to build a custom kernel, see . Obviously, the most versatile system is one that includes everything. If there is adequate disk space, select All as shown in by using the arrow keys and press Enter. If there is a concern about disk space consider using an option that is more suitable for the situation. Do not fret over the perfect choice, as other distributions can be added after installation.
- Choose Distributions + ¿ï¾Ü®M¥ó(Distributions)
- Installing the Ports Collection + ¦w¸Ë Ports Collection After selecting the desired distribution, an opportunity to install the FreeBSD Ports Collection is presented. The ports collection is an easy and convenient way to install software. The Ports Collection does not contain the source code necessary to compile the software. Instead, it is a collection of files which automates the downloading, compiling and installation of third-party software packages. discusses how to use the ports collection. The installation program does not check to see if you have adequate space. Select this option only if you have adequate hard disk space. As of FreeBSD &rel.current;, the FreeBSD Ports Collection takes up about &ports.size; of disk space. You can safely assume a larger value for more recent versions of FreeBSD. User Confirmation Requested Would you like to install the FreeBSD ports collection? This will give you ready access to over &os.numports; ported software packages, at a cost of around &ports.size; of disk space when "clean" and possibly much more than that if a lot of the distribution tarballs are loaded (unless you have the extra CDs from a FreeBSD CD/DVD distribution available and can mount it on /cdrom, in which case this is far less of a problem). The Ports Collection is a very valuable resource and well worth having on your /usr partition, so it is advisable to say Yes to this option. For more information on the Ports Collection & the latest ports, visit: http://www.FreeBSD.org/ports [ Yes ] No Select &gui.yes; with the arrow keys to install the Ports Collection or &gui.no; to skip this option. Press Enter to continue. The Choose Distributions menu will redisplay.
Confirm Distributions
If satisfied with the options, select Exit with the arrow keys, ensure that &gui.ok; is highlighted, and pressing Enter to continue.
- Choosing Your Installation Media + ¿ï¾Ü¦w¸Ë¨Ó·½ If Installing from a CDROM or DVD, use the arrow keys to highlight Install from a FreeBSD CD/DVD. Ensure that &gui.ok; is highlighted, then press Enter to proceed with the installation. For other methods of installation, select the appropriate option and follow the instructions. Press F1 to display the Online Help for installation media. Press Enter to return to the media selection menu.
- Choose Installation Media + ¿ï¾Ü¦w¸Ë¨Ó·½
- FTP Installation Modes + FTP ¦w¸Ë¼Ò¦¡ installation network FTP There are three FTP installation modes you can choose from: active FTP, passive FTP, or via a HTTP proxy. FTP Active: Install from an FTP server This option will make all FTP transfers use Active mode. This will not work through firewalls, but will often work with older FTP servers that do not support passive mode. If your connection hangs with passive mode (the default), try active! FTP Passive: Install from an FTP server through a firewall FTP passive mode This option instructs sysinstall to use Passive mode for all FTP operations. This allows the user to pass through firewalls that do not allow incoming connections on random TCP ports. FTP via a HTTP proxy: Install from an FTP server through a http proxy FTP via a HTTP proxy This option instructs sysinstall to use the HTTP protocol (like a web browser) to connect to a proxy for all FTP operations. The proxy will translate the requests and send them to the FTP server. This allows the user to pass through firewalls that do not allow FTP at all, but offer a HTTP proxy. In this case, you have to specify the proxy in addition to the FTP server. For a proxy FTP server, you should usually give the name of the server you really want as a part of the username, after an @ sign. The proxy server then fakes the real server. For example, assuming you want to install from ftp.FreeBSD.org, using the proxy FTP server foo.example.com, listening on port 1024. In this case, you go to the options menu, set the FTP username to ftp@ftp.FreeBSD.org, and the password to your email address. As your installation media, you specify FTP (or passive FTP, if the proxy supports it), and the URL ftp://foo.example.com:1234/pub/FreeBSD. Since /pub/FreeBSD from ftp.FreeBSD.org is proxied under foo.example.com, you are able to install from that machine (which will fetch the files from ftp.FreeBSD.org as your installation requests them).
- Committing to the Installation + ¶}©l¶i¦æ¦w¸Ë + - The installation can now proceed if desired. This is also - the last chance for aborting the installation to prevent changes - to the hard drive. + ¨ì¦¹¬°¤î¡A¥i¥H¶}©l¶i¦æ¦w¸Ë¤F¡A³o¤]¬O±zÁ×§K§ó°Ê¨ìµwºÐªº³Ì«á¾÷·|¡C User Confirmation Requested Last Chance! Are you SURE you want to continue the installation? If you're running this on a disk with data you wish to save then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before proceeding! We can take no responsibility for lost disk contents! [ Yes ] No - Select &gui.yes; and press - Enter to proceed. + ¿ï¾Ü &gui.yes; ¨Ã«ö¤U + Enter¥H½T»{¯uªº­n¶}©l¦w¸Ë - The installation time will vary according to the distribution - chosen, installation media, and the speed of the computer. - There will be a series of - messages displayed indicating the status. + ¦w¸Ë©Ò»Ý®É¶¡·|¨Ì¾Ú©Ò¿ï¾Ü¦w¸Ëªº®M¥ó¶°(distribution) + ¡B¦w¸Ë¨Ó·½¥H¤Î¹q¸£³t«×¦Ó¦³©Ò¤£¦P¡C + ¦b¦w¸Ëªº¹Lµ{¤¤¡A·|¦³¤@¨Ç°T®§Åã¥Ü¥Ø«eªº¦w¸Ë¶i«×¡C - The installation is complete when the following message is - displayed: + ·í±z¬Ý¨ì¤U­±ªº°T®§ªí¥Ü¤w¸g¦w¸Ë§¹¦¨¤F¡J Message Congratulations! You now have FreeBSD installed on your system. We will now move on to the final configuration questions. For any option you do not wish to configure, simply select No. If you wish to re-enter this utility after the system is up, you may do so by typing: /stand/sysinstall . [ OK ] [ Press enter to continue ] Press Enter to proceed with post-installation configurations. Selecting &gui.no; and pressing Enter will abort the installation so no changes will be made to your system. The following message will appear: Message Installation complete with some errors. You may wish to scroll through the debugging messages on VTY1 with the scroll-lock feature. You can also choose "No" at the next prompt and go back into the installation menus to retry whichever operations have failed. [ OK ] This message is generated because nothing was installed. Pressing Enter will return to the Main Installation Menu to exit the installation. «áÄò¦w¸Ë ¦w¸Ë¨t²Î¦¨¥\¤§«á¡A¥i¥H¦b·s¸Ë¦nªº FreeBSD ­«¶}¾÷¤§«e¡A©ÎªÌ¬O¨Æ«á¦A³z¹L sysinstall (&os; 5.2 ¤§«eª©¥»«h¬O /stand/sysinstall) µM«á¿ï¾Ü Configure ¿ï¶µ¥H¶i¦æ«áÄò³]©w¡C Network Device Configuration If you previously configured PPP for an FTP install, this screen will not display and can be configured later as described above. For detailed information on Local Area Networks and configuring FreeBSD as a gateway/router refer to the Advanced Networking chapter. User Confirmation Requested Would you like to configure any Ethernet or SLIP/PPP network devices? [ Yes ] No To configure a network device, select &gui.yes; and press Enter. Otherwise, select &gui.no; to continue.
Selecting an Ethernet Device
Select the interface to be configured with the arrow keys and press Enter. User Confirmation Requested Do you want to try IPv6 configuration of the interface? Yes [ No ] In this private local area network, the current Internet type protocol (IPv4) was sufficient and &gui.no; was selected with the arrow keys and Enter pressed. If you are connected to an existing IPv6 network with an RA server, then choose &gui.yes; and press Enter. It will take several seconds to scan for RA servers. User Confirmation Requested Do you want to try DHCP configuration of the interface? Yes [ No ] If DHCP (Dynamic Host Configuration Protocol) is not required select &gui.no; with the arrow keys and press Enter. Selecting &gui.yes; will execute dhclient, and if successful, will fill in the network configuration information automatically. Refer to for more information. The following Network Configuration screen shows the configuration of the Ethernet device for a system that will act as the gateway for a Local Area Network.
Set Network Configuration for ed0
Use Tab to select the information fields and fill in appropriate information: Host The fully-qualified hostname, such as k6-2.example.com in this case. Domain The name of the domain that your machine is in, such as example.com for this case. IPv4 Gateway IP address of host forwarding packets to non-local destinations. You must fill this in if the machine is a node on the network. Leave this field blank if the machine is the gateway to the Internet for the network. The IPv4 Gateway is also known as the default gateway or default route. Name server IP address of your local DNS server. There is no local DNS server on this private local area network so the IP address of the provider's DNS server (208.163.10.2) was used. IPv4 address The IP address to be used for this interface was 192.168.0.1 Netmask The address block being used for this local area network is a Class C block (192.168.0.0 - 192.168.255.255). The default netmask is for a Class C network (255.255.255.0). Extra options to ifconfig Any interface-specific options to ifconfig you would like to add. There were none in this case. Use Tab to select &gui.ok; when finished and press Enter. User Confirmation Requested Would you like to Bring Up the ed0 interface right now? [ Yes ] No Choosing &gui.yes; and pressing Enter will bring the machine up on the network and be ready for use. However, this does not accomplish much during installation, since the machine still needs to be rebooted.
Configure Gateway User Confirmation Requested Do you want this machine to function as a network gateway? [ Yes ] No If the machine will be acting as the gateway for a local area network and forwarding packets between other machines then select &gui.yes; and press Enter. If the machine is a node on a network then select &gui.no; and press Enter to continue. Configure Internet Services User Confirmation Requested Do you want to configure inetd and the network services that it provides? Yes [ No ] If &gui.no; is selected, various services such telnetd will not be enabled. This means that remote users will not be able to telnet into this machine. Local users will be still be able to access remote machines with telnet. These services can be enabled after installation by editing /etc/inetd.conf with your favorite text editor. See for more information. Select &gui.yes; if you wish to configure these services during install. An additional confirmation will display: User Confirmation Requested The Internet Super Server (inetd) allows a number of simple Internet services to be enabled, including finger, ftp and telnetd. Enabling these services may increase risk of security problems by increasing the exposure of your system. With this in mind, do you wish to enable inetd? [ Yes ] No Select &gui.yes; to continue. User Confirmation Requested inetd(8) relies on its configuration file, /etc/inetd.conf, to determine which of its Internet services will be available. The default FreeBSD inetd.conf(5) leaves all services disabled by default, so they must be specifically enabled in the configuration file before they will function, even once inetd(8) is enabled. Note that services for IPv6 must be separately enabled from IPv4 services. Select [Yes] now to invoke an editor on /etc/inetd.conf, or [No] to use the current settings. [ Yes ] No Selecting &gui.yes; will allow adding services by deleting the # at the beginning of a line.
Editing <filename>inetd.conf</filename>
After adding the desired services, pressing Esc will display a menu which will allow exiting and saving the changes.
Anonymous FTP FTP anonymous User Confirmation Requested Do you want to have anonymous FTP access to this machine? Yes [ No ] Deny Anonymous FTP Selecting the default &gui.no; and pressing Enter will still allow users who have accounts with passwords to use FTP to access the machine. Allow Anonymous FTP Anyone can access your machine if you elect to allow anonymous FTP connections. The security implications should be considered before enabling this option. For more information about security see . To allow anonymous FTP, use the arrow keys to select &gui.yes; and press Enter. The following screen (or similar) will display:
Default Anonymous FTP Configuration
Pressing F1 will display the help: This screen allows you to configure the anonymous FTP user. The following configuration values are editable: UID: The user ID you wish to assign to the anonymous FTP user. All files uploaded will be owned by this ID. Group: Which group you wish the anonymous FTP user to be in. Comment: String describing this user in /etc/passwd FTP Root Directory: Where files available for anonymous FTP will be kept. Upload subdirectory: Where files uploaded by anonymous FTP users will go. The ftp root directory will be put in /var by default. If you do not have enough room there for the anticipated FTP needs, the /usr directory could be used by setting the FTP Root Directory to /usr/ftp. When you are satisfied with the values, press Enter to continue. User Confirmation Requested Create a welcome message file for anonymous FTP users? [ Yes ] No If you select &gui.yes; and press Enter, an editor will automatically start allowing you to edit the message.
Edit the FTP Welcome Message
This is a text editor called ee. Use the instructions to change the message or change the message later using a text editor of your choice. Note the file name/location at the bottom of the editor screen. Press Esc and a pop-up menu will default to a) leave editor. Press Enter to exit and continue. Press Enter again to save changes if you made any.
Configure Network File System Network File System (NFS) allows sharing of files across a network. A machine can be configured as a server, a client, or both. Refer to for a more information. NFS Server User Confirmation Requested Do you want to configure this machine as an NFS server? Yes [ No ] If there is no need for a Network File System server, select &gui.no; and press Enter. If &gui.yes; is chosen, a message will pop-up indicating that the exports file must be created. Message Operating as an NFS server means that you must first configure an /etc/exports file to indicate which hosts are allowed certain kinds of access to your local filesystems. Press [Enter] now to invoke an editor on /etc/exports [ OK ] Press Enter to continue. A text editor will start allowing the exports file to be created and edited.
Editing <filename>exports</filename>
Use the instructions to add the actual exported filesystems now or later using a text editor of your choice. Note the file name/location at the bottom of the editor screen. Press Esc and a pop-up menu will default to a) leave editor. Press Enter to exit and continue.
NFS Client The NFS client allows your machine to access NFS servers. User Confirmation Requested Do you want to configure this machine as an NFS client? Yes [ No ] With the arrow keys, select &gui.yes; or &gui.no; as appropriate and press Enter.
Security Profile A security profile is a set of configuration options that attempts to achieve the desired ratio of security to convenience by enabling and disabling certain programs and other settings. The more severe the security profile, the fewer programs will be enabled by default. This is one of the basic principles of security: do not run anything except what you must. Please note that the security profile is just a default setting. All programs can be enabled and disabled after you have installed FreeBSD by editing or adding the appropriate line(s) to /etc/rc.conf. For more information, please see the &man.rc.conf.5; manual page. The following table describes what each of the security profiles does. The columns are the choices you have for a security profile, and the rows are the program or feature that the profile enables or disables. Possible Security Profiles Extreme Moderate &man.sendmail.8; NO YES &man.sshd.8; NO YES &man.portmap.8; NO MAYBE The portmapper is enabled if the machine has been configured as an NFS client or server earlier in the installation. NFS server NO YES &man.securelevel.8; YES If you choose a security profile that sets the securelevel to Extreme or High, you must be aware of the implications. Please read the &man.init.8; manual page and pay particular attention to the meanings of the security levels, or you may have significant trouble later! NO
User Confirmation Requested Do you want to select a default security profile for this host (select No for "medium" security)? [ Yes ] No Selecting &gui.no; and pressing Enter will set the security profile to medium. Selecting &gui.yes; and pressing Enter will allow selecting a different security profile.
Security Profile Options
Press F1 to display the help. Press Enter to return to selection menu. Use the arrow keys to choose Medium unless your are sure that another level is required for your needs. With &gui.ok; highlighted, press Enter. An appropriate confirmation message will display depending on which security setting was chosen. Message Moderate security settings have been selected. Sendmail and SSHd have been enabled, securelevels are disabled, and NFS server setting have been left intact. PLEASE NOTE that this still does not save you from having to properly secure your system in other ways or exercise due diligence in your administration, this simply picks a standard set of out-of-box defaults to start with. To change any of these settings later, edit /etc/rc.conf [OK] Message Extreme security settings have been selected. Sendmail, SSHd, and NFS services have been disabled, and securelevels have been enabled. PLEASE NOTE that this still does not save you from having to properly secure your system in other ways or exercise due diligence in your administration, this simply picks a more secure set of out-of-box defaults to start with. To change any of these settings later, edit /etc/rc.conf [OK] Press Enter to continue with the post-installation configuration. The security profile is not a silver bullet! Even if you use the extreme setting, you need to keep up with security issues by reading an appropriate mailing list (), using good passwords and passphrases, and generally adhering to good security practices. It simply sets up the desired security to convenience ratio out of the box.
System Console Settings There are several options available to customize the system console. User Confirmation Requested Would you like to customize your system console settings? [ Yes ] No To view and configure the options, select &gui.yes; and press Enter.
System Console Configuration Options
A commonly used option is the screen saver. Use the arrow keys to select Saver and then press Enter.
Screen Saver Options
Select the desired screen saver using the arrow keys and then press Enter. The System Console Configuration menu will redisplay. The default time interval is 300 seconds. To change the time interval, select Saver again. At the Screen Saver Options menu, select Timeout using the arrow keys and press Enter. A pop-up menu will appear:
Screen Saver Timeout
The value can be changed, then select &gui.ok; and press Enter to return to the System Console Configuration menu.
System Console Configuration Exit
Selecting Exit and pressing Enter will continue with the post-installation configurations.
Setting the Time Zone Setting the time zone for your machine will allow it to automatically correct for any regional time changes and perform other time zone related functions properly. The example shown is for a machine located in the Eastern time zone of the United States. Your selections will vary according to your geographical location. User Confirmation Requested Would you like to set this machine's time zone now? [ Yes ] No Select &gui.yes; and press Enter to set the time zone. User Confirmation Requested Is this machine's CMOS clock set to UTC? If it is set to local time or you don't know, please choose NO here! Yes [ No ] Select &gui.yes; or &gui.no; according to how the machine's clock is configured and press Enter.
Select Your Region
The appropriate region is selected using the arrow keys and then pressing Enter.
Select Your Country
Select the appropriate country using the arrow keys and press Enter.
Select Your Time Zone
The appropriate time zone is selected using the arrow keys and pressing Enter. Confirmation Does the abbreviation 'EDT' look reasonable? [ Yes ] No Confirm the abbreviation for the time zone is correct. If it looks okay, press Enter to continue with the post-installation configuration.
Linux Compatibility User Confirmation Requested Would you like to enable Linux binary compatibility? [ Yes ] No Selecting &gui.yes; and pressing Enter will allow running Linux software on FreeBSD. The install will add the appropriate packages for Linux compatibility. If installing by FTP, the machine will need to be connected to the Internet. Sometimes a remote ftp site will not have all the distributions like the Linux binary compatibility. This can be installed later if necessary. Mouse Settings This option will allow you to cut and paste text in the console and user programs with a 3-button mouse. If using a 2-button mouse, refer to manual page, &man.moused.8;, after installation for details on emulating the 3-button style. This example depicts a non-USB mouse configuration (such as a PS/2 or COM port mouse): User Confirmation Requested Does this system have a non-USB mouse attached to it? [ Yes ] No Select &gui.yes; for a non-USB mouse or &gui.no; for a USB mouse and press Enter.
Select Mouse Protocol Type
Use the arrow keys to select Type and press Enter.
Set Mouse Protocol
The mouse used in this example is a PS/2 type, so the default Auto was appropriate. To change protocol, use the arrow keys to select another option. Ensure that &gui.ok; is highlighted and press Enter to exit this menu.
Configure Mouse Port
Use the arrow keys to select Port and press Enter.
Setting the Mouse Port
This system had a PS/2 mouse, so the default PS/2 was appropriate. To change the port, use the arrow keys and then press Enter.
Enable the Mouse Daemon
Last, use the arrow keys to select Enable, and press Enter to enable and test the mouse daemon.
Test the Mouse Daemon
Move the mouse around the screen and verify the cursor shown responds properly. If it does, select &gui.yes; and press Enter. If not, the mouse has not been configured correctly — select &gui.no; and try using different configuration options. Select Exit with the arrow keys and press Enter to return to continue with the post-installation configuration.
Tom Rhodes Contributed by Configure Additional Network Services Configuring network services can be a daunting task for new users if they lack previous knowledge in this area. Networking, including the Internet, is critical to all modern operating systems including &os;; as a result, it is very useful to have some understanding &os;'s extensive networking capabilities. Doing this during the installation will ensure users have some understanding of the various services available to them. Network services are programs that accept input from anywhere on the network. Every effort is made to make sure these programs will not do anything harmful. Unfortunately, programmers are not perfect and through time there have been cases where bugs in network services have been exploited by attackers to do bad things. It is important that you only enable the network services you know that you need. If in doubt it is best if you do not enable a network service until you find out that you do need it. You can always enable it later by re-running sysinstall or by using the features provided by the /etc/rc.conf file. Selecting the Networking option will display a menu similar to the one below:
Network Configuration Upper-level
The first option, Interfaces, was previously covered during the , thus this option can safely be ignored. Selecting the AMD option adds support for the BSD automatic mount utility. This is usually used in conjunction with the NFS protocol (see below) for automatically mounting remote file systems. No special configuration is required here. Next in line is the AMD Flags option. When selected, a menu will pop up for you to enter specific AMD flags. The menu already contains a set of default options: -a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map The option sets the default mount location which is specified here as /.amd_mnt. The option specifies the default log file; however, when syslogd is used all log activity will be sent to the system log daemon. The /host directory is used to mount an exported file system from a remote host, while /net directory is used to mount an exported file system from an IP address. The /etc/amd.map file defines the default options for AMD exports. FTP anonymous The Anon FTP option permits anonymous FTP connections. Select this option to make this machine an anonymous FTP server. Be aware of the security risks involved with this option. Another menu will be displayed to explain the security risks and configuration in depth. The Gateway configuration menu will set the machine up to be a gateway as explained previously. This can be used to unset the Gateway option if you accidentally selected it during the installation process. The Inetd option can be used to configure or completely disable the &man.inetd.8; daemon as discussed above. The Mail option is used to configure the system's default MTA or Mail Transfer Agent. Selecting this option will bring up the following menu:
Select a default MTA
Here you are offered a choice as to which MTA to install and set as the default. An MTA is nothing more than a mail server which delivers email to users on the system or the Internet. Selecting Sendmail will install the popular sendmail server which is the &os; default. The Sendmail local option will set sendmail to be the default MTA, but disable its ability to receive incoming email from the Internet. The other options here, Postfix and Exim act similar to Sendmail. They both deliver email; however, some users prefer these alternatives to the sendmail MTA. After selecting an MTA, or choosing not to select an MTA, the network configuration menu will appear with the next option being NFS client. The NFS client option will configure the system to communicate with a server via NFS. An NFS server makes file systems available to other machines on the network via the NFS protocol. If this is a stand alone machine, this option can remain unselected. The system may require more configuration later; see for more information about client and server configuration. Below that option is the NFS server option, permitting you to set the system up as an NFS server. This adds the required information to start up the RPC remote procedure call services. RPC is used to coordinate connections between hosts and programs. Next in line is the Ntpdate option, which deals with time synchronization. When selected, a menu like the one below shows up:
Ntpdate Configuration
From this menu, select the server which is the closest to your location. Selecting a close one will make the time synchronization more accurate as a server further from your location may have more connection latency. The next option is the PCNFSD selection. This option will install the net/pcnfsd package from the Ports Collection. This is a useful utility which provides NFS authentication services for systems which are unable to provide their own, such as Microsoft's &ms-dos; operating system. Now you must scroll down a bit to see the other options:
Network Configuration Lower-level
The &man.rpcbind.8;, &man.rpc.statd.8;, and &man.rpc.lockd.8; utilities are all used for Remote Procedure Calls (RPC). The rpcbind utility manages communication between NFS servers and clients, and is required for NFS servers to operate correctly. The rpc.statd daemon interacts with the rpc.statd daemon on other hosts to provide status monitoring. The reported status is usually held in the /var/db/statd.status file. The next option listed here is the rpc.lockd option, which, when selected, will provide file locking services. This is usually used with rpc.statd to monitor what hosts are requesting locks and how frequently they request them. While these last two options are marvelous for debugging, they are not required for NFS servers and clients to operate correctly. As you progress down the list the next item here is Routed, which is the routing daemon. The &man.routed.8; utility manages network routing tables, discovers multicast routers, and supplies a copy of the routing tables to any physically connected host on the network upon request. This is mainly used for machines which act as a gateway for the local network. When selected, a menu will be presented requesting the default location of the utility. The default location is already defined for you and can be selected with the Enter key. You will then be presented with yet another menu, this time asking for the flags you wish to pass on to routed. The default is and it should already appear on the screen. Next in line is the Rwhod option which, when selected, will start the &man.rwhod.8; daemon during system initialization. The rwhod utility broadcasts system messages across the network periodically, or collects them when in consumer mode. More information can be found in the &man.ruptime.1; and &man.rwho.1; manual pages. The next to the last option in the list is for the &man.sshd.8; daemon. This is the secure shell server for OpenSSH and it is highly recommended over the standard telnet and FTP servers. The sshd server is used to create a secure connection from one host to another by using encrypted connections. Finally there is the TCP Extensions option. This enables the TCP Extensions defined in RFC 1323 and RFC 1644. While on many hosts this can speed up connections, it can also cause some connections to be dropped. It is not recommended for servers, but may be beneficial for stand alone machines. Now that you have configured the network services, you can scroll up to the very top item which is Exit and continue on to the next configuration section.
Configure X Server As of &os; 5.3-RELEASE, the X server configuration facility has been removed from sysinstall, you have to install and configure the X server after the installation of &os;. More information regarding the installation and the configuration of a X server can be found in . You can skip this section if you are not installing a &os; version prior to 5.3-RELEASE. In order to use a graphical user interface such as KDE, GNOME, or others, the X server will need to be configured. In order to run &xfree86; as a non root user you will need to have x11/wrapper installed. This is installed by default beginning with FreeBSD 4.7. For earlier versions this can be added from the Package Selection menu. To see whether your video card is supported, check the &xfree86; web site. User Confirmation Requested Would you like to configure your X server at this time? [ Yes ] No It is necessary to know your monitor specifications and video card information. Equipment damage can occur if settings are incorrect. If you do not have this information, select &gui.no; and perform the configuration after installation when you have the information using sysinstall (/stand/sysinstall in &os; versions older than 5.2), selecting Configure and then XFree86. Improper configuration of the X server at this time can leave the machine in a frozen state. It is often advised to configure the X server once the installation has completed. If you have graphics card and monitor information, select &gui.yes; and press Enter to proceed with configuring the X server.
Select Configuration Method Menu
There are several ways to configure the X server. Use the arrow keys to select one of the methods and press Enter. Be sure to read all instructions carefully. The xf86cfg and xf86cfg -textmode methods may make the screen go dark and take a few seconds to start. Be patient. The following will illustrate the use of the xf86config configuration tool. The configuration choices you make will depend on the hardware in the system so your choices will probably be different than those shown: Message You have configured and been running the mouse daemon. Choose "/dev/sysmouse" as the mouse port and "SysMouse" or "MouseSystems" as the mouse protocol in the X configuration utility. [ OK ] [ Press enter to continue ] This indicates that the mouse daemon previously configured has been detected. Press Enter to continue. Starting xf86config will display a brief introduction: This program will create a basic XF86Config file, based on menu selections you make. The XF86Config file usually resides in /usr/X11R6/etc/X11 or /etc/X11. A sample XF86Config file is supplied with XFree86; it is configured for a standard VGA card and monitor with 640x480 resolution. This program will ask for a pathname when it is ready to write the file. You can either take the sample XF86Config as a base and edit it for your configuration, or let this program produce a base XF86Config file for your configuration and fine-tune it. Before continuing with this program, make sure you know what video card you have, and preferably also the chipset it uses and the amount of video memory on your video card. SuperProbe may be able to help with this. Press enter to continue, or ctrl-c to abort. Pressing Enter will start the mouse configuration. Be sure to follow the instructions and use Mouse Systems as the mouse protocol and /dev/sysmouse as the mouse port even if using a PS/2 mouse is shown as an illustration. First specify a mouse protocol type. Choose one from the following list: 1. Microsoft compatible (2-button protocol) 2. Mouse Systems (3-button protocol) & FreeBSD moused protocol 3. Bus Mouse 4. PS/2 Mouse 5. Logitech Mouse (serial, old type, Logitech protocol) 6. Logitech MouseMan (Microsoft compatible) 7. MM Series 8. MM HitTablet 9. Microsoft IntelliMouse If you have a two-button mouse, it is most likely of type 1, and if you have a three-button mouse, it can probably support both protocol 1 and 2. There are two main varieties of the latter type: mice with a switch to select the protocol, and mice that default to 1 and require a button to be held at boot-time to select protocol 2. Some mice can be convinced to do 2 by sending a special sequence to the serial port (see the ClearDTR/ClearRTS options). Enter a protocol number: 2 You have selected a Mouse Systems protocol mouse. If your mouse is normally in Microsoft-compatible mode, enabling the ClearDTR and ClearRTS options may cause it to switch to Mouse Systems mode when the server starts. Please answer the following question with either 'y' or 'n'. Do you want to enable ClearDTR and ClearRTS? n You have selected a three-button mouse protocol. It is recommended that you do not enable Emulate3Buttons, unless the third button doesn't work. Please answer the following question with either 'y' or 'n'. Do you want to enable Emulate3Buttons? y Now give the full device name that the mouse is connected to, for example /dev/tty00. Just pressing enter will use the default, /dev/mouse. On FreeBSD, the default is /dev/sysmouse. Mouse device: /dev/sysmouse The keyboard is the next item to be configured. A generic 101-key model is shown for illustration. Any name may be used for the variant or simply press Enter to accept the default value. Please select one of the following keyboard types that is the better description of your keyboard. If nothing really matches, choose 1 (Generic 101-key PC) 1 Generic 101-key PC 2 Generic 102-key (Intl) PC 3 Generic 104-key PC 4 Generic 105-key (Intl) PC 5 Dell 101-key PC 6 Everex STEPnote 7 Keytronic FlexPro 8 Microsoft Natural 9 Northgate OmniKey 101 10 Winbook Model XP5 11 Japanese 106-key 12 PC-98xx Series 13 Brazilian ABNT2 14 HP Internet 15 Logitech iTouch 16 Logitech Cordless Desktop Pro 17 Logitech Internet Keyboard 18 Logitech Internet Navigator Keyboard 19 Compaq Internet 20 Microsoft Natural Pro 21 Genius Comfy KB-16M 22 IBM Rapid Access 23 IBM Rapid Access II 24 Chicony Internet Keyboard 25 Dell Internet Keyboard Enter a number to choose the keyboard. 1 Please select the layout corresponding to your keyboard 1 U.S. English 2 U.S. English w/ ISO9995-3 3 U.S. English w/ deadkeys 4 Albanian 5 Arabic 6 Armenian 7 Azerbaidjani 8 Belarusian 9 Belgian 10 Bengali 11 Brazilian 12 Bulgarian 13 Burmese 14 Canadian 15 Croatian 16 Czech 17 Czech (qwerty) 18 Danish Enter a number to choose the country. Press enter for the next page 1 Please enter a variant name for 'us' layout. Or just press enter for default variant us Please answer the following question with either 'y' or 'n'. Do you want to select additional XKB options (group switcher, group indicator, etc.)? n Next, we proceed to the configuration for the monitor. Do not exceed the ratings of your monitor. Damage could occur. If you have any doubts, do the configuration after you have the information. Now we want to set the specifications of the monitor. The two critical parameters are the vertical refresh rate, which is the rate at which the whole screen is refreshed, and most importantly the horizontal sync rate, which is the rate at which scanlines are displayed. The valid range for horizontal sync and vertical sync should be documented in the manual of your monitor. If in doubt, check the monitor database /usr/X11R6/lib/X11/doc/Monitors to see if your monitor is there. Press enter to continue, or ctrl-c to abort. You must indicate the horizontal sync range of your monitor. You can either select one of the predefined ranges below that correspond to industry- standard monitor types, or give a specific range. It is VERY IMPORTANT that you do not specify a monitor type with a horizontal sync range that is beyond the capabilities of your monitor. If in doubt, choose a conservative setting. hsync in kHz; monitor type with characteristic modes 1 31.5; Standard VGA, 640x480 @ 60 Hz 2 31.5 - 35.1; Super VGA, 800x600 @ 56 Hz 3 31.5, 35.5; 8514 Compatible, 1024x768 @ 87 Hz interlaced (no 800x600) 4 31.5, 35.15, 35.5; Super VGA, 1024x768 @ 87 Hz interlaced, 800x600 @ 56 Hz 5 31.5 - 37.9; Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz 6 31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz 7 31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz 8 31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz 9 31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz 10 31.5 - 82.0; Monitor that can do 1280x1024 @ 76 Hz 11 Enter your own horizontal sync range Enter your choice (1-11): 6 You must indicate the vertical sync range of your monitor. You can either select one of the predefined ranges below that correspond to industry- standard monitor types, or give a specific range. For interlaced modes, the number that counts is the high one (e.g. 87 Hz rather than 43 Hz). 1 50-70 2 50-90 3 50-100 4 40-150 5 Enter your own vertical sync range Enter your choice: 2 You must now enter a few identification/description strings, namely an identifier, a vendor name, and a model name. Just pressing enter will fill in default names. The strings are free-form, spaces are allowed. Enter an identifier for your monitor definition: Hitachi The selection of a video card driver from a list is next. If you pass your card on the list, continue to press Enter and the list will repeat. Only an excerpt from the list is shown: Now we must configure video card specific settings. At this point you can choose to make a selection out of a database of video card definitions. Because there can be variation in Ramdacs and clock generators even between cards of the same model, it is not sensible to blindly copy the settings (e.g. a Device section). For this reason, after you make a selection, you will still be asked about the components of the card, with the settings from the chosen database entry presented as a strong hint. The database entries include information about the chipset, what driver to run, the Ramdac and ClockChip, and comments that will be included in the Device section. However, a lot of definitions only hint about what driver to run (based on the chipset the card uses) and are untested. If you can't find your card in the database, there's nothing to worry about. You should only choose a database entry that is exactly the same model as your card; choosing one that looks similar is just a bad idea (e.g. a GemStone Snail 64 may be as different from a GemStone Snail 64+ in terms of hardware as can be). Do you want to look at the card database? y 288 Matrox Millennium G200 8MB mgag200 289 Matrox Millennium G200 SD 16MB mgag200 290 Matrox Millennium G200 SD 4MB mgag200 291 Matrox Millennium G200 SD 8MB mgag200 292 Matrox Millennium G400 mgag400 293 Matrox Millennium II 16MB mga2164w 294 Matrox Millennium II 4MB mga2164w 295 Matrox Millennium II 8MB mga2164w 296 Matrox Mystique mga1064sg 297 Matrox Mystique G200 16MB mgag200 298 Matrox Mystique G200 4MB mgag200 299 Matrox Mystique G200 8MB mgag200 300 Matrox Productiva G100 4MB mgag100 301 Matrox Productiva G100 8MB mgag100 302 MediaGX mediagx 303 MediaVision Proaxcel 128 ET6000 304 Mirage Z-128 ET6000 305 Miro CRYSTAL VRX Verite 1000 Enter a number to choose the corresponding card definition. Press enter for the next page, q to continue configuration. 288 Your selected card definition: Identifier: Matrox Millennium G200 8MB Chipset: mgag200 Driver: mga Do NOT probe clocks or use any Clocks line. Press enter to continue, or ctrl-c to abort. Now you must give information about your video card. This will be used for the "Device" section of your video card in XF86Config. You must indicate how much video memory you have. It is probably a good idea to use the same approximate amount as that detected by the server you intend to use. If you encounter problems that are due to the used server not supporting the amount memory you have (e.g. ATI Mach64 is limited to 1024K with the SVGA server), specify the maximum amount supported by the server. How much video memory do you have on your video card: 1 256K 2 512K 3 1024K 4 2048K 5 4096K 6 Other Enter your choice: 6 Amount of video memory in Kbytes: 8192 You must now enter a few identification/description strings, namely an identifier, a vendor name, and a model name. Just pressing enter will fill in default names (possibly from a card definition). Your card definition is Matrox Millennium G200 8MB. The strings are free-form, spaces are allowed. Enter an identifier for your video card definition: Next, the video modes are set for the resolutions desired. Typically, useful ranges are 640x480, 800x600, and 1024x768 but those are a function of video card capability, monitor size, and eye comfort. When selecting a color depth, select the highest mode that your card will support. For each depth, a list of modes (resolutions) is defined. The default resolution that the server will start-up with will be the first listed mode that can be supported by the monitor and card. Currently it is set to: "640x480" "800x600" "1024x768" "1280x1024" for 8-bit "640x480" "800x600" "1024x768" "1280x1024" for 16-bit "640x480" "800x600" "1024x768" "1280x1024" for 24-bit Modes that cannot be supported due to monitor or clock constraints will be automatically skipped by the server. 1 Change the modes for 8-bit (256 colors) 2 Change the modes for 16-bit (32K/64K colors) 3 Change the modes for 24-bit (24-bit color) 4 The modes are OK, continue. Enter your choice: 2 Select modes from the following list: 1 "640x400" 2 "640x480" 3 "800x600" 4 "1024x768" 5 "1280x1024" 6 "320x200" 7 "320x240" 8 "400x300" 9 "1152x864" a "1600x1200" b "1800x1400" c "512x384" Please type the digits corresponding to the modes that you want to select. For example, 432 selects "1024x768" "800x600" "640x480", with a default mode of 1024x768. Which modes? 432 You can have a virtual screen (desktop), which is screen area that is larger than the physical screen and which is panned by moving the mouse to the edge of the screen. If you don't want virtual desktop at a certain resolution, you cannot have modes listed that are larger. Each color depth can have a differently-sized virtual screen Please answer the following question with either 'y' or 'n'. Do you want a virtual screen that is larger than the physical screen? n For each depth, a list of modes (resolutions) is defined. The default resolution that the server will start-up with will be the first listed mode that can be supported by the monitor and card. Currently it is set to: "640x480" "800x600" "1024x768" "1280x1024" for 8-bit "1024x768" "800x600" "640x480" for 16-bit "640x480" "800x600" "1024x768" "1280x1024" for 24-bit Modes that cannot be supported due to monitor or clock constraints will be automatically skipped by the server. 1 Change the modes for 8-bit (256 colors) 2 Change the modes for 16-bit (32K/64K colors) 3 Change the modes for 24-bit (24-bit color) 4 The modes are OK, continue. Enter your choice: 4 Please specify which color depth you want to use by default: 1 1 bit (monochrome) 2 4 bits (16 colors) 3 8 bits (256 colors) 4 16 bits (65536 colors) 5 24 bits (16 million colors) Enter a number to choose the default depth. 4 Finally, the configuration needs to be saved. Be sure to enter /etc/X11/XF86Config as the location for saving the configuration. I am going to write the XF86Config file now. Make sure you don't accidently overwrite a previously configured one. Shall I write it to /etc/X11/XF86Config? y If the configuration fails, you can try the configuration again by selecting &gui.yes; when the following message appears: User Confirmation Requested The XFree86 configuration process seems to have failed. Would you like to try again? [ Yes ] No If you have trouble configuring &xfree86;, select &gui.no; and press Enter and continue with the installation process. After installation you can use xf86cfg -textmode or xf86config to access the command line configuration utilities as root. There is an additional method for configuring &xfree86; described in . If you choose not to configure &xfree86; at this time the next menu will be for package selection. The default setting which allows the server to be killed is the hotkey sequence CtrlAlt Backspace. This can be executed if something is wrong with the server settings and prevent hardware damage. The default setting that allows video mode switching will permit changing of the mode while running X with the hotkey sequence CtrlAlt+ or CtrlAlt- . After you have &xfree86; running, the display can be adjusted for height, width, or centering by using xvidtune. There are warnings that improper settings can damage your equipment. Heed them. If in doubt, do not do it. Instead, use the monitor controls to adjust the display for X Window. There may be some display differences when switching back to text mode, but it is better than damaging equipment. Read the &man.xvidtune.1; manual page before making any adjustments. Following a successful &xfree86; configuration, it will proceed to the selection of a default desktop.
Select Default X Desktop As of &os; 5.3-RELEASE, the X desktop selection facility has been removed from sysinstall, you have to configure the X desktop after the installation of &os;. More information regarding the installation and the configuration of a X desktop can be found in . You can skip this section if you are not installing a &os; version prior to 5.3-RELEASE. There are a variety of window managers available. They range from very basic environments to full desktop environments with a large suite of software. Some require only minimal disk space and low memory while others with more features require much more. The best way to determine which is most suitable for you is to try a few different ones. Those are available from the Ports Collection or as packages and can be added after installation. You can select one of the popular desktops to be installed and configured as the default desktop. This will allow you to start it right after installation.
Select Default Desktop
Use the arrow keys to select a desktop and press Enter. Installation of the selected desktop will proceed.
Install Packages Packages are pre-compiled binaries and are a convenient way to install software. Installation of one package is shown for purposes of illustration. Additional packages can also be added at this time if desired. After installation sysinstall (/stand/sysinstall in &os; versions older than 5.2) can be used to add additional packages. User Confirmation Requested The FreeBSD package collection is a collection of hundreds of ready-to-run applications, from text editors to games to WEB servers and more. Would you like to browse the collection now? [ Yes ] No Selecting &gui.yes; and pressing Enter will be followed by the Package Selection screens:
Select Package Category
Only packages on the current installation media are available for installation at any given time. All packages available will be displayed if All is selected or you can select a particular category. Highlight your selection with the arrow keys and press Enter. A menu will display showing all the packages available for the selection made:
Select Packages
The bash shell is shown selected. Select as many as desired by highlighting the package and pressing the Space key. A short description of each package will appear in the lower left corner of the screen. Pressing the Tab key will toggle between the last selected package, &gui.ok;, and &gui.cancel;. When you have finished marking the packages for installation, press Tab once to toggle to the &gui.ok; and press Enter to return to the Package Selection menu. The left and right arrow keys will also toggle between &gui.ok; and &gui.cancel;. This method can also be used to select &gui.ok; and press Enter to return to the Package Selection menu.
Install Packages
Use the Tab and arrow keys to select [ Install ] and press Enter. You will then need to confirm that you want to install the packages:
Confirm Package Installation
Selecting &gui.ok; and pressing Enter will start the package installation. Installing messages will appear until completed. Make note if there are any error messages. The final configuration continues after packages are installed. If you end up not selecting any packages, and wish to return to the final configuration, select Install anyways.
Add Users/Groups You should add at least one user during the installation so that you can use the system without being logged in as root. The root partition is generally small and running applications as root can quickly fill it. A bigger danger is noted below: User Confirmation Requested Would you like to add any initial user accounts to the system? Adding at least one account for yourself at this stage is suggested since working as the "root" user is dangerous (it is easy to do things which adversely affect the entire system). [ Yes ] No Select &gui.yes; and press Enter to continue with adding a user.
Select User
Select User with the arrow keys and press Enter.
Add User Information
The following descriptions will appear in the lower part of the screen as the items are selected with Tab to assist with entering the required information: Login ID The login name of the new user (mandatory). UID The numerical ID for this user (leave blank for automatic choice). Group The login group name for this user (leave blank for automatic choice). Password The password for this user (enter this field with care!). Full name The user's full name (comment). Member groups The groups this user belongs to (i.e. gets access rights for). Home directory The user's home directory (leave blank for default). Login shell The user's login shell (leave blank for default, e.g. /bin/sh). The login shell was changed from /bin/sh to /usr/local/bin/bash to use the bash shell that was previously installed as a package. Do not try to use a shell that does not exist or you will not be able to login. The most common shell used in the BSD-world is the C shell, which can be indicated as /bin/tcsh. The user was also added to the wheel group to be able to become a superuser with root privileges. When you are satisfied, press &gui.ok; and the User and Group Management menu will redisplay:
Exit User and Group Management
Groups can also be added at this time if specific needs are known. Otherwise, this may be accessed through using sysinstall (/stand/sysinstall in &os; versions older than 5.2) after installation is completed. When you are finished adding users, select Exit with the arrow keys and press Enter to continue the installation.
Set the <username>root</username> Password Message Now you must set the system manager's password. This is the password you'll use to log in as "root". [ OK ] [ Press enter to continue ] Press Enter to set the root password. The password will need to be typed in twice correctly. Needless to say, make sure you have a way of finding the password if you forget. Notice that the password you type in is not echoed, nor are asterisks displayed. Changing local password for root. New password : Retype new password : The installation will continue after the password is successfully entered. Exiting Install If you need to configure additional network devices or any other configuration, you can do it at this point or after installation with sysinstall (/stand/sysinstall in &os; versions older than 5.2). User Confirmation Requested Visit the general configuration menu for a chance to set any last options? Yes [ No ] Select &gui.no; with the arrow keys and press Enter to return to the Main Installation Menu.
Exit Install
Select [X Exit Install] with the arrow keys and press Enter. You will be asked to confirm exiting the installation: User Confirmation Requested Are you sure you wish to exit? The system will reboot (be sure to remove any floppies from the drives). [ Yes ] No Select &gui.yes; and remove the floppy if booting from the floppy. The CDROM drive is locked until the machine starts to reboot. The CDROM drive is then unlocked and the disk can be removed from drive (quickly). The system will reboot so watch for any error messages that may appear.
FreeBSD Bootup FreeBSD Bootup on the &i386; If everything went well, you will see messages scroll off the screen and you will arrive at a login prompt. You can view the content of the messages by pressing Scroll-Lock and using PgUp and PgDn. Pressing Scroll-Lock again will return to the prompt. The entire message may not display (buffer limitation) but it can be viewed from the command line after logging in by typing dmesg at the prompt. Login using the username/password you set during installation (rpratt, in this example). Avoid logging in as root except when necessary. Typical boot messages (version information omitted): Copyright (c) 1992-2002 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. Timecounter "i8254" frequency 1193182 Hz CPU: AMD-K6(tm) 3D processor (300.68-MHz 586-class CPU) Origin = "AuthenticAMD" Id = 0x580 Stepping = 0 Features=0x8001bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX> AMD Features=0x80000800<SYSCALL,3DNow!> real memory = 268435456 (262144K bytes) config> di sn0 config> di lnc0 config> di le0 config> di ie0 config> di fe0 config> di cs0 config> di bt0 config> di aic0 config> di aha0 config> di adv0 config> q avail memory = 256311296 (250304K bytes) Preloaded elf kernel "kernel" at 0xc0491000. Preloaded userconfig_script "/boot/kernel.conf" at 0xc049109c. md0: Malloc disk Using $PIR table, 4 entries at 0xc00fde60 npx0: <math processor> on motherboard npx0: INT 16 interface pcib0: <Host to PCI bridge> on motherboard pci0: <PCI bus> on pcib0 pcib1: <VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge> at device 1.0 on pci0 pci1: <PCI bus> on pcib1 pci1: <Matrox MGA G200 AGP graphics accelerator> at 0.0 irq 11 isab0: <VIA 82C586 PCI-ISA bridge> at device 7.0 on pci0 isa0: <ISA bus> on isab0 atapci0: <VIA 82C586 ATA33 controller> port 0xe000-0xe00f at device 7.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 uhci0: <VIA 83C572 USB controller> port 0xe400-0xe41f irq 10 at device 7.2 on pci0 usb0: <VIA 83C572 USB controller> on uhci0 usb0: USB revision 1.0 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered chip1: <VIA 82C586B ACPI interface> at device 7.3 on pci0 ed0: <NE2000 PCI Ethernet (RealTek 8029)> port 0xe800-0xe81f irq 9 at device 10.0 on pci0 ed0: address 52:54:05:de:73:1b, type NE2000 (16 bit) isa0: too many dependant configs (8) isa0: unexpected small tag 14 fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0 fdc0: FIFO enabled, 8 bytes threshold fd0: <1440-KB 3.5" drive> on fdc0 drive 0 atkbdc0: <keyboard controller (i8042)> at port 0x60-0x64 on isa0 atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0 kbd0 at atkbd0 psm0: <PS/2 Mouse> irq 12 on atkbdc0 psm0: model Generic PS/2 mouse, device ID 0 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 sc0: <System console> at flags 0x1 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0 sio0: type 16550A sio1 at port 0x2f8-0x2ff irq 3 on isa0 sio1: type 16550A ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/15 bytes threshold ppbus0: IEEE1284 device found /NIBBLE Probing for PnP devices on ppbus0: plip0: <PLIP network interface> on ppbus0 lpt0: <Printer> on ppbus0 lpt0: Interrupt-driven port ppi0: <Parallel I/O> on ppbus0 ad0: 8063MB <IBM-DHEA-38451> [16383/16/63] at ata0-master using UDMA33 ad2: 8063MB <IBM-DHEA-38451> [16383/16/63] at ata1-master using UDMA33 acd0: CDROM <DELTA OTC-H101/ST3 F/W by OIPD> at ata0-slave using PIO4 Mounting root from ufs:/dev/ad0s1a swapon: adding /dev/ad0s1b as swap device Automatic boot in progress... /dev/ad0s1a: FILESYSTEM CLEAN; SKIPPING CHECKS /dev/ad0s1a: clean, 48752 free (552 frags, 6025 blocks, 0.9% fragmentation) /dev/ad0s1f: FILESYSTEM CLEAN; SKIPPING CHECKS /dev/ad0s1f: clean, 128997 free (21 frags, 16122 blocks, 0.0% fragmentation) /dev/ad0s1g: FILESYSTEM CLEAN; SKIPPING CHECKS /dev/ad0s1g: clean, 3036299 free (43175 frags, 374073 blocks, 1.3% fragmentation) /dev/ad0s1e: filesystem CLEAN; SKIPPING CHECKS /dev/ad0s1e: clean, 128193 free (17 frags, 16022 blocks, 0.0% fragmentation) Doing initial network setup: hostname. ed0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 inet6 fe80::5054::5ff::fede:731b%ed0 prefixlen 64 tentative scopeid 0x1 ether 52:54:05:de:73:1b lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 Additional routing options: IP gateway=YES TCP keepalive=YES routing daemons:. additional daemons: syslogd. Doing additional network setup:. Starting final network daemons: creating ssh RSA host key Generating public/private rsa1 key pair. Your identification has been saved in /etc/ssh/ssh_host_key. Your public key has been saved in /etc/ssh/ssh_host_key.pub. The key fingerprint is: cd:76:89:16:69:0e:d0:6e:f8:66:d0:07:26:3c:7e:2d root@k6-2.example.com creating ssh DSA host key Generating public/private dsa key pair. Your identification has been saved in /etc/ssh/ssh_host_dsa_key. Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub. The key fingerprint is: f9:a1:a9:47:c4:ad:f9:8d:52:b8:b8:ff:8c:ad:2d:e6 root@k6-2.example.com. setting ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout starting standard daemons: inetd cron sshd usbd sendmail. Initial rc.i386 initialization:. rc.i386 configuring syscons: blank_time screensaver moused. Additional ABI support: linux. Local package initialization:. Additional TCP options:. FreeBSD/i386 (k6-2.example.com) (ttyv0) login: rpratt Password: Generating the RSA and DSA keys may take some time on slower machines. This happens only on the initial boot-up of a new installation. Subsequent boots will be faster. If the X server has been configured and a Default Desktop chosen, it can be started by typing startx at the command line. Bootup of FreeBSD on the Alpha Alpha Once the install procedure has finished, you will be able to start FreeBSD by typing something like this to the SRM prompt: >>>BOOT DKC0 This instructs the firmware to boot the specified disk. To make FreeBSD boot automatically in the future, use these commands: >>> SET BOOT_OSFLAGS A >>> SET BOOT_FILE '' >>> SET BOOTDEF_DEV DKC0 >>> SET AUTO_ACTION BOOT The boot messages will be similar (but not identical) to those produced by FreeBSD booting on the &i386;. FreeBSD Shutdown It is important to properly shutdown the operating system. Do not just turn off power. First, become a superuser by typing su at the command line and entering the root password. This will work only if the user is a member of the wheel group. Otherwise, login as root and use shutdown -h now. The operating system has halted. Please press any key to reboot. It is safe to turn off the power after the shutdown command has been issued and the message Please press any key to reboot appears. If any key is pressed instead of turning off the power switch, the system will reboot. You could also use the Ctrl Alt Del key combination to reboot the system, however this is not recommended during normal operation.
- Supported Hardware + ¤ä´©ªºµwÅé hardware FreeBSD currently runs on a wide variety of ISA, VLB, EISA, and PCI bus-based PCs with Intel, AMD, Cyrix, or NexGen x86 processors, as well as a number of machines based on the Compaq Alpha processor. Support for generic IDE or ESDI drive configurations, various SCSI controllers, PCMCIA cards, USB devices, and network and serial cards is also provided. FreeBSD also supports IBM's microchannel (MCA) bus. A list of supported hardware is provided with each FreeBSD release in the FreeBSD Hardware Notes. This document can usually be found in a file named HARDWARE.TXT, in the top-level directory of a CDROM or FTP distribution or in sysinstall's documentation menu. It lists, for a given architecture, what hardware devices are known to be supported by each release of FreeBSD. Copies of the supported hardware list for various releases and architectures can also be found on the Release Information page of the FreeBSD Web site. - Troubleshooting + ¦w¸ËªººÃÃøÂø¯g¸Ñ¨M installation troubleshooting The following section covers basic installation troubleshooting, such as common problems people have reported. There are also a few questions and answers for people wishing to dual-boot FreeBSD with &ms-dos;. What to Do If Something Goes Wrong Due to various limitations of the PC architecture, it is impossible for probing to be 100% reliable, however, there are a few things you can do if it fails. Check the Hardware Notes document for your version of FreeBSD to make sure your hardware is supported. If your hardware is supported and you still experience lock-ups or other problems, reset your computer, and when the visual kernel configuration option is given, choose it. This will allow you to go through your hardware and supply information to the system about it. The kernel on the boot disks is configured assuming that most hardware devices are in their factory default configuration in terms of IRQs, IO addresses, and DMA channels. If your hardware has been reconfigured, you will most likely need to use the configuration editor to tell FreeBSD where to find things. It is also possible that a probe for a device not present will cause a later probe for another device that is present to fail. In that case, the probes for the conflicting driver(s) should be disabled. Some installation problems can be avoided or alleviated by updating the firmware on various hardware components, most notably the motherboard. The motherboard firmware may also be referred to as BIOS and most of the motherboard or computer manufactures have a website where the upgrades and upgrade information may be located. Most manufacturers strongly advise against upgrading the motherboard BIOS unless there is a good reason for doing so, which could possibly be a critical update of sorts. The upgrade process can go wrong, causing permanent damage to the BIOS chip. Do not disable any drivers you will need during the installation, such as your screen (sc0). If the installation wedges or fails mysteriously after leaving the configuration editor, you have probably removed or changed something you should not have. Reboot and try again. In configuration mode, you can: List the device drivers installed in the kernel. Disable device drivers for hardware that is not present in your system. Change IRQs, DRQs, and IO port addresses used by a device driver. After adjusting the kernel to match your hardware configuration, type Q to boot with the new settings. Once the installation has completed, any changes you made in the configuration mode will be permanent so you do not have to reconfigure every time you boot. It is still highly likely that you will eventually want to build a custom kernel. Dealing with Existing &ms-dos; Partitions DOS Many users wish to install &os; on PCs inhabited by µsoft; based operating systems. For those instances, &os; has a utility known as FIPS. This utility can be found in the tools directory on the install CD-ROM, or downloaded from one of various &os; mirrors. The FIPS utility allows you to split an existing &ms-dos; partition into two pieces, preserving the original partition and allowing you to install onto the second free piece. You first need to defragment your &ms-dos; partition using the &windows; Disk Defragmenter utility (go into Explorer, right-click on the hard drive, and choose to defrag your hard drive), or use Norton Disk Tools. Now you can run the FIPS utility. It will prompt you for the rest of the information, just follow the on screen instructions. Afterwards, you can reboot and install &os; on the new free slice. See the Distributions menu for an estimate of how much free space you will need for the kind of installation you want. There is also a very useful product from PowerQuest (http://www.powerquest.com) called &partitionmagic;. This application has far more functionality than FIPS, and is highly recommended if you plan to add/remove operating systems often. It does cost money, so if you plan to install &os; and keep it installed, FIPS will probably be fine for you. Using &ms-dos; and &windows; File Systems At this time, &os; does not support file systems compressed with the Double Space™ application. Therefore the file system will need to be uncompressed before &os; can access the data. This can be done by running the Compression Agent located in the Start> Programs > System Tools menu. &os; can support &ms-dos; based file systems. This requires you use the &man.mount.msdos.8; command (in &os; 5.X, the command is &man.mount.msdosfs.8;) with the required parameters. The utilities most common usage is: &prompt.root; mount_msdos /dev/ad0s1 /mnt In this example, the &ms-dos; file system is located on the first partition of the primary hard disk. Your situation may be different, check the output from the dmesg, and mount commands. They should produce enough information to give an idea of the partition layout. Extended &ms-dos; file systems are usually mapped after the &os; partitions. In other words, the slice number may be higher than the ones &os; is using. For instance, the first &ms-dos; partition may be /dev/ad0s1, the &os; partition may be /dev/ad0s2, with the extended &ms-dos; partition being located on /dev/ad0s3. To some, this can be confusing at first. NTFS partitions can also be mounted in a similar manner using the &man.mount.ntfs.8; command. Alpha User's Questions and Answers Alpha This section answers some commonly asked questions about installing FreeBSD on Alpha systems. Can I boot from the ARC or Alpha BIOS Console? ARC Alpha BIOS SRM No. &os;, like Compaq Tru64 and VMS, will only boot from the SRM console. Help, I have no space! Do I need to delete everything first? Unfortunately, yes. Can I mount my Compaq Tru64 or VMS filesystems? No, not at this time. Valentino Vaschetto Contributed by - Advanced Installation Guide + ¶i¶¥¦w¸Ë«ü«n This section describes how to install FreeBSD in exceptional cases. Installing FreeBSD on a System without a Monitor or Keyboard installation headless (serial console) serial console This type of installation is called a headless install, because the machine that you are trying to install FreeBSD on either does not have a monitor attached to it, or does not even have a VGA output. How is this possible you ask? Using a serial console. A serial console is basically using another machine to act as the main display and keyboard for a system. To do this, just follow the steps to create installation floppies, explained in . To modify these floppies to boot into a serial console, follow these steps: Enabling the Boot Floppies to Boot into a Serial Console mount If you were to boot into the floppies that you just made, FreeBSD would boot into its normal install mode. We want FreeBSD to boot into a serial console for our install. To do this, you have to mount the kern.flp floppy onto your FreeBSD system using the &man.mount.8; command. &prompt.root; mount /dev/fd0 /mnt Now that you have the floppy mounted, you must change into the /mnt directory: &prompt.root; cd /mnt Here is where you must set the floppy to boot into a serial console. You have to make a file called boot.config containing /boot/loader -h. All this does is pass a flag to the bootloader to boot into a serial console. &prompt.root; echo "/boot/loader -h" > boot.config Now that you have your floppy configured correctly, you must unmount the floppy using the &man.umount.8; command: &prompt.root; cd / &prompt.root; umount /mnt Now you can remove the floppy from the floppy drive. Connecting Your Null-modem Cable null-modem cable You now need to connect a null-modem cable between the two machines. Just connect the cable to the serial ports of the 2 machines. A normal serial cable will not work here, you need a null-modem cable because it has some of the wires inside crossed over. Booting Up for the Install It is now time to go ahead and start the install. Put the kern.flp floppy in the floppy drive of the machine you are doing the headless install on, and power on the machine. Connecting to Your Headless Machine cu Now you have to connect to that machine with &man.cu.1;: &prompt.root; cu -l /dev/cuaa0 That's it! You should now be able to control the headless machine through your cu session. It will ask you to put in the mfsroot.flp, and then it will come up with a selection of what kind of terminal to use. Select the FreeBSD color console and proceed with your install! - Preparing Your Own Installation Media + »s§@¦w¸Ë¤ù - To prevent repetition, FreeBSD disc in this context - means a FreeBSD CDROM or DVD that you have purchased or produced - yourself. + ¬°Á×§K­«Âл¡©ú¡A¦b¤å¤¤©Ò´£¨ìªº¡uFreeBSD ¥úºÐ¡v¡A + ¦b³o¸Ì«üªº¬O±z©ÒÁʶR©Î¦Û¦æ¿N¿ýªº FreeBSD CDROM ©Î DVD¡C There may be some situations in which you need to create your own FreeBSD installation media and/or source. This might be physical media, such as a tape, or a source that sysinstall can use to retrieve the files, such as a local FTP site, or an &ms-dos; partition. For example: You have many machines connected to your local network, and one FreeBSD disc. You want to create a local FTP site using the contents of the FreeBSD disc, and then have your machines use this local FTP site instead of needing to connect to the Internet. You have a FreeBSD disc, and FreeBSD does not recognize your CD/DVD drive, but &ms-dos;/&windows; does. You want to copy the FreeBSD installation files to a DOS partition on the same computer, and then install FreeBSD using those files. The computer you want to install on does not have a CD/DVD drive or a network card, but you can connect a Laplink-style serial or parallel cable to a computer that does. You want to create a tape that can be used to install FreeBSD. Creating an Installation CDROM As part of each release, the FreeBSD project makes available two CDROM images (ISO images). These images can be written (burned) to CDs if you have a CD writer, and then used to install FreeBSD. If you have a CD writer, and bandwidth is cheap, then this is the easiest way to install FreeBSD. Download the Correct ISO Images The ISO images for each release can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/ISO-IMAGES-arch/version or the closest mirror. Substitute arch and version as appropriate. That directory will normally contain the following images: FreeBSD 4.<replaceable>X</replaceable> ISO Image Names and Meanings Filename Contains version-RELEASE-arch-miniinst.iso Everything you need to install FreeBSD. version-RELEASE-arch-disc1.iso Everything you need to install FreeBSD, and as many additional third party packages as would fit on the disc. version-RELEASE-arch-disc2.iso A live filesystem, which is used in conjunction with the Repair facility in sysinstall. A copy of the FreeBSD CVS tree. As many additional third party packages as would fit on the disc.
FreeBSD 5.<replaceable>X</replaceable> ISO Image Names and Meanings Filename Contains version-RELEASE-arch-bootonly.iso Everything you need to boot into a FreeBSD kernel and start the installation interface. The installable files have to be pulled over FTP or some other supported source. version-RELEASE-arch-miniinst.iso Everything you need to install FreeBSD. version-RELEASE-arch-disc1.iso Everything you need to install &os; and a live filesystem, which is used in conjunction with the Repair facility in sysinstall. version-RELEASE-arch-disc2.iso &os; documentation and as many third party packages as would fit on the disc.
You must download one of either the miniinst ISO image, or the image of disc one. Do not download both of them, since the disc one image contains everything that the miniinst ISO image contains. The miniinst ISO image is only available for releases prior to 5.4-RELEASE. Use the miniinst ISO if Internet access is cheap for you. It will let you install FreeBSD, and you can then install third party packages by downloading them using the ports/packages system (see ) as necessary. Use the image of disc one if you want to install a &os; 4.X release and want a reasonable selection of third party packages on the disc as well. The additional disc images are useful, but not essential, especially if you have high-speed access to the Internet.
Write the CDs You must then write the CD images to disc. If you will be doing this on another FreeBSD system then see for more information (in particular, and ). If you will be doing this on another platform then you will need to use whatever utilities exist to control your CD writer on that platform. The images provided are in the standard ISO format, which many CD writing applications support.
If you are interested in building a customized release of FreeBSD, please see the Release Engineering Article.
Creating a Local FTP Site with a FreeBSD Disc installation network FTP FreeBSD discs are laid out in the same way as the FTP site. This makes it very easy for you to create a local FTP site that can be used by other machines on your network when installing FreeBSD. On the FreeBSD computer that will host the FTP site, ensure that the CDROM is in the drive, and mounted on /cdrom. &prompt.root; mount /cdrom Create an account for anonymous FTP in /etc/passwd. Do this by editing /etc/passwd using &man.vipw.8; and adding this line: ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent Ensure that the FTP service is enabled in /etc/inetd.conf. Anyone with network connectivity to your machine can now chose a media type of FTP and type in ftp://your machine after picking Other in the FTP sites menu during the install. If the boot media (floppy disks, usually) for your FTP clients is not precisely the same version as that provided by the local FTP site, then sysinstall will not let you complete the installation. If the versions are not similar and you want to override this, you must go into the Options menu and change distribution name to any. This approach is OK for a machine that is on your local network, and that is protected by your firewall. Offering up FTP services to other machines over the Internet (and not your local network) exposes your computer to the attention of crackers and other undesirables. We strongly recommend that you follow good security practices if you do this. Creating Installation Floppies installation floppies If you must install from floppy disk (which we suggest you do not do), either due to unsupported hardware or simply because you insist on doing things the hard way, you must first prepare some floppies for the installation. At a minimum, you will need as many 1.44 MB or 1.2 MB floppies as it takes to hold all the files in the bin (binary distribution) directory. If you are preparing the floppies from DOS, then they must be formatted using the &ms-dos; FORMAT command. If you are using &windows;, use Explorer to format the disks (right-click on the A: drive, and select Format). Do not trust factory pre-formatted floppies. Format them again yourself, just to be sure. Many problems reported by our users in the past have resulted from the use of improperly formatted media, which is why we are making a point of it now. If you are creating the floppies on another FreeBSD machine, a format is still not a bad idea, though you do not need to put a DOS filesystem on each floppy. You can use the disklabel and newfs commands to put a UFS filesystem on them instead, as the following sequence of commands (for a 3.5" 1.44 MB floppy) illustrates: &prompt.root; fdformat -f 1440 fd0.1440 &prompt.root; disklabel -w -r fd0.1440 floppy3 &prompt.root; newfs -t 2 -u 18 -l 1 -i 65536 /dev/fd0 Use fd0.1200 and floppy5 for 5.25" 1.2 MB disks. Then you can mount and write to them like any other filesystem. After you have formatted the floppies, you will need to copy the files to them. The distribution files are split into chunks conveniently sized so that five of them will fit on a conventional 1.44 MB floppy. Go through all your floppies, packing as many files as will fit on each one, until you have all of the distributions you want packed up in this fashion. Each distribution should go into a subdirectory on the floppy, e.g.: a:\bin\bin.aa, a:\bin\bin.ab, and so on. Once you come to the Media screen during the install process, select Floppy and you will be prompted for the rest. Installing from an &ms-dos; Partition installation from MS-DOS To prepare for an installation from an &ms-dos; partition, copy the files from the distribution into a directory called freebsd in the root directory of the partition. For example, c:\freebsd. The directory structure of the CDROM or FTP site must be partially reproduced within this directory, so we suggest using the DOS xcopy command if you are copying it from a CD. For example, to prepare for a minimal installation of FreeBSD: C:\> md c:\freebsd C:\> xcopy e:\bin c:\freebsd\bin\ /s C:\> xcopy e:\manpages c:\freebsd\manpages\ /s Assuming that C: is where you have free space and E: is where your CDROM is mounted. If you do not have a CDROM drive, you can download the distribution from ftp.FreeBSD.org. Each distribution is in its own directory; for example, the base distribution can be found in the &rel.current;/base/ directory. In the 4.X and older releases of &os; the base distribution is called bin. Adjust the sample commands and URLs above accordingly, if you are using one of these versions. For as many distributions you wish to install from an &ms-dos; partition (and you have the free space for), install each one under c:\freebsd — the BIN distribution is the only one required for a minimum installation. Creating an Installation Tape installation from QIC/SCSI Tape Installing from tape is probably the easiest method, short of an online FTP install or CDROM install. The installation program expects the files to be simply tarred onto the tape. After getting all of the distribution files you are interested in, simply tar them onto the tape: &prompt.root; cd /freebsd/distdir &prompt.root; tar cvf /dev/rwt0 dist1 ... dist2 When you perform the installation, you should make sure that you leave enough room in some temporary directory (which you will be allowed to choose) to accommodate the full contents of the tape you have created. Due to the non-random access nature of tapes, this method of installation requires quite a bit of temporary storage. When starting the installation, the tape must be in the drive before booting from the boot floppy. The installation probe may otherwise fail to find it. Before Installing over a Network installation network serial (SLIP or PPP) installation network parallel (PLIP) installation network Ethernet There are three types of network installations available. Serial port (SLIP or PPP), Parallel port (PLIP (laplink cable)), or Ethernet (a standard Ethernet controller (includes some PCMCIA)). The SLIP support is rather primitive, and limited primarily to hard-wired links, such as a serial cable running between a laptop computer and another computer. The link should be hard-wired as the SLIP installation does not currently offer a dialing capability; that facility is provided with the PPP utility, which should be used in preference to SLIP whenever possible. If you are using a modem, then PPP is almost certainly your only choice. Make sure that you have your service provider's information handy as you will need to know it fairly early in the installation process. If you use PAP or CHAP to connect your ISP (in other words, if you can connect to the ISP in &windows; without using a script), then all you will need to do is type in dial at the ppp prompt. Otherwise, you will need to know how to dial your ISP using the AT commands specific to your modem, as the PPP dialer provides only a very simple terminal emulator. Please refer to the user-ppp handbook and FAQ entries for further information. If you have problems, logging can be directed to the screen using the command set log local .... If a hard-wired connection to another FreeBSD (2.0-R or later) machine is available, you might also consider installing over a laplink parallel port cable. The data rate over the parallel port is much higher than what is typically possible over a serial line (up to 50 kbytes/sec), thus resulting in a quicker installation. Finally, for the fastest possible network installation, an Ethernet adapter is always a good choice! FreeBSD supports most common PC Ethernet cards; a table of supported cards (and their required settings) is provided in the Hardware Notes for each release of FreeBSD. If you are using one of the supported PCMCIA Ethernet cards, also be sure that it is plugged in before the laptop is powered on! FreeBSD does not, unfortunately, currently support hot insertion of PCMCIA cards during installation. You will also need to know your IP address on the network, the netmask value for your address class, and the name of your machine. If you are installing over a PPP connection and do not have a static IP, fear not, the IP address can be dynamically assigned by your ISP. Your system administrator can tell you which values to use for your particular network setup. If you will be referring to other hosts by name rather than IP address, you will also need a name server and possibly the address of a gateway (if you are using PPP, it is your provider's IP address) to use in talking to it. If you want to install by FTP via a HTTP proxy, you will also need the proxy's address. If you do not know the answers to all or most of these questions, then you should really probably talk to your system administrator or ISP before trying this type of installation. Before Installing via NFS installation network NFS The NFS installation is fairly straight-forward. Simply copy the FreeBSD distribution files you want onto an NFS server and then point the NFS media selection at it. If this server supports only privileged port (as is generally the default for Sun workstations), you will need to set the option NFS Secure in the Options menu before installation can proceed. If you have a poor quality Ethernet card which suffers from very slow transfer rates, you may also wish to toggle the NFS Slow flag. In order for NFS installation to work, the server must support subdir mounts, for example, if your FreeBSD &rel.current; distribution directory lives on: ziggy:/usr/archive/stuff/FreeBSD, then ziggy will have to allow the direct mounting of /usr/archive/stuff/FreeBSD, not just /usr or /usr/archive/stuff. In FreeBSD's /etc/exports file, this is controlled by the options. Other NFS servers may have different conventions. If you are getting permission denied messages from the server, then it is likely that you do not have this enabled properly.
diff --git a/zh_TW.Big5/books/handbook/introduction/chapter.sgml b/zh_TW.Big5/books/handbook/introduction/chapter.sgml index c408fb0685..1b3e731eac 100644 --- a/zh_TW.Big5/books/handbook/introduction/chapter.sgml +++ b/zh_TW.Big5/books/handbook/introduction/chapter.sgml @@ -1,951 +1,824 @@ Jim Mock Restructured, reorganized, and parts rewritten by ²¤¶ ·§­z «D±`·PÁ±z¹ï FreeBSD ·P¿³½ì¡I¥H¤U³¹¸`²[»\ FreeBSD - ­pµeªº¦U¤è­±¡G¤ñ¦p¥¦ªº¾ú¥v¡B¥Ø¼Ð¡B¶}µo¼Ò¦¡µ¥µ¥¡C + ­p¹ºªº¦U¤è­±¡G¤ñ¦p¥¦ªº¾ú¥v¡B¥Ø¼Ð¡B¶}µo¼Ò¦¡µ¥µ¥¡C - Ū§¹³o³¹¡A¥i¥HÁA¸Ñ¡G + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡J FreeBSD »P¨ä¥L OS ¤§¶¡ªºÃö«Y¡F - FreeBSD ­pµeªº¾ú¥v²W·½¡F + FreeBSD ­p¹ºªº¾ú¥v²W·½¡F - FreeBSD ­pµeªº¥Ø¼Ð¡F + FreeBSD ­p¹ºªº¥Ø¼Ð¡F FreeBSD open-source ¶}µo¼Ò¦¡ªº°ò¦·§©À¡F ·íµMÅo¡AÁÙ¦³ FreeBSD ³o¦W¦rªº½t¬G¡C Welcome to FreeBSD! 4.4BSD-Lite FreeBSD ¬O¤@­Ó±q 4.4BSD-Lite ­l¥Í¥X¦Ó¯à¦b¥H Intel (x86 and &itanium;), AMD64, Alpha, Sun &ultrasparc; ¬°°ò¦ªº¹q¸£¤W°õ¦æªº§@·~¨t²Î¡C¦P®É¡A²¾´Ó¨ì¨ä¥L¥­¥xªº¤u§@¤]¦b¶i¦æ¤¤¡C - ¹ï©ó¥»­p¹º¾ú¥vªº¤¶²Ð¡A½Ð¬Ý FreeBSD ªºÂ²µu¾ú¥v¡A - ¹ï©ó FreeBSD ªº³Ì·sª©¥»¤¶²Ð¡A½Ð¬Ý current release - - -is a 4.4BSD-Lite based operating system for - Intel (x86 and &itanium;), AMD64, Alpha, Sun - &ultrasparc; computers. Ports to other - architectures are also underway. - You can also - read about the history of FreeBSD, - or the current release. If you - are interested in contributing something to the Project (code, - hardware, unmarked bills), see the Contributing to FreeBSD article. + ¹ï©ó¥»­p¹º¾ú¥vªº¤¶²Ð¡A½Ð¬Ý FreeBSD ¾ú¥v²W·½¡A + ¹ï©ó FreeBSD ªº³Ì·sª©¥»¤¶²Ð¡A½Ð¬Ý current release + ¡C­Y¥´ºâ¹ï©ó FreeBSD ­p¹º¦³©Ò°^Ämªº¸Ü(¹³¬Oµ{¦¡½XµwÅé³]³Æ¡A¸êª÷)¡A + ½Ð¬Ý ¦p¦ó¹ï FreeBSD + ¦³°^Äm¡C - What Can FreeBSD Do? + FreeBSD ¯à°µ¤°»ò¡H - FreeBSD has many noteworthy features. Some of these - are: + FreeBSD ´£¨Ñµ¹§A³\¦h¥ý¶i¥\¯à¡C³o¨Ç¥\¯à¥]¬A¡G - preemptive multitasking + ¥ý¦û¦¡¦h¤u(preemptive multitasking) - Preemptive multitasking with - dynamic priority adjustment to ensure smooth and fair - sharing of the computer between applications and users, even - under the heaviest of loads. + °ÊºAÀu¥ýÅv½Õ¾ãªº¡y¥ý¦û¦¡¦h¤u¡z¯à°÷½T«O¡A§Y¨Ï¦b¨t²Î­t¾á«Ü­«ªº±¡ªp¤U¡A + µ{¦¡°õ¦æ¥­¶¶¨Ã¥BÀ³¥Îµ{¦¡»P¨Ï¥ÎªÌ¤½¥­¦a¦@¨É¸ê·½¡C - multi-user facilities + ¤ä´©¦h¤H¦@¥Î - Multi-user facilities which allow many - people to use a FreeBSD system simultaneously for a variety - of things. This means, for example, that system peripherals - such as printers and tape drives are properly shared between - all users on the system or the network and that individual - resource limits can be placed on users or groups of users, - protecting critical system resources from over-use. + ¡y¦h¤H¦@¥Î(multi-user)¡z¥NªíµÛ³\¦h¤H¥i¥H¦P®É¨Ï¥Î¤@­Ó FreeBSD ¨t²Î¨Ó³B²z¦U¦Ûªº¨Æ°È¡C + ¨t²ÎªºµwÅé©PÃä(¦p¦Lªí¾÷¤ÎºÏ±a¾÷)¤]¥i¥HÅý©Ò¦³ªº¨Ï¥ÎªÌ¾A·í¦a¤À¨É¡C + ¤]¥i¥H°w¹ï¦U§O¨Ï¥ÎªÌ©Î¤@¸s¨Ï¥ÎªÌªº¨t²Î¸ê·½¡A¤©¥H³]­­¡A + ¥H«OÅ@¨t²Î¤£­P³Q¹L«×¨Ï¥Î¡C - TCP/IP networking + TCP/IP ºô¸ô¥\¯à - Strong TCP/IP networking with - support for industry standards such as SLIP, PPP, NFS, DHCP, - and NIS. This means that your FreeBSD machine can - interoperate easily with other systems as well as act as an - enterprise server, providing vital functions such as NFS - (remote file access) and email services or putting your - organization on the Internet with WWW, FTP, routing and - firewall (security) services. + ¦n¥Îªº¡yTCP/IP ºô¸ô¥\¯à¡z¥i¤ä´©³\¦h·~¬É¼Ð·Ç¡A¤ñ¦p¡GSLIP¡BPPP¡BNFS¡BDHCP + ©M NIS ªº¤ä´©¡A¤]´N¬O»¡ FreeBSD ¥i¥H®e©ö¦a¸ò¨ä¥L§@·~¨t²Î³z¹Lºô¸ô¦@¦P¹B§@¡A + ©Î¬O·í§@¥ø·~ªº¦øªA¾¹¥Î³~¡A¨Ò¦p´£¨Ñ»·ºÝÀɮצ@¨É(NFS)¤Î¹q¤l¶l¥ó(email)µ¥ªA°È¡A + ©Î¬OÅý±zªº¥ø·~³s¤Wºô»Úºô¸ô(Internet)¨Ã´£¨Ñ WWW¡BFTP¡B¸ô¥Ñ(routing) + ¡B¤Î¨¾¤õÀð(firewall¡Bsecurity) µ¥¥²³ÆªA°È¡C - memory protection + °O¾ÐÅé«OÅ@ - Memory protection ensures that - applications (or users) cannot interfere with each other. One - application crashing will not affect others in any way. + ¡y°O¾ÐÅé«OÅ@(Memory protection)¡z¯à½T«Oµ{¦¡(©Î¬O¨Ï¥ÎªÌ)¤£·|¤¬¬Û¤zÂZ¡A + §Y¨Ï¥ô¦óµ{¦¡¦³¤£¥¿±`ªº¹B§@¡A³£¤£·|¼vÅT¨ä¥Lµ{¦¡ªº°õ¦æ¡C - FreeBSD is a 32-bit operating - system (64-bit on the Alpha, &itanium;, AMD64, and &ultrasparc;) and was - designed as such from the ground up. + FreeBSD ¬O¡y32¦ì¤¸(32-bit)¡zªº§@·~¨t²Î + (¦b Alpha¡B&itanium;¡B AMD64 ¤Î &ultrasparc; ¤W«h¬O¡y64¦ì¤¸(64-bit)¡z) + ¡X ¥´±q¤@¶}©l«K¬O³o¼Ë³]­pªº¡C X Window System XFree86 - The industry standard X Window System - (X11R6) provides a graphical user interface (GUI) for the cost - of a common VGA card and monitor and comes with full - sources. + ·~¬É¼Ð·Çªº¡yX Window ¨t²Î¡z(X11R6)¥i¥H¦b±`¨£ªº«K©y VGA Åã¥Ü¥d/¿Ã¹õ¡A + ´£¨Ñ¤F¹Ï§Î¤Æªº¨Ï¥ÎªÌ¤¶­±(GUI)¡A¨Ã¥B¥]¬A¤F§¹¾ãªº­ì©lµ{¦¡½X¡C binary compatibility Linux binary compatibility SCO binary compatibility SVR4 binary compatibility BSD/OS binary compatibility NetBSD - Binary compatibility with many - programs built for Linux, SCO, SVR4, BSDI and NetBSD. + ¯à¡yª½±µ°õ¦æ¡z³\¦h¨ä¥L§@·~¨t²Î(¤ñ¦p¡G Linux¡BSCO¡BSVR4¡BBSDI ©M NetBSD) + ªº¥i°õ¦æÀÉ¡C - Thousands of ready-to-run - applications are available from the FreeBSD - ports and packages - collection. Why search the net when you can find it all right - here? + ¼Æ¥H¸U­pªº¥ß§Y¥i¥H°õ¦æªºÀ³¥Îµ{¦¡¡A³o¨Ç³£¥i³z¹L FreeBSD + ªº¡yports¡z¤Î¡ypackages¡z³nÅéºÞ²z¾÷¨î¨Ó¨ú±o¡C + ¤£¦A»Ý­n¶O¤ß¨ìºô¸ô¤W¨ì³B·j´M©Ò»Ý­nªº³nÅé¡C - Thousands of additional and - easy-to-port applications are available - on the Internet. FreeBSD is source code compatible with most - popular commercial &unix; systems and thus most applications - require few, if any, changes to compile. + ¦¹¥~¡Aºô¸ô¤W©|¦³¥i«D±`®e©ö²¾´Óªº¼Æ¥H¸U­pÀ³¥Îµ{¦¡¡C + FreeBSD ªº­ì©lµ{¦¡½X»P³\¦h±`¨£ªº°Ó·~ª© &unix; ¨t²Î³£¬Û®e¡A + ©Ò¥H¤j³¡¤Àªºµ{¦¡³£¥u»Ý­n«Ü¤Öªº­×§ï(©Î®Ú¥»¤£¥Î­×§ï) + ¡A´N¥i¥H½sͰõ¦æ¡C virtual memory - Demand paged virtual memory and - merged VM/buffer cache design efficiently - satisfies applications with large appetites for memory while - still maintaining interactive response to other users. + »Ý­n®É¤~¸m´«(demand paged) virtual memory ¤Î + merged VM/buffer cache ªº³]­p¡A + ³oÂI¦b¨t²Î¤¤¦³¥Î¥h¤j¶q°O¾ÐÅ骺µ{¦¡°õ¦æ®É¡A¤´µM¦³¤£¿ùªº®Ä²vªí²{¡C Symmetric Multi-Processing (SMP) - SMP support for machines with - multiple CPUs. + ¤ä´© CPU ªº¹ïºÙ¦h¤u³B²z(SMP)¡G¥i¥H¤ä´©¦h CPU + ªº¹q¸£¨t²Î¡C compilers C compilers C++ compilers FORTRAN - A full complement of C, - C++, Fortran, and - Perl development tools. - Many additional languages for advanced research - and development are also available in the ports and packages - collection. + §¹¥þ¬Û®eªº C¡BC++¡B + Fortran ©M Perl ¶}µo¤u¨ã¤ÎÀô¹Ò¡C + ¥H¤Î¨ä¥L³\¦h¥i¨Ñ¶i¶¥¬ãµoªºµ{¦¡»y¨¥¤]¦¬¶°¦b ports ©M packages¡C + source code - Source code for the entire system - means you have the greatest degree of control over your - environment. Why be locked into a proprietary solution - at the mercy of your vendor when you can have a truly open - system? + ¾ã­Ó¨t²Î³£¦³¡y­ì©lµ{¦¡½X¡z¡A + ³oÅý§A¹ï§@·~Àô¹Ò¾Ö¦³³Ì§¹¥þªº´x´¤«×¡C + ¬JµM¯à¾Ö¦³§¹¥þ¶}©ñªº¨t²Î¡A¦ó­W³Q¯S©w«Ê³¬³nÅé©Ò¬ù§ô¡A¥ô¼t°ÓÂ\§G©O¡H + - Extensive online - documentation. + ¼sªx¥BÂ×´Iªº¡y½u¤W¤å¥ó¡z¡C - And many more! + ·íµMÅo¡AÁÙ¤£¤î¦p¦¹¡I - + 4.4BSD-Lite Computer Systems Research Group (CSRG) U.C. Berkeley - FreeBSD is based on the 4.4BSD-Lite release from Computer - Systems Research Group (CSRG) at the University of California at - Berkeley, and carries on the distinguished tradition of BSD - systems development. In addition to the fine work provided by - CSRG, the FreeBSD Project has put in many thousands of hours in - fine tuning the system for maximum performance and reliability in - real-life load situations. As many of the commercial giants - struggle to field PC operating systems with such features, - performance and reliability, FreeBSD can offer them - now! - - The applications to which FreeBSD can be put are truly - limited only by your own imagination. From software development - to factory automation, inventory control to azimuth correction of - remote satellite antennae; if it can be done with a commercial - &unix; product then it is more than likely that you can do it with - FreeBSD too! FreeBSD also benefits significantly from - literally thousands of high quality applications developed by - research centers and universities around the world, often - available at little to no cost. Commercial applications are also - available and appearing in greater numbers every day. - - Because the source code for FreeBSD itself is generally - available, the system can also be customized to an almost unheard - of degree for special applications or projects, and in ways not - generally possible with operating systems from most major - commercial vendors. Here is just a sampling of some of the - applications in which people are currently using FreeBSD: - + FreeBSD ¨t²Î¤D¬O°ò©ó¬ü°ê¥[¦{¤j¾Ç¬f§JµÜ¤À®Õªº¹q¸£¨t²Î¬ã¨s¸s + (Computer Systems Research Group ¤]´N¬O CSRG) ©Òµo¦æªº + 4.4BSD-Lite¡A¥H¤Î°ò©ó BSD ¨t²Î¶}µoªºÀu¨}¶Ç²Î¡C + °£¤F¥Ñ CSRG ©Ò´£¨Ñªº°ª«~½èªº¦¨ªG¡A + ¬°¤F´£¨Ñ¥i³B²z¯u¥¿¨ã­t²üªº¤u§@¡A + FreeBSD ­p¹º¤]§ë¤J¤F¼Æ¤d¤p®É¥H¤Wªº²Ó³¡½Õ¾ã¡A + ¥H¯àÀò±o³Ì¦nªº°õ¦æ®Ä²v¥H¤Î¨t²ÎªºÃ­©w«×¡C + ¥¿·í³\¦h°Ó·~¤Wªº¥¨¤H¥¿§V¤O¦a§Æ±æ¯à´£¨Ñ®Ä¯à¤Îí©w®É¡A + FreeBSD ¤w¸g¨ã³Æ³o¼Ëªº¯S½è -- ´N¬O²{¦b¡I + + + FreeBSD ªº¹B¥Î½d³òµL­­¡A¨ä¹ê§¹¥þ­­¨î¦b§Aªº·Q¹³¤O¤W¡C + ±q³nÅ骺¶}µo¨ì¤u¼t¦Û°Ê¤Æ¡A©Î¬O¤H³y½Ã¬P¤W­±ªº¤Ñ½uªº¤è¦ì¨¤«×ªº»·ºÝ±±¨î¡F + ³o¨Ç¥\¯à­Y¥i¥H¥Î°Ó¥Îªº Unix ²£«~¨Ó¹F¦¨¡A + ¨º»ò·¥¦³¥i¯à¨Ï¥Î FreeBSD ¤]¯à¿ì¨ì¡I + FreeBSD ¤]¨ü¯q©ó¨Ó¦Û©ó¥þ²y¦U¬ã¨s¤¤¤ß¤Î¤j¾Ç©Ò¶}µoªº¼Æ¤d­Ó°ª«~½èªº³nÅé + ¡A³o¨Ç³q±`¥u»Ý­nªá¶O«Ü¤Öªº¶O¥Î©Î®Ú¥»´N¬O§K¶Oªº¡C + ·íµM¤]¦³°Ó·~³nÅé¡A¦Ó¥B¥X²{ªº¼Æ¥Ø¬O»P¤é­Ñ¼W¡C + + ¥Ñ©ó¨C­Ó¤H³£¥i¥H¨ú±o FreeBSD ªº­ì©lµ{¦¡½X¡A + ³o­Ó¨t²Î¥i¥H³Q½Õ¾ã¦Ó¯à°õ¦æ¥ô¦ó­ì¥»§¹¥þµLªk·Q¹³ªº¥\¯à©Î­p¹º¡A + ¦Ó¹ï©ó±q¦U¼t°Ó¨ú±oªº§@·~¨t²Î³q±`¨S¦³¿ìªk³o¼Ë¦a³Q­×§ï¡C + ¥H¤U´£¨Ñ¤@¨Ç¤H­Ì¨Ï¥Î FreeBSD ªº¨Ò¤l¡G + - Internet Services: The robust TCP/IP - networking built into FreeBSD makes it an ideal platform for a - variety of Internet services such as: + ºô¸ôªA°È¡G FreeBSD + ¤º«Ø±j«lªººô¸ô¥\¯à¨Ï¥¦¦¨¬°ºô¸ôªA°È(¦p¤U¨Ò)ªº²z·Q¥­¥x¡G FTP servers - FTP servers + ÀɮצøªA¾¹(FTP servers) web servers - World Wide Web servers (standard or secure - [SSL]) + ¥þ²y¸ê°Tºô¦øªA¾¹(WWW servers) + (¼Ð·Çªº©Î§ó¦w¥þªº SSL ³s½u) - + firewall - NAT + IP masquerading - Firewalls and NAT (IP masquerading) - gateways + ¨¾¤õÀð¥H¤Î NAT (IP masquerading) + gateways¡C - - electronic mail - email - - - email - + electronic mail - Electronic Mail servers + ¹q¤l¶l¥ó¦øªA¾¹(Electronic Mail servers) USENET - USENET News or Bulletin Board Systems + ºô¸ô·s»D¦øªA¾¹(USENET News) + ©Î¬O¹q¤l§G§iÄæ¨t²Î(BBS) - And more... + ÁÙ¦³§ó¦h... - With FreeBSD, you can easily start out small with an - inexpensive 386 class PC and upgrade all the way up to a - quad-processor Xeon with RAID storage as your enterprise - grows. + ¦³¤F FreeBSD¡A±z¥i¥H®e©ö¦a¥ý¥Î«K©yªº 386 PC¡A + ¦A³v¨B¤É¯Å±zªº¾÷¾¹¨ì¥|­Ó CPU ªº Xeon + ¨Ã¨Ï¥ÎºÏºÐ°}¦C(RAID)¨Óº¡¨¬±z¥ø·~¹B¥Î¤Wªº»Ý¨D¡C - Education: Are you a student of - computer science or a related engineering field? There is no - better way of learning about operating systems, computer - architecture and networking than the hands on, under the hood - experience that FreeBSD can provide. A number of freely - available CAD, mathematical and graphic design packages also - make it highly useful to those whose primary interest in a - computer is to get other work - done! + ±Ð¨|¡G + ¦pªG§A¬O¸ê°T©Î¬ÛÃö¤uµ{»â°ìªº¾Ç¥Í¡A¦A¤]¨S¦³¤ñ¨Ï¥Î FreeBSD + ¯à¾Ç¨ì§ó¦h§@·~¨t²Î¡B­pºâ¾÷µ²ºc¡B¤Îºô¸ôªº¤èªk¤F¡C + ¥t¥~¦pªG§A·Q§Q¥Î¹q¸£¨Ó³B²z¤@¨Ç¨ä¥Lªº + ¤u§@¡AÁÙ¦³¤@¨Ç¦p CAD¡B + ¼Æ¾Ç¹Bºâ¥H¤Î¹Ï§Î³B²z³nÅéµ¥¥i¥H§K¶O¦a¨ú±o¨Ï¥Î¡C - Research: With source code for the - entire system available, FreeBSD is an excellent platform for - research in operating systems as well as other branches of - computer science. FreeBSD's freely available nature also makes - it possible for remote groups to collaborate on ideas or - shared development without having to worry about special - licensing agreements or limitations on what may be discussed - in open forums. + ¬ã¨s¡G¦³¤F§¹¾ãªº­ì©lµ{¦¡½X¡AFreeBSD + ¬O¬ã¨s§@·~¨t²Î¤Î¹q¸£¬ì¾Çªº·¥¨ÎÀô¹Ò¡C + ¨ã¦³§K¶O¥B¦Û¥Ñ¨ú±o¯S©Êªº FreeBSD + ¤]¨Ï±o¤@­Ó¤À¸m¨â¦aªº¦X§@­p¹º¡A¤£¥²¾á¤ßª©Åv¤Î¨t²Î¶}©ñ©Êªº°ÝÃD¡A + ¦Ó¯à¦Û¦bªº¥æ¬y¡C router DNS Server - Networking: Need a new router? A - name server (DNS)? A firewall to keep people out of your - internal network? FreeBSD can easily turn that unused 386 or - 486 PC sitting in the corner into an advanced router with - sophisticated packet-filtering capabilities. - + ºô¸ô¡G + §A¦pªG»Ý­n router¡BName Server (DNS) ©Î¦w¥þªº¨¾¤õÀð(Firewall)¡A + FreeBSD ¥i¥H»´©öªº±N§A¨S¦³¥Î¨ìªº 386 ©Î 486 PC + Åܨ­¦¨¬°µ´¨Îªº¦øªA¾¹¡A¬Æ¦Ü¨ã¦³¹LÂo«Ê¥](packet-filter) ªº¥\¯à¡C + + X Window System XFree86 X Window System Accelerated-X - X Window workstation: FreeBSD is a - fine choice for an inexpensive X terminal solution, either - using the freely available X11 server or one of the - excellent commercial servers provided by Xi Graphics. Unlike an - X terminal, FreeBSD allows many applications to be run - locally if desired, thus relieving the burden on a central - server. FreeBSD can even boot diskless, making - individual workstations even cheaper and easier to - administer. + X µøµ¡¤u§@¯¸¡G FreeBSD ¬O X + ²×ºÝ¾÷ªº¨}µ¦¡A§A¥i¥H¨Ï¥Î§K¶Oªº X11 Server ©Î¬O¥Ñ + Xi Graphics ©Ò´£¨Ñªº°Ó·~ª© X Server¡C + FreeBSD ¤£¦ý¥i¥H¥R·í»·ºÝ X µ{¦¡²×ºÝ¾÷¡A + ¤]¥i¥H°õ¦æ¥»¦aªº X µ{¦¡¦Ó´î»´¤j«¬¤u§@¯¸ªº­t²ü¡C + ¦pªG¦³¤@¥x¤¤¥¡¦øªA¾¹ªº¸Ü¡AFreeBSD ¬Æ¦Ü¥i¥H¸g¥Ñºô¸ô¶}¾÷ + (¤£»ÝµwºÐ¡A¤]´N¬Odiskless) + ¡A¦ÓÅܦ¨§ó«K©y¥B©ö©óºÞ²zªº¤u§@¯¸¡C GNU Compiler Collection - Software Development: The basic - FreeBSD system comes with a full complement of development - tools including the renowned GNU C/C++ compiler and - debugger. + ³nÅé¶}µo¡G + °ò¥»¦w¸Ëªº FreeBSD ´N¥]§t¤F§¹¾ãªºµ{¦¡¶}µo¤u¨ã¡A¦p GNU C/C++ + ½s;¹¤Î°£¿ù¾¹¡C - FreeBSD is available in both source and binary form on CDROM, - DVD, - and via anonymous FTP. Please see - for more information about obtaining FreeBSD. + §A¥i¥H¸g¥Ñ¿N¿ý CDROM¡BDVD ©Î¬O±q FTP ¯¸¤W§ì¦^ FreeBSD -- + ¥]¬A¥ß§Y¥i°õ¦æªº¨t²Î¥H¤Î¨t²Îªº§¹¾ãµ{¦¡½X¡C + ¸Ô±¡½Ð°Ñ¾\ ¨ú±o FreeBSD¡C - Who Uses FreeBSD? + ½Ö¦b¥Î FreeBSD¡H users large sites running FreeBSD - - FreeBSD is used to power some of the biggest sites on the - Internet, including: + ³\¦h Internet ¤Wªº¤j«¬ºô¯¸³£¬O¥H FreeBSD §@¬°¥¦ªº§@·~¨t²Î¡A¨Ò¦p¡G Yahoo! Yahoo! Apache Apache Blue Mountain Arts Blue Mountain Arts Pair Networks Pair Networks Sony Japan Sony Japan Netcraft Netcraft Weathernews Weathernews Supervalu Supervalu TELEHOUSE America TELEHOUSE America Sophos Anti-Virus Sophos Anti-Virus JMA Wired JMA Wired - and many more. + ¥H¤Î³\¦h¨ä¥Lªººô¯¸¡C - About the FreeBSD Project + Ãö©ó FreeBSD ­p¹º - The following section provides some background information on - the project, including a brief history, project goals, and the - development model of the project. + ±µ¤U¨ÓÁ¿ªº¬O FreeBSD ­p¹ºªº­I´º¡A¥]§t¾ú¥v²W·½ªºÂ²¤¶¡B­p¹ºªº¥Ø¼Ð¡A¥H¤Î¶}µoªº¼Ò¦¡¡C Jordan Hubbard Contributed by - A Brief History of FreeBSD + FreeBSD ¾ú¥v²W·½ªºÂ²¤¶ 386BSD Patchkit Hubbard, Jordan Williams, Nate Grimes, Rod FreeBSD Project history - The FreeBSD project had its genesis in the early part of 1993, - partially as an outgrowth of the Unofficial 386BSD - Patchkit by the patchkit's last 3 coordinators: Nate - Williams, Rod Grimes and myself. + FreeBSD ­pµeªº·Qªk¬O¦b 1993 ¦~ªì©Ò§Î¦¨ªº¡A + ¨º¬O·½¦Û©óºûÅ@¤@²Õ ¡y«D©x¤è 386BSD ªº patchkit(­×¥¿¤u¨ã)¡z­p¹ºªº¤T­Ó¨ó½ÕºûÅ@¤H + Nate Williams¡ARod Grimes ©M§Ú(Jordan Hubbard)¡C 386BSD - Our original goal was to produce an intermediate snapshot of - 386BSD in order to fix a number of problems with it that the - patchkit mechanism just was not capable of solving. Some of you - may remember the early working title for the project being - 386BSD 0.5 or 386BSD Interim in - reference to that fact. + §Ú­Ì³Ìªìªº¥Ø¼Ð¬O°µ¥X¤@¥÷ 386BSD ºî¦X­×¥¿ªº snapshot ª©¡A¥H«K­×¥¿·í®É¤@°ï + patchkit ³£¤£®e©ö¸Ñ¨Mªº°ÝÃD¡C¦³¨Ç¤H¥i¯àÁÙ°O±o¦­´Áªº­p¹º¦WºÙ¥s°µ + 386BSD 0.5 ©Î 386BSD Interim ´N¬O³o­Ó­ì¦]¡C Jolitz, Bill - 386BSD was Bill Jolitz's operating system, which had been up - to that point suffering rather severely from almost a year's worth - of neglect. As the patchkit swelled ever more uncomfortably with - each passing day, we were in unanimous agreement that something - had to be done and decided to assist Bill by providing - this interim cleanup snapshot. Those plans came to - a rude halt when Bill Jolitz suddenly decided to withdraw his - sanction from the project without any clear indication of what - would be done instead. + 386BSD ¬O Bill Jolitz ªº§@·~¨t²Î¡A¦b·í®É´N¤w¦³¬ù¤@¦~ªº¤Àµõ°Q½×¡C + ·í¸Ó­×¥¿¤u¨ã (patchkit) ¤éº¥ÃeÂø±o¥O¤H¤£µÎªA¡A§Ú­ÌµL²§Ä³¦a¦P·N­n§@¤@¨Ç¨Æ¤F¡A + ¨Ã¨M©w´£¨Ñ¤@¥÷Á{®É©Êªº ²b¤Æª©(cleanup) ¨ÓÀ°§U Bill¡C + µM¦Ó¡A¥Ñ©ó Bill Jolitz ©¿µM¨M©w¨ú®ø¨ä¹ï¸Ó­p¹ºªº»{¥i¡A¥B¨S¦³©ú½T«ü¥X¥¼¨Óªº¥´ºâ¡A + ©Ò¥H¸Ó­p¹º«K¬ðµM­±Á{Â_ª¤¦M¾÷¡C Greenman, David Walnut Creek CDROM - It did not take us long to decide that the goal remained - worthwhile, even without Bill's support, and so we adopted the - name FreeBSD, coined by David Greenman. Our initial - objectives were set after consulting with the system's current - users and, once it became clear that the project was on the road - to perhaps even becoming a reality, I contacted Walnut Creek CDROM - with an eye toward improving FreeBSD's distribution channels for - those many unfortunates without easy access to the Internet. - Walnut Creek CDROM not only supported the idea of distributing - FreeBSD on CD but also went so far as to provide the project with a - machine to work on and a fast Internet connection. Without Walnut - Creek CDROM's almost unprecedented degree of faith in what was, at - the time, a completely unknown project, it is quite unlikely that - FreeBSD would have gotten as far, as fast, as it has today. + ¤£¤[§Ú­Ì«K¨M©w¦b§Y¨Ï¨S¦³ Bill ªº¤ä«ù¤U¡AÅý¸Ó­p¹º¤´µMÄ~Äò¤U¥h¡A + ³Ì«á§Ú­Ì±Ä¥Î David Greenman ¥á»ÉªO¨M©wªº¦W¦r¡A¤]´N¬O¡yFreeBSD¡z¡C + ¦b¸ß°Ý¤F·í®Éªº¤@¨Ç¨Ï¥ÎªÌ·N¨£¤§«á¡A´N¶}©l¨M©w¤F³Ìªìªº¥Ø¼Ð¡A + ·í¸Ó­p¹º¶}©l¹ê¬I¤@¤Á´N­n¦¨¯u®É¡A¤@¤Á´NÅܱo§ó²M·¡¤F¡C + §Ú¸ò Walnut Creek CDROM °Q½×µo¦æ CDROM + ³o¼Ë¤l¤£«K¤Wºôªº¤H´N¥i¥H¥Î¤ñ¸û²³æªº¤è¦¡¨ú±o FreeBSD¡C + Walnut Creek CDROM ¤£¥uÃÙ¦¨¥H CDROM ¨Óµo¦æ FreeBSD + ªº·Qªk¡A¦P®É´£¨Ñ¤F¤@¥x¾÷¾¹¥H¤Î§Ö³tªººô»Úºô¸ôªºÀW¼e¡C + ¦pªG¤£¬O Walnut Creek CDROM ´X¥G¬OªÅ«eªº«H¥ô³o­Ó­è¶}©lÁÙ¬O§¹¥þÀqÀqµL»Dªº­p¹º¡A + ¨º»ò«Ü¥i¯à FreeBSD ¤£·|¦p¦¹§Ö³tªº¦¨ªø¨ì¤µ¤é³o¼Ëªº³W¼Ò¡C 4.3BSD-Lite Net/2 U.C. Berkeley 386BSD Free Software Foundation - The first CDROM (and general net-wide) distribution was - FreeBSD 1.0, released in December of 1993. This was based on the - 4.3BSD-Lite (Net/2) tape from U.C. Berkeley, with - many components also provided by 386BSD and the Free Software - Foundation. It was a fairly reasonable success for a first - offering, and we followed it with the highly successful FreeBSD - 1.1 release in May of 1994. + ²Ä¤@±i¥H CDROM (¤Îºô¸ô)µo¦æªº FreeBSD 1.0 ¬O¦b 1993 ¦~¤Q¤G¤ë¡C + ¸Óª©¥»¬O°ò©ó¥Ñ U.C. Berkeley ¥HºÏ±a¤è¦¡µo¦æªº + 4.3BSD-Lite (Net/2)¥H¤Î³\¦h¨Ó¦Û©ó 386BSD + ©M¦Û¥Ñ³nÅé°òª÷·|ªº³nÅé¡C¹ï©ó²Ä¤@¦¸µo¦æ¦Ó¨¥Áٺ⦨¥\¡A + §Ú­Ì¤S±µµÛ©ó 1994 ¦~ 5 ¤ëµo¦æ¤F¬Û·í¦¨¥\ªº FreeBSD 1.1¡C Novell U.C. Berkeley Net/2 AT&T - Around this time, some rather unexpected storm clouds formed - on the horizon as Novell and U.C. Berkeley settled their - long-running lawsuit over the legal status of the Berkeley Net/2 - tape. A condition of that settlement was U.C. Berkeley's - concession that large parts of Net/2 were encumbered - code and the property of Novell, who had in turn acquired it from - AT&T some time previously. What Berkeley got in return was - Novell's blessing that the 4.4BSD-Lite release, when - it was finally released, would be declared unencumbered and all - existing Net/2 users would be strongly encouraged to switch. This - included FreeBSD, and the project was given until the end of July - 1994 to stop shipping its own Net/2 based product. Under the - terms of that agreement, the project was allowed one last release - before the deadline, that release being FreeBSD 1.1.5.1. - - FreeBSD then set about the arduous task of literally - re-inventing itself from a completely new and rather incomplete - set of 4.4BSD-Lite bits. The Lite releases were - light in part because Berkeley's CSRG had removed large chunks of - code required for actually constructing a bootable running system - (due to various legal requirements) and the fact that the Intel - port of 4.4 was highly incomplete. It took the project until - November of 1994 to make this transition, at which point it - released FreeBSD 2.0 to the net and on CDROM (in late December). - Despite being still more than a little rough around the edges, - the release was a significant success and was followed by the - more robust and easier to install FreeBSD 2.0.5 release in June of - 1995. - - We released FreeBSD 2.1.5 in August of 1996, and it appeared - to be popular enough among the ISP and commercial communities that - another release along the 2.1-STABLE branch was merited. This was - FreeBSD 2.1.7.1, released in February 1997 and capping the end of - mainstream development on 2.1-STABLE. Now in maintenance mode, - only security enhancements and other critical bug fixes will be - done on this branch (RELENG_2_1_0). - - FreeBSD 2.2 was branched from the development mainline - (-CURRENT) in November 1996 as the RELENG_2_2 - branch, and the first full release (2.2.1) was released in April - 1997. Further releases along the 2.2 branch were done in the - summer and fall of '97, the last of which (2.2.8) appeared in - November 1998. The first official 3.0 release appeared in - October 1998 and spelled the beginning of the end for the 2.2 - branch. - - The tree branched again on Jan 20, 1999, leading to the - 4.0-CURRENT and 3.X-STABLE branches. From 3.X-STABLE, 3.1 was - released on February 15, 1999, 3.2 on May 15, 1999, 3.3 on - September 16, 1999, 3.4 on December 20, 1999, and 3.5 on - June 24, 2000, which was followed a few days later by a minor - point release update to 3.5.1, to incorporate some last-minute - security fixes to Kerberos. This will be the final release in the - 3.X branch. - - There was another branch on March 13, 2000, which saw the - emergence of the 4.X-STABLE branch. There have been several releases - from it so far: 4.0-RELEASE was introduced in March 2000, and - the last &rel2.current;-RELEASE came out in - &rel2.current.date;. - - The long-awaited 5.0-RELEASE was announced on January 19, - 2003. The culmination of nearly three years of work, this - release started FreeBSD on the path of advanced multiprocessor - and application thread support and introduced support for the - &ultrasparc; and ia64 platforms. This release - was followed by 5.1 in June of 2003. The last 5.X release from - -CURRENT branch was 5.2.1-RELEASE, introduced in February 2004. - - RELENG_5 branch created in August 2004, followed by 5.3-RELEASE, - that marks beginning of the 5-STABLE branch releases. The most - recent &rel.current;-RELEASE came out in &rel.current.date;. - There will be additional releases from the RELENG_5 branch. - - For now, long-term development projects continue to take place in the - 6.X-CURRENT (trunk) branch, and SNAPshot releases of 6.X on - CDROM (and, of course, on the net) are continually made available - from - the snapshot server as work progresses. + µM¦Ó¦¹«á¤£¤[¡A¥t¤@­Ó·N¥~ªº­·¼É¦b Novell ©M U.C. Berkeley Ãö©ó + Berkeley Net/2 ºÏ±a¤§ªk«ß¦a¦ìªº¶D³^½T©w¤§«á§Î¦¨¡C + U.C. Berkeley ±µ¨ü¤j³¡¥÷ªº Net/2 ªºµ{¦¡½X³£¬O¡y«I¦û¨Óªº¡z¥B¬OÄÝ©ó Novell ªº°]²£ + -- ¨Æ¹ê¤W¬O·í®É¤£¤[«e±q AT&T ¨ú±oªº¡C + Berkeley ±o¨ìªº¬O Novell ¹ï©ó 4.4BSD-Lite ªº¡y¯¬ºÖ¡z¡A³Ì«á·í 4.4BSD-Lite + ²×©óµo¦æ¤§«á¡A«K¤£¦A¬O«I¦û¦æ¬°¡C + ¦Ó©Ò¦³²{¦³ Net/2 ¨Ï¥ÎªÌ³£³Q±j¯P«ØÄ³§ó´«·sª©¥»¡A³o¥]¬A¤F FreeBSD¡C + ©ó¬O¡A§Ú­Ì³Q­n¨D©ó 1994 ¦~ 6 ¤ë©³«e°±¤î´²§G°ò©ó Net/2 + ªº²£«~¡C¦b¦¹«e´£¤§¤U¡A¥»­p¹º³Q¤¹³\¦b´Á­­¥H«e§@³Ì«á¤@¦¸µo¦æ¡A¤]´N¬O + FreeBSD 1.1.5.1¡C + + FreeBSD «K¶}©l¤F³o©{¦p¡y­«·sµo©ú½ü¤l¡zªºÁ}¹d¤u§@ -- ±q¥þ·sªº¥B¤£§¹¾ãªº + 4.4BSD-Lite ­«·s¾ã¦X¡C + ³o­Ó Lite ª©¥»¬O¤£§¹¾ãªº¡A¦]¬° + Berkeley ªº CSRG ¤w¸g§R°£¤F¤j¶q¦b«Ø¥ß¤@­Ó¥i¥H¶}¾÷°õ¦æªº¨t²Î©Ò»Ý­nªºµ{¦¡½X + (°ò©ó­Y¤zªk«ß¤Wªº­n¨D)¡A¥B¸Óª©¥»¦b Intel ¥­¥xªº²¾´Ó¬O«D±`¤£§¹¾ãªº¡C + ª½¨ì 1994 ¦~ 11 ¤ë¥»­p¹º¤~§¹¦¨¤F³o­ÓÂಾ¡A + ¦P®É¦b¸Ó¦~ 12 ¤ë©³¥H CDROM ¥H¤Îºô¸ôªº§Î¦¡µo¦æ¤F FreeBSD 2.0¡C + ÁöµM¸Ó¥÷ª©¥»¦b·í®É¦³ÂI¥^«P²ÊÁW¡A¦ý¤´¬O´I¦³·N¸qªº¦¨¥\¡C + ÀH¤§©ó 1995 ¦~ 6 ¤ë¤Sµo¦æ¤F§ó®e©ö¦w¸Ë¡A§ó¦nªº FreeBSD 2.0.5¡C + + §Ú­Ì¦b 1996 ¦~ 8 ¤ëµo¦æ¤F FreeBSD 2.1.5¡A¦b ISP ©M°Ó·~¹ÎÅ餤«D±`¬y¦æ¡C + ÀH«á¡A 2.1-STABLE ¤À¤äªº¥t¤@­Óª©¥»À³¹B¦Ó¥Í¡A¥¦´N¬O¦b 1997 ¦~ 2 ¤ëµo¦æ FreeBSD 2.1.7.1 + ¡A¦P®É¤]¬O 2.1-STABLE ¤À¤äªº³Ì«áª©¡C¤§«á¦¹¤À¤ä«K¶i¤JºûÅ@ª¬ºA¡A + ¶È¶È´£¨Ñ¦w¥þ©Êªº¥[±j©M¨ä¥LÄY­«¿ù»~­×¸ÉªººûÅ@(RELENG_2_1_0)¡C + + 1996 ¦~ 11 ¤ë FreeBSD 2.2 ±q¶}µo¥D¶b¤À¤ä (-CURRENT) + ¥X¨Ó¦¨¬° RELENG_2_2 ¤À¤ä¡C¥¦ªº²Ä¤@­Ó§¹¾ãª©(2.2.1)©ó 1997 ¦~ 4 ¤ëµo¦æ¡C + 2.2 ¤À¤äªº©µÄòª©¥»¦b 97 ¦~®L¬î¤§¶¡µo¦æªº¡A¨ä³Ì«áª©¬O¦b 1998 ¦~ 11 ¤ëµo¦æªº 2.2.8 ª©¡C + ²Ä¤@­Ó¥¿¦¡ªº 3.0 ª©¥»¦b 1998 ¦~ 10 ¤ëµo¦æ¡A¥ç§Y«Å§i 2.2 ¤À¤äªº¸¨¹õ¡C + + 1999/01/20 ¤é¦A«×¤À¤ä¡A³o²£¥Í¤F 4.0-CURRENT ¥H¤Î 3.X-STABLE ¨â­Ó¤À¤ä¡C + 3.X-STABLE ¤è­±¡A3.1 µo¦æ©ó 1999/02/15¡A3.2 µo¦æ©ó1999/05/15¡A3.3 µo¦æ©ó 1999/09/16¡A + 3.4 µo¦æ©ó 1999/12/20¡A3.5 µo¦æ©ó 2000/06/24 + ¡A±µ¤U¨Ó´X¤Ñ«áµo§G¤F¤@¨Çªº­×¸ÉÀÉ(¹ï Kerberos ¦w¥þ©Ê¤è­±ªº­×¥¿)¡A´N¤É¯Å¦Ü 3.5.1 + ¡A³o¬O 3.X ¤À¤ä³Ì«á¤@­Óµo¦æª©¥»¡C + + ¦b 2000/03/13 ¤S¦³¤F¤@­Ó·sªº¤À¤ä¡A ¤]´N¬O 4.X-STABLE + ¡C³o­Ó¤À¤ä¤§«áµo§G¤F³\¦hªºµo¦æª©¥»¡J 4.0-RELEASE ¦b 2000 ¦~ 3 ¤ëµo¦æ¡A + ¦Ó³Ì«áªº 4.11-RELEASE «h¦b 2005 ¦~ 1 ¤ëµo¦æ¡C4-STABLE ¤À¤äªº¤ä´©·|«ùÄò¨ì 2007/01/31 + ¡A¦ý¥D­nµJÂI¦b©ó¦w¥þ¤è­±ªºº|¬}¡B¯äÂΤΨä¥LÄY­«°ÝÃDªº­×¸É¡C + + ´Á«Ý¤w¤[ªº 5.0-RELEASE ¦b 2003/01/19 ¥¿¦¡µo¦æ¡C³o¬O±Nªñ¶}µo¤T¦~ªºÅq®p¤§§@¡A¦P®É + ¤]¶}©l¥[±j¦hÁûCPU(SMPng)ªº¤ä´©¡Bkernel thread(KSE) ªº¤ä´©¡BÀɮרt²Î±Ä¥Î UFS2 ¥H¤Î¤ä´© snapshot + µ¥¡A ¨Ã¤ä´© &ultrasparc; ©M + ia64 ¥­¥x¡B¤ä´©ÂŪޡB32 bit ªº PCMCIA µ¥¡C¤§«á©ó 2003 ¦~ 6 ¤ëµo¦æ¤F 5.1¡C + ¦Ó -CURRENT ³o­Óµo®i¥D¶b¤À¤äªº³Ì«á 5.X ª©¥»¬O¦b 2004 ¦~ 2 ¤ë¥¿¦¡µo¦æªº 5.2.1-RELEASE¡A¦b 5.X + ¨t¦C¶i¤J -STABLE (RELENG_5¤À¤ä)¤§«á¡A-CURRENT ´NÂಾ¬° 6.X ¨t¦C¡C + + RELENG_5 ¤À¤ä©ó 2004 ¦~ 8 ¤ë¥¿¦¡¶}¶]¡A¤§«á¬O 5.3-RELEASE + ¡A¥¦¬O 5-STABLE ¤À¤äªº²Ä¤@­Óµo¦æª©¥»¡C5-STABLE ªº³Ì·sµoªí¬O¦b &rel2.current.date; µo¦æªº &rel2.current;-RELEASE¡A·íµMÅo¡ARELENG_5 ¤À¤äÁÙ±N¦³«áÄòªºµo¦æª©¡C + + + RELENG_6 ¤À¤ä©ó 2005 ¦~ 11 ¤ë¶}¶]¡A³Ì·sªº &rel.current;-RELEASE ¬O¦b &rel.current.date; µo¦æ¡C + + ¥Ø«e¡Aªø´Áªº¶}µo­pµeÄ~Äò¦b 7.X-CURRENT (trunk) ¤À¤ä¤¤¶i¦æ¡A¦Ó 7.X ªº CDROM + (·íµM¡A¤]¥i¥H¥Îºô¸ô§ì) snapshot ª©¥»¥i¥H¦b FreeBSD snapshot server + ¨ú±o¡C Jordan Hubbard Contributed by - FreeBSD Project Goals + FreeBSD ­p¹ºªº¥Ø¼Ð FreeBSD Project goals - The goals of the FreeBSD Project are to provide software that - may be used for any purpose and without strings attached. Many of - us have a significant investment in the code (and project) and - would certainly not mind a little financial compensation now and - then, but we are definitely not prepared to insist on it. We - believe that our first and foremost mission is to - provide code to any and all comers, and for whatever purpose, so - that the code gets the widest possible use and provides the widest - possible benefit. This is, I believe, one of the most fundamental - goals of Free Software and one that we enthusiastically - support. + FreeBSD ­p¹ºªº¥Ø¼Ð¦b©ó´£¨Ñ¥i§@¥ô·N¥Î³~ªº³nÅé¦Ó¤£ªþ±a¥ô¦ó­­¨î±ø¤å¡C + §Ú­Ì¤§¤¤³\¦h¤H¹ïµ{¦¡½X (¥H¤Î­pµe¥»¨­) ³£¦³«D±`¤jªº§ë¤J¡A + ¦]¦¹¡A·íµM¤£¤¶·N°¸º¸¦³¤@¨Ç¸êª÷¤Wªº¸ÉÀv¡A¦ý§Ú­Ì¨Ã¨S¥´ºâ°í¨M¦a­n¨D±o¨ì³oÃþ¸ê§U¡C + §Ú­Ì»{¬°§Ú­Ìªº­º­n¡y¨Ï©R(mission)¡z¬O¬°¥ô¦ó¤H´£¨Ñµ{¦¡½X¡A + ¤£ºÞ¥L­Ì¥´ºâ¥Î³o¨Çµ{¦¡½X°µ¤°»ò¡A ¦]¬°³o¼Ëµ{¦¡½X±N¯à°÷³Q§ó¼sªx¦a¨Ï¥Î¡A±q¦Óµo´§¨ä»ù­È¡C + §Ú»{¬°³o¬O¦Û¥Ñ³nÅé³Ì°ò¥»ªº¡A¦P®É¤]¬O§Ú­Ì©Ò­Ò¾Éªº¤@­Ó¥Ø¼Ð¡C GNU General Public License (GPL) GNU Lesser General Public License (LGPL) BSD Copyright - That code in our source tree which falls under the GNU - General Public License (GPL) or Library General Public License - (LGPL) comes with slightly more strings attached, though at - least on the side of enforced access rather than the usual - opposite. Due to the additional complexities that can evolve - in the commercial use of GPL software we do, however, prefer - software submitted under the more relaxed BSD copyright when - it is a reasonable option to do so. + §Ú­Ìµ{¦¡½X¾ð¤¤¡A¦³­Y¤z¬O¥H GNU GPL ©ÎªÌ LGPL + µo§Gªº¨º¨Çµ{¦¡½X±a¦³¤Ö³\ªºªþ¥[­­¨î¡AÁÙ¦n¥u¬O±j¨î©Êªº­n¨D¶}©ñµ{¦¡½X¦Ó¤£¬O§Oªº¡C + ¥Ñ©ó¨Ï¥Î GPL ªº³nÅé¦b°Ó·~¥Î³~¤W·|¼W¥[­Y¤z½ÆÂø©Ê¡A¦]¦¹¡A¦pªG¥i¥H¿ï¾Üªº¸Ü¡A + §Ú­Ì·|¤ñ¸û³ßÅw¨Ï¥Î­­¨î¬Û¹ï§ó¼eÃPªº BSD ª©Åv¨Óµo§G³nÅé¡C Satoshi Asami Contributed by - The FreeBSD Development Model + FreeBSD ªº¶}µo¼Ò¦¡ FreeBSD Project development model - The development of FreeBSD is a very open and flexible - process, being literally built from the contributions - of hundreds of people around the world, as can be seen from - our list of - contributors. FreeBSD's development infrastructure allow - these hundreds of developers to collaborate over the Internet. - We are constantly on the lookout for - new developers and ideas, and those interested in becoming - more closely involved with the project need simply contact us - at the &a.hackers;. The &a.announce; is also available to - those wishing to make other FreeBSD users aware of major areas - of work. - - Useful things to know about the FreeBSD project and its - development process, whether working independently or in close - cooperation: + FreeBSD ªº¶}µo¬O¤@­Ó«D±`¶}©ñ¥B¨ã¼u©Êªº¹Lµ{¡A´N¹³±q °^ÄmªÌ¦W³æ + ©Ò¬Ý¨ìªº¡A¬O¥Ñ¥þ¥@¬É¤W¤d¤W¸Uªº°^ÄmªÌµo®i°_¨Óªº¡C + FreeBSD ªº¶}µo°ò¦¬[ºc¤¹³\¼Æ¥H¦Ê­pªº¶}µoªÌ³z¹Lºô»Úºô¸ô¨ó¦P¤u§@¡C + §Ú­Ì¤]¸g±`Ãöª`µÛ¨º¨Ç¹ï§Ú­Ìªº­pµe·P¿³½ìªº·s¶}µoªÌ©M·sªº³Ð·N¡A + ¨º¨Ç¦³¿³½ì§ó¶i¤@¨B°Ñ»P­p¹ºªº¤H¥u»Ý­n¦b &a.hackers; ³sô§Ú­Ì¡C + &a.announce; ¹ï¨º¨Ç§Æ±æ¤F¸Ñ§Ú­Ì¶i«×ªº¤H¤]¬O¬Û·í¦³¥Îªº¡C + + µL½×¬O³æ¿W¶}µoªÌ©ÎªÌ«Ê³¬¦¡ªº¹Î¶¤¦X§@¡A­Y¯à¤F¸Ñ FreeBSD ­p¹º©M¥¦ªº¶}µo¹Lµ{³£¬O¦³¥Îªº¡J The CVS repository CVS repository Concurrent Versions System CVS The central source tree for FreeBSD is maintained by CVS (Concurrent Versions System), a freely available source code control tool that comes bundled with FreeBSD. The primary CVS repository resides on a machine in Santa Clara CA, USA from where it is replicated to numerous mirror machines throughout the world. The CVS tree, which contains the -CURRENT and -STABLE trees, can all be easily replicated to your own machine as well. Please refer to the Synchronizing your source tree section for more information on doing this. The committers list committers The committers are the people who have write access to the CVS tree, and are authorized to make modifications to the FreeBSD source (the term committer comes from the &man.cvs.1; commit command, which is used to bring new changes into the CVS repository). The best way of making submissions for review by the committers list is to use the &man.send-pr.1; command. If something appears to be jammed in the system, then you may also reach them by sending mail to the &a.committers;. The FreeBSD core team core team - The FreeBSD core team - would be equivalent to the board of directors if the FreeBSD - Project were a company. The primary task of the core team - is to make sure the project, as a whole, is in good shape - and is heading in the right directions. Inviting dedicated - and responsible developers to join our group of committers - is one of the functions of the core team, as is the - recruitment of new core team members as others move on. - The current core team was elected from a pool of committer - candidates in July 2004. Elections are held every 2 years. - + FreeBSD core team + ´Nµ¥©ó¸³¨Æ·| -- ¦pªG§â FreeBSD ¬Ý¦¨¬O¤@®a¤½¥qªº¸Ü¡C + core team ªº¥D­n¾³d¦b©ó½T«O¦¹­p¹º¦³¨}¦nªº¬[ºc¡A¥H´ÂµÛ¥¿½Tªº¤è¦Vµo®i¡C + ¦¹¥~¡AÁܽмö¦å¥B­t³dªº³nÅé¶}µoªÌ¥[¤J committers ¦æ¦C¡A¥H¦b­Y¤z¦¨­ûÂ÷¥h®É±o¥H¸É¥R·s¦å¡C + ¥Ø«eªº core team ¬O¦b 2004 ¦~ 6 ¤ë committers ­Ô¿ï¤H¤¤¿ï¥X¨Óªº¡A¨C¨â¦~·|Á|¿ì¤@¦¸¿ïÁ| Some core team members also have specific areas of responsibility, meaning that they are committed to ensuring that some large portion of the system works as advertised. For a complete list of FreeBSD developers and their areas of responsibility, please see the Contributors List Most members of the core team are volunteers when it comes to FreeBSD development and do not benefit from the project financially, so commitment should also not be misconstrued as meaning guaranteed support. The board of directors analogy above is not very accurate, and it may be more suitable to say that these are the people who gave up their lives in favor of FreeBSD against their better judgment! Outside contributors contributors Last, but definitely not least, the largest group of developers are the users themselves who provide feedback and bug fixes to us on an almost constant basis. The primary way of keeping in touch with FreeBSD's more non-centralized development is to subscribe to the &a.hackers; where such things are discussed. See for more information about the various FreeBSD mailing lists. The FreeBSD Contributors List is a long and growing one, so why not join it by contributing something back to FreeBSD today? Providing code is not the only way of contributing to the project; for a more complete list of things that need doing, please refer to the FreeBSD Project web site. In summary, our development model is organized as a loose set of concentric circles. The centralized model is designed for the convenience of the users of FreeBSD, who are provided with an easy way of tracking one central code base, not to keep potential contributors out! Our desire is to present a stable operating system with a large set of coherent application programs that the users can easily install and use — this model works very well in accomplishing that. All we ask of those who would join us as FreeBSD developers is some of the same dedication its current people have to its continued success! - The Current FreeBSD Release + ³Ì·sªº FreeBSD µo¦æª©¥» NetBSD OpenBSD 386BSD Free Software Foundation U.C. Berkeley Computer Systems Research Group (CSRG) - FreeBSD is a freely available, full source 4.4BSD-Lite based - release for Intel &i386;, &i486;, &pentium;, + FreeBSD ¬O§K¶O¨Ï¥Î¥B±a¦³§¹¾ã­ì©lµ{¦¡½Xªº¥H 4.4BSD-Lite ¬°°ò¦ªº¨t²Î¡A¥i¥H¦b + Intel &i386;, &i486;, &pentium;, &pentium; Pro, &celeron;, &pentium; II, &pentium; III, - &pentium; 4 (or compatible), + &pentium; 4 (©ÎªÌ¬Û®e«¬¸¹), &xeon;, DEC Alpha - and Sun &ultrasparc; based computer - systems. It is based primarily on software from U.C. Berkeley's - CSRG group, with some enhancements from NetBSD, OpenBSD, 386BSD, and - the Free Software Foundation. + ©M Sun &ultrasparc; ¬°°ò¦ªº¹q¸£¤W°õ¦æªº§@·~¨t²Î¡C + ¥¦¥D­n¥H¥[¦{¤j¾Ç¤Úº¸§J§Q¤À®Õ ªº CSRG ¬ã¨s¤p²Õªº³nÅ鬰°ò¦¡A¨Ã¥[¤J¤F + NetBSD¡BOpenBSD¡B386BSD ¥H¤Î¦Û¥Ñ³nÅé°òª÷·|ªº¤@¨ÇªF¦è¡C - Since our release of FreeBSD 2.0 in late 94, the performance, - feature set, and stability of FreeBSD has improved dramatically. + ¦Û±q 1994 ¦~¥½¡A§Ú­Ìµo§G¤F FreeBSD 2.0 ¤§«á¡A¨t²Îªº°õ¦æ®Ä²v¡B + ¥\¯à¡Bí©w©Ê³£¦³¤F¥O¤Hª`¥Øªº´£¤É¡C - The largest change is a revamped virtual memory system with a merged - VM/file buffer cache that not only increases performance, but also - reduces FreeBSD's memory footprint, making a 5 MB configuration a - more acceptable minimum. Other enhancements include full NIS client - and server support, transaction TCP support, dial-on-demand PPP, - integrated DHCP support, an improved SCSI subsystem, ISDN support, - support for ATM, FDDI, Fast and Gigabit Ethernet (1000 Mbit) - adapters, improved support for the latest Adaptec controllers, and - many thousands of bug fixes. - - In addition to the base distributions, FreeBSD offers a - ported software collection with thousands of commonly - sought-after programs. At the time of this printing, there - were over &os.numports; ports! The list of ports ranges from - http (WWW) servers, to games, languages, editors, and almost - everything in between. The entire Ports Collection requires - approximately &ports.size; of storage, all ports being expressed as - deltas to their original sources. This makes - it much easier for us to update ports, and greatly reduces the - disk space demands made by the older 1.0 Ports Collection. To - compile a port, you simply change to the directory of the - program you wish to install, type make - install, and let the system do the rest. The full - original distribution for each port you build is retrieved - dynamically off the CDROM or a local FTP site, so you need - only enough disk space to build the ports you want. Almost - every port is also provided as a pre-compiled - package, which can be installed with a simple - command (pkg_add) by those who do not wish - to compile their own ports from source. More information on - packages and ports can be found in . - - A number of additional documents which you may find very helpful - in the process of installing and using FreeBSD may now also be found - in the /usr/share/doc directory on any recent - FreeBSD machine. You may view the locally installed - manuals with any HTML capable browser using the following - URLs: + ³Ì¤jªº§ïÅÜ´N¬O§Ú­Ì±N°O¾ÐÅé»PÀɮרt²Îªº cache ¾÷¨îµ²¦X¦b¤@°_¡C + ³o¤£¥u¨Ï±o¨t²Îªºªí²{Åܱo§ó¦n, ¨Ã¥B¨Ï±o FreeBSD + ¨t²Î³Ì¤Öªº°O¾ÐÅé»Ý¨D´î¤Ö¨ì 5 MB¡C + ¨ä¥¦ªº§ï¶i¥]¬A§¹¾ãªº NIS cilent and server ¥\¯à¤ä´©¡A + ¤ä´© transaction TCP¡BPPP ¼·±µ³s½u¡B¾ã¦Xªº DHCP ¤ä´©¡B + SCSI ¤l¨t²Îªº§ï¶i¡BISDN ªº¤ä´©¡AATM¡BFDDI ¥H¤Î¤A¤Óºô¸ô (Ethernet¡B¥]¬A + 100 Mbit ©M Gigabit) ªº¤ä´©¡A´£¤É¤F³Ì·sªº Adaptec + ±±¨î¥dÅX°Êµ{¦¡ªº§ïµ½¡A¥H¤Î¼Æ¥H¤d­pªº bug ­×¥¿¡C + + °£¤F³Ì°ò¥»ªº¨t²Î³nÅé¡AFreeBSD ÁÙ´£¨Ñ¤F¼s¨üÅwªïªº®M¥ó³nÅéºÞ²z¾÷¨î¡G Ports Collection¡C + ¨ì¥»®Ñ¥I¦L®É¡A¤w¦³¶W¹L &os.numports; ­Ó ports¡A¨ä¤¤½dÃ¥¥]¬A±q http(WWW) + ¦øªA¾¹¨ì¹CÀ¸¡Bµ{¦¡»y¨¥¡B½s¿è¾¹¥H¤Î±z¯à·Q¨ìªº´X¥G©Ò¦³ªºªF¦è¡C + §¹¾ãªº Ports Collection »Ý­n¬ù &ports.size; ªºµwºÐªÅ¶¡¡A°£¤F + port °ò¥»¬[ºcÀÉ®×¥~¡A³£¥uÀx¦s»P¸Ó port ³nÅ骺­ì©l½X¦³¡y¶·­nÅܧó¡zªº³¡¥÷¡C + ¦p¦¹¤@¨Ó¡A§Ú­Ì¥i¥H§ó®e©ö§ó·s³o¨Ç ports¡A + ¤]¤j¶qªº´î¤Ö¦pªº 1.0 ª© Ports Collection ¹ï©óµwºÐªÅ¶¡ªº»Ý¨D¡C + ­n¦w¸Ë¤@­Ó port ªº¸Ü¡A¥u»Ý­n¶i¤J¸Ó port ªº¥Ø¿ý¡A¿é¤J make install + ¡A³o¼Ë¤l¨t²Î´N·|À°§A¸Ë¦n¤F¡C±z­n½sĶªº¨C­Óµ{¦¡ªº§¹¾ã­ì©lµ{¦¡¡A + ³£¥i±q FTP ©Î CDROM ¤¤Àò±o¡A©Ò¥H±z¥u»Ý·Ç³Æ¨¬°÷ªºµwºÐªÅ¶¡¨Ó½sͧA­nªº port ³nÅé¡C + ´X¥G¨C¤@­Ó port ³£¦³¤w¨Æ¥ý½sͦnªº package¥H¤è«K¦w¸Ë¡A + ¦pªG¤£·Q±q½sĶ port ªº¤H¡A¥u­n¥Î­Ó²³æ«ü¥O(pkg_add)´N¥i¥H¦w¸Ë¡C + ¦³Ãö packages ©M ports ªº²Ó¸`¡A¥i¥H°Ñ¾\ ¡C + + FreeBSD ¥D¾÷ªº /usr/share/doc ¥Ø¿ý¤U§ä¨ì³\¦h¦³¥Îªº¤å¥ó¡A + ¨ÓÀ°§U±z¦w¸Ë¡B¨Ï¥Î FreeBSD¡C¤]¥i¥H¨Ï¥Î¤U­±ªººô§}¡A¥HÂsÄý¾¹¨Ó½¾\¥»¾÷¤W¦w¸Ëªº¤â¥U¡J - The FreeBSD Handbook + FreeBSD ¨Ï¥Î¤â¥U /usr/share/doc/handbook/index.html - The FreeBSD FAQ + FreeBSD ±`¨£°Ýµª¶° /usr/share/doc/faq/index.html - You can also view the master (and most frequently updated) - copies at . + ¦¹¥~¡A¥i¦b¤U¦Cºô§}§ä¨ì³Ì·sª© (¤]¬O§ó·s³ÌÀWÁcªºª©¥»)¡G¡C diff --git a/zh_TW.Big5/books/handbook/linuxemu/chapter.sgml b/zh_TW.Big5/books/handbook/linuxemu/chapter.sgml index a64a35ff6e..e6ef6c83fd 100644 --- a/zh_TW.Big5/books/handbook/linuxemu/chapter.sgml +++ b/zh_TW.Big5/books/handbook/linuxemu/chapter.sgml @@ -1,3348 +1,3358 @@ Jim Mock Restructured and parts updated by Brian N. Handy Originally contributed by Rich Murphey Linux Binary Compatibility Synopsis Linux binary compatibility binary compatibility Linux FreeBSD provides binary compatibility with several other &unix; like operating systems, including Linux. At this point, you may be asking yourself why exactly, does FreeBSD need to be able to run Linux binaries? The answer to that question is quite simple. Many companies and developers develop only for Linux, since it is the latest hot thing in the computing world. That leaves the rest of us FreeBSD users bugging these same companies and developers to put out native FreeBSD versions of their applications. The problem is, that most of these companies do not really realize how many people would use their product if there were FreeBSD versions too, and most continue to only develop for Linux. So what is a FreeBSD user to do? This is where the Linux binary compatibility of FreeBSD comes into play. In a nutshell, the compatibility allows FreeBSD users to run about 90% of all Linux applications without modification. This includes applications such as &staroffice;, the Linux version of &netscape;, &adobe; &acrobat;, RealPlayer, VMware, &oracle;, WordPerfect, Doom, Quake, and more. It is also reported that in some situations, Linux binaries perform better on FreeBSD than they do under Linux. There are, however, some Linux-specific operating system features that are not supported under FreeBSD. Linux binaries will not work on FreeBSD if they overly use &i386; specific calls, such as enabling virtual 8086 mode. After reading this chapter, you will know: How to enable Linux binary compatibility on your system. How to install additional Linux shared libraries. How to install Linux applications on your FreeBSD system. The implementation details of Linux compatibility in FreeBSD. Before reading this chapter, you should: Know how to install additional third-party software (). Installation KLD (kernel loadable object) Linux binary compatibility is not turned on by default. The easiest way to enable this functionality is to load the linux KLD object (Kernel LoaDable object). You can load this module by typing the following as root: &prompt.root; kldload linux If you would like Linux compatibility to always be enabled, then you should add the following line to /etc/rc.conf: linux_enable="YES" The &man.kldstat.8; command can be used to verify that the KLD is loaded: &prompt.user; kldstat Id Refs Address Size Name 1 2 0xc0100000 16bdb8 kernel 7 1 0xc24db000 d000 linux.ko kernel options LINUX If for some reason you do not want to or cannot load the KLD, then you may statically link Linux binary compatibility into the kernel by adding options COMPAT_LINUX to your kernel configuration file. Then install your new kernel as described in . Installing Linux Runtime Libraries Linux installing Linux libraries This can be done one of two ways, either by using the linux_base port, or by installing them manually. Installing Using the linux_base Port Ports Collection This is by far the easiest method to use when installing the runtime libraries. It is just like installing any other port from the Ports Collection. Simply do the following: &prompt.root; cd /usr/ports/emulators/linux_base &prompt.root; make install distclean You should now have working Linux binary compatibility. Some programs may complain about incorrect minor versions of the system libraries. In general, however, this does not seem to be a problem. There may be multiple versions of the emulators/linux_base port available, corresponding to different versions of various Linux distributions. You should install the port most closely resembling the requirements of the Linux applications you would like to install. Installing Libraries Manually If you do not have the ports collection installed, you can install the libraries by hand instead. You will need the Linux shared libraries that the program depends on and the runtime linker. Also, you will need to create a shadow root directory, /compat/linux, for Linux libraries on your FreeBSD system. Any shared libraries opened by Linux programs run under FreeBSD will look in this tree first. So, if a Linux program loads, for example, /lib/libc.so, FreeBSD will first try to open /compat/linux/lib/libc.so, and if that does not exist, it will then try /lib/libc.so. Shared libraries should be installed in the shadow tree /compat/linux/lib rather than the paths that the Linux ld.so reports. Generally, you will need to look for the shared libraries that Linux binaries depend on only the first few times that you install a Linux program on your FreeBSD system. After a while, you will have a sufficient set of Linux shared libraries on your system to be able to run newly imported Linux binaries without any extra work. How to Install Additional Shared Libraries shared libraries What if you install the linux_base port and your application still complains about missing shared libraries? How do you know which shared libraries Linux binaries need, and where to get them? Basically, there are 2 possibilities (when following these instructions you will need to be root on your FreeBSD system). If you have access to a Linux system, see what shared libraries the application needs, and copy them to your FreeBSD system. Look at the following example: Let us assume you used FTP to get the Linux binary of Doom, and put it on a Linux system you have access to. You then can check which shared libraries it needs by running ldd linuxdoom, like so: &prompt.user; ldd linuxdoom libXt.so.3 (DLL Jump 3.1) => /usr/X11/lib/libXt.so.3.1.0 libX11.so.3 (DLL Jump 3.1) => /usr/X11/lib/libX11.so.3.1.0 libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29 symbolic links You would need to get all the files from the last column, and put them under /compat/linux, with the names in the first column as symbolic links pointing to them. This means you eventually have these files on your FreeBSD system: /compat/linux/usr/X11/lib/libXt.so.3.1.0 /compat/linux/usr/X11/lib/libXt.so.3 -> libXt.so.3.1.0 /compat/linux/usr/X11/lib/libX11.so.3.1.0 /compat/linux/usr/X11/lib/libX11.so.3 -> libX11.so.3.1.0 /compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29
Note that if you already have a Linux shared library with a matching major revision number to the first column of the ldd output, you will not need to copy the file named in the last column to your system, the one you already have should work. It is advisable to copy the shared library anyway if it is a newer version, though. You can remove the old one, as long as you make the symbolic link point to the new one. So, if you have these libraries on your system: /compat/linux/lib/libc.so.4.6.27 /compat/linux/lib/libc.so.4 -> libc.so.4.6.27 and you find a new binary that claims to require a later version according to the output of ldd: libc.so.4 (DLL Jump 4.5pl26) -> libc.so.4.6.29 If it is only one or two versions out of date in the in the trailing digit then do not worry about copying /lib/libc.so.4.6.29 too, because the program should work fine with the slightly older version. However, if you like, you can decide to replace the libc.so anyway, and that should leave you with: /compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29
The symbolic link mechanism is only needed for Linux binaries. The FreeBSD runtime linker takes care of looking for matching major revision numbers itself and you do not need to worry about it.
Installing Linux ELF Binaries Linux ELF binaries ELF binaries sometimes require an extra step of branding. If you attempt to run an unbranded ELF binary, you will get an error message like the following: &prompt.user; ./my-linux-elf-binary ELF binary type not known Abort To help the FreeBSD kernel distinguish between a FreeBSD ELF binary from a Linux binary, use the &man.brandelf.1; utility. &prompt.user; brandelf -t Linux my-linux-elf-binary GNU toolchain The GNU toolchain now places the appropriate branding information into ELF binaries automatically, so this step should become increasingly unnecessary in the future. Configuring the Hostname Resolver If DNS does not work or you get this message: resolv+: "bind" is an invalid keyword resolv+: "hosts" is an invalid keyword You will need to configure a /compat/linux/etc/host.conf file containing: order hosts, bind multi on The order here specifies that /etc/hosts is searched first and DNS is searched second. When /compat/linux/etc/host.conf is not installed, Linux applications find FreeBSD's /etc/host.conf and complain about the incompatible FreeBSD syntax. You should remove bind if you have not configured a name server using the /etc/resolv.conf file.
- Murray - Stokely - Updated for Mathematica 4.X by - - - - - Bojan - Bistrovic - Merged with work by + Boris + Hollas + Updated for Mathematica 5.X by Installing &mathematica; applications Mathematica This document describes the process of installing the Linux - version of &mathematica; 4.X onto + version of &mathematica; 5.X onto a FreeBSD system. - The Linux version of &mathematica; - runs perfectly under FreeBSD - however the binaries shipped by Wolfram need to be branded so that - FreeBSD knows to use the Linux ABI to execute them. - The Linux version of &mathematica; or &mathematica; for Students can be ordered directly from Wolfram at . - Branding the Linux Binaries - - The Linux binaries are located in the Unix - directory of the &mathematica; CDROM - distributed by Wolfram. You - need to copy this directory tree to your local hard drive so that - you can brand the Linux binaries with &man.brandelf.1; before - running the installer: + Running the &mathematica; Installer - &prompt.root; mount /cdrom -&prompt.root; cp -rp /cdrom/Unix/ /localdir/ -&prompt.root; brandelf -t Linux /localdir/Files/SystemFiles/Kernel/Binaries/Linux/* -&prompt.root; brandelf -t Linux /localdir/Files/SystemFiles/FrontEnd/Binaries/Linux/* -&prompt.root; brandelf -t Linux /localdir/Files/SystemFiles/Installation/Binaries/Linux/* -&prompt.root; brandelf -t Linux /localdir/Files/SystemFiles/Graphics/Binaries/Linux/* -&prompt.root; brandelf -t Linux /localdir/Files/SystemFiles/Converters/Binaries/Linux/* -&prompt.root; brandelf -t Linux /localdir/Files/SystemFiles/LicenseManager/Binaries/Linux/mathlm -&prompt.root; cd /localdir/Installers/Linux/ -&prompt.root; ./MathInstaller - - Alternatively, you can simply set the default ELF brand + First, you have to tell &os; that + &mathematica;'s Linux + binaries use the Linux ABI. The easiest way to do so is to + set the default ELF brand to Linux for all unbranded binaries with the command: + &prompt.root; sysctl kern.fallback_elf_brand=3 - This will make FreeBSD assume that unbranded ELF binaries + + This will make &os; assume that unbranded ELF binaries use the Linux ABI and so you should be able to run the installer straight from the CDROM. + + Now, copy the file MathInstaller to + your hard drive: + + &prompt.root; mount /cdrom +&prompt.root; cp /cdrom/Unix/Installers/Linux/MathInstaller /localdir/ + + and in this file, replace /bin/sh in + the first line by /compat/linux/bin/sh. + This makes sure that the installer is executed by the Linux + version of &man.sh.1;. Next, replace all occurrences of + Linux) by FreeBSD) with + a text editor or the script below in the next section. This + tells the &mathematica; installer, + who calls uname -s to determine the + operating system, to treat &os; as a Linux-like operating + system. Invoking MathInstaller will now + install &mathematica;. + + + + Modifying the &mathematica; Executables + + The shell scripts that + &mathematica; created during + installation have to be modified before you can use them. If + you chose /usr/local/bin + as the directory to place the + &mathematica; executables in, you + will find symlinks in this directory to files called + math, mathematica, + Mathematica, and + MathKernel. In each of these, replace + Linux) by FreeBSD) with + a text editor or the following shell script: + + #!/bin/sh +cd /usr/local/bin +for i in math mathematica Mathematica MathKernel + do sed 's/Linux)/FreeBSD)/g' $i > $i.tmp + sed 's/\/bin\/sh/\/compat\/linux\/bin\/sh/g' $i.tmp > $i + rm $i.tmp + chmod a+x $i +done Obtaining Your &mathematica; Password - Before you can run &mathematica; - you will have to obtain a - password from Wolfram that corresponds to your machine - ID. Ethernet MAC address - Once you have installed the Linux compatibility runtime - libraries and unpacked &mathematica; - you can obtain the - machine ID by running the program - mathinfo in the installation directory. This - machine ID is based solely on the MAC address of your first - Ethernet card. - - &prompt.root; cd /localdir/Files/SystemFiles/Installation/Binaries/Linux -&prompt.root; mathinfo -disco.example.com 7115-70839-20412 + When you start &mathematica; + for the first time, you will be asked for a password. If you + have not yet obtained a password from Wolfram, run the program + mathinfo in the installation directory to + obtain your machine ID. This machine ID is + based solely on the MAC address of your first Ethernet card, + so you cannot run your copy of + &mathematica; on different + machines. When you register with Wolfram, either by email, phone or fax, you will give them the machine ID and they will respond with a corresponding password consisting of groups of - numbers. You can then enter this information when you attempt to - run &mathematica; for the first time - exactly as you would for any other - &mathematica; platform. + numbers. Running the &mathematica; Frontend over a Network &mathematica; uses some special fonts to display characters not present in any of the standard font sets (integrals, sums, Greek letters, etc.). The X protocol requires these fonts to be install locally. This means you will have to copy these fonts from the CDROM or from a host with &mathematica; installed to your local machine. These fonts are normally stored in /cdrom/Unix/Files/SystemFiles/Fonts on the CDROM, or /usr/local/mathematica/SystemFiles/Fonts on your hard drive. The actual fonts are in the subdirectories Type1 and X. There are several ways to use them, as described below. The first way is to copy them into one of the existing font directories in /usr/X11R6/lib/X11/fonts. This will require editing the fonts.dir file, adding the font names to it, and changing the number of fonts on the first line. Alternatively, you should also just be able to run &man.mkfontdir.1; in the directory you have copied them to. The second way to do this is to copy the directories to /usr/X11R6/lib/X11/fonts: &prompt.root; cd /usr/X11R6/lib/X11/fonts &prompt.root; mkdir X &prompt.root; mkdir MathType1 &prompt.root; cd /cdrom/Unix/Files/SystemFiles/Fonts &prompt.root; cp X/* /usr/X11R6/lib/X11/fonts/X &prompt.root; cp Type1/* /usr/X11R6/lib/X11/fonts/MathType1 &prompt.root; cd /usr/X11R6/lib/X11/fonts/X &prompt.root; mkfontdir &prompt.root; cd ../MathType1 &prompt.root; mkfontdir Now add the new font directories to your font path: &prompt.root; xset fp+ /usr/X11R6/lib/X11/fonts/X &prompt.root; xset fp+ /usr/X11R6/lib/X11/fonts/MathType1 &prompt.root; xset fp rehash If you are using the &xorg; server, you can have these font directories loaded automatically by adding them to your xorg.conf file. For &xfree86; servers, the configuration file is XF86Config. fonts If you do not already have a directory called /usr/X11R6/lib/X11/fonts/Type1, you can change the name of the MathType1 directory in the example above to Type1. Aaron Kaplan Contributed by Robert Getschmann Thanks to Installing &maple; applications Maple &maple; is a commercial mathematics program similar to &mathematica;. You must purchase this software from and then register there for a license file. To install this software on FreeBSD, please follow these simple steps. Execute the INSTALL shell script from the product distribution. Choose the RedHat option when prompted by the installation program. A typical installation directory might be /usr/local/maple. If you have not done so, order a license for &maple; from Maple Waterloo Software () and copy it to /usr/local/maple/license/license.dat. Install the FLEXlm license manager by running the INSTALL_LIC install shell script that comes with &maple;. Specify the primary hostname for your machine for the license server. Patch the /usr/local/maple/bin/maple.system.type file with the following: ----- snip ------------------ *** maple.system.type.orig Sun Jul 8 16:35:33 2001 --- maple.system.type Sun Jul 8 16:35:51 2001 *************** *** 72,77 **** --- 72,78 ---- # the IBM RS/6000 AIX case MAPLE_BIN="bin.IBM_RISC_UNIX" ;; + "FreeBSD"|\ "Linux") # the Linux/x86 case # We have two Linux implementations, one for Red Hat and ----- snip end of patch ----- Please note that after the "FreeBSD"|\ no other whitespace should be present. This patch instructs &maple; to recognize FreeBSD as a type of Linux system. The bin/maple shell script calls the bin/maple.system.type shell script which in turn calls uname -a to find out the operating system name. Depending on the OS name it will find out which binaries to use. Start the license server. The following script, installed as /usr/local/etc/rc.d/lmgrd.sh is a convenient way to start up lmgrd: ----- snip ------------ #! /bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin PATH=${PATH}:/usr/local/maple/bin:/usr/local/maple/FLEXlm/UNIX/LINUX export PATH LICENSE_FILE=/usr/local/maple/license/license.dat LOG=/var/log/lmgrd.log case "$1" in start) - lmgrd -c ${LICENSE_FILE} 2>> ${LOG} 1>&2 + lmgrd -c ${LICENSE_FILE} 2>> ${LOG} 1>&2 echo -n " lmgrd" ;; stop) - lmgrd -c ${LICENSE_FILE} -x lmdown 2>> ${LOG} 1>&2 + lmgrd -c ${LICENSE_FILE} -x lmdown 2>> ${LOG} 1>&2 ;; *) - echo "Usage: `basename $0` {start|stop}" 1>&2 + echo "Usage: `basename $0` {start|stop}" 1>&2 exit 64 ;; esac exit 0 ----- snip ------------ Test-start &maple;: &prompt.user; cd /usr/local/maple/bin &prompt.user; ./xmaple You should be up and running. Make sure to write Maplesoft to let them know you would like a native FreeBSD version! Common Pitfalls The FLEXlm license manager can be a difficult tool to work with. Additional documentation on the subject can be found at . lmgrd is known to be very picky about the license file and to core dump if there are any problems. A correct license file should look like this: # ======================================================= # License File for UNIX Installations ("Pointer File") # ======================================================= SERVER chillig ANY #USE_SERVER VENDOR maplelmg FEATURE Maple maplelmg 2000.0831 permanent 1 XXXXXXXXXXXX \ PLATFORMS=i86_r ISSUER="Waterloo Maple Inc." \ ISSUED=11-may-2000 NOTICE=" Technische Universitat Wien" \ SN=XXXXXXXXX Serial number and key 'X''ed out. chillig is a hostname. Editing the license file works as long as you do not touch the FEATURE line (which is protected by the license key). Dan Pelleg Contributed by Installing &matlab; applications MATLAB This document describes the process of installing the Linux version of &matlab; version 6.5 onto a &os; system. It works quite well, with the exception of the &java.virtual.machine; (see ). The Linux version of &matlab; can be ordered directly from The MathWorks at . Make sure you also get the license file or instructions how to create it. While you are there, let them know you would like a native &os; version of their software. Installing &matlab; To install &matlab;, do the following: Insert the installation CD and mount it. Become root, as recommended by the installation script. To start the installation script type: &prompt.root; /compat/linux/bin/sh /cdrom/install The installer is graphical. If you get errors about not being able to open a display, type setenv HOME ~USER, where USER is the user you did a &man.su.1; as. When asked for the &matlab; root directory, type: /compat/linux/usr/local/matlab. For easier typing on the rest of the installation process, type this at your shell prompt: set MATLAB=/compat/linux/usr/local/matlab Edit the license file as instructed when obtaining the &matlab; license. You can prepare this file in advance using your favorite editor, and copy it to $MATLAB/license.dat before the installer asks you to edit it. Complete the installation process. At this point your &matlab; installation is complete. The following steps apply glue to connect it to your &os; system. License Manager Startup Create symlinks for the license manager scripts: &prompt.root; ln -s $MATLAB/etc/lmboot /usr/local/etc/lmboot_TMW &prompt.root; ln -s $MATLAB/etc/lmdown /usr/local/etc/lmdown_TMW Create a startup file at /usr/local/etc/rc.d/flexlm.sh. The example below is a modified version of the distributed $MATLAB/etc/rc.lm.glnx86. The changes are file locations, and startup of the license manager under Linux emulation. #!/bin/sh case "$1" in start) if [ -f /usr/local/etc/lmboot_TMW ]; then /compat/linux/bin/sh /usr/local/etc/lmboot_TMW -u username && echo 'MATLAB_lmgrd' fi ;; stop) if [ -f /usr/local/etc/lmdown_TMW ]; then /compat/linux/bin/sh /usr/local/etc/lmdown_TMW > /dev/null 2>&1 fi ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac exit 0 The file must be made executable: &prompt.root; chmod +x /usr/local/etc/rc.d/flexlm.sh You must also replace username above with the name of a valid user on your system (and not root). Start the license manager with the command: &prompt.root; /usr/local/etc/rc.d/flexlm.sh start Linking the &java; Runtime Environment Change the &java; Runtime Environment (JRE) link to one working under &os;: &prompt.root; cd $MATLAB/sys/java/jre/glnx86/ &prompt.root; unlink jre; ln -s ./jre1.1.8 ./jre Creating a &matlab; Startup Script Place the following startup script in /usr/local/bin/matlab: #!/bin/sh /compat/linux/bin/sh /compat/linux/usr/local/matlab/bin/matlab "$@" Then type the command chmod +x /usr/local/bin/matlab. Depending on your version of emulators/linux_base, you may run into errors when running this script. To avoid that, edit the file /compat/linux/usr/local/matlab/bin/matlab, and change the line that says: if [ `expr "$lscmd" : '.*->.*'` -ne 0 ]; then (in version 13.0.1 it is on line 410) to this line: if test -L $newbase; then Creating a &matlab; Shutdown Script The following is needed to solve a problem with &matlab; not exiting correctly. Create a file $MATLAB/toolbox/local/finish.m, and in it put the single line: ! $MATLAB/bin/finish.sh The $MATLAB is literal. In the same directory, you will find the files finishsav.m and finishdlg.m, which let you save your workspace before quitting. If you use either of them, insert the line above immediately after the save command. Create a file $MATLAB/bin/finish.sh, which will contain the following: #!/usr/compat/linux/bin/sh (sleep 5; killall -1 matlab_helper) & exit 0 Make the file executable: &prompt.root; chmod +x $MATLAB/bin/finish.sh Using &matlab; At this point you are ready to type matlab and start using it. Marcel Moolenaar Contributed by Installing &oracle; applications Oracle Preface This document describes the process of installing &oracle; 8.0.5 and &oracle; 8.0.5.1 Enterprise Edition for Linux onto a FreeBSD machine. Installing the Linux Environment Make sure you have both emulators/linux_base and devel/linux_devtools from the Ports Collection installed. If you run into difficulties with these ports, you may have to use the packages or older versions available in the Ports Collection. If you want to run the intelligent agent, you will also need to install the Red Hat Tcl package: tcl-8.0.3-20.i386.rpm. The general command for installing packages with the official RPM port (archivers/rpm) is: &prompt.root; rpm -i --ignoreos --root /compat/linux --dbpath /var/lib/rpm package Installation of the package should not generate any errors. Creating the &oracle; Environment Before you can install &oracle;, you need to set up a proper environment. This document only describes what to do specially to run &oracle; for Linux on FreeBSD, not what has been described in the &oracle; installation guide. Kernel Tuning kernel tuning As described in the &oracle; installation guide, you need to set the maximum size of shared memory. Do not use SHMMAX under FreeBSD. SHMMAX is merely calculated out of SHMMAXPGS and PGSIZE. Therefore define SHMMAXPGS. All other options can be used as described in the guide. For example: options SHMMAXPGS=10000 options SHMMNI=100 options SHMSEG=10 options SEMMNS=200 options SEMMNI=70 options SEMMSL=61 Set these options to suit your intended use of &oracle;. Also, make sure you have the following options in your kernel configuration file: options SYSVSHM #SysV shared memory options SYSVSEM #SysV semaphores options SYSVMSG #SysV interprocess communication &oracle; Account Create an oracle account just as you would create any other account. The oracle account is special only that you need to give it a Linux shell. Add /compat/linux/bin/bash to /etc/shells and set the shell for the oracle account to /compat/linux/bin/bash. Environment Besides the normal &oracle; variables, such as ORACLE_HOME and ORACLE_SID you must set the following environment variables: Variable Value LD_LIBRARY_PATH $ORACLE_HOME/lib CLASSPATH $ORACLE_HOME/jdbc/lib/classes111.zip PATH /compat/linux/bin /compat/linux/sbin /compat/linux/usr/bin /compat/linux/usr/sbin /bin /sbin /usr/bin /usr/sbin /usr/local/bin $ORACLE_HOME/bin It is advised to set all the environment variables in .profile. A complete example is: ORACLE_BASE=/oracle; export ORACLE_BASE ORACLE_HOME=/oracle; export ORACLE_HOME LD_LIBRARY_PATH=$ORACLE_HOME/lib export LD_LIBRARY_PATH ORACLE_SID=ORCL; export ORACLE_SID ORACLE_TERM=386x; export ORACLE_TERM CLASSPATH=$ORACLE_HOME/jdbc/lib/classes111.zip export CLASSPATH PATH=/compat/linux/bin:/compat/linux/sbin:/compat/linux/usr/bin PATH=$PATH:/compat/linux/usr/sbin:/bin:/sbin:/usr/bin:/usr/sbin PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin export PATH Installing &oracle; Due to a slight inconsistency in the Linux emulator, you need to create a directory named .oracle in /var/tmp before you start the installer. Let it be owned by the oracle user. You should be able to install &oracle; without any problems. If you have problems, check your &oracle; distribution and/or configuration first! After you have installed &oracle;, apply the patches described in the next two subsections. A frequent problem is that the TCP protocol adapter is not installed right. As a consequence, you cannot start any TCP listeners. The following actions help solve this problem: &prompt.root; cd $ORACLE_HOME/network/lib &prompt.root; make -f ins_network.mk ntcontab.o &prompt.root; cd $ORACLE_HOME/lib &prompt.root; ar r libnetwork.a ntcontab.o &prompt.root; cd $ORACLE_HOME/network/lib &prompt.root; make -f ins_network.mk install Do not forget to run root.sh again! Patching root.sh When installing &oracle;, some actions, which need to be performed as root, are recorded in a shell script called root.sh. This script is written in the orainst directory. Apply the following patch to root.sh, to have it use to proper location of chown or alternatively run the script under a Linux native shell. *** orainst/root.sh.orig Tue Oct 6 21:57:33 1998 --- orainst/root.sh Mon Dec 28 15:58:53 1998 *************** *** 31,37 **** # This is the default value for CHOWN # It will redefined later in this script for those ports # which have it conditionally defined in ss_install.h ! CHOWN=/bin/chown # # Define variables to be used in this script --- 31,37 ---- # This is the default value for CHOWN # It will redefined later in this script for those ports # which have it conditionally defined in ss_install.h ! CHOWN=/usr/sbin/chown # # Define variables to be used in this script When you do not install &oracle; from CD, you can patch the source for root.sh. It is called rthd.sh and is located in the orainst directory in the source tree. Patching genclntsh The script genclntsh is used to create a single shared client library. It is used when building the demos. Apply the following patch to comment out the definition of PATH: *** bin/genclntsh.orig Wed Sep 30 07:37:19 1998 --- bin/genclntsh Tue Dec 22 15:36:49 1998 *************** *** 32,38 **** # # Explicit path to ensure that we're using the correct commands #PATH=/usr/bin:/usr/ccs/bin export PATH ! PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin export PATH # # each product MUST provide a $PRODUCT/admin/shrept.lst --- 32,38 ---- # # Explicit path to ensure that we're using the correct commands #PATH=/usr/bin:/usr/ccs/bin export PATH ! #PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin export PATH # # each product MUST provide a $PRODUCT/admin/shrept.lst Running &oracle; When you have followed the instructions, you should be able to run &oracle; as if it was run on Linux itself. Holger Kipp Contributed by Valentino Vaschetto Original version converted to SGML by Installing &sap.r3; applications SAP R/3 Installations of &sap; Systems using FreeBSD will not be supported by the &sap; support team — they only offer support for certified platforms. Preface This document describes a possible way of installing a &sap.r3; System with &oracle; Database for Linux onto a FreeBSD machine, including the installation of FreeBSD and &oracle;. Two different configurations will be described: &sap.r3; 4.6B (IDES) with &oracle; 8.0.5 on FreeBSD 4.3-STABLE &sap.r3; 4.6C with &oracle; 8.1.7 on FreeBSD 4.5-STABLE Even though this document tries to describe all important steps in a greater detail, it is not intended as a replacement for the &oracle; and &sap.r3; installation guides. Please see the documentation that comes with the &sap.r3; Linux edition for &sap; and &oracle; specific questions, as well as resources from &oracle; and &sap; OSS. Software The following CD-ROMs have been used for &sap; installations: &sap.r3; 4.6B, &oracle; 8.0.5 Name Number Description KERNEL 51009113 SAP Kernel Oracle / Installation / AIX, Linux, Solaris RDBMS 51007558 Oracle / RDBMS 8.0.5.X / Linux EXPORT1 51010208 IDES / DB-Export / Disc 1 of 6 EXPORT2 51010209 IDES / DB-Export / Disc 2 of 6 EXPORT3 51010210 IDES / DB-Export / Disc 3 of 6 EXPORT4 51010211 IDES / DB-Export / Disc 4 of 6 EXPORT5 51010212 IDES / DB-Export / Disc 5 of 6 EXPORT6 51010213 IDES / DB-Export / Disc 6 of 6 Additionally, we used the &oracle; 8 Server (Pre-production version 8.0.5 for Linux, Kernel Version 2.0.33) CD which is not really necessary, and FreeBSD 4.3-STABLE (it was only a few days past 4.3 RELEASE). &sap.r3; 4.6C SR2, &oracle; 8.1.7 Name Number Description KERNEL 51014004 SAP Kernel Oracle / SAP Kernel Version 4.6D / DEC, Linux RDBMS 51012930 Oracle 8.1.7/ RDBMS / Linux EXPORT1 51013953 Release 4.6C SR2 / Export / Disc 1 of 4 EXPORT1 51013953 Release 4.6C SR2 / Export / Disc 2 of 4 EXPORT1 51013953 Release 4.6C SR2 / Export / Disc 3 of 4 EXPORT1 51013953 Release 4.6C SR2 / Export / Disc 4 of 4 LANG1 51013954 Release 4.6C SR2 / Language / DE, EN, FR / Disc 1 of 3 Depending on the languages you would like to install, additional language CDs might be necessary. Here we are just using DE and EN, so the first language CD is the only one needed. As a little note, the numbers for all four EXPORT CDs are identical. All three language CDs also have the same number (this is different from the 4.6B IDES release CD numbering). At the time of writing this installation is running on FreeBSD 4.5-STABLE (20.03.2002). &sap; Notes The following notes should be read before installing &sap.r3; and proved to be useful during installation: &sap.r3; 4.6B, &oracle; 8.0.5 Number Title 0171356 SAP Software on Linux: Essential Comments 0201147 INST: 4.6C R/3 Inst. on UNIX - Oracle 0373203 Update / Migration Oracle 8.0.5 --> 8.0.6/8.1.6 LINUX 0072984 Release of Digital UNIX 4.0B for Oracle 0130581 R3SETUP step DIPGNTAB terminates 0144978 Your system has not been installed correctly 0162266 Questions and tips for R3SETUP on Windows NT / W2K &sap.r3; 4.6C, &oracle; 8.1.7 Number Title 0015023 Initializing table TCPDB (RSXP0004) (EBCDIC) 0045619 R/3 with several languages or typefaces 0171356 SAP Software on Linux: Essential Comments 0195603 RedHat 6.1 Enterprise version: Known problems 0212876 The new archiving tool SAPCAR 0300900 Linux: Released DELL Hardware 0377187 RedHat 6.2: important remarks 0387074 INST: R/3 4.6C SR2 Installation on UNIX 0387077 INST: R/3 4.6C SR2 Inst. on UNIX - Oracle 0387078 SAP Software on UNIX: OS Dependencies 4.6C SR2 Hardware Requirements The following equipment is sufficient for the installation of a &sap.r3; System. For production use, a more exact sizing is of course needed: Component 4.6B 4.6C Processor 2 x 800MHz &pentium; III 2 x 800MHz &pentium; III Memory 1GB ECC 2GB ECC Hard Disk Space 50-60GB (IDES) 50-60GB (IDES) For use in production, &xeon; Processors with large cache, high-speed disk access (SCSI, RAID hardware controller), USV and ECC-RAM is recommended. The large amount of hard disk space is due to the preconfigured IDES System, which creates 27 GB of database files during installation. This space is also sufficient for initial production systems and application data. &sap.r3; 4.6B, &oracle; 8.0.5 The following off-the-shelf hardware was used: a dual processor board with 2 800 MHz &pentium; III processors, &adaptec; 29160 Ultra160 SCSI adapter (for accessing a 40/80 GB DLT tape drive and CDROM), &mylex; &acceleraid; (2 channels, firmware 6.00-1-00 with 32 MB RAM). To the &mylex; RAID controller are attached two 17 GB hard disks (mirrored) and four 36 GB hard disks (RAID level 5). &sap.r3; 4.6C, &oracle; 8.1.7 For this installation a &dell; &poweredge; 2500 was used: a dual processor board with two 1000 MHz &pentium; III processors (256 kB Cache), 2 GB PC133 ECC SDRAM, PERC/3 DC PCI RAID Controller with 128 MB, and an EIDE DVD-ROM drive. To the RAID controller are attached two 18 GB hard disks (mirrored) and four 36 GB hard disks (RAID level 5). Installation of FreeBSD First you have to install FreeBSD. There are several ways to do this (FreeBSD 4.3 was installed via FTP, FreeBSD 4.5 directly from the RELEASE CD) for more information read the . Disk Layout To keep it simple, the same disk layout both for the &sap.r3; 46B and &sap.r3; 46C SR2 installation was used. Only the device names changed, as the installations were on different hardware (/dev/da and /dev/amr respectively, so if using an AMI &megaraid;, one will see /dev/amr0s1a instead of /dev/da0s1a): File system Size (1k-blocks) Size (GB) Mounted on /dev/da0s1a 1.016.303 1 / /dev/da0s1b 6 swap /dev/da0s1e 2.032.623 2 /var /dev/da0s1f 8.205.339 8 /usr /dev/da1s1e 45.734.361 45 /compat/linux/oracle /dev/da1s1f 2.032.623 2 /compat/linux/sapmnt /dev/da1s1g 2.032.623 2 /compat/linux/usr/sap Configure and initialize the two logical drives with the &mylex; or PERC/3 RAID software beforehand. The software can be started during the BIOS boot phase. Please note that this disk layout differs slightly from the &sap; recommendations, as &sap; suggests mounting the &oracle; subdirectories (and some others) separately — we decided to just create them as real subdirectories for simplicity. <command>make world</command> and a New Kernel Download the latest -STABLE sources. Rebuild world and your custom kernel after configuring your kernel configuration file. Here you should also include the kernel parameters which are required for both &sap.r3; and &oracle;. Installing the Linux Environment Installing the Linux Base System First the linux_base port needs to be installed (as root): &prompt.root; cd /usr/ports/emulators/linux_base &prompt.root; make install distclean Installing Linux Development Environment The Linux development environment is needed, if you want to install &oracle; on FreeBSD according to the : &prompt.root; cd /usr/ports/devel/linux_devtools &prompt.root; make install distclean The Linux development environment has only been installed for the &sap.r3; 46B IDES installation. It is not needed, if the &oracle; DB is not relinked on the FreeBSD system. This is the case if you are using the &oracle; tarball from a Linux system. Installing the Necessary RPMs RPMs To start the R3SETUP program, PAM support is needed. During the first &sap; Installation on FreeBSD 4.3-STABLE we tried to install PAM with all the required packages and finally forced the installation of the PAM package, which worked. For &sap.r3; 4.6C SR2 we directly forced the installation of the PAM RPM, which also works, so it seems the dependent packages are not needed: &prompt.root; rpm -i --ignoreos --nodeps --root /compat/linux --dbpath /var/lib/rpm \ pam-0.68-7.i386.rpm For &oracle; 8.0.5 to run the intelligent agent, we also had to install the RedHat Tcl package tcl-8.0.5-30.i386.rpm (otherwise the relinking during &oracle; installation will not work). There are some other issues regarding relinking of &oracle;, but that is a &oracle; Linux issue, not FreeBSD specific. Some Additional Hints It might also be a good idea to add linprocfs to /etc/fstab, for more information, see the &man.linprocfs.5; manual page. Another parameter to set is kern.fallback_elf_brand=3 which is done in the file /etc/sysctl.conf. Creating the &sap.r3; Environment Creating the Necessary File Systems and Mountpoints For a simple installation, it is sufficient to create the following file systems: mount point size in GB /compat/linux/oracle 45 GB /compat/linux/sapmnt 2 GB /compat/linux/usr/sap 2 GB It is also necessary to created some links. Otherwise the &sap; Installer will complain, as it is checking the created links: &prompt.root; ln -s /compat/linux/oracle /oracle &prompt.root; ln -s /compat/linux/sapmnt /sapmnt &prompt.root; ln -s /compat/linux/usr/sap /usr/sap Possible error message during installation (here with System PRD and the &sap.r3; 4.6C SR2 installation): INFO 2002-03-19 16:45:36 R3LINKS_IND_IND SyLinkCreate:200 Checking existence of symbolic link /usr/sap/PRD/SYS/exe/dbg to /sapmnt/PRD/exe. Creating if it does not exist... WARNING 2002-03-19 16:45:36 R3LINKS_IND_IND SyLinkCreate:400 Link /usr/sap/PRD/SYS/exe/dbg exists but it points to file /compat/linux/sapmnt/PRD/exe instead of /sapmnt/PRD/exe. The program cannot go on as long as this link exists at this location. Move the link to another location. ERROR 2002-03-19 16:45:36 R3LINKS_IND_IND Ins_SetupLinks:0 can not setup link '/usr/sap/PRD/SYS/exe/dbg' with content '/sapmnt/PRD/exe' Creating Users and Directories &sap.r3; needs two users and three groups. The user names depend on the &sap; system ID (SID) which consists of three letters. Some of these SIDs are reserved by &sap; (for example SAP and NIX. For a complete list please see the &sap; documentation). For the IDES installation we used IDS, for the 4.6C SR2 installation PRD, as that system is intended for production use. We have therefore the following groups (group IDs might differ, these are just the values we used with our installation): group ID group name description 100 dba Data Base Administrator 101 sapsys &sap; System 102 oper Data Base Operator For a default &oracle; installation, only group dba is used. As oper group, one also uses group dba (see &oracle; and &sap; documentation for further information). We also need the following users: user ID user name generic name group additional groups description 1000 idsadm/prdadm sidadm sapsys oper &sap; Administrator 1002 oraids/oraprd orasid dba oper &oracle; Administrator Adding the users with &man.adduser.8; requires the following (please note shell and home directory) entries for &sap; Administrator: Name: sidadm Password: ****** Fullname: SAP Administrator SID Uid: 1000 Gid: 101 (sapsys) Class: Groups: sapsys dba HOME: /home/sidadm Shell: bash (/compat/linux/bin/bash) and for &oracle; Administrator: Name: orasid Password: ****** Fullname: Oracle Administrator SID Uid: 1002 Gid: 100 (dba) Class: Groups: dba HOME: /oracle/sid Shell: bash (/compat/linux/bin/bash) This should also include group oper in case you are using both groups dba and oper. Creating Directories These directories are usually created as separate file systems. This depends entirely on your requirements. We choose to create them as simple directories, as they are all located on the same RAID 5 anyway: First we will set owners and rights of some directories (as user root): &prompt.root; chmod 775 /oracle &prompt.root; chmod 777 /sapmnt &prompt.root; chown root:dba /oracle &prompt.root; chown sidadm:sapsys /compat/linux/usr/sap &prompt.root; chmod 775 /compat/linux/usr/sap Second we will create directories as user orasid. These will all be subdirectories of /oracle/SID: &prompt.root; su - orasid &prompt.root; cd /oracle/SID &prompt.root; mkdir mirrlogA mirrlogB origlogA origlogB &prompt.root; mkdir sapdata1 sapdata2 sapdata3 sapdata4 sapdata5 sapdata6 &prompt.root; mkdir saparch sapreorg &prompt.root; exit For the &oracle; 8.1.7 installation some additional directories are needed: &prompt.root; su - orasid &prompt.root; cd /oracle &prompt.root; mkdir 805_32 &prompt.root; mkdir client stage &prompt.root; mkdir client/80x_32 &prompt.root; mkdir stage/817_32 &prompt.root; cd /oracle/SID &prompt.root; mkdir 817_32 The directory client/80x_32 is used with exactly this name. Do not replace the x with some number or anything. In the third step we create directories as user sidadm: &prompt.root; su - sidadm &prompt.root; cd /usr/sap &prompt.root; mkdir SID &prompt.root; mkdir trans &prompt.root; exit Entries in <filename>/etc/services</filename> &sap.r3; requires some entries in file /etc/services, which will not be set correctly during installation under FreeBSD. Please add the following entries (you need at least those entries corresponding to the instance number — in this case, 00. It will do no harm adding all entries from 00 to 99 for dp, gw, sp and ms). If you are going to use a SAProuter or need to access &sap; OSS, you also need 99, as port 3299 is usually used for the SAProuter process on the target system: sapdp00 3200/tcp # SAP Dispatcher. 3200 + Instance-Number sapgw00 3300/tcp # SAP Gateway. 3300 + Instance-Number sapsp00 3400/tcp # 3400 + Instance-Number sapms00 3500/tcp # 3500 + Instance-Number sapmsSID 3600/tcp # SAP Message Server. 3600 + Instance-Number sapgw00s 4800/tcp # SAP Secure Gateway 4800 + Instance-Number Necessary Locales locale &sap; requires at least two locales that are not part of the default RedHat installation. &sap; offers the required RPMs as download from their FTP server (which is only accessible if you are a customer with OSS access). See note 0171356 for a list of RPMs you need. It is also possible to just create appropriate links (for example from de_DE and en_US ), but we would not recommend this for a production system (so far it worked with the IDES system without any problems, though). The following locales are needed: de_DE.ISO-8859-1 en_US.ISO-8859-1 Create the links like this: &prompt.root; cd /compat/linux/usr/share/locale &prompt.root; ln -s de_DE de_DE.ISO-8859-1 &prompt.root; ln -s en_US en_US.ISO-8859-1 If they are not present, there will be some problems during the installation. If these are then subsequently ignored (by setting the STATUS of the offending steps to OK in file CENTRDB.R3S), it will be impossible to log onto the &sap; system without some additional effort. Kernel Tuning kernel tuning &sap.r3; systems need a lot of resources. We therefore added the following parameters to the kernel configuration file: # Set these for memory pigs (SAP and Oracle): options MAXDSIZ="(1024*1024*1024)" options DFLDSIZ="(1024*1024*1024)" # System V options needed. options SYSVSHM #SYSV-style shared memory options SHMMAXPGS=262144 #max amount of shared mem. pages #options SHMMAXPGS=393216 #use this for the 46C inst.parameters options SHMMNI=256 #max number of shared memory ident if. options SHMSEG=100 #max shared mem.segs per process options SYSVMSG #SYSV-style message queues options MSGSEG=32767 #max num. of mes.segments in system options MSGSSZ=32 #size of msg-seg. MUST be power of 2 options MSGMNB=65535 #max char. per message queue options MSGTQL=2046 #max amount of msgs in system options SYSVSEM #SYSV-style semaphores options SEMMNU=256 #number of semaphore UNDO structures options SEMMNS=1024 #number of semaphores in system options SEMMNI=520 #number of semaphore identifiers options SEMUME=100 #number of UNDO keys The minimum values are specified in the documentation that comes from &sap;. As there is no description for Linux, see the HP-UX section (32-bit) for further information. As the system for the 4.6C SR2 installation has more main memory, the shared segments can be larger both for &sap; and &oracle;, therefore choose a larger number of shared memory pages. With the default installation of FreeBSD 4.5 on &i386;, leave MAXDSIZ and DFLDSIZ at 1 GB maximum. Otherwise, strange errors like ORA-27102: out of memory and Linux Error: 12: Cannot allocate memory might happen. Installing &sap.r3; Preparing &sap; CDROMs There are many CDROMs to mount and unmount during the installation. Assuming you have enough CDROM drives, you can just mount them all. We decided to copy the CDROMs contents to corresponding directories: /oracle/SID/sapreorg/cd-name where cd-name was one of KERNEL, RDBMS, EXPORT1, EXPORT2, EXPORT3, EXPORT4, EXPORT5 and EXPORT6 for the 4.6B/IDES installation, and KERNEL, RDBMS, DISK1, DISK2, DISK3, DISK4 and LANG for the 4.6C SR2 installation. All the filenames on the mounted CDs should be in capital letters, otherwise use the option for mounting. So use the following commands: &prompt.root; mount_cd9660 -g /dev/cd0a /mnt &prompt.root; cp -R /mnt/* /oracle/SID/sapreorg/cd-name &prompt.root; umount /mnt Running the Installation Script First you have to prepare an install directory: &prompt.root; cd /oracle/SID/sapreorg &prompt.root; mkdir install &prompt.root; cd install Then the installation script is started, which will copy nearly all the relevant files into the install directory: &prompt.root; /oracle/SID/sapreorg/KERNEL/UNIX/INSTTOOL.SH The IDES installation (4.6B) comes with a fully customized &sap.r3; demonstration system, so there are six instead of just three EXPORT CDs. At this point the installation template CENTRDB.R3S is for installing a standard central instance (&r3; and database), not the IDES central instance, so one needs to copy the corresponding CENTRDB.R3S from the EXPORT1 directory, otherwise R3SETUP will only ask for three EXPORT CDs. The newer &sap; 4.6C SR2 release comes with four EXPORT CDs. The parameter file that controls the installation steps is CENTRAL.R3S. Contrary to earlier releases there are no separate installation templates for a central instance with or without database. &sap; is using a separate template for database installation. To restart the installation later it is however sufficient to restart with the original file. During and after installation, &sap; requires hostname to return the computer name only, not the fully qualified domain name. So either set the hostname accordingly, or set an alias with alias hostname='hostname -s' for both orasid and sidadm (and for root at least during installation steps performed as root). It is also possible to adjust the installed .profile and .login files of both users that are installed during &sap; installation. Start <command>R3SETUP</command> 4.6B Make sure LD_LIBRARY_PATH is set correctly: &prompt.root; export LD_LIBRARY_PATH=/oracle/IDS/lib:/sapmnt/IDS/exe:/oracle/805_32/lib Start R3SETUP as root from installation directory: &prompt.root; cd /oracle/IDS/sapreorg/install &prompt.root; ./R3SETUP -f CENTRDB.R3S The script then asks some questions (defaults in brackets, followed by actual input): Question Default Input Enter SAP System ID [C11] IDSEnter Enter SAP Instance Number [00] Enter Enter SAPMOUNT Directory [/sapmnt] Enter Enter name of SAP central host [troubadix.domain.de] Enter Enter name of SAP db host [troubadix] Enter Select character set [1] (WE8DEC) Enter Enter Oracle server version (1) Oracle 8.0.5, (2) Oracle 8.0.6, (3) Oracle 8.1.5, (4) Oracle 8.1.6 1Enter Extract Oracle Client archive [1] (Yes, extract) Enter Enter path to KERNEL CD [/sapcd] /oracle/IDS/sapreorg/KERNEL Enter path to RDBMS CD [/sapcd] /oracle/IDS/sapreorg/RDBMS Enter path to EXPORT1 CD [/sapcd] /oracle/IDS/sapreorg/EXPORT1 Directory to copy EXPORT1 CD [/oracle/IDS/sapreorg/CD4_DIR] Enter Enter path to EXPORT2 CD [/sapcd] /oracle/IDS/sapreorg/EXPORT2 Directory to copy EXPORT2 CD [/oracle/IDS/sapreorg/CD5_DIR] Enter Enter path to EXPORT3 CD [/sapcd] /oracle/IDS/sapreorg/EXPORT3 Directory to copy EXPORT3 CD [/oracle/IDS/sapreorg/CD6_DIR] Enter Enter path to EXPORT4 CD [/sapcd] /oracle/IDS/sapreorg/EXPORT4 Directory to copy EXPORT4 CD [/oracle/IDS/sapreorg/CD7_DIR] Enter Enter path to EXPORT5 CD [/sapcd] /oracle/IDS/sapreorg/EXPORT5 Directory to copy EXPORT5 CD [/oracle/IDS/sapreorg/CD8_DIR] Enter Enter path to EXPORT6 CD [/sapcd] /oracle/IDS/sapreorg/EXPORT6 Directory to copy EXPORT6 CD [/oracle/IDS/sapreorg/CD9_DIR] Enter Enter amount of RAM for SAP + DB 850Enter (in Megabytes) Service Entry Message Server [3600] Enter Enter Group-ID of sapsys [101] Enter Enter Group-ID of oper [102] Enter Enter Group-ID of dba [100] Enter Enter User-ID of sidadm [1000] Enter Enter User-ID of orasid [1002] Enter Number of parallel procs [2] Enter If you had not copied the CDs to the different locations, then the &sap; installer cannot find the CD needed (identified by the LABEL.ASC file on the CD) and would then ask you to insert and mount the CD and confirm or enter the mount path. The CENTRDB.R3S might not be error free. In our case, it requested EXPORT4 CD again but indicated the correct key (6_LOCATION, then 7_LOCATION etc.), so one can just continue with entering the correct values. Apart from some problems mentioned below, everything should go straight through up to the point where the &oracle; database software needs to be installed. Start <command>R3SETUP</command> 4.6C SR2 Make sure LD_LIBRARY_PATH is set correctly. This is a different value from the 4.6B installation with &oracle; 8.0.5: &prompt.root; export LD_LIBRARY_PATH=/sapmnt/PRD/exe:/oracle/PRD/817_32/lib Start R3SETUP as user root from installation directory: &prompt.root; cd /oracle/PRD/sapreorg/install &prompt.root; ./R3SETUP -f CENTRAL.R3S The script then asks some questions (defaults in brackets, followed by actual input): Question Default Input Enter SAP System ID [C11] PRDEnter Enter SAP Instance Number [00] Enter Enter SAPMOUNT Directory [/sapmnt] Enter Enter name of SAP central host [majestix] Enter Enter Database System ID [PRD] PRDEnter Enter name of SAP db host [majestix] Enter Select character set [1] (WE8DEC) Enter Enter Oracle server version (2) Oracle 8.1.7 2Enter Extract Oracle Client archive [1] (Yes, extract) Enter Enter path to KERNEL CD [/sapcd] /oracle/PRD/sapreorg/KERNEL Enter amount of RAM for SAP + DB 2044 1800Enter (in Megabytes) Service Entry Message Server [3600] Enter Enter Group-ID of sapsys [100] Enter Enter Group-ID of oper [101] Enter Enter Group-ID of dba [102] Enter Enter User-ID of oraprd [1002] Enter Enter User-ID of prdadm [1000] Enter LDAP support 3Enter (no support) Installation step completed [1] (continue) Enter Choose installation service [1] (DB inst,file) Enter So far, creation of users gives an error during installation in phases OSUSERDBSID_IND_ORA (for creating user orasid) and OSUSERSIDADM_IND_ORA (creating user sidadm). Apart from some problems mentioned below, everything should go straight through up to the point where the &oracle; database software needs to be installed. Installing &oracle; 8.0.5 Please see the corresponding &sap; Notes and &oracle; Readmes regarding Linux and &oracle; DB for possible problems. Most if not all problems stem from incompatible libraries. For more information on installing &oracle;, refer to the Installing &oracle; chapter. Installing the &oracle; 8.0.5 with <command>orainst</command> If &oracle; 8.0.5 is to be used, some additional libraries are needed for successfully relinking, as &oracle; 8.0.5 was linked with an old glibc (RedHat 6.0), but RedHat 6.1 already uses a new glibc. So you have to install the following additional packages to ensure that linking will work: compat-libs-5.2-2.i386.rpm compat-glibc-5.2-2.0.7.2.i386.rpm compat-egcs-5.2-1.0.3a.1.i386.rpm compat-egcs-c++-5.2-1.0.3a.1.i386.rpm compat-binutils-5.2-2.9.1.0.23.1.i386.rpm See the corresponding &sap; Notes or &oracle; Readmes for further information. If this is no option (at the time of installation we did not have enough time to check this), one could use the original binaries, or use the relinked binaries from an original RedHat system. For compiling the intelligent agent, the RedHat Tcl package must be installed. If you cannot get tcl-8.0.3-20.i386.rpm, a newer one like tcl-8.0.5-30.i386.rpm for RedHat 6.1 should also do. Apart from relinking, the installation is straightforward: &prompt.root; su - oraids &prompt.root; export TERM=xterm &prompt.root; export ORACLE_TERM=xterm &prompt.root; export ORACLE_HOME=/oracle/IDS &prompt.root; cd $ORACLE_HOME/orainst_sap &prompt.root; ./orainst Confirm all screens with Enter until the software is installed, except that one has to deselect the &oracle; On-Line Text Viewer, as this is not currently available for Linux. &oracle; then wants to relink with i386-glibc20-linux-gcc instead of the available gcc, egcs or i386-redhat-linux-gcc . Due to time constrains we decided to use the binaries from an &oracle; 8.0.5 PreProduction release, after the first attempt at getting the version from the RDBMS CD working, failed, and finding and accessing the correct RPMs was a nightmare at that time. Installing the &oracle; 8.0.5 Pre-production Release for Linux (Kernel 2.0.33) This installation is quite easy. Mount the CD, start the installer. It will then ask for the location of the &oracle; home directory, and copy all binaries there. We did not delete the remains of our previous RDBMS installation tries, though. Afterwards, &oracle; Database could be started with no problems. Installing the &oracle; 8.1.7 Linux Tarball Take the tarball oracle81732.tgz you produced from the installation directory on a Linux system and untar it to /oracle/SID/817_32/. Continue with &sap.r3; Installation First check the environment settings of users idsamd (sidadm) and oraids (orasid). They should now both have the files .profile, .login and .cshrc which are all using hostname. In case the system's hostname is the fully qualified name, you need to change hostname to hostname -s within all three files. Database Load Afterwards, R3SETUP can either be restarted or continued (depending on whether exit was chosen or not). R3SETUP then creates the tablespaces and loads the data (for 46B IDES, from EXPORT1 to EXPORT6, for 46C from DISK1 to DISK4) with R3load into the database. When the database load is finished (might take a few hours), some passwords are requested. For test installations, one can use the well known default passwords (use different ones if security is an issue!): Question Input Enter Password for sapr3 sapEnter Confirum Password for sapr3 sapEnter Enter Password for sys change_on_installEnter Confirm Password for sys change_on_installEnter Enter Password for system managerEnter Confirm Password for system managerEnter At this point We had a few problems with dipgntab during the 4.6B installation. Listener Start the &oracle; Listener as user orasid as follows: &prompt.user; umask 0; lsnrctl start Otherwise you might get the error ORA-12546 as the sockets will not have the correct permissions. See &sap; Note 072984. Updating MNLS Tables If you plan to import non-Latin-1 languages into the &sap; system, you have to update the Multi National Language Support tables. This is described in the &sap; OSS Notes 15023 and 45619. Otherwise, you can skip this question during &sap; installation. If you do not need MNLS, it is still necessary to check the table TCPDB and initializing it if this has not been done. See &sap; note 0015023 and 0045619 for further information. Post-installation Steps Request &sap.r3; License Key You have to request your &sap.r3; License Key. This is needed, as the temporary license that was installed during installation is only valid for four weeks. First get the hardware key. Log on as user idsadm and call saplicense: &prompt.root; /sapmnt/IDS/exe/saplicense -get Calling saplicense without parameters gives a list of options. Upon receiving the license key, it can be installed using: &prompt.root; /sapmnt/IDS/exe/saplicense -install You are then required to enter the following values: SAP SYSTEM ID = SID, 3 chars CUSTOMER KEY = hardware key, 11 chars INSTALLATION NO = installation, 10 digits EXPIRATION DATE = yyyymmdd, usually "99991231" LICENSE KEY = license key, 24 chars Creating Users Create a user within client 000 (for some tasks required to be done within client 000, but with a user different from users sap* and ddic). As a user name, We usually choose wartung (or service in English). Profiles required are sap_new and sap_all. For additional safety the passwords of default users within all clients should be changed (this includes users sap* and ddic). Configure Transport System, Profile, Operation Modes, Etc. Within client 000, user different from ddic and sap*, do at least the following: Task Transaction Configure Transport System, e.g. as Stand-Alone Transport Domain Entity STMS Create / Edit Profile for System RZ10 Maintain Operation Modes and Instances RZ04 These and all the other post-installation steps are thoroughly described in &sap; installation guides. Edit <filename>init<replaceable>sid</replaceable>.sap</filename> (<filename>initIDS.sap</filename>) The file /oracle/IDS/dbs/initIDS.sap contains the &sap; backup profile. Here the size of the tape to be used, type of compression and so on need to be defined. To get this running with sapdba / brbackup, we changed the following values: compress = hardware archive_function = copy_delete_save cpio_flags = "-ov --format=newc --block-size=128 --quiet" cpio_in_flags = "-iuv --block-size=128 --quiet" tape_size = 38000M tape_address = /dev/nsa0 tape_address_rew = /dev/sa0 Explanations: compress: The tape we use is a HP DLT1 which does hardware compression. archive_function: This defines the default behavior for saving &oracle; archive logs: new logfiles are saved to tape, already saved logfiles are saved again and are then deleted. This prevents lots of trouble if you need to recover the database, and one of the archive-tapes has gone bad. cpio_flags: Default is to use which sets block size to 5120 Bytes. For DLT Tapes, HP recommends at least 32 K block size, so we used for 64 K. is needed because we have inode numbers greater than 65535. The last option is needed as otherwise brbackup complains as soon as cpio outputs the numbers of blocks saved. cpio_in_flags: Flags needed for loading data back from tape. Format is recognized automatically. tape_size: This usually gives the raw storage capability of the tape. For security reason (we use hardware compression), the value is slightly lower than the actual value. tape_address: The non-rewindable device to be used with cpio. tape_address_rew: The rewindable device to be used with cpio. Configuration Issues after Installation The following &sap; parameters should be tuned after installation (examples for IDES 46B, 1 GB memory): Name Value ztta/roll_extension 250000000 abap/heap_area_dia 300000000 abap/heap_area_nondia 400000000 em/initial_size_MB 256 em/blocksize_kB 1024 ipc/shm_psize_40 70000000 &sap; Note 0013026: Name Value ztta/dynpro_area 2500000 &sap; Note 0157246: Name Value rdisp/ROLL_MAXFS 16000 rdisp/PG_MAXFS 30000 With the above parameters, on a system with 1 gigabyte of memory, one may find memory consumption similar to: Mem: 547M Active, 305M Inact, 109M Wired, 40M Cache, 112M Buf, 3492K Free Problems during Installation Restart <command>R3SETUP</command> after Fixing a Problem R3SETUP stops if it encounters an error. If you have looked at the corresponding logfiles and fixed the error, you have to start R3SETUP again, usually selecting REPEAT as option for the last step R3SETUP complained about. To restart R3SETUP, just start it with the corresponding R3S file: &prompt.root; ./R3SETUP -f CENTRDB.R3S for 4.6B, or with &prompt.root; ./R3SETUP -f CENTRAL.R3S for 4.6C, no matter whether the error occurred with CENTRAL.R3S or DATABASE.R3S. At some stages, R3SETUP assumes that both database and &sap; processes are up and running (as those were steps it already completed). Should errors occur and for example the database could not be started, you have to start both database and &sap; by hand after you fixed the errors and before starting R3SETUP again. Do not forget to also start the &oracle; listener again (as orasid with umask 0; lsnrctl start) if it was also stopped (for example due to a necessary reboot of the system). OSUSERSIDADM_IND_ORA during <command>R3SETUP</command> If R3SETUP complains at this stage, edit the template file R3SETUP used at that time (CENTRDB.R3S (4.6B) or either CENTRAL.R3S or DATABASE.R3S (4.6C)). Locate [OSUSERSIDADM_IND_ORA] or search for the only STATUS=ERROR entry and edit the following values: HOME=/home/sidadm (was empty) STATUS=OK (had status ERROR) Then you can restart R3SETUP again. OSUSERDBSID_IND_ORA during <command>R3SETUP</command> Possibly R3SETUP also complains at this stage. The error here is similar to the one in phase OSUSERSIDADM_IND_ORA. Just edit the template file R3SETUP used at that time (CENTRDB.R3S (4.6B) or either CENTRAL.R3S or DATABASE.R3S (4.6C)). Locate [OSUSERDBSID_IND_ORA] or search for the only STATUS=ERROR entry and edit the following value in that section: STATUS=OK Then restart R3SETUP. <errorname>oraview.vrf FILE NOT FOUND</errorname> during &oracle; Installation You have not deselected &oracle; On-Line Text Viewer before starting the installation. This is marked for installation even though this option is currently not available for Linux. Deselect this product inside the &oracle; installation menu and restart installation. <errorname>TEXTENV_INVALID</errorname> during <command>R3SETUP</command>, RFC or SAPgui Start If this error is encountered, the correct locale is missing. &sap; Note 0171356 lists the necessary RPMs that need be installed (e.g. saplocales-1.0-3, saposcheck-1.0-1 for RedHat 6.1). In case you ignored all the related errors and set the corresponding STATUS from ERROR to OK (in CENTRDB.R3S) every time R3SETUP complained and just restarted R3SETUP, the &sap; system will not be properly configured and you will then not be able to connect to the system with a SAPgui, even though the system can be started. Trying to connect with the old Linux SAPgui gave the following messages: Sat May 5 14:23:14 2001 *** ERROR => no valid userarea given [trgmsgo. 0401] Sat May 5 14:23:22 2001 *** ERROR => ERROR NR 24 occured [trgmsgi. 0410] *** ERROR => Error when generating text environment. [trgmsgi. 0435] *** ERROR => function failed [trgmsgi. 0447] *** ERROR => no socket operation allowed [trxio.c 3363] Speicherzugriffsfehler This behavior is due to &sap.r3; being unable to correctly assign a locale and also not being properly configured itself (missing entries in some database tables). To be able to connect to &sap;, add the following entries to file DEFAULT.PFL (see Note 0043288): abap/set_etct_env_at_new_mode = 0 install/collate/active = 0 rscp/TCP0B = TCP0B Restart the &sap; system. Now you can connect to the system, even though country-specific language settings might not work as expected. After correcting country settings (and providing the correct locales), these entries can be removed from DEFAULT.PFL and the &sap; system can be restarted. <errorcode>ORA-00001</errorcode> This error only happened with &oracle; 8.1.7 on FreeBSD 4.5. The reason was that the &oracle; database could not initialize itself properly and crashed, leaving semaphores and shared memory on the system. The next try to start the database then returned ORA-00001. Find them with ipcs -a and remove them with ipcrm. <errorcode>ORA-00445</errorcode> (Background Process PMON Did Not Start) This error happened with &oracle; 8.1.7. This error is reported if the database is started with the usual startsap script (for example startsap_majestix_00) as user prdadm. A possible workaround is to start the database as user oraprd instead with svrmgrl: &prompt.user; svrmgrl SVRMGR> connect internal; SVRMGR> startup; SVRMGR> exit <errorcode>ORA-12546</errorcode> (Start Listener with Correct Permissions) Start the &oracle; listener as user oraids with the following commands: &prompt.root; umask 0; lsnrctl start Otherwise you might get ORA-12546 as the sockets will not have the correct permissions. See &sap; Note 0072984. <errorcode>ORA-27102</errorcode> (Out of Memory) This error happened whilst trying to use values for MAXDSIZ and DFLDSIZ greater than 1 GB (1024x1024x1024). Additionally, we got Linux Error 12: Cannot allocate memory. [DIPGNTAB_IND_IND] during <command>R3SETUP</command> In general, see &sap; Note 0130581 (R3SETUP step DIPGNTAB terminates). During the IDES-specific installation, for some reason the installation process was not using the proper &sap; system name IDS, but the empty string "" instead. This leads to some minor problems with accessing directories, as the paths are generated dynamically using SID (in this case IDS). So instead of accessing: /usr/sap/IDS/SYS/... /usr/sap/IDS/DVMGS00 the following paths were used: /usr/sap//SYS/... /usr/sap/D00 To continue with the installation, we created a link and an additional directory: &prompt.root; pwd /compat/linux/usr/sap &prompt.root; ls -l total 4 drwxr-xr-x 3 idsadm sapsys 512 May 5 11:20 D00 drwxr-x--x 5 idsadm sapsys 512 May 5 11:35 IDS -lrwxr-xr-x 1 root sapsys 7 May 5 11:35 SYS -> IDS/SYS +lrwxr-xr-x 1 root sapsys 7 May 5 11:35 SYS -> IDS/SYS drwxrwxr-x 2 idsadm sapsys 512 May 5 13:00 tmp drwxrwxr-x 11 idsadm sapsys 512 May 4 14:20 trans We also found &sap; Notes (0029227 and 0008401) describing this behavior. We did not encounter any of these problems with the &sap; 4.6C installation. [RFCRSWBOINI_IND_IND] during <command>R3SETUP</command> During installation of &sap; 4.6C, this error was just the result of another error happening earlier during installation. In this case, you have to look through the corresponding logfiles and correct the real problem. If after looking through the logfiles this error is indeed the correct one (check the &sap; Notes), you can set STATUS of the offending step from ERROR to OK (file CENTRDB.R3S) and restart R3SETUP. After installation, you have to execute the report RSWBOINS from transaction SE38. See &sap; Note 0162266 for additional information about phase RFCRSWBOINI and RFCRADDBDIF. [RFCRADDBDIF_IND_IND] during <command>R3SETUP</command> Here the same restrictions apply: make sure by looking through the logfiles, that this error is not caused by some previous problems. If you can confirm that &sap; Note 0162266 applies, just set STATUS of the offending step from ERROR to OK (file CENTRDB.R3S) and restart R3SETUP. After installation, you have to execute the report RADDBDIF from transaction SE38. <errorcode>sigaction sig31: File size limit exceeded</errorcode> This error occurred during start of &sap; processes disp+work. If starting &sap; with the startsap script, subprocesses are then started which detach and do the dirty work of starting all other &sap; processes. As a result, the script itself will not notice if something goes wrong. To check whether the &sap; processes did start properly, have a look at the process status with ps ax | grep SID, which will give you a list of all &oracle; and &sap; processes. If it looks like some processes are missing or if you cannot connect to the &sap; system, look at the corresponding logfiles which can be found at /usr/sap/SID/DVEBMGSnr/work/. The files to look at are dev_ms and dev_disp. Signal 31 happens here if the amount of shared memory used by &oracle; and &sap; exceed the one defined within the kernel configuration file and could be resolved by using a larger value: # larger value for 46C production systems: options SHMMAXPGS=393216 # smaller value sufficient for 46B: #options SHMMAXPGS=262144 Start of <command>saposcol</command> Failed There are some problems with the program saposcol (version 4.6D). The &sap; system is using saposcol to collect data about the system performance. This program is not needed to use the &sap; system, so this problem can be considered a minor one. The older versions (4.6B) does work, but does not collect all the data (many calls will just return 0, for example for CPU usage). Advanced Topics If you are curious as to how the Linux binary compatibility works, this is the section you want to read. Most of what follows is based heavily on an email written to &a.chat; by Terry Lambert tlambert@primenet.com (Message ID: <199906020108.SAA07001@usr09.primenet.com>). How Does It Work? execution class loader FreeBSD has an abstraction called an execution class loader. This is a wedge into the &man.execve.2; system call. What happens is that FreeBSD has a list of loaders, instead of a single loader with a fallback to the #! loader for running any shell interpreters or shell scripts. Historically, the only loader on the &unix; platform examined the magic number (generally the first 4 or 8 bytes of the file) to see if it was a binary known to the system, and if so, invoked the binary loader. If it was not the binary type for the system, the &man.execve.2; call returned a failure, and the shell attempted to start executing it as shell commands. The assumption was a default of whatever the current shell is. Later, a hack was made for &man.sh.1; to examine the first two characters, and if they were :\n, then it invoked the &man.csh.1; shell instead (we believe SCO first made this hack). What FreeBSD does now is go through a list of loaders, with a generic #! loader that knows about interpreters as the characters which follow to the next whitespace next to last, followed by a fallback to /bin/sh. ELF For the Linux ABI support, FreeBSD sees the magic number as an ELF binary (it makes no distinction between FreeBSD, &solaris;, Linux, or any other OS which has an ELF image type, at this point). Solaris The ELF loader looks for a specialized brand, which is a comment section in the ELF image, and which is not present on SVR4/&solaris; ELF binaries. For Linux binaries to function, they must be branded as type Linux from &man.brandelf.1;: &prompt.root; brandelf -t Linux file When this is done, the ELF loader will see the Linux brand on the file. ELF branding When the ELF loader sees the Linux brand, the loader replaces a pointer in the proc structure. All system calls are indexed through this pointer (in a traditional &unix; system, this would be the sysent[] structure array, containing the system calls). In addition, the process is flagged for special handling of the trap vector for the signal trampoline code, and several other (minor) fix-ups that are handled by the Linux kernel module. The Linux system call vector contains, among other things, a list of sysent[] entries whose addresses reside in the kernel module. When a system call is called by the Linux binary, the trap code dereferences the system call function pointer off the proc structure, and gets the Linux, not the FreeBSD, system call entry points. In addition, the Linux mode dynamically reroots lookups; this is, in effect, what the option to file system mounts (not the unionfs file system type!) does. First, an attempt is made to lookup the file in the /compat/linux/original-path directory, then only if that fails, the lookup is done in the /original-path directory. This makes sure that binaries that require other binaries can run (e.g., the Linux toolchain can all run under Linux ABI support). It also means that the Linux binaries can load and execute FreeBSD binaries, if there are no corresponding Linux binaries present, and that you could place a &man.uname.1; command in the /compat/linux directory tree to ensure that the Linux binaries could not tell they were not running on Linux. In effect, there is a Linux kernel in the FreeBSD kernel; the various underlying functions that implement all of the services provided by the kernel are identical to both the FreeBSD system call table entries, and the Linux system call table entries: file system operations, virtual memory operations, signal delivery, System V IPC, etc… The only difference is that FreeBSD binaries get the FreeBSD glue functions, and Linux binaries get the Linux glue functions (most older OS's only had their own glue functions: addresses of functions in a static global sysent[] structure array, instead of addresses of functions dereferenced off a dynamically initialized pointer in the proc structure of the process making the call). Which one is the native FreeBSD ABI? It does not matter. Basically the only difference is that (currently; this could easily be changed in a future release, and probably will be after this) the FreeBSD glue functions are statically linked into the kernel, and the Linux glue functions can be statically linked, or they can be accessed via a kernel module. Yeah, but is this really emulation? No. It is an ABI implementation, not an emulation. There is no emulator (or simulator, to cut off the next question) involved. So why is it sometimes called Linux emulation? To make it hard to sell FreeBSD! Really, it is because the historical implementation was done at a time when there was really no word other than that to describe what was going on; saying that FreeBSD ran Linux binaries was not true, if you did not compile the code in or load a module, and there needed to be a word to describe what was being loaded—hence the Linux emulator.
diff --git a/zh_TW.Big5/books/handbook/mirrors/chapter.sgml b/zh_TW.Big5/books/handbook/mirrors/chapter.sgml index 31726da40b..36094ce40d 100644 --- a/zh_TW.Big5/books/handbook/mirrors/chapter.sgml +++ b/zh_TW.Big5/books/handbook/mirrors/chapter.sgml @@ -1,3169 +1,3177 @@ Obtaining FreeBSD CDROM and DVD Publishers Retail Boxed Products FreeBSD is available as a boxed product (FreeBSD CDs, additional software, and printed documentation) from several retailers:
CompUSA WWW:
Frys Electronics WWW:
CD and DVD Sets FreeBSD CD and DVD sets are available from many online retailers:
BSD Mall by Daemon News PO Box 161 Nauvoo, IL 62354 USA Phone: +1 866 273-6255 Fax: +1 217 453-9956 Email: sales@bsdmall.com WWW:
BSD-Systems Email: info@bsd-systems.co.uk WWW:
fastdiscs.com 6 Eltham Close Leeds, LS6 2TY United Kingdom Phone: +44 870 1995 171 Email: sales@fastdiscs.com WWW:
FreeBSD Mall, Inc. 3623 Sanford Street Concord, CA 94520-1405 USA Phone: +1 925 674-0783 Fax: +1 925 674-0821 Email: info@freebsdmall.com WWW:
Hinner EDV St. Augustinus-Str. 10 D-81825 München Germany Phone: (089) 428 419 WWW:
Ikarios 22-24 rue Voltaire 92000 Nanterre France WWW:
JMC Software Ireland Phone: 353 1 6291282 WWW:
Linux CD Mall Private Bag MBE N348 Auckland 1030 New Zealand Phone: +64 21 866529 WWW:
The Linux Emporium Hilliard House, Lester Way Wallingford OX10 9TA United Kingdom Phone: +44 1491 837010 Fax: +44 1491 837016 WWW:
Linux+ DVD Magazine Lewartowskiego 6 Warsaw 00-190 Poland Phone: +48 22 860 18 18 Email: editors@lpmagazine.org WWW:
Linux System Labs Australia 21 Ray Drive Balwyn North VIC - 3104 Australia Phone: +61 3 9857 5918 Fax: +61 3 9857 8974 WWW:
LinuxCenter.Ru Galernaya Street, 55 Saint-Petersburg 190000 Russia Phone: +7-812-3125208 Email: info@linuxcenter.ru WWW:
Distributors If you are a reseller and want to carry FreeBSD CDROM products, please contact a distributor:
Cylogistics 809B Cuesta Dr., #2149 Mountain View, CA 94040 USA Phone: +1 650 694-4949 Fax: +1 650 694-4953 Email: sales@cylogistics.com WWW:
Ingram Micro 1600 E. St. Andrew Place Santa Ana, CA 92705-4926 USA Phone: 1 (800) 456-8000 WWW:
Kudzu, LLC 7375 Washington Ave. S. Edina, MN 55439 USA Phone: +1 952 947-0822 Fax: +1 952 947-0876 Email: sales@kudzuenterprises.com
LinuxCenter.Ru Galernaya Street, 55 Saint-Petersburg 190000 Russia Phone: +7-812-3125208 Email: info@linuxcenter.ru WWW:
Navarre Corp 7400 49th Ave South New Hope, MN 55428 USA Phone: +1 763 535-8333 Fax: +1 763 535-0341 WWW:
FTP Sites The official sources for FreeBSD are available via anonymous FTP from a worldwide set of mirror sites. The site is well connected and allows a large number of connections to it, but you are probably better off finding a closer mirror site (especially if you decide to set up some sort of mirror site). The FreeBSD mirror sites database is more accurate than the mirror listing in the Handbook, as it gets its information from the DNS rather than relying on static lists of hosts. Additionally, FreeBSD is available via anonymous FTP from the following mirror sites. If you choose to obtain FreeBSD via anonymous FTP, please try to use a site near you. The mirror sites listed as Primary Mirror Sites typically have the entire FreeBSD archive (all the currently available versions for each of the architectures) but you will probably have faster download times from a site that is in your country or region. The regional sites carry the most recent versions for the most popular architecture(s) but might not carry the entire FreeBSD archive. All sites provide access via anonymous FTP but some sites also provide access via other methods. The access methods available for each site are provided in parentheses after the hostname. &chap.mirrors.ftp.inc; Anonymous CVS <anchor id="anoncvs-intro">Introduction CVS anonymous Anonymous CVS (or, as it is otherwise known, anoncvs) is a feature provided by the CVS utilities bundled with FreeBSD for synchronizing with a remote CVS repository. Among other things, it allows users of FreeBSD to perform, with no special privileges, read-only CVS operations against one of the FreeBSD project's official anoncvs servers. To use it, one simply sets the CVSROOT environment variable to point at the appropriate anoncvs server, provides the well-known password anoncvs with the cvs login command, and then uses the &man.cvs.1; command to access it like any local repository. The cvs login command, stores the passwords that are used for authenticating to the CVS server in a file called .cvspass in your HOME directory. If this file does not exist, you might get an error when trying to use cvs login for the first time. Just make an empty .cvspass file, and retry to login. While it can also be said that the CVSup and anoncvs services both perform essentially the same function, there are various trade-offs which can influence the user's choice of synchronization methods. In a nutshell, CVSup is much more efficient in its usage of network resources and is by far the most technically sophisticated of the two, but at a price. To use CVSup, a special client must first be installed and configured before any bits can be grabbed, and then only in the fairly large chunks which CVSup calls collections. Anoncvs, by contrast, can be used to examine anything from an individual file to a specific program (like ls or grep) by referencing the CVS module name. Of course, anoncvs is also only good for read-only operations on the CVS repository, so if it is your intention to support local development in one repository shared with the FreeBSD project bits then CVSup is really your only option. <anchor id="anoncvs-usage">Using Anonymous CVS Configuring &man.cvs.1; to use an Anonymous CVS repository is a simple matter of setting the CVSROOT environment variable to point to one of the FreeBSD project's anoncvs servers. At the time of this writing, the following servers are available: Austria: :pserver:anoncvs@anoncvs.at.FreeBSD.org:/home/ncvs (Use cvs login and enter any password when prompted.) France: :pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs (pserver (password anoncvs), ssh (no password)) Germany: :pserver:anoncvs@anoncvs.de.FreeBSD.org:/home/ncvs (Use cvs login and enter the password anoncvs when prompted.) Germany: :pserver:anoncvs@anoncvs2.de.FreeBSD.org:/home/ncvs (rsh, pserver, ssh, ssh/2022) Japan: :pserver:anoncvs@anoncvs.jp.FreeBSD.org:/home/ncvs (Use cvs login and enter the password anoncvs when prompted.) Sweden: freebsdanoncvs@anoncvs.se.FreeBSD.org:/home/ncvs (ssh only - no password) SSH HostKey: 1024 a7:34:15:ee:0e:c6:65:cf:40:78:2d:f3:cd:87:bd:a6 root@apelsin.fruitsalad.org SSH2 HostKey: 1024 21:df:04:03:c7:26:3e:e8:36:1a:50:2d:c7:ae:b8:5f ssh_host_dsa_key.pub USA: freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs (ssh only - no password) SSH HostKey: 1024 a1:e7:46:de:fb:56:ef:05:bc:73:aa:91:09:da:f7:f4 root@sanmateo.ecn.purdue.edu SSH2 HostKey: 1024 52:02:38:1a:2f:a8:71:d3:f5:83:93:8d:aa:00:6f:65 ssh_host_dsa_key.pub USA: anoncvs@anoncvs1.FreeBSD.org:/home/ncvs (ssh only - no password) SSH HostKey: 1024 4b:83:b6:c5:70:75:6c:5b:18:8e:3a:7a:88:a0:43:bb root@ender.liquidneon.com SSH2 HostKey: 1024 80:a7:87:fa:61:d9:25:5c:33:d5:48:51:aa:8f:b6:12 ssh_host_dsa_key.pub Since CVS allows one to check out virtually any version of the FreeBSD sources that ever existed (or, in some cases, will exist), you need to be familiar with the revision () flag to &man.cvs.1; and what some of the permissible values for it in the FreeBSD Project repository are. There are two kinds of tags, revision tags and branch tags. A revision tag refers to a specific revision. Its meaning stays the same from day to day. A branch tag, on the other hand, refers to the latest revision on a given line of development, at any given time. Because a branch tag does not refer to a specific revision, it may mean something different tomorrow than it means today. contains revision tags that users might be interested in. Again, none of these are valid for the Ports Collection since the Ports Collection does not have multiple revisions. When you specify a branch tag, you normally receive the latest versions of the files on that line of development. If you wish to receive some past version, you can do so by specifying a date with the flag. See the &man.cvs.1; manual page for more details. Examples While it really is recommended that you read the manual page for &man.cvs.1; thoroughly before doing anything, here are some quick examples which essentially show how to use Anonymous CVS: Checking Out Something from -CURRENT (&man.ls.1;): &prompt.user; setenv CVSROOT :pserver:anoncvs@anoncvs.jp.FreeBSD.org:/home/ncvs &prompt.user; cvs login At the prompt, enter the password anoncvs. &prompt.user; cvs co ls Using SSH to check out the <filename>src/</filename> tree: &prompt.user; cvs -d freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs co src The authenticity of host 'anoncvs.freebsd.org (128.46.156.46)' can't be established. DSA key fingerprint is 52:02:38:1a:2f:a8:71:d3:f5:83:93:8d:aa:00:6f:65. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'anoncvs.freebsd.org' (DSA) to the list of known hosts. Checking Out the Version of &man.ls.1; in the 6-STABLE Branch: &prompt.user; setenv CVSROOT :pserver:anoncvs@anoncvs.jp.FreeBSD.org:/home/ncvs &prompt.user; cvs login At the prompt, enter the password anoncvs. &prompt.user; cvs co -rRELENG_6 ls Creating a List of Changes (as Unified Diffs) to &man.ls.1; &prompt.user; setenv CVSROOT :pserver:anoncvs@anoncvs.jp.FreeBSD.org:/home/ncvs &prompt.user; cvs login At the prompt, enter the password anoncvs. &prompt.user; cvs rdiff -u -rRELENG_5_3_0_RELEASE -rRELENG_5_4_0_RELEASE ls Finding Out What Other Module Names Can Be Used: &prompt.user; setenv CVSROOT :pserver:anoncvs@anoncvs.jp.FreeBSD.org:/home/ncvs &prompt.user; cvs login At the prompt, enter the password anoncvs. &prompt.user; cvs co modules &prompt.user; more modules/modules Other Resources The following additional resources may be helpful in learning CVS: CVS Tutorial from Cal Poly. CVS Home, the CVS development and support community. CVSweb is the FreeBSD Project web interface for CVS. Using CTM CTM CTM is a method for keeping a remote directory tree in sync with a central one. It has been developed for usage with FreeBSD's source trees, though other people may find it useful for other purposes as time goes by. Little, if any, documentation currently exists at this time on the process of creating deltas, so contact the &a.ctm-users.name; mailing list for more information and if you wish to use CTM for other things. Why Should I Use <application>CTM</application>? CTM will give you a local copy of the FreeBSD source trees. There are a number of flavors of the tree available. Whether you wish to track the entire CVS tree or just one of the branches, CTM can provide you the information. If you are an active developer on FreeBSD, but have lousy or non-existent TCP/IP connectivity, or simply wish to have the changes automatically sent to you, CTM was made for you. You will need to obtain up to three deltas per day for the most active branches. However, you should consider having them sent by automatic email. The sizes of the updates are always kept as small as possible. This is typically less than 5K, with an occasional (one in ten) being 10-50K and every now and then a large 100K+ or more coming around. You will also need to make yourself aware of the various caveats related to working directly from the development sources rather than a pre-packaged release. This is particularly true if you choose the current sources. It is recommended that you read Staying current with FreeBSD. What Do I Need to Use <application>CTM</application>? You will need two things: The CTM program, and the initial deltas to feed it (to get up to current levels). The CTM program has been part of FreeBSD ever since version 2.0 was released, and lives in /usr/src/usr.sbin/ctm if you have a copy of the source available. The deltas you feed CTM can be had two ways, FTP or email. If you have general FTP access to the Internet then the following FTP sites support access to CTM: or see section mirrors. FTP the relevant directory and fetch the README file, starting from there. If you wish to get your deltas via email: Subscribe to one of the CTM distribution lists. &a.ctm-cvs-cur.name; supports the entire CVS tree. &a.ctm-src-cur.name; supports the head of the development branch. &a.ctm-src-4.name; supports the 4.X release branch, etc.. (If you do not know how to subscribe yourself to a list, click on the list name above or go to &a.mailman.lists.link; and click on the list that you wish to subscribe to. The list page should contain all of the necessary subscription instructions.) When you begin receiving your CTM updates in the mail, you may use the ctm_rmail program to unpack and apply them. You can actually use the ctm_rmail program directly from a entry in /etc/aliases if you want to have the process run in a fully automated fashion. Check the ctm_rmail manual page for more details. No matter what method you use to get the CTM deltas, you should subscribe to the &a.ctm-announce.name; mailing list. In the future, this will be the only place where announcements concerning the operations of the CTM system will be posted. Click on the list name above and follow the instructions to subscribe to the list. Using <application>CTM</application> for the First Time Before you can start using CTM deltas, you will need to get to a starting point for the deltas produced subsequently to it. First you should determine what you already have. Everyone can start from an empty directory. You must use an initial Empty delta to start off your CTM supported tree. At some point it is intended that one of these started deltas be distributed on the CD for your convenience, however, this does not currently happen. Since the trees are many tens of megabytes, you should prefer to start from something already at hand. If you have a -RELEASE CD, you can copy or extract an initial source from it. This will save a significant transfer of data. You can recognize these starter deltas by the X appended to the number (src-cur.3210XEmpty.gz for instance). The designation following the X corresponds to the origin of your initial seed. Empty is an empty directory. As a rule a base transition from Empty is produced every 100 deltas. By the way, they are large! 70 to 80 Megabytes of gzip'd data is common for the XEmpty deltas. Once you have picked a base delta to start from, you will also need all deltas with higher numbers following it. Using <application>CTM</application> in Your Daily Life To apply the deltas, simply say: &prompt.root; cd /where/ever/you/want/the/stuff &prompt.root; ctm -v -v /where/you/store/your/deltas/src-xxx.* CTM understands deltas which have been put through gzip, so you do not need to gunzip them first, this saves disk space. Unless it feels very secure about the entire process, CTM will not touch your tree. To verify a delta you can also use the flag and CTM will not actually touch your tree; it will merely verify the integrity of the delta and see if it would apply cleanly to your current tree. There are other options to CTM as well, see the manual pages or look in the sources for more information. That is really all there is to it. Every time you get a new delta, just run it through CTM to keep your sources up to date. Do not remove the deltas if they are hard to download again. You just might want to keep them around in case something bad happens. Even if you only have floppy disks, consider using fdwrite to make a copy. Keeping Your Local Changes As a developer one would like to experiment with and change files in the source tree. CTM supports local modifications in a limited way: before checking for the presence of a file foo, it first looks for foo.ctm. If this file exists, CTM will operate on it instead of foo. This behavior gives us a simple way to maintain local changes: simply copy the files you plan to modify to the corresponding file names with a .ctm suffix. Then you can freely hack the code, while CTM keeps the .ctm file up-to-date. Other Interesting <application>CTM</application> Options Finding Out Exactly What Would Be Touched by an Update You can determine the list of changes that CTM will make on your source repository using the option to CTM. This is useful if you would like to keep logs of the changes, pre- or post- process the modified files in any manner, or just are feeling a tad paranoid. Making Backups Before Updating Sometimes you may want to backup all the files that would be changed by a CTM update. Specifying the option causes CTM to backup all files that would be touched by a given CTM delta to backup-file. Restricting the Files Touched by an Update Sometimes you would be interested in restricting the scope of a given CTM update, or may be interested in extracting just a few files from a sequence of deltas. You can control the list of files that CTM would operate on by specifying filtering regular expressions using the and options. For example, to extract an up-to-date copy of lib/libc/Makefile from your collection of saved CTM deltas, run the commands: &prompt.root; cd /where/ever/you/want/to/extract/it/ &prompt.root; ctm -e '^lib/libc/Makefile' ~ctm/src-xxx.* For every file specified in a CTM delta, the and options are applied in the order given on the command line. The file is processed by CTM only if it is marked as eligible after all the and options are applied to it. Future Plans for <application>CTM</application> Tons of them: Use some kind of authentication into the CTM system, so as to allow detection of spoofed CTM updates. Clean up the options to CTM, they became confusing and counter intuitive. Miscellaneous Stuff There is a sequence of deltas for the ports collection too, but interest has not been all that high yet. CTM Mirrors CTM/FreeBSD is available via anonymous FTP from the following mirror sites. If you choose to obtain CTM via anonymous FTP, please try to use a site near you. In case of problems, please contact the &a.ctm-users.name; mailing list. California, Bay Area, official source South Africa, backup server for old deltas Taiwan/R.O.C. If you did not find a mirror near to you or the mirror is incomplete, try to use a search engine such as alltheweb. Using CVSup Introduction CVSup is a software package for distributing and updating source trees from a master CVS repository on a remote server host. The FreeBSD sources are maintained in a CVS repository on a central development machine in California. With CVSup, FreeBSD users can easily keep their own source trees up to date. CVSup uses the so-called pull model of updating. Under the pull model, each client asks the server for updates, if and when they are wanted. The server waits passively for update requests from its clients. Thus all updates are instigated by the client. The server never sends unsolicited updates. Users must either run the CVSup client manually to get an update, or they must set up a cron job to run it automatically on a regular basis. The term CVSup, capitalized just so, refers to the entire software package. Its main components are the client cvsup which runs on each user's machine, and the server cvsupd which runs at each of the FreeBSD mirror sites. As you read the FreeBSD documentation and mailing lists, you may see references to sup. Sup was the predecessor of CVSup, and it served a similar purpose. CVSup is used much in the same way as sup and, in fact, uses configuration files which are backward-compatible with sup's. Sup is no longer used in the FreeBSD project, because CVSup is both faster and more flexible. Installation The easiest way to install CVSup is to use the precompiled net/cvsup package from the FreeBSD packages collection. If you prefer to build CVSup from source, you can use the net/cvsup port instead. But be forewarned: the net/cvsup port depends on the Modula-3 system, which takes a substantial amount of time and disk space to download and build. If you are going to be using CVSup on a machine which will not have &xfree86; or &xorg; installed, such as a server, be sure to use the port which does not include the CVSup GUI, net/cvsup-without-gui. CVSup Configuration CVSup's operation is controlled by a configuration file called the supfile. There are some sample supfiles in the directory /usr/share/examples/cvsup/. The information in a supfile answers the following questions for CVSup: Which files do you want to receive? Which versions of them do you want? Where do you want to get them from? Where do you want to put them on your own machine? Where do you want to put your status files? In the following sections, we will construct a typical supfile by answering each of these questions in turn. First, we describe the overall structure of a supfile. A supfile is a text file. Comments begin with # and extend to the end of the line. Lines that are blank and lines that contain only comments are ignored. Each remaining line describes a set of files that the user wishes to receive. The line begins with the name of a collection, a logical grouping of files defined by the server. The name of the collection tells the server which files you want. After the collection name come zero or more fields, separated by white space. These fields answer the questions listed above. There are two types of fields: flag fields and value fields. A flag field consists of a keyword standing alone, e.g., delete or compress. A value field also begins with a keyword, but the keyword is followed without intervening white space by = and a second word. For example, release=cvs is a value field. A supfile typically specifies more than one collection to receive. One way to structure a supfile is to specify all of the relevant fields explicitly for each collection. However, that tends to make the supfile lines quite long, and it is inconvenient because most fields are the same for all of the collections in a supfile. CVSup provides a defaulting mechanism to avoid these problems. Lines beginning with the special pseudo-collection name *default can be used to set flags and values which will be used as defaults for the subsequent collections in the supfile. A default value can be overridden for an individual collection, by specifying a different value with the collection itself. Defaults can also be changed or augmented in mid-supfile by additional *default lines. With this background, we will now proceed to construct a supfile for receiving and updating the main source tree of FreeBSD-CURRENT. Which files do you want to receive? The files available via CVSup are organized into named groups called collections. The collections that are available are described in the following section. In this example, we wish to receive the entire main source tree for the FreeBSD system. There is a single large collection src-all which will give us all of that. As a first step toward constructing our supfile, we simply list the collections, one per line (in this case, only one line): src-all Which version(s) of them do you want? With CVSup, you can receive virtually any version of the sources that ever existed. That is possible because the cvsupd server works directly from the CVS repository, which contains all of the versions. You specify which one of them you want using the tag= and value fields. Be very careful to specify any tag= fields correctly. Some tags are valid only for certain collections of files. If you specify an incorrect or misspelled tag, CVSup will delete files which you probably do not want deleted. In particular, use only tag=. for the ports-* collections. The tag= field names a symbolic tag in the repository. There are two kinds of tags, revision tags and branch tags. A revision tag refers to a specific revision. Its meaning stays the same from day to day. A branch tag, on the other hand, refers to the latest revision on a given line of development, at any given time. Because a branch tag does not refer to a specific revision, it may mean something different tomorrow than it means today. contains branch tags that users might be interested in. When specifying a tag in CVSup's configuration file, it must be preceded with tag= (RELENG_4 will become tag=RELENG_4). Keep in mind that only the tag=. is relevant for the Ports Collection. Be very careful to type the tag name exactly as shown. CVSup cannot distinguish between valid and invalid tags. If you misspell the tag, CVSup will behave as though you had specified a valid tag which happens to refer to no files at all. It will delete your existing sources in that case. When you specify a branch tag, you normally receive the latest versions of the files on that line of development. If you wish to receive some past version, you can do so by specifying a date with the value field. The &man.cvsup.1; manual page explains how to do that. For our example, we wish to receive FreeBSD-CURRENT. We add this line at the beginning of our supfile: *default tag=. There is an important special case that comes into play if you specify neither a tag= field nor a date= field. In that case, you receive the actual RCS files directly from the server's CVS repository, rather than receiving a particular version. Developers generally prefer this mode of operation. By maintaining a copy of the repository itself on their systems, they gain the ability to browse the revision histories and examine past versions of files. This gain is achieved at a large cost in terms of disk space, however. Where do you want to get them from? We use the host= field to tell cvsup where to obtain its updates. Any of the CVSup mirror sites will do, though you should try to select one that is close to you in cyberspace. In this example we will use a fictional FreeBSD distribution site, cvsup99.FreeBSD.org: *default host=cvsup99.FreeBSD.org You will need to change the host to one that actually exists before running CVSup. On any particular run of cvsup, you can override the host setting on the command line, with . Where do you want to put them on your own machine? The prefix= field tells cvsup where to put the files it receives. In this example, we will put the source files directly into our main source tree, /usr/src. The src directory is already implicit in the collections we have chosen to receive, so this is the correct specification: *default prefix=/usr Where should cvsup maintain its status files? The CVSup client maintains certain status files in what is called the base directory. These files help CVSup to work more efficiently, by keeping track of which updates you have already received. We will use the standard base directory, /var/db: *default base=/var/db If your base directory does not already exist, now would be a good time to create it. The cvsup client will refuse to run if the base directory does not exist. Miscellaneous supfile settings: There is one more line of boiler plate that normally needs to be present in the supfile: *default release=cvs delete use-rel-suffix compress release=cvs indicates that the server should get its information out of the main FreeBSD CVS repository. This is virtually always the case, but there are other possibilities which are beyond the scope of this discussion. delete gives CVSup permission to delete files. You should always specify this, so that CVSup can keep your source tree fully up-to-date. CVSup is careful to delete only those files for which it is responsible. Any extra files you happen to have will be left strictly alone. use-rel-suffix is ... arcane. If you really want to know about it, see the &man.cvsup.1; manual page. Otherwise, just specify it and do not worry about it. compress enables the use of gzip-style compression on the communication channel. If your network link is T1 speed or faster, you probably should not use compression. Otherwise, it helps substantially. Putting it all together: Here is the entire supfile for our example: *default tag=. *default host=cvsup99.FreeBSD.org *default prefix=/usr *default base=/var/db *default release=cvs delete use-rel-suffix compress src-all The <filename>refuse</filename> File As mentioned above, CVSup uses a pull method. Basically, this means that you connect to the CVSup server, and it says, Here is what you can download from me..., and your client responds OK, I will take this, this, this, and this. In the default configuration, the CVSup client will take every file associated with the collection and tag you chose in the configuration file. However, this is not always what you want, especially if you are synching the doc, ports, or www trees — most people cannot read four or five languages, and therefore they do not need to download the language-specific files. If you are CVSuping the Ports Collection, you can get around this by specifying each collection individually (e.g., ports-astrology, ports-biology, etc instead of simply saying ports-all). However, since the doc and www trees do not have language-specific collections, you must use one of CVSup's many nifty features: the refuse file. The refuse file essentially tells CVSup that it should not take every single file from a collection; in other words, it tells the client to refuse certain files from the server. The refuse file can be found (or, if you do not yet have one, should be placed) in base/sup/. base is defined in your supfile; our defined base is /var/db, which means that by default the refuse file is /var/db/sup/refuse. The refuse file has a very simple format; it simply contains the names of files or directories that you do not wish to download. For example, if you cannot speak any languages other than English and some German, and you do not feel the need to read the German translation of documentation, you can put the following in your refuse file: doc/bn_* doc/da_* doc/de_* doc/el_* doc/es_* doc/fr_* doc/it_* doc/ja_* doc/nl_* doc/no_* doc/pl_* doc/pt_* doc/ru_* doc/sr_* doc/tr_* doc/zh_* and so forth for the other languages (you can find the full list by browsing the FreeBSD CVS repository). With this very useful feature, those users who are on slow links or pay by the minute for their Internet connection will be able to save valuable time as they will no longer need to download files that they will never use. For more information on refuse files and other neat features of CVSup, please view its manual page. Running <application>CVSup</application> You are now ready to try an update. The command line for doing this is quite simple: &prompt.root; cvsup supfile where supfile is of course the name of the supfile you have just created. Assuming you are running under X11, cvsup will display a GUI window with some buttons to do the usual things. Press the go button, and watch it run. Since you are updating your actual /usr/src tree in this example, you will need to run the program as root so that cvsup has the permissions it needs to update your files. Having just created your configuration file, and having never used this program before, that might understandably make you nervous. There is an easy way to do a trial run without touching your precious files. Just create an empty directory somewhere convenient, and name it as an extra argument on the command line: &prompt.root; mkdir /var/tmp/dest &prompt.root; cvsup supfile /var/tmp/dest The directory you specify will be used as the destination directory for all file updates. CVSup will examine your usual files in /usr/src, but it will not modify or delete any of them. Any file updates will instead land in /var/tmp/dest/usr/src. CVSup will also leave its base directory status files untouched when run this way. The new versions of those files will be written into the specified directory. As long as you have read access to /usr/src, you do not even need to be root to perform this kind of trial run. If you are not running X11 or if you just do not like GUIs, you should add a couple of options to the command line when you run cvsup: &prompt.root; cvsup -g -L 2 supfile The tells CVSup not to use its GUI. This is automatic if you are not running X11, but otherwise you have to specify it. The tells CVSup to print out the details of all the file updates it is doing. There are three levels of verbosity, from to . The default is 0, which means total silence except for error messages. There are plenty of other options available. For a brief list of them, type cvsup -H. For more detailed descriptions, see the manual page. Once you are satisfied with the way updates are working, you can arrange for regular runs of CVSup using &man.cron.8;. Obviously, you should not let CVSup use its GUI when running it from &man.cron.8;. <application>CVSup</application> File Collections The file collections available via CVSup are organized hierarchically. There are a few large collections, and they are divided into smaller sub-collections. Receiving a large collection is equivalent to receiving each of its sub-collections. The hierarchical relationships among collections are reflected by the use of indentation in the list below. The most commonly used collections are src-all, and ports-all. The other collections are used only by small groups of people for specialized purposes, and some mirror sites may not carry all of them. cvs-all release=cvs The main FreeBSD CVS repository, including the cryptography code. distrib release=cvs Files related to the distribution and mirroring of FreeBSD. doc-all release=cvs Sources for the FreeBSD Handbook and other documentation. This does not include files for the FreeBSD web site. ports-all release=cvs The FreeBSD Ports Collection. If you do not want to update the whole of ports-all (the whole ports tree), but use one of the subcollections listed below, make sure that you always update the ports-base subcollection! Whenever something changes in the ports build infrastructure represented by ports-base, it is virtually certain that those changes will be used by real ports real soon. Thus, if you only update the real ports and they use some of the new features, there is a very high chance that their build will fail with some mysterious error message. The very first thing to do in this case is to make sure that your ports-base subcollection is up to date. If you are going to be building your own local copy of ports/INDEX, you must accept ports-all (the whole ports tree). Building ports/INDEX with a partial tree is not supported. See the FAQ. ports-accessibility release=cvs Software to help disabled users. ports-arabic release=cvs Arabic language support. ports-archivers release=cvs Archiving tools. ports-astro release=cvs Astronomical ports. ports-audio release=cvs Sound support. ports-base release=cvs The Ports Collection build infrastructure - various files located in the Mk/ and Tools/ subdirectories of /usr/ports. Please see the important warning above: you should always update this subcollection, whenever you update any part of the FreeBSD Ports Collection! ports-benchmarks release=cvs Benchmarks. ports-biology release=cvs Biology. ports-cad release=cvs Computer aided design tools. ports-chinese release=cvs Chinese language support. ports-comms release=cvs Communication software. ports-converters release=cvs character code converters. ports-databases release=cvs Databases. ports-deskutils release=cvs Things that used to be on the desktop before computers were invented. ports-devel release=cvs Development utilities. ports-dns release=cvs DNS related software. ports-editors release=cvs Editors. ports-emulators release=cvs Emulators for other operating systems. ports-finance release=cvs Monetary, financial and related applications. ports-ftp release=cvs FTP client and server utilities. ports-games release=cvs Games. ports-german release=cvs German language support. ports-graphics release=cvs Graphics utilities. ports-hebrew release=cvs Hebrew language support. ports-hungarian release=cvs Hungarian language support. ports-irc release=cvs Internet Relay Chat utilities. ports-japanese release=cvs Japanese language support. ports-java release=cvs &java; utilities. ports-korean release=cvs Korean language support. ports-lang release=cvs Programming languages. ports-mail release=cvs Mail software. ports-math release=cvs Numerical computation software. ports-mbone release=cvs MBone applications. ports-misc release=cvs Miscellaneous utilities. ports-multimedia release=cvs Multimedia software. ports-net release=cvs Networking software. ports-net-im release=cvs Instant messaging software. ports-net-mgmt release=cvs Network management software. ports-news release=cvs USENET news software. ports-palm release=cvs Software support for Palm series. ports-polish release=cvs Polish language support. ports-portuguese release=cvs Portuguese language support. ports-print release=cvs Printing software. ports-russian release=cvs Russian language support. ports-science release=cvs Science. ports-security release=cvs Security utilities. ports-shells release=cvs Command line shells. ports-sysutils release=cvs System utilities. ports-textproc release=cvs text processing utilities (does not include desktop publishing). ports-ukrainian release=cvs Ukrainian language support. ports-vietnamese release=cvs Vietnamese language support. ports-www release=cvs Software related to the World Wide Web. ports-x11 release=cvs Ports to support the X window system. ports-x11-clocks release=cvs X11 clocks. ports-x11-fm release=cvs X11 file managers. ports-x11-fonts release=cvs X11 fonts and font utilities. ports-x11-toolkits release=cvs X11 toolkits. ports-x11-servers release=cvs X11 servers. ports-x11-themes release=cvs X11 themes. ports-x11-wm release=cvs X11 window managers. src-all release=cvs The main FreeBSD sources, including the cryptography code. src-base release=cvs Miscellaneous files at the top of /usr/src. src-bin release=cvs User utilities that may be needed in single-user mode (/usr/src/bin). src-contrib release=cvs Utilities and libraries from outside the FreeBSD project, used relatively unmodified (/usr/src/contrib). src-crypto release=cvs Cryptography utilities and libraries from outside the FreeBSD project, used relatively unmodified (/usr/src/crypto). src-eBones release=cvs Kerberos and DES (/usr/src/eBones). Not used in current releases of FreeBSD. src-etc release=cvs System configuration files (/usr/src/etc). src-games release=cvs Games (/usr/src/games). src-gnu release=cvs Utilities covered by the GNU Public License (/usr/src/gnu). src-include release=cvs Header files (/usr/src/include). src-kerberos5 release=cvs Kerberos5 security package (/usr/src/kerberos5). src-kerberosIV release=cvs KerberosIV security package (/usr/src/kerberosIV). src-lib release=cvs Libraries (/usr/src/lib). src-libexec release=cvs System programs normally executed by other programs (/usr/src/libexec). src-release release=cvs Files required to produce a FreeBSD release (/usr/src/release). src-sbin release=cvs System utilities for single-user mode (/usr/src/sbin). src-secure release=cvs Cryptographic libraries and commands (/usr/src/secure). src-share release=cvs Files that can be shared across multiple systems (/usr/src/share). src-sys release=cvs The kernel (/usr/src/sys). src-sys-crypto release=cvs Kernel cryptography code (/usr/src/sys/crypto). src-tools release=cvs Various tools for the maintenance of FreeBSD (/usr/src/tools). src-usrbin release=cvs User utilities (/usr/src/usr.bin). src-usrsbin release=cvs System utilities (/usr/src/usr.sbin). www release=cvs The sources for the FreeBSD WWW site. distrib release=self The CVSup server's own configuration files. Used by CVSup mirror sites. gnats release=current The GNATS bug-tracking database. mail-archive release=current FreeBSD mailing list archive. www release=current The pre-processed FreeBSD WWW site files (not the source files). Used by WWW mirror sites. For More Information For the CVSup FAQ and other information about CVSup, see The CVSup Home Page. Most FreeBSD-related discussion of CVSup takes place on the &a.hackers;. New versions of the software are announced there, as well as on the &a.announce;. Questions and bug reports should be addressed to the author of the program at cvsup-bugs@polstra.com. CVSup Sites CVSup servers for FreeBSD are running at the following sites: &chap.mirrors.cvsup.inc; Using Portsnap Introduction Portsnap is a system for securely distributing the &os; ports tree. Approximately once an hour, a snapshot of the ports tree is generated, repackaged, and cryptographically signed. The resulting files are then distributed via HTTP. Like CVSup, Portsnap uses a pull model of updating: The packaged and signed ports trees are placed on a web server which waits passively for clients to request files. Users must either run &man.portsnap.8; manually to download updates or set up a &man.cron.8; job to download updates automatically on a regular basis. For technical reasons, Portsnap does not update the live ports tree in /usr/ports/ directly; instead, it works via a compressed copy of the ports tree stored in /var/db/portsnap/ by default. This compressed copy is then used to update the live ports tree. If Portsnap is installed from the &os; Ports Collection, then the default location for its compressed snapshot will be /usr/local/portsnap/ instead of /var/db/portsnap/. Installation On &os; 6.0 and more recent versions, Portsnap is contained in the &os; base system. On older versions of &os;, it can be installed using the sysutils/portsnap port. Portsnap Configuration Portsnap's operation is controlled by the /etc/portsnap.conf configuration file. For most users, the default configuration file will suffice; for more details, consult the &man.portsnap.conf.5; manual page. If Portsnap is installed from the &os; Ports Collection, it will use the configuration file /usr/local/etc/portsnap.conf instead of /etc/portsnap.conf. This configuration file is not created when the port is installed, but a sample configuration file is distributed; to copy it into place, run the following command: - &prompt.root; cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf + &prompt.root; cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf Running <application>Portsnap</application> for the First Time The first time &man.portsnap.8; is run, it will need to download a compressed snapshot of the entire ports tree into /var/db/portsnap/ (or /usr/local/portsnap/ if Portsnap was installed from the - Ports Collection). This is approximately a 36 MB + Ports Collection). This is approximately a 38 MB download. &prompt.root; portsnap fetch Once the compressed snapshot has been downloaded, a live copy of the ports tree can be extracted into /usr/ports/. This is necessary even if a ports tree has already been created in that directory (e.g., by using CVSup), since it establishes a baseline from which portsnap can determine which parts of the ports tree need to be updated later. In the default installation /usr/ports is not created. It should be created before portsnap is used. &prompt.root; mkdir /usr/ports &prompt.root; portsnap extract Updating the Ports Tree After an initial compressed snapshot of the ports tree has been downloaded and extracted into /usr/ports/, updating the ports tree consists of two steps: fetching updates to the compressed snapshot, and using them to update the live ports tree. These two steps can be specified to portsnap as a single command: &prompt.root; portsnap fetch update Some older versions of portsnap do not support this syntax; if it fails, try instead the following: &prompt.root; portsnap fetch &prompt.root; portsnap update Running Portsnap from cron In order to avoid problems with flash crowds accessing the Portsnap servers, portsnap fetch will not run from a &man.cron.8; job. Instead, a special portsnap cron command exists, which waits for a random duration up to 3600 seconds before fetching updates. In addition, it is strongly recommended that portsnap update not be run from a cron job, since it is liable to cause major problems if it happens to run at the same time as a port is being built or installed. However, it is safe to update the ports INDEX files, and this can be done by passing the flag to portsnap. (Obviously, if portsnap -I update is run from cron, then it will be necessary to run portsnap update without the flag at a later time in order to update the rest of the tree.) Adding the following line to /etc/crontab will cause portsnap to update its compressed snapshot and the INDEX files in /usr/ports/, and will send an email if any installed ports are out of date: - 0 3 * * * root portsnap -I cron update && pkg_version -vIL= + 0 3 * * * root portsnap -I cron update && pkg_version -vIL= If the system clock is not set to the local time zone, please replace 3 with a random value between 0 and 23, in order to spread the load on the Portsnap servers more evenly. Some older versions of portsnap do not support listing multiple commands (e.g., cron update) in the same invocation of portsnap. If the line above fails, try replacing portsnap -I cron update with - portsnap cron && portsnap -I update. + portsnap cron && portsnap -I update. CVS Tags When obtaining or updating sources using cvs or CVSup, a revision tag must be specified. A revision tag refers to either a particular line of &os; development, or a specific point in time. The first type are called branch tags, and the second type are called release tags. Branch Tags All of these, with the exception of HEAD (which is always a valid tag), only apply to the src/ tree. The ports/, doc/, and www/ trees are not branched. HEAD Symbolic name for the main line, or FreeBSD-CURRENT. Also the default when no revision is specified. In CVSup, this tag is represented by a . (not punctuation, but a literal . character). In CVS, this is the default when no revision tag is specified. It is usually not a good idea to checkout or update to CURRENT sources on a STABLE machine, unless that is your intent. RELENG_6 The line of development for FreeBSD-6.X, also known as FreeBSD 6-STABLE RELENG_6_0 The release branch for FreeBSD-6.0, used only for security advisories and other critical fixes. RELENG_5 The line of development for FreeBSD-5.X, also known as FreeBSD 5-STABLE. RELENG_5_4 The release branch for FreeBSD-5.4, used only for security advisories and other critical fixes. RELENG_5_3 The release branch for FreeBSD-5.3, used only for security advisories and other critical fixes. RELENG_5_2 The release branch for FreeBSD-5.2 and FreeBSD-5.2.1, used only for security advisories and other critical fixes. RELENG_5_1 The release branch for FreeBSD-5.1, used only for security advisories and other critical fixes. RELENG_5_0 The release branch for FreeBSD-5.0, used only for security advisories and other critical fixes. RELENG_4 The line of development for FreeBSD-4.X, also known as FreeBSD 4-STABLE. RELENG_4_11 The release branch for FreeBSD-4.11, used only for security advisories and other critical fixes. RELENG_4_10 The release branch for FreeBSD-4.10, used only for security advisories and other critical fixes. RELENG_4_9 The release branch for FreeBSD-4.9, used only for security advisories and other critical fixes. RELENG_4_8 The release branch for FreeBSD-4.8, used only for security advisories and other critical fixes. RELENG_4_7 The release branch for FreeBSD-4.7, used only for security advisories and other critical fixes. RELENG_4_6 The release branch for FreeBSD-4.6 and FreeBSD-4.6.2, used only for security advisories and other critical fixes. RELENG_4_5 The release branch for FreeBSD-4.5, used only for security advisories and other critical fixes. RELENG_4_4 The release branch for FreeBSD-4.4, used only for security advisories and other critical fixes. RELENG_4_3 The release branch for FreeBSD-4.3, used only for security advisories and other critical fixes. RELENG_3 The line of development for FreeBSD-3.X, also known as 3.X-STABLE. RELENG_2_2 The line of development for FreeBSD-2.2.X, also known as 2.2-STABLE. This branch is mostly obsolete. Release Tags These tags refer to a specific point in time when a particular version of &os; was released. The release engineering process is documented in more detail by the Release Engineering Information and Release Process documents. The src tree uses tag names that start with RELENG_ tags. The ports and doc trees use tags whose names begin with RELEASE tags. Finally, the www tree is not tagged with any special name for releases. + + RELENG_6_0_0_RELEASE + + + FreeBSD 6.0 + + + RELENG_5_4_0_RELEASE FreeBSD 5.4 RELENG_4_11_0_RELEASE FreeBSD 4.11 RELENG_5_3_0_RELEASE FreeBSD 5.3 RELENG_4_10_0_RELEASE FreeBSD 4.10 RELENG_5_2_1_RELEASE FreeBSD 5.2.1 RELENG_5_2_0_RELEASE FreeBSD 5.2 RELENG_4_9_0_RELEASE FreeBSD 4.9 RELENG_5_1_0_RELEASE FreeBSD 5.1 RELENG_4_8_0_RELEASE FreeBSD 4.8 RELENG_5_0_0_RELEASE FreeBSD 5.0 RELENG_4_7_0_RELEASE FreeBSD 4.7 RELENG_4_6_2_RELEASE FreeBSD 4.6.2 RELENG_4_6_1_RELEASE FreeBSD 4.6.1 RELENG_4_6_0_RELEASE FreeBSD 4.6 RELENG_4_5_0_RELEASE FreeBSD 4.5 RELENG_4_4_0_RELEASE FreeBSD 4.4 RELENG_4_3_0_RELEASE FreeBSD 4.3 RELENG_4_2_0_RELEASE FreeBSD 4.2 RELENG_4_1_1_RELEASE FreeBSD 4.1.1 RELENG_4_1_0_RELEASE FreeBSD 4.1 RELENG_4_0_0_RELEASE FreeBSD 4.0 RELENG_3_5_0_RELEASE FreeBSD-3.5 RELENG_3_4_0_RELEASE FreeBSD-3.4 RELENG_3_3_0_RELEASE FreeBSD-3.3 RELENG_3_2_0_RELEASE FreeBSD-3.2 RELENG_3_1_0_RELEASE FreeBSD-3.1 RELENG_3_0_0_RELEASE FreeBSD-3.0 RELENG_2_2_8_RELEASE FreeBSD-2.2.8 RELENG_2_2_7_RELEASE FreeBSD-2.2.7 RELENG_2_2_6_RELEASE FreeBSD-2.2.6 RELENG_2_2_5_RELEASE FreeBSD-2.2.5 RELENG_2_2_2_RELEASE FreeBSD-2.2.2 RELENG_2_2_1_RELEASE FreeBSD-2.2.1 RELENG_2_2_0_RELEASE FreeBSD-2.2.0 AFS Sites AFS servers for FreeBSD are running at the following sites: Sweden The path to the files are: /afs/stacken.kth.se/ftp/pub/FreeBSD/ stacken.kth.se # Stacken Computer Club, KTH, Sweden 130.237.234.43 #hot.stacken.kth.se 130.237.237.230 #fishburger.stacken.kth.se 130.237.234.3 #milko.stacken.kth.se Maintainer ftp@stacken.kth.se rsync Sites The following sites make FreeBSD available through the rsync protocol. The rsync utility works in much the same way as the &man.rcp.1; command, but has more options and uses the rsync remote-update protocol which transfers only the differences between two sets of files, thus greatly speeding up the synchronization over the network. This is most useful if you are a mirror site for the FreeBSD FTP server, or the CVS repository. The rsync suite is available for many operating systems, on FreeBSD, see the net/rsync port or use the package. Czech Republic rsync://ftp.cz.FreeBSD.org/ Available collections: ftp: A partial mirror of the FreeBSD FTP server. FreeBSD: A full mirror of the FreeBSD FTP server. Germany rsync://grappa.unix-ag.uni-kl.de/ Available collections: freebsd-cvs: The full FreeBSD CVS repository. This machine also mirrors the CVS repositories of the NetBSD and the OpenBSD projects, among others. Netherlands rsync://ftp.nl.FreeBSD.org/ Available collections: vol/4/freebsd-core: A full mirror of the FreeBSD FTP server. United Kingdom rsync://rsync.mirror.ac.uk/ Available collections: ftp.FreeBSD.org: A full mirror of the FreeBSD FTP server. United States of America rsync://ftp-master.FreeBSD.org/ This server may only be used by FreeBSD primary mirror sites. Available collections: FreeBSD: The master archive of the FreeBSD FTP server. acl: The FreeBSD master ACL list. rsync://ftp13.FreeBSD.org/ Available collections: FreeBSD: A full mirror of the FreeBSD FTP server.
diff --git a/zh_TW.Big5/books/handbook/multimedia/chapter.sgml b/zh_TW.Big5/books/handbook/multimedia/chapter.sgml index c7e9e90a67..95977e1b60 100644 --- a/zh_TW.Big5/books/handbook/multimedia/chapter.sgml +++ b/zh_TW.Big5/books/handbook/multimedia/chapter.sgml @@ -1,1865 +1,1855 @@ Ross Lippert Edited by - Multimedia + ¦h´CÅé¼v­µ®T¼Ö(Multimedia) - Synopsis - - FreeBSD supports a wide variety of sound cards, allowing you - to enjoy high fidelity output from your computer. This includes - the ability to record and playback audio in the MPEG Audio Layer - 3 (MP3), WAV, and Ogg Vorbis formats as well as many other - formats. The FreeBSD Ports Collection also contains - applications allowing you to edit your recorded audio, add sound - effects, and control attached MIDI devices. - - With some willingness to experiment, FreeBSD can support - playback of video files and DVD's. The number of applications - to encode, convert, and playback various video media is more - limited than the number of sound applications. For example as - of this writing, there is no good re-encoding application in the - FreeBSD Ports Collection, which could be use to convert - between formats, as there is with audio/sox. However, the software - landscape in this area is changing rapidly. - - This chapter will describe the necessary steps to configure - your sound card. The configuration and installation of X11 - () has already taken care of the - hardware issues for your video card, though there may be some - tweaks to apply for better playback. - - After reading this chapter, you will know: + ·§­z + + FreeBSD ¼sªx¦a¤ä´©¦UºØ­µ®Ä¥d¡A Åý±z¥i¥H¨É¨ü¨Ó¦Û¹q¸£¤Wªº°ª¶Ç¯u­µ½è(Hi-Fi)¡A + ¦¹¥~ÁÙ¥]¬A¤F¿ý»s©M¼½©ñ MPEG Audio Layer 3 (MP3)¡B WAV¡B ¥H¤Î Ogg Vorbis + µ¥³\¦hºØ®æ¦¡Án­µªº¯à¤O¡C¦P®É FreeBSD Ports Collection ¤]¥]¬A¤F³\¦hªºÀ³¥Îµ{¦¡¡A + Åý±z¥i¥H¿ý­µ¡B½s­×­µ®Ä¥H¤Î±±¨î MIDI °t³Æ¡C + + ­n¬O³ßÅw°Ê¤â¹Á¸Õ¤£¦PªºÅéÅç¡A FreeBSD ¤]¯à¼½©ñ¤@¯ëªºµø°TÀÉ©M DVD¡C + ½s½X¡BÂà´«©M¼½©ñµø°Tªºµ{¦¡¤ñ°_³B²zÁn­µªºµ{¦¡²¤¤Ö¤@¨Ç¡C¨Ò¦p¡A ¦b¼¶¼g³o³¹®É¡A + FreeBSD Ports Collection ¤¤ÁÙ¨S¦³Ãþ¦ü audio/sox ¨º¼Ë¦n¥Îªº½s½X¤u¨ã¡A¯à°÷¥Î¨ÓÂà´«¤£¦Pªº®æ¦¡¡C + ¤£¹L¡A³o­Ó»â°ìªº³nÅé¬ãµo¶i®i¬O¬Û·í¨³³tªº¡C + + ¥»³¹±N¤¶²Ð³]©w­µ®Ä¥dªº¥²­n¨BÆJ¡C¥ý«e¤¶²Ð¨ìªº X11 + () ¦w¸Ë©M³]©w¸Ì¡A¤w¸gÁ¿¨ì¤FÅã¥Ü¥dªº³¡¥÷¡A + ¦ý­n·Q¦³§ó¦nªº¼½©ñ®ÄªG¡A ¤´»Ý­n¤@¨Ç²Ó³¡½Õ¾ã¡C + + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡G - How to configure your system so that your sound card is - recognized. + ¦p¦ó³]©w¨t²Î¡A¥H¥¿½TÃѧO­µ®Ä¥d¡C Methods to test that your card is working using sample applications. - How to troubleshoot your sound setup. + ¦p¦ó¸Ñ¨M­µ®Ä¥dªº³]©w°ÝÃD¡C How to playback and encode MP3s and other audio. How video is supported by the X server. Some video player/encoder ports which give good results. - How to playback DVD's, .mpg and - .avi files. + ¦p¦ó¼½©ñ DVD ªº .mpg ¤Î + .avi ÀÉ - How to rip CD and DVD information into files. + ¦p¦ó±q CD ©M DVD ¤¤Â^¨ú(rip)ÀɮסC - How to configure a TV card. + ¦p¦ó³]©w¹qµø¥d - How to configure an image scanner. + ¦p¦ó³]©w±½´y¾¹ - Before reading this chapter, you should: + ¦b¾\Ū³o³¹¤§«e¡A±zÀ³·í¤F¸Ñ¡G - Know how to configure and install a new kernel (). + ª¾¹D¦p¦ó³]©w¡B¦w¸Ë·sªº kernel ()¡C Trying to mount audio CDs with the &man.mount.8; command will result in an error, at least, and a kernel panic, at worst. These media have specialized encodings which differ from the usual ISO-filesystem. Moses Moore Contributed by Marc Fonvieille Enhanced for &os; 5.X by - Setting Up the Sound Card + ³]©w­µ®Ä¥d Configuring the System PCI ISA sound cards Before you begin, you should know the model of the card you have, the chip it uses, and whether it is a PCI or ISA card. FreeBSD supports a wide variety of both PCI and ISA cards. Check the supported audio devices list of the Hardware Notes to see if your card is supported. This document will also mention which driver supports your card. kernel configuration To use your sound device, you will need to load the proper device driver. This may be accomplished in one of two ways. The easiest way is to simply load a kernel module for your sound card with &man.kldload.8; which can either be done from the command line: &prompt.root; kldload snd_emu10k1 or by adding the appropriate line to the file /boot/loader.conf like this: snd_emu10k1_load="YES" These examples are for a Creative &soundblaster; Live! sound card. Other available loadable sound modules are listed in /boot/defaults/loader.conf. If you are not sure which driver to use, you may try to load the snd_driver module: &prompt.root; kldload snd_driver This is a metadriver loading the most common device drivers at once. This speeds up the search for the correct driver. It is also possible to load all sound drivers via the /boot/loader.conf facility. If you wish to find out the driver selected for your soundcard after loading the snd_driver metadriver, you may check the /dev/sndstat file with the cat /dev/sndstat command. Under &os; 4.X, to load all sound drivers, you have to load the snd module instead of snd_driver. A second method is to statically compile in support for your sound card in your kernel. The section below provides the information you need to add support for your hardware in this manner. For more information about recompiling your kernel, please see . Configuring a Custom Kernel with Sound Support The first thing to do is adding the generic audio driver &man.sound.4; to the kernel, for that you will need to add the following line to the kernel configuration file: device sound Under &os; 4.X, you would use the following line: device pcm Then we have to add the support for our sound card. Therefore, we need to know which driver supports the card. Check the supported audio devices list of the Hardware Notes, to determine the correct driver for your sound card. For example, a Creative &soundblaster; Live! sound card is supported by the &man.snd.emu10k1.4; driver. To add the support for this card, use the following: device "snd_emu10k1" Be sure to read the manual page of the driver for the syntax to use. Information regarding the syntax of sound drivers in the kernel configuration can also be found in the /usr/src/sys/conf/NOTES file (/usr/src/sys/i386/conf/LINT for &os; 4.X). Non-PnP ISA cards may require you to provide the kernel with information on the sound card settings (IRQ, I/O port, etc). This is done via the /boot/device.hints file. At system boot, the &man.loader.8; will read this file and pass the settings to the kernel. For example, an old Creative &soundblaster; 16 ISA non-PnP card will use the &man.snd.sbc.4; driver in conjunction with snd_sb16(4). For this card the following lines have to be added to the kernel configuration file: device snd_sbc device snd_sb16 as well as the following in /boot/device.hints: hint.sbc.0.at="isa" hint.sbc.0.port="0x220" hint.sbc.0.irq="5" hint.sbc.0.drq="1" hint.sbc.0.flags="0x15" In this case, the card uses the 0x220 I/O port and the IRQ 5. The syntax used in the /boot/device.hints file is covered in the sound driver manual page. On &os; 4.X, these settings are directly written in the kernel configuration file. In the case of our ISA card, we would only use this line: device sbc0 at isa? port 0x220 irq 5 drq 1 flags 0x15 The settings shown above are the defaults. In some cases, you may need to change the IRQ or the other settings to match your card. See the &man.snd.sbc.4; manual page for more information. Under &os; 4.X, some systems with built-in motherboard sound devices may require the following option in the kernel configuration: options PNPBIOS Testing the Sound Card After rebooting with the modified kernel, or after loading the required module, the sound card should appear in your system message buffer (&man.dmesg.8;) as something like: pcm0: <Intel ICH3 (82801CA)> port 0xdc80-0xdcbf,0xd800-0xd8ff irq 5 at device 31.5 on pci0 pcm0: [GIANT-LOCKED] pcm0: <Cirrus Logic CS4205 AC97 Codec> The status of the sound card may be checked via the /dev/sndstat file: &prompt.root; cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: <Intel ICH3 (82801CA)> at io 0xd800, 0xdc80 irq 5 bufsz 16384 kld snd_ich (1p/2r/0v channels duplex default) The output from your system may vary. If no pcm devices show up, go back and review what was done earlier. Go through your kernel configuration file again and make sure the correct device is chosen. Common problems are listed in . If all goes well, you should now have a functioning sound card. If your CD-ROM or DVD-ROM drive is properly coupled to your sound card, you can put a CD in the drive and play it with &man.cdcontrol.1;: &prompt.user; cdcontrol -f /dev/acd0 play 1 Various applications, such as audio/workman can provide a friendlier interface. You may want to install an application such as audio/mpg123 to listen to MP3 audio files. A quick way to test the card is sending data to the /dev/dsp, like this: &prompt.user; cat filename > /dev/dsp where filename can be any file. This command line should produce some noise, confirming the sound card is actually working. &os; 4.X users need to create the sound card device nodes before being able to use it. If the card showed up in message buffer as pcm0, you will have to run the following as root: &prompt.root; cd /dev &prompt.root; sh MAKEDEV snd0 If the card detection returned pcm1, follow the same steps as shown above, replacing snd0 with snd1. MAKEDEV will create a group of device nodes that will be used by the different sound related applications. Sound card mixer levels can be changed via the &man.mixer.8; command. More details can be found in the &man.mixer.8; manual page. Common Problems device nodes I/O port IRQ DSP Error Solution unsupported subdevice XX One or more of the device nodes was not created correctly. Repeat the steps above. sb_dspwr(XX) timed out The I/O port is not set correctly. bad irq XX The IRQ is set incorrectly. Make sure that the set IRQ and the sound IRQ are the same. xxx: gus pcm not attached, out of memory There is not enough available memory to use the device. xxx: can't open /dev/dsp! Check with fstat | grep dsp if another application is holding the device open. Noteworthy troublemakers are esound and KDE's sound support. Munish Chopra Contributed by Utilizing Multiple Sound Sources It is often desirable to have multiple sources of sound that are able to play simultaneously, such as when esound or artsd do not support sharing of the sound device with a certain application. FreeBSD lets you do this through Virtual Sound Channels, which can be set with the &man.sysctl.8; facility. Virtual channels allow you to multiplex your sound card's playback channels by mixing sound in the kernel. To set the number of virtual channels, there are two sysctl knobs which, if you are the root user, can be set like this: &prompt.root; sysctl hw.snd.pcm0.vchans=4 &prompt.root; sysctl hw.snd.maxautovchans=4 The above example allocates four virtual channels, which is a practical number for everyday use. hw.snd.pcm0.vchans is the number of virtual channels pcm0 has, and is configurable once a device has been attached. hw.snd.maxautovchans is the number of virtual channels a new audio device is given when it is attached using &man.kldload.8;. Since the pcm module can be loaded independently of the hardware drivers, hw.snd.maxautovchans can store how many virtual channels any devices which are attached later will be given. You cannot change the number of virtual channels for a device while it is in use. First close any programs using the device, such as music players or sound daemons. If you are not using &man.devfs.5;, you will have to point your applications at /dev/dsp0.x, where x is 0 to 3 if hw.snd.pcm.0.vchans is set to 4 as in the above example. On a system using &man.devfs.5;, the above will automatically be allocated transparently to the user. Josef El-Rayes Contributed by Setting Default Values for Mixer Channels The default values for the different mixer channels are hardcoded in the sourcecode of the &man.pcm.4; driver. There are a lot of different applications and daemons that allow you to set values for the mixer they remember and set each time they are started, but this is not a clean solution, we want to have default values at the driver level. This is accomplished by defining the appropriate values in /boot/device.hints. E.g.: hint.pcm.0.vol="100" This will set the volume channel to a default value of 100, as soon as the &man.pcm.4; module gets loaded. This is only supported in &os; 5.3-RELEASE and later. Chern Lee Contributed by - MP3 Audio + MP3 ­µ¼Ö MP3 (MPEG Layer 3 Audio) accomplishes near CD-quality sound, leaving no reason to let your FreeBSD workstation fall short of its offerings. MP3 Players By far, the most popular X11 MP3 player is XMMS (X Multimedia System). Winamp skins can be used with XMMS since the GUI is almost identical to that of Nullsoft's Winamp. XMMS also has native plug-in support. XMMS can be installed from the multimedia/xmms port or package. XMMS' interface is intuitive, with a playlist, graphic equalizer, and more. Those familiar with Winamp will find XMMS simple to use. The audio/mpg123 port is an alternative, command-line MP3 player. mpg123 can be run by specifying the sound device and the MP3 file on the command line, as shown below: &prompt.root; mpg123 -a /dev/dsp1.0 Foobar-GreatestHits.mp3 High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3. Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp. Uses code from various people. See 'README' for more! THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK! Playing MPEG stream from Foobar-GreatestHits.mp3 ... MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo /dev/dsp1.0 should be replaced with the dsp device entry on your system. Ripping CD Audio Tracks Before encoding a CD or CD track to MP3, the audio data on the CD must be ripped onto the hard drive. This is done by copying the raw CDDA (CD Digital Audio) data to WAV files. The cdda2wav tool, which is a part of the sysutils/cdrtools suite, is used for ripping audio information from CDs and the information associated with them. With the audio CD in the drive, the following command can be issued (as root) to rip an entire CD into individual (per track) WAV files: &prompt.root; cdda2wav -D 0,1,0 -B cdda2wav will support ATAPI (IDE) CDROM drives. To rip from an IDE drive, specify the device name in place of the SCSI unit numbers. For example, to rip track 7 from an IDE drive: &prompt.root; cdda2wav -D /dev/acd0a -t 7 The indicates the SCSI device 0,1,0, which corresponds to the output of cdrecord -scanbus. To rip individual tracks, make use of the option as shown: &prompt.root; cdda2wav -D 0,1,0 -t 7 This example rips track seven of the audio CDROM. To rip a range of tracks, for example, track one to seven, specify a range: &prompt.root; cdda2wav -D 0,1,0 -t 1+7 The utility &man.dd.1; can also be used to extract audio tracks on ATAPI drives, read for more information on that possibility. Encoding MP3s Nowadays, the mp3 encoder of choice is lame. Lame can be found at audio/lame in the ports tree. Using the ripped WAV files, the following command will convert audio01.wav to audio01.mp3: &prompt.root; lame -h -b 128 \ --tt "Foo Song Title" \ --ta "FooBar Artist" \ --tl "FooBar Album" \ --ty "2001" \ --tc "Ripped and encoded by Foo" \ --tg "Genre" \ audio01.wav audio01.mp3 128 kbits seems to be the standard MP3 bitrate in use. Many enjoy the higher quality 160, or 192. The higher the bitrate, the more disk space the resulting MP3 will consume--but the quality will be higher. The option turns on the higher quality but a little slower mode. The options beginning with indicate ID3 tags, which usually contain song information, to be embedded within the MP3 file. Additional encoding options can be found by consulting the lame man page. Decoding MP3s In order to burn an audio CD from MP3s, they must be converted to a non-compressed WAV format. Both XMMS and mpg123 support the output of MP3 to an uncompressed file format. Writing to Disk in XMMS: Launch XMMS. Right-click on the window to bring up the XMMS menu. Select Preference under Options. Change the Output Plugin to Disk Writer Plugin. Press Configure. Enter (or choose browse) a directory to write the uncompressed files to. Load the MP3 file into XMMS as usual, with volume at 100% and EQ settings turned off. Press PlayXMMS will appear as if it is playing the MP3, but no music will be heard. It is actually playing the MP3 to a file. Be sure to set the default Output Plugin back to what it was before in order to listen to MP3s again. Writing to stdout in mpg123: Run mpg123 -s audio01.mp3 > audio01.pcm XMMS writes a file in the WAV format, while mpg123 converts the MP3 into raw PCM audio data. Both of these formats can be used with cdrecord to create audio CDs. You have to use raw PCM with &man.burncd.8;. If you use WAV files, you will notice a small tick sound at the beginning of each track, this sound is the header of the WAV file. You can simply remove the header of a WAV file with the utility SoX (it can be installed from the audio/sox port or package): &prompt.user; sox -t wav -r 44100 -s -w -c 2 track.wav track.raw Read for more information on using a CD burner in FreeBSD. Ross Lippert Contributed by - Video Playback + ¼½©ñ¼v¤ù Video playback is a very new and rapidly developing application area. Be patient. Not everything is going to work as smoothly as it did with sound. Before you begin, you should know the model of the video card you have and the chip it uses. While &xorg; and &xfree86; support a wide variety of video cards, fewer give good playback performance. To obtain a list of extensions supported by the X server using your card use the command &man.xdpyinfo.1; while X11 is running. It is a good idea to have a short MPEG file which can be treated as a test file for evaluating various players and options. Since some DVD players will look for DVD media in /dev/dvd by default, or have this device name hardcoded in them, you might find it useful to make symbolic links to the proper devices: &prompt.root; ln -sf /dev/acd0c /dev/dvd &prompt.root; ln -sf /dev/racd0c /dev/rdvd On FreeBSD 5.X, which uses &man.devfs.5; there is a slightly different set of recommended links: &prompt.root; ln -sf /dev/acd0 /dev/dvd &prompt.root; ln -sf /dev/acd0 /dev/rdvd Note that due to the nature of &man.devfs.5;, manually created links like these will not persist if you reboot your system. In order to create the symbolic links automatically whenever you boot your system, add the following lines to /etc/devfs.conf: link acd0 dvd link acd0 rdvd Additionally, DVD decryption, which requires invoking special DVD-ROM functions, requires write permission on the DVD devices. kernel options CPU_ENABLE_SSE kernel options USER_LDT Some of the ports discussed rely on the following kernel options to build correctly. Before attempting to build, add this option to the kernel configuration file, build a new kernel, and reboot: options CPU_ENABLE_SSE On &os; 4.X options USER_LDT should be added to the kernel configuration file. This option is not available on &os; 5.X and later version. To enhance the shared memory X11 interface, it is recommended that the values of some &man.sysctl.8; variables should be increased: kern.ipc.shmmax=67108864 kern.ipc.shmall=32768 Determining Video Capabilities XVideo SDL DGA There are several possible ways to display video under X11. What will really work is largely hardware dependent. Each method described below will have varying quality across different hardware. Secondly, the rendering of video in X11 is a topic receiving a lot of attention lately, and with each version of &xorg;, or of &xfree86;, there may be significant improvement. A list of common video interfaces: X11: normal X11 output using shared memory. XVideo: an extension to the X11 interface which supports video in any X11 drawable. SDL: the Simple Directmedia Layer. DGA: the Direct Graphics Access. SVGAlib: low level console graphics layer. XVideo &xorg; and &xfree86; 4.X have an extension called XVideo (aka Xvideo, aka Xv, aka xv) which allows video to be directly displayed in drawable objects through a special acceleration. This extension provides very good quality playback even on low-end machines. To check whether the extension is running, use xvinfo: &prompt.user; xvinfo XVideo is supported for your card if the result looks like: X-Video Extension version 2.2 screen #0 Adaptor #0: "Savage Streams Engine" number of ports: 1 port base: 43 operations supported: PutImage supported visuals: depth 16, visualID 0x22 depth 16, visualID 0x23 number of attributes: 5 "XV_COLORKEY" (range 0 to 16777215) client settable attribute client gettable attribute (current value is 2110) "XV_BRIGHTNESS" (range -128 to 127) client settable attribute client gettable attribute (current value is 0) "XV_CONTRAST" (range 0 to 255) client settable attribute client gettable attribute (current value is 128) "XV_SATURATION" (range 0 to 255) client settable attribute client gettable attribute (current value is 128) "XV_HUE" (range -180 to 180) client settable attribute client gettable attribute (current value is 0) maximum XvImage size: 1024 x 1024 Number of image formats: 7 id: 0x32595559 (YUY2) guid: 59555932-0000-0010-8000-00aa00389b71 bits per pixel: 16 number of planes: 1 type: YUV (packed) id: 0x32315659 (YV12) guid: 59563132-0000-0010-8000-00aa00389b71 bits per pixel: 12 number of planes: 3 type: YUV (planar) id: 0x30323449 (I420) guid: 49343230-0000-0010-8000-00aa00389b71 bits per pixel: 12 number of planes: 3 type: YUV (planar) id: 0x36315652 (RV16) guid: 52563135-0000-0000-0000-000000000000 bits per pixel: 16 number of planes: 1 type: RGB (packed) depth: 0 red, green, blue masks: 0x1f, 0x3e0, 0x7c00 id: 0x35315652 (RV15) guid: 52563136-0000-0000-0000-000000000000 bits per pixel: 16 number of planes: 1 type: RGB (packed) depth: 0 red, green, blue masks: 0x1f, 0x7e0, 0xf800 id: 0x31313259 (Y211) guid: 59323131-0000-0010-8000-00aa00389b71 bits per pixel: 6 number of planes: 3 type: YUV (packed) id: 0x0 guid: 00000000-0000-0000-0000-000000000000 bits per pixel: 0 number of planes: 0 type: RGB (packed) depth: 1 red, green, blue masks: 0x0, 0x0, 0x0 Also note that the formats listed (YUV2, YUV12, etc) are not present with every implementation of XVideo and their absence may hinder some players. If the result looks like: X-Video Extension version 2.2 screen #0 no adaptors present Then XVideo is probably not supported for your card. If XVideo is not supported for your card, this only means that it will be more difficult for your display to meet the computational demands of rendering video. Depending on your video card and processor, though, you might still be able to have a satisfying experience. You should probably read about ways of improving performance in the advanced reading . Simple Directmedia Layer The Simple Directmedia Layer, SDL, was intended to be a porting layer between µsoft.windows;, BeOS, and &unix;, allowing cross-platform applications to be developed which made efficient use of sound and graphics. The SDL layer provides a low-level abstraction to the hardware which can sometimes be more efficient than the X11 interface. The SDL can be found at devel/sdl12. Direct Graphics Access Direct Graphics Access is an X11 extension which allows a program to bypass the X server and directly alter the framebuffer. Because it relies on a low level memory mapping to effect this sharing, programs using it must be run as root. The DGA extension can be tested and benchmarked by &man.dga.1;. When dga is running, it changes the colors of the display whenever a key is pressed. To quit, use q. Ports and Packages Dealing with Video video ports video packages This section discusses the software available from the FreeBSD Ports Collection which can be used for video playback. Video playback is a very active area of software development, and the capabilities of various applications are bound to diverge somewhat from the descriptions given here. Firstly, it is important to know that many of the video applications which run on FreeBSD were developed as Linux applications. Many of these applications are still beta-quality. Some of the problems that you may encounter with video packages on FreeBSD include: An application cannot playback a file which another application produced. An application cannot playback a file which the application itself produced. The same application on two different machines, rebuilt on each machine for that machine, plays back the same file differently. A seemingly trivial filter like rescaling of the image size results in very bad artifacts from a buggy rescaling routine. An application frequently dumps core. Documentation is not installed with the port and can be found either on the web or under the port's work directory. Many of these applications may also exhibit Linux-isms. That is, there may be issues resulting from the way some standard libraries are implemented in the Linux distributions, or some features of the Linux kernel which have been assumed by the authors of the applications. These issues are not always noticed and worked around by the port maintainers, which can lead to problems like these: The use of /proc/cpuinfo to detect processor characteristics. A misuse of threads which causes a program to hang upon completion instead of truly terminating. Software not yet in the FreeBSD Ports Collection which is commonly used in conjunction with the application. So far, these application developers have been cooperative with port maintainers to minimize the work-arounds needed for port-ing. MPlayer MPlayer is a recently developed and rapidly developing video player. The goals of the MPlayer team are speed and flexibility on Linux and other Unices. The project was started when the team founder got fed up with bad playback performance on then available players. Some would say that the graphical interface has been sacrificed for a streamlined design. However, once you get used to the command line options and the key-stroke controls, it works very well. Building MPlayer MPlayer making MPlayer resides in multimedia/mplayer. MPlayer performs a variety of hardware checks during the build process, resulting in a binary which will not be portable from one system to another. Therefore, it is important to build it from ports and not to use a binary package. Additionally, a number of options can be specified in the make command line, as described in the Makefile and at the start of the build: &prompt.root; cd /usr/ports/multimedia/mplayer &prompt.root; make N - O - T - E Take a careful look into the Makefile in order to learn how to tune mplayer towards you personal preferences! For example, make WITH_GTK1 builds MPlayer with GTK1-GUI support. If you want to use the GUI, you can either install /usr/ports/multimedia/mplayer-skins or download official skin collections from http://www.mplayerhq.hu/homepage/dload.html The default port options should be sufficient for most users. However, if you need the XviD codec, you have to specify the WITH_XVID option in the command line. The default DVD device can also be defined with the WITH_DVD_DEVICE option, by default /dev/acd0 will be used. As of this writing, the MPlayer port will build its HTML documentation and two executables, mplayer, and mencoder, which is a tool for re-encoding video. The HTML documentation for MPlayer is very informative. If the reader finds the information on video hardware and interfaces in this chapter lacking, the MPlayer documentation is a very thorough supplement. You should definitely take the time to read the MPlayer documentation if you are looking for information about video support in &unix;. Using MPlayer MPlayer use Any user of MPlayer must set up a .mplayer subdirectory of her home directory. To create this necessary subdirectory, you can type the following: &prompt.user; cd /usr/ports/multimedia/mplayer &prompt.user; make install-user The command options for mplayer are listed in the manual page. For even more detail there is HTML documentation. In this section, we will describe only a few common uses. To play a file, such as testfile.avi, through one of the various video interfaces set the option: &prompt.user; mplayer -vo xv testfile.avi &prompt.user; mplayer -vo sdl testfile.avi &prompt.user; mplayer -vo x11 testfile.avi &prompt.root; mplayer -vo dga testfile.avi &prompt.root; mplayer -vo 'sdl:dga' testfile.avi It is worth trying all of these options, as their relative performance depends on many factors and will vary significantly with hardware. To play from a DVD, replace the testfile.avi with where N is the title number to play and DEVICE is the device node for the DVD-ROM. For example, to play title 3 from /dev/dvd: &prompt.root; mplayer -vo xv dvd://3 -dvd-device /dev/dvd The default DVD device can be defined during the build of the MPlayer port via the WITH_DVD_DEVICE option. By default, this device is /dev/acd0. More details can be found in the port Makefile. To stop, pause, advance and so on, consult the keybindings, which are output by running mplayer -h or read the manual page. Additional important options for playback are: which engages the fullscreen mode and which helps performance. In order for the mplayer command line to not become too large, the user can create a file .mplayer/config and set default options there: vo=xv fs=yes zoom=yes Finally, mplayer can be used to rip a DVD title into a .vob file. To dump out the second title from a DVD, type this: &prompt.root; mplayer -dumpstream -dumpfile out.vob dvd://2 -dvd-device /dev/dvd The output file, out.vob, will be MPEG and can be manipulated by the other packages described in this section. mencoder mencoder Before using mencoder it is a good idea to familiarize yourself with the options from the HTML documentation. There is a manual page, but it is not very useful without the HTML documentation. There are innumerable ways to improve quality, lower bitrate, and change formats, and some of these tricks may make the difference between good or bad performance. Here are a couple of examples to get you going. First a simple copy: &prompt.user; mencoder input.avi -oac copy -ovc copy -o output.avi Improper combinations of command line options can yield output files that are unplayable even by mplayer. Thus, if you just want to rip to a file, stick to the in mplayer. To convert input.avi to the MPEG4 codec with MPEG3 audio encoding (audio/lame is required): &prompt.user; mencoder input.avi -oac mp3lame -lameopts br=192 \ -ovc lavc -lavcopts vcodec=mpeg4:vhq -o output.avi This has produced output playable by mplayer and xine. input.avi can be replaced with and run as root to re-encode a DVD title directly. Since you are likely to be dissatisfied with your results the first time around, it is recommended you dump the title to a file and work on the file. The xine Video Player The xine video player is a project of wide scope aiming not only at being an all in one video solution, but also in producing a reusable base library and a modular executable which can be extended with plugins. It comes both as a package and as a port, multimedia/xine. The xine player is still very rough around the edges, but it is clearly off to a good start. In practice, xine requires either a fast CPU with a fast video card, or support for the XVideo extension. The GUI is usable, but a bit clumsy. As of this writing, there is no input module shipped with xine which will play CSS encoded DVD's. There are third party builds which do have modules for this built in them, but none of these are in the FreeBSD Ports Collection. Compared to MPlayer, xine does more for the user, but at the same time, takes some of the more fine-grained control away from the user. The xine video player performs best on XVideo interfaces. By default, xine player will start up in a graphical user interface. The menus can then be used to open a specific file: &prompt.user; xine Alternatively, it may be invoked to play a file immediately without the GUI with the command: &prompt.user; xine -g -p mymovie.avi The transcode Utilities The software transcode is not a player, but a suite of tools for re-encoding video and audio files. With transcode, one has the ability to merge video files, repair broken files, using command line tools with stdin/stdout stream interfaces. A great number of options can be specified during the build from the multimedia/transcode port, we recommend the following command line to build transcode: &prompt.root; make WITH_OPTIMIZED_CFLAGS=yes WITH_LIBA52=yes WITH_LAME=yes WITH_OGG=yes \ WITH_MJPEG=yes -DWITH_XVID=yes The proposed settings should be sufficient for most users. To illustrate transcode capacities, one example to show how to convert a DivX file into a PAL MPEG-1 file (PAL VCD): &prompt.user; transcode -i input.avi -V --export_prof vcd-pal -o output_vcd &prompt.user; mplex -f 1 -o output_vcd.mpg output_vcd.m1v output_vcd.mpa The resulting MPEG file, output_vcd.mpg, is ready to be played with MPlayer. You could even burn the file on a CD-R media to create a Video CD, in this case you will need to install and use both multimedia/vcdimager and sysutils/cdrdao programs. There is a manual page for transcode, but you should also consult the transcode wiki for further information and examples. Further Reading The various video software packages for FreeBSD are developing rapidly. It is quite possible that in the near future many of the problems discussed here will have been resolved. In the mean time, those who want to get the very most out of FreeBSD's A/V capabilities will have to cobble together knowledge from several FAQs and tutorials and use a few different applications. This section exists to give the reader pointers to such additional information. The MPlayer documentation is very technically informative. These documents should probably be consulted by anyone wishing to obtain a high level of expertise with &unix; video. The MPlayer mailing list is hostile to anyone who has not bothered to read the documentation, so if you plan on making bug reports to them, RTFM. The xine HOWTO contains a chapter on performance improvement which is general to all players. Finally, there are some other promising applications which the reader may try: Avifile which is also a port multimedia/avifile. Ogle which is also a port multimedia/ogle. Xtheater multimedia/dvdauthor, an open source package for authoring DVD content. Josef El-Rayes Original contribution by Marc Fonvieille Enhanced and adapted by - Setting Up TV Cards + ³]©w¹qµø¥d(TV Cards) TV cards Introduction TV cards allow you to watch broadcast or cable TV on your computer. Most of them accept composite video via an RCA or S-video input and some of these cards come with a FM radio tuner. &os; provides support for PCI-based TV cards using a Brooktree Bt848/849/878/879 or a Conexant CN-878/Fusion 878a Video Capture Chip with the &man.bktr.4; driver. You must also ensure the board comes with a supported tuner, consult the &man.bktr.4; manual page for a list of supported tuners. Adding the Driver To use your card, you will need to load the &man.bktr.4; driver, this can be done by adding the following line to the /boot/loader.conf file like this: bktr_load="YES" Alternatively, you may statically compile the support for the TV card in your kernel, in that case add the following lines to your kernel configuration: device bktr device iicbus device iicbb device smbus These additional device drivers are necessary because of the card components being interconnected via an I2C bus. Then build and install a new kernel. Once the support was added to your system, you have to reboot your machine. During the boot process, your TV card should show up, like this: bktr0: <BrookTree 848A> mem 0xd7000000-0xd7000fff irq 10 at device 10.0 on pci0 iicbb0: <I2C bit-banging driver> on bti2c0 iicbus0: <Philips I2C bus> on iicbb0 master-only iicbus1: <Philips I2C bus> on iicbb0 master-only smbus0: <System Management Bus> on bti2c0 bktr0: Pinnacle/Miro TV, Philips SECAM tuner. Of course these messages can differ according to your hardware. However you should check if the tuner is correctly detected; it is still possible to override some of the detected parameters with &man.sysctl.8; MIBs and kernel configuration file options. For example, if you want to force the tuner to a Philips SECAM tuner, you should add the following line to your kernel configuration file: options OVERRIDE_TUNER=6 or you can directly use &man.sysctl.8;: &prompt.root; sysctl hw.bt848.tuner=6 See the &man.bktr.4; manual page and the /usr/src/sys/conf/NOTES file for more details on the available options. (If you are under &os; 4.X, /usr/src/sys/conf/NOTES is replaced with /usr/src/sys/i386/conf/LINT.) Useful Applications To use your TV card you need to install one of the following applications: multimedia/fxtv provides TV-in-a-window and image/audio/video capture capabilities. multimedia/xawtv is also a TV application, with the same features as fxtv. misc/alevt decodes and displays Videotext/Teletext. audio/xmradio, an application to use the FM radio tuner coming with some TV cards. audio/wmtune, a handy desktop application for radio tuners. More applications are available in the &os; Ports Collection. Troubleshooting If you encounter any problem with your TV card, you should check at first if the video capture chip and the tuner are really supported by the &man.bktr.4; driver and if you used the right configuration options. For more support and various questions about your TV card you may want to contact and use the archives of the &a.multimedia.name; mailing list. Marc Fonvieille Written by - Image Scanners + ±½´y¾¹ image scanners - Introduction + ¤¶²Ð &os;, like any modern operating system, allows the use of image scanners. Standardized access to scanners is provided by the SANE (Scanner Access Now Easy) API available through the &os; Ports Collection. SANE will also use some &os; devices drivers to access to the scanner hardware. &os; supports both SCSI and USB scanners. Be sure your scanner is supported by SANE prior to performing any configuration. SANE has a supported devices list that can provide you with information about the support for a scanner and its status. The &man.uscanner.4; manual page also provides a list of supported USB scanners. Kernel Configuration As mentioned above both SCSI and USB interfaces are supported. According to your scanner interface, different device drivers are required. USB Interface The GENERIC kernel by default includes the device drivers needed to support USB scanners. Should you decide to use a custom kernel, be sure that the following lines are present in your kernel configuration file: device usb device uhci device ohci device uscanner Depending upon the USB chipset on your motherboard, you will only need either device uhci or device ohci, however having both in the kernel configuration file is harmless. If you do not want to rebuild your kernel and your kernel is not the GENERIC one, you can directly load the &man.uscanner.4; device driver module with the &man.kldload.8; command: &prompt.root; kldload uscanner To load this module at each system startup, add the following line to /boot/loader.conf: uscanner_load="YES" After rebooting with the correct kernel, or after loading the required module, plug in your USB scanner. The scanner should appear in your system message buffer (&man.dmesg.8;) as something like: uscanner0: EPSON EPSON Scanner, rev 1.10/3.02, addr 2 This shows that our scanner is using the /dev/uscanner0 device node. On &os; 4.X, the USB daemon (&man.usbd.8;) must be running to be able to see some USB devices. To enable this, add usbd_enable="YES" to your /etc/rc.conf file and reboot the machine. SCSI Interface If your scanner comes with a SCSI interface, it is important to know which SCSI controller board you will use. According to the SCSI chipset used, you will have to tune your kernel configuration file. The GENERIC kernel supports the most common SCSI controllers. Be sure to read the NOTES file (LINT under &os; 4.X) and add the correct line to your kernel configuration file. In addition to the SCSI adapter driver, you need to have the following lines in your kernel configuration file: device scbus device pass Once your kernel has been properly compiled, you should be able to see the devices in your system message buffer, when booting: pass2 at aic0 bus 0 target 2 lun 0 pass2: <AGFA SNAPSCAN 600 1.10> Fixed Scanner SCSI-2 device pass2: 3.300MB/s transfers If your scanner was not powered-on at system boot, it is still possible to manually force the detection by performing a SCSI bus scan with the &man.camcontrol.8; command: &prompt.root; camcontrol rescan all Re-scan of bus 0 was successful Re-scan of bus 1 was successful Re-scan of bus 2 was successful Re-scan of bus 3 was successful Then the scanner will appear in the SCSI devices list: &prompt.root; camcontrol devlist <IBM DDRS-34560 S97B> at scbus0 target 5 lun 0 (pass0,da0) <IBM DDRS-34560 S97B> at scbus0 target 6 lun 0 (pass1,da1) <AGFA SNAPSCAN 600 1.10> at scbus1 target 2 lun 0 (pass3) <PHILIPS CDD3610 CD-R/RW 1.00> at scbus2 target 0 lun 0 (pass2,cd0) More details about SCSI devices, are available in the &man.scsi.4; and &man.camcontrol.8; manual pages. SANE Configuration The SANE system has been splitted in two parts: the backends (graphics/sane-backends) and the frontends (graphics/sane-frontends). The backends part provides access to the scanner itself. The SANE's supported devices list specifies which backend will support your image scanner. It is mandatory to determine the correct backend for your scanner if you want to be able to use your device. The frontends part provides the graphical scanning interface (xscanimage). The first thing to do is install the graphics/sane-backends port or package. Then, use the sane-find-scanner command to check the scanner detection by the SANE system: &prompt.root; sane-find-scanner -q found SCSI scanner "AGFA SNAPSCAN 600 1.10" at /dev/pass3 The output will show the interface type of the scanner and the device node used to attach the scanner to the system. The vendor and the product model may not appear, it is not important. Some USB scanners require you to load a firmware, this is explained in the backend manual page. You should also read &man.sane-find-scanner.1; and &man.sane.7; manual pages. Now we have to check if the scanner will be identified by a scanning frontend. By default, the SANE backends comes with a command line tool called &man.scanimage.1;. This command allows you to list the devices and to perform an image acquisition from the command line. The option is used to list the scanner device: &prompt.root; scanimage -L device `snapscan:/dev/pass3' is a AGFA SNAPSCAN 600 flatbed scanner No output or a message saying that no scanners were identified indicates that &man.scanimage.1; is unable to identify the scanner. If this happens, you will need to edit the backend configuration file and define the scanner device used. The /usr/local/etc/sane.d/ directory contains all backends configuration files. This identification problem does appear with certain USB scanners. For example, with the USB scanner used in the , sane-find-scanner gives us the following information: &prompt.root; sane-find-scanner -q found USB scanner (UNKNOWN vendor and product) at device /dev/uscanner0 The scanner is correctly detected, it uses the USB interface and is attached to the /dev/uscanner0 device node. We can now check if the scanner is correctly identified: &prompt.root; scanimage -L No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages). Since the scanner is not identified, we will need to edit the /usr/local/etc/sane.d/epson.conf file. The scanner model used was the &epson.perfection; 1650, so we know the scanner will use the epson backend. Be sure to read the help comments in the backends configuration files. Line changes are quite simple: comment out all lines that have the wrong interface for your scanner (in our case, we will comment out all lines starting with the word scsi as our scanner uses the USB interface), then add at the end of the file a line specifying the interface and the device node used. In this case, we add the following line: usb /dev/uscanner0 Please be sure to read the comments provided in the backend configuration file as well as the backend manual page for more details and correct syntax to use. We can now verify if the scanner is identified: &prompt.root; scanimage -L device `epson:/dev/uscanner0' is a Epson GT-8200 flatbed scanner Our USB scanner has been identified. It is not important if the brand and the model do not match. The key item to be concerned with is the `epson:/dev/uscanner0' field, which give us the right backend name and the right device node. Once the scanimage -L command is able to see the scanner, the configuration is complete. The device is now ready to scan. While &man.scanimage.1; does allow us to perform an image acquisition from the command line, it is preferable to use a graphical user interface to perform image scanning. SANE offers a simple but efficient graphical interface: xscanimage (graphics/sane-frontends). Xsane (graphics/xsane) is another popular graphical scanning frontend. This frontend offers advanced features such as various scanning mode (photocopy, fax, etc.), color correction, batch scans, etc. Both of these applications are useable as a GIMP plugin. Allowing Scanner Access to Other Users All previous operations have been done with root privileges. You may however, need other users to have access to the scanner. The user will need read and write permissions to the device node used by the scanner. As an example, our USB scanner uses the device node /dev/uscanner0 which is owned by the operator group. Adding the user joe to the operator group will allow him to use the scanner: &prompt.root; pw groupmod operator -m joe For more details read the &man.pw.8; manual page. You also have to set the correct write permissions (0660 or 0664) on the /dev/uscanner0 device node, by default the operator group can only read the device node. This is done by adding the following lines to the /etc/devfs.rules file: [system=5] add path uscanner0 mode 660 Then add the following to /etc/rc.conf and reboot the machine: devfs_system_ruleset="system" More information regarding these lines can be found in the &man.devfs.8; manual page. Under &os; 4.X, the operator group has, by default, read and write permissions to /dev/uscanner0. Of course, for security reasons, you should think twice before adding a user to any group, especially the operator group. diff --git a/zh_TW.Big5/books/handbook/ports/chapter.sgml b/zh_TW.Big5/books/handbook/ports/chapter.sgml index 64393aaf09..5be761ba7f 100644 --- a/zh_TW.Big5/books/handbook/ports/chapter.sgml +++ b/zh_TW.Big5/books/handbook/ports/chapter.sgml @@ -1,1405 +1,1366 @@ - Installing Applications: Packages and Ports + ³nÅé®M¥óºÞ²z¨t²Î¡GPackages ¤Î Ports ¾÷¨î - Synopsis + ·§­z ports packages - FreeBSD is bundled with a rich collection of system tools as - part of the base system. However, there is only so much one can - do before needing to install an additional third-party - application to get real work done. FreeBSD provides two - complementary technologies for installing third party software - on your system: the FreeBSD Ports Collection (for installing from - source), and packages (for installing from pre-built binaries). - Either method may be used to install the - newest version of your favorite applications from local media or - straight off the network. - - After reading this chapter, you will know: + ¾¨ºÞ FreeBSD ¦b base system ¤w¥[¤F«Ü¦h¨t²Î¤u¨ã¡C + µM¦Ó¡A¦b¹ê°È¹B¥Î¤W¡A±z¥i¯à¤´»Ý­n¦w¸ËÃB¥~ªº³nÅé¡C + FreeBSD ´£¨Ñ¤F 2 ºØ¦w¸ËÀ³¥Îµ{¦¡ªº®M¥óºÞ²z¨t²Î¡JPorts Collection(¥H soucre ¨Ó½sĶ¡B¦w¸Ë) ©M + package(¹w¥ý½sͦnªº binary ÀÉ)¡C¤W­zªº¤è¦¡¡AµL½×­n¥Î­þ¤@ºØ¡A³£¥i¥H¥Ñ¹³¬O CDROM + µ¥©Îºô¸ô¤W¨Ó¦w¸Ë·Q¸Ëªº³Ì·sª©³nÅé¡C + + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡G - How to install third-party binary software packages. + ¦p¦ó¥H packages ¨Ó¦w¸Ë³nÅé¡C - How to build third-party software from source by using the ports - collection. + ¦p¦ó¥H ports ¨Ó¦w¸Ë³nÅé¡C - How to remove previously installed packages or ports. + ¤w¦w¸Ëªº packages ©Î ports ­n¦p¦ó²¾°£¡C - How to override the default values that the ports - collection uses. + ¦p¦ó§ó§ï(override) ports collection ©Ò¨Ï¥Îªº¹w³]­È¡C - How to find the appropriate software package. + ¦p¦ó¦b®M¥óºÞ²z¨t²Î¤¤¡A§ä¥X·Q¸Ëªº³nÅé¡C - How to upgrade your applications. + ¦p¦ó¤É¯Å¤w¦w¸Ëªº³nÅé¡C - Overview of Software Installation + ¦w¸Ë³nÅ骺¦UºØ¤è¦¡¤¶²Ð - If you have used a &unix; system before you will know that - the typical procedure for installing third party software goes - something like this: + ³q±`­n¦b &unix; ¨t²Î¤W¦w¸Ë³nÅé®É¡A¦³´X­Ó¨BÆJ­n§@¡G - Download the software, which might be distributed in - source code format, or as a binary. + ¥ý¤U¸ü¸Ó³nÅéÀ£ÁYÀÉ(tarball)¡A¦³¥i¯à¬O­ì©l½X©Î¬O binary °õ¦æÀÉ¡C - Unpack the software from its distribution format - (typically a tarball compressed with &man.compress.1;, - &man.gzip.1;, or &man.bzip2.1;). + ¸Ñ¶}¸ÓÀ£ÁYÀÉ¡C(³q±`¬O¥H &man.compress.1; , &man.gzip.1; ©Î &man.bzip2.1; À£ÁYªº) - Locate the documentation (perhaps an - INSTALL or README - file, or some files in a doc/ - subdirectory) and read up on how to install the - software. + ¾\Ū¬ÛÃö¤å¥óÀÉ¡A¥H¤F¸Ñ¦p¦ó¦w¸Ë¡C(³q±`ÀɦW¬O INSTALL ©Î + README¡A ©Î¦b doc/ ¥Ø¿ý¤Uªº¤@¨Ç¤å¥ó) - If the software was distributed in source format, - compile it. This may involve editing a - Makefile, or running a - configure script, and other work. + ¦pªG©Ò¤U¸üªº¬O­ì©l½X¡A¥i¯à­n¥ý­×§ï Makefile ©Î¬O°õ¦æ + ./configure ¤§Ãþªº script ¡A±µµÛ¦A½s͏ӳnÅé¡C - Test and install the software. + ³Ì«á´ú¸Õ¦A´ú¸Õ»P¦w¸Ë¡C - And that is only if everything goes well. If you are - installing a software package that was not deliberately ported - to FreeBSD you may even have to go in and edit the code to make - it work properly. + ¦pªG¤@¤Á¶¶§Qªº¸Ü¡A´N³o»ò²³æ¡C¦pªG¦b¦w¸Ë«D±Mªù³]­p(²¾´Ó)µ¹ FreeBSD ªº³nÅé®É¥X°ÝÃD¡A + ¨º¥i¯à»Ý­n­×§ï¤@¤U¥¦ªºµ{¦¡½X¡A¤~¯à¥¿±`¨Ï¥Î¡C - Should you want to, you can continue to install software the - traditional way with FreeBSD. However, FreeBSD - provides two technologies which can save you a lot of effort: - packages and ports. At the time of writing, over &os.numports; - third party applications have been made available in this - way. + ·íµM¡A§Ú­Ì¥i¥H¦b FreeBSD ¤W¨Ï¥Î¤W­zªº¶Ç²Î¤è¦¡¨Ó¦w¸Ë³nÅé¡A¦ý¬O¡A§Ú­ÌÁÙ¦³§ó²³æªº¿ï¾Ü¡C + FreeBSD ´£¨Ñ¤F¨âºØ¬Ù¨Æªº³nÅéºÞ²z¾÷¨î¡G packages ©M ports¡C´N¦b¼g³o½g¤å³¹ªº®É­Ô¡A + ¤w¸g¦³¶W¹L &os.numports; ­Ó port ³nÅé¥i¥H¨Ï¥Î¡C For any given application, the FreeBSD package for that application is a single file which you must download. The package contains pre-compiled copies of all the commands for the application, as well as any configuration files or documentation. A downloaded package file can be manipulated with FreeBSD package management commands, such as &man.pkg.add.1;, &man.pkg.delete.1;, &man.pkg.info.1;, and so on. Installing a new application can be carried out with a single command. A FreeBSD port for an application is a collection of files designed to automate the process of compiling an application from source code. Remember that there are a number of steps you would normally carry out if you compiled a program yourself (downloading, unpacking, patching, compiling, installing). The files that make up a port contain all the necessary information to allow the system to do this for you. You run a handful of simple commands and the source code for the application is automatically downloaded, extracted, patched, compiled, and installed for you. In fact, the ports system can also be used to generate packages which can later be manipulated with pkg_add and the other package management commands that will be introduced shortly. Both packages and ports understand dependencies. Suppose you want to install an application that depends on a specific library being installed. Both the application and the library have been made available as FreeBSD ports and packages. If you use the pkg_add command or the ports system to add the application, both will notice that the library has not been installed, and automatically install the library first. Given that the two technologies are quite similar, you might be wondering why FreeBSD bothers with both. Packages and ports both have their own strengths, and which one you use will depend on your own preference. - Package Benefits + Package ¦n³B¦b©ó¡G A compressed package tarball is typically smaller than the compressed tarball containing the source code for the application. Packages do not require any additional compilation. For large applications, such as Mozilla, KDE, or GNOME this can be important, particularly if you are on a slow system. Packages do not require any understanding of the process involved in compiling software on FreeBSD. - Ports Benefits + Ports ¦n³B¦b©ó¡G Packages are normally compiled with conservative options, because they have to run on the maximum number of systems. By installing from the port, you can tweak the compilation options to (for example) generate code that is specific to a Pentium IV or Athlon processor. Some applications have compile time options relating to what they can and cannot do. For example, Apache can be configured with a wide variety of different built-in options. By building from the port you do not have to accept the default options, and can set them yourself. In some cases, multiple packages will exist for the same application to specify certain settings. For example, Ghostscript is available as a ghostscript package and a ghostscript-nox11 package, depending on whether or not you have installed an X11 server. This sort of rough tweaking is possible with packages, but rapidly becomes impossible if an application has more than one or two different compile time options. The licensing conditions of some software distributions forbid binary distribution. They must be distributed as source code. Some people do not trust binary distributions. At least with source code, you can (in theory) read through it and look for potential problems yourself. If you have local patches, you will need the source in order to apply them. Some people like having code around, so they can read it if they get bored, hack it, borrow from it (license permitting, of course), and so on. To keep track of updated ports, subscribe to the &a.ports; and the &a.ports-bugs;. Before installing any application, you should check for security issues related to your application. You can also install security/portaudit which will automatically check all installed applications for known vulnerabilities; a check will be also performed before any port build. Meanwhile, you can use the command portaudit -F -a after you have installed some packages. The remainder of this chapter will explain how to use packages and ports to install and manage third party software on FreeBSD. - Finding Your Application + ´M§ä·Q¸Ëªº³nÅé Before you can install any applications you need to know what you want, and what the application is called. FreeBSD's list of available applications is growing all the time. Fortunately, there are a number of ways to find what you want: The FreeBSD web site maintains an up-to-date searchable list of all the available applications, at http://www.FreeBSD.org/ports/. The ports are divided into categories, and you may either search for an application by name (if you know it), or see all the applications available in a category. FreshPorts Dan Langille maintains FreshPorts, at . FreshPorts tracks changes to the applications in the ports tree as they happen, allows you to watch one or more ports, and can send you email when they are updated. FreshMeat If you do not know the name of the application you want, try using a site like FreshMeat () to find an application, then check back at the FreeBSD site to see if the application has been ported yet. If you know the exact name of the port, but just need to find out which category it is in, you can use the &man.whereis.1; command. Simply type whereis file, where file is the program you want to install. If it is found on your system, you will be told where it is, as follows: &prompt.root; whereis lsof lsof: /usr/ports/sysutils/lsof This tells us that lsof (a system utility) can be found in the /usr/ports/sysutils/lsof directory. Yet another way to find a particular port is by using the Ports Collection's built-in search mechanism. To use the search feature, you will need to be in the /usr/ports directory. Once in that directory, run make search name=program-name where program-name is the name of the program you want to find. For example, if you were looking for lsof: &prompt.root; cd /usr/ports &prompt.root; make search name=lsof Port: lsof-4.56.4 Path: /usr/ports/sysutils/lsof Info: Lists information about open files (similar to fstat(1)) Maint: obrien@FreeBSD.org Index: sysutils B-deps: R-deps: The part of the output you want to pay particular attention to is the Path: line, since that tells you where to find the port. The other information provided is not needed in order to install the port, so it will not be covered here. For more in-depth searching you can also use make search key=string where string is some text to search for. This searches port names, comments, descriptions and dependencies and can be used to find ports which relate to a particular subject if you do not know the name of the program you are looking for. In both of these cases, the search string is case-insensitive. Searching for LSOF will yield the same results as searching for lsof. Chern Lee Contributed by - Using the Packages System + ¨Ï¥Î Packages ºÞ²z¾÷¨î - Installing a Package + Package ªº¦w¸Ë¤è¦¡ packages installing pkg_add You can use the &man.pkg.add.1; utility to install a FreeBSD software package from a local file or from a server on the network. - Downloading a Package Manually and Installing It Locally + ¤â°Ê¤U¸ü¡B¦w¸Ë Package (ĶªÌchinsan: ¦]¤ñ¸û¤£«K¦Ó¤£«ØÄ³³o»ò°µ) &prompt.root; ftp -a ftp2.FreeBSD.org Connected to ftp2.FreeBSD.org. 220 ftp2.FreeBSD.org FTP server (Version 6.00LS) ready. 331 Guest login ok, send your email address as password. 230- 230- This machine is in Vienna, VA, USA, hosted by Verio. 230- Questions? E-mail freebsd@vienna.verio.net. 230- 230- 230 Guest login ok, access restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd /pub/FreeBSD/ports/packages/sysutils/ 250 CWD command successful. ftp> get lsof-4.56.4.tgz local: lsof-4.56.4.tgz remote: lsof-4.56.4.tgz 200 PORT command successful. 150 Opening BINARY mode data connection for 'lsof-4.56.4.tgz' (92375 bytes). 100% |**************************************************| 92375 00:00 ETA 226 Transfer complete. 92375 bytes received in 5.60 seconds (16.11 KB/s) ftp> exit &prompt.root; pkg_add lsof-4.56.4.tgz If you do not have a source of local packages (such as a FreeBSD CD-ROM set) then it will probably be easier to use the option to &man.pkg.add.1;. This will cause the utility to automatically determine the correct object format and release and then fetch and install the package from an FTP site. pkg_add &prompt.root; pkg_add -r lsof The example above would download the correct package and add it without any further user intervention. If you want to specify an alternative &os; Packages Mirror, instead of the main distribution site, you have to set PACKAGESITE accordingly, to override the default settings. &man.pkg.add.1; uses &man.fetch.3; to download the files, which honors various environment variables, including FTP_PASSIVE_MODE, FTP_PROXY, and FTP_PASSWORD. You may need to set one or more of these if you are behind a firewall, or need to use an FTP/HTTP proxy. See &man.fetch.3; for the complete list. Note that in the example above lsof is used instead of lsof-4.56.4. When the remote fetching feature is used, the version number of the package must be removed. &man.pkg.add.1; will automatically fetch the latest version of the application. &man.pkg.add.1; will download the latest version of your application if you are using &os.current; or &os.stable;. If you run a -RELEASE version, it will grab the version of the package that was built with your release. It is possible to change this behavior by overriding the PACKAGESITE environment variable. For example, if you run a &os; 5.4-RELEASE system, by default &man.pkg.add.1; will try to fetch packages from ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5.4-release/Latest/. If you want to force &man.pkg.add.1; to download &os; 5-STABLE packages, set PACKAGESITE to ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/Latest/. Package files are distributed in .tgz and .tbz formats. You can find them at , or on the FreeBSD CD-ROM distribution. Every CD on the FreeBSD 4-CD set (and the PowerPak, etc.) contains packages in the /packages directory. The layout of the packages is similar to that of the /usr/ports tree. Each category has its own directory, and every package can be found within the All directory. The directory structure of the package system matches the ports layout; they work with each other to form the entire package/port system. - Managing Packages + ºÞ²z Packages packages managing &man.pkg.info.1; is a utility that lists and describes the various packages installed. pkg_info &prompt.root; pkg_info cvsup-16.1 A general network file distribution system optimized for CV docbook-1.2 Meta-port for the different versions of the DocBook DTD ... &man.pkg.version.1; is a utility that summarizes the versions of all installed packages. It compares the package version to the current version found in the ports tree. pkg_version &prompt.root; pkg_version cvsup = docbook = ... The symbols in the second column indicate the relative age of the installed version and the version available in the local ports tree. - Symbol - Meaning + ²Å¸¹ + ¥Nªí·N¸q = The version of the installed package matches the one found in the local ports tree. < The installed version is older than the one available in the ports tree. >The installed version is newer than the one found in the local ports tree. (The local ports tree is probably out of date.) ?The installed package cannot be found in the ports index. (This can happen, for instance, if an installed port is removed from the Ports Collection or renamed.) *There are multiple versions of the package. - Deleting a Package + ²¾°£¤w¦w¸Ëªº Package pkg_delete packages deleting To remove a previously installed software package, use the &man.pkg.delete.1; utility. &prompt.root; pkg_delete xchat-1.7.1 - Miscellaneous + ¨ä¥L²Ó¸`³¡¥÷ All package information is stored within the /var/db/pkg directory. The installed file list and descriptions of each package can be found within files in this directory. - Using the Ports Collection + ¨Ï¥Î Ports ºÞ²z¾÷¨î The following sections provide basic instructions on using the Ports Collection to install or remove programs from your system. The detailed description of available make targets and environment variables is available in &man.ports.7;. - Obtaining the Ports Collection + °O±o¦w¸Ë Ports Collection Before you can install ports, you must first obtain the Ports Collection—which is essentially a set of Makefiles, patches, and description files placed in /usr/ports. When installing your FreeBSD system, sysinstall asked if you would like to install the Ports Collection. If you chose no, you can follow these instructions to obtain the ports collection: - CVSup Method + CVSup ¤è¦¡ This is a quick method for getting and keeping your copy of the Ports Collection up to date using CVSup. If you want to learn more about CVSup, see Using CVSup. Install the net/cvsup-without-gui package: &prompt.root; pkg_add -r cvsup-without-gui See CVSup Installation () for more details. Run cvsup: &prompt.root; cvsup -L 2 -h cvsup.FreeBSD.org /usr/share/examples/cvsup/ports-supfile Change cvsup.FreeBSD.org to a CVSup server near you. See CVSup Mirrors () for a complete listing of mirror sites. One may want to use his own ports-supfile, for example to avoid the need of passing the CVSup server on the command line. In this case, as root, copy /usr/share/examples/cvsup/ports-supfile to a new location, such as /root or your home directory. Edit ports-supfile. Change CHANGE_THIS.FreeBSD.org to a CVSup server near you. See CVSup Mirrors () for a complete listing of mirror sites. And now to run cvsup, use the following: &prompt.root; cvsup -L 2 /root/ports-supfile Running the &man.cvsup.1; command later will download and apply all the recent changes to your Ports Collection, except actually rebuilding the ports for your own system. - Portsnap Method + Portsnap ¤è¦¡ &man.portsnap.8; is an alternative system for distributing the Ports Collection. It was first included in &os; 6.0. On older systems, you can install it from sysutils/portsnap port: &prompt.root; pkg_add -r portsnap Please refer to Using Portsnap for a detailed description of all Portsnap features. Create an empty directory /usr/ports if it does not exists. &prompt.root; mkdir /usr/ports Download a compressed snapshot of the Ports Collection into /var/db/portsnap. You can disconnect from the Internet after this step, if you wish. &prompt.root; portsnap fetch If you are running Portsnap for the first time, extract the snapshot into /usr/ports: &prompt.root; portsnap extract If you already have a populated /usr/ports and you are just updating, run the following command instead: &prompt.root; portsnap update - Sysinstall Method + Sysinstall ¤è¦¡ This method involves using sysinstall to install the Ports Collection from the installation media. Note that the old copy of Ports Collection from the date of the release will be installed. If you have Internet access, you should always use one of the methods mentioned above. As root, run sysinstall (/stand/sysinstall in &os; versions older than 5.2) as shown below: &prompt.root; sysinstall Scroll down and select Configure, press Enter. Scroll down and select Distributions, press Enter. Scroll down to ports, press Space. Scroll up to Exit, press Enter. Select your desired installation media, such as CDROM, FTP, and so on. Scroll up to Exit and press Enter. Press X to exit sysinstall. - Installing Ports + Ports ªº¦w¸Ë¤è¦¡ ports installing The first thing that should be explained when it comes to the Ports Collection is what is actually meant by a skeleton. In a nutshell, a port skeleton is a minimal set of files that tell your FreeBSD system how to cleanly compile and install a program. Each port skeleton includes: A Makefile. The Makefile contains various statements that specify how the application should be compiled and where it should be installed on your system. A distinfo file. This file contains information about the files that must be downloaded to build the port and their checksums, to verify that files have not been corrupted during the download using &man.md5.1;. A files directory. This directory contains patches to make the program compile and install on your FreeBSD system. Patches are basically small files that specify changes to particular files. They are in plain text format, and basically say Remove line 10 or Change line 26 to this .... Patches are also known as diffs because they are generated by the &man.diff.1; program. This directory may also contain other files used to build the port. A pkg-descr file. This is a more detailed, often multiple-line, description of the program. A pkg-plist file. This is a list of all the files that will be installed by the port. It also tells the ports system what files to remove upon deinstallation. Some ports have other files, such as pkg-message. The ports system uses these files to handle special situations. If you want more details on these files, and on ports in general, check out the FreeBSD Porter's Handbook. The port includes instructions on how to build source code, but does not include the actual source code. You can get the source code from a CD-ROM or from the Internet. Source code is distributed in whatever manner the software author desires. Frequently this is a tarred and gzipped file, but it might be compressed with some other tool or even uncompressed. The program source code, whatever form it comes in, is called a distfile. The two methods for installing a &os; port are described below. You must be logged in as root to install ports. Before installing any port, you should be sure to have an up-to-date Ports Collection and you should check for security issues related to your port. A security vulnerabilities check can be automatically done by portaudit before any new application installation. This tool can be found in the Ports Collection (security/portaudit). Consider running portaudit -F before installing a new port, to fetch the current vulnerabilities database. A security audit and an update of the database will be performed during the daily security system check. For more information read the &man.portaudit.1; and &man.periodic.8; manual pages. The Ports Collection makes an assumption that you have a working Internet connection. If you do not, you will need to put a copy of the distfile into /usr/ports/distfiles manually. To begin, change to the directory for the port you want to install: &prompt.root; cd /usr/ports/sysutils/lsof Once inside the lsof directory, you will see the port skeleton. The next step is to compile, or build, the port. This is done by simply typing make at the prompt. Once you have done so, you should see something like this: &prompt.root; make >> lsof_4.57D.freebsd.tar.gz doesn't seem to exist in /usr/ports/distfiles/. >> Attempting to fetch from ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/. ===> Extracting for lsof-4.57 ... [extraction output snipped] ... >> Checksum OK for lsof_4.57D.freebsd.tar.gz. ===> Patching for lsof-4.57 ===> Applying FreeBSD patches for lsof-4.57 ===> Configuring for lsof-4.57 ... [configure output snipped] ... ===> Building for lsof-4.57 ... [compilation output snipped] ... &prompt.root; Notice that once the compile is complete you are returned to your prompt. The next step is to install the port. In order to install it, you simply need to tack one word onto the make command, and that word is install: &prompt.root; make install ===> Installing for lsof-4.57 ... [installation output snipped] ... ===> Generating temporary packing list ===> Compressing manual pages for lsof-4.57 ===> Registering installation for lsof-4.57 ===> SECURITY NOTE: This port has installed the following binaries which execute with increased privileges. &prompt.root; Once you are returned to your prompt, you should be able to run the application you just installed. Since lsof is a program that runs with increased privileges, a security warning is shown. During the building and installation of ports, you should take heed of any other warnings that may appear. It is a good idea to delete the working subdirectory, which contains all the temporary files used during compilation. Not only it consumes a valuable disk space, it would also cause problems later when upgrading to the newer version of the port. &prompt.root; make clean ===> Cleaning for lsof-4.57 &prompt.root; You can save an extra step by just running make install clean instead of make, make install and make clean as three separate steps. Some shells keep a cache of the commands that are available in the directories listed in the PATH environment variable, to speed up lookup operations for the executable file of these commands. If you are using one of these shells, you might have to use the rehash command after installing a port, before the newly installed commands can be used. This command will work for shells like tcsh. Use the hash -r command for shells like sh. Look at the documentation for your shell for more information. Some third party DVD-ROM products such as the FreeBSD Toolkit from the FreeBSD Mall contain distfiles. They can be used with the Ports Collection. Mount the DVD-ROM on /cdrom. If you use a different mount point, set CD_MOUNTPTS make variable. The needed distfiles will be automatically used if they are present on the disk. Please be aware that the licenses of a few ports do not allow for inclusion on the CD-ROM. This could be because a registration form needs to be filled out before downloading or redistribution is not allowed, or for another reason. If you wish to install a port not included on the CD-ROM, you will need to be online in order to do so. The ports system uses &man.fetch.1; to download the files, which honors various environment variables, including FTP_PASSIVE_MODE, FTP_PROXY, and FTP_PASSWORD. You may need to set one or more of these if you are behind a firewall, or need to use an FTP/HTTP proxy. See &man.fetch.3; for the complete list. For users which cannot be connected all the time, the make fetch option is provided. Just run this command at the top level directory (/usr/ports) and the required files will be downloaded for you. This command will also work in the lower level categories, for example: /usr/ports/net. Note that if a port depends on libraries or other ports this will not fetch the distfiles of those ports too. Replace fetch with fetch-recursive if you want to fetch all the dependencies of a port too. You can build all the ports in a category or as a whole by running make in the top level directory, just like the aforementioned make fetch method. This is dangerous, however, as some ports cannot co-exist. In other cases, some ports can install two different files with the same filename. In some rare cases, users may need to acquire the tarballs from a site other than the MASTER_SITES (the location where files are downloaded from). You can override the MASTER_SITES option with the following command: &prompt.root; cd /usr/ports/directory &prompt.root; make MASTER_SITE_OVERRIDE= \ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch In this example we change the MASTER_SITES option to ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/. Some ports allow (or even require) you to provide build options which can enable/disable parts of the application which are unneeded, certain security options, and other customizations. A few which come to mind are www/mozilla, security/gpgme, and mail/sylpheed-claws. A message will be displayed when options such as these are available. - Overriding the Default Ports Directories + §ó§ï(Override)¹w³]ªº Ports ¥Ø¿ý Sometimes it is useful (or mandatory) to use a different distfiles and ports directory. The PORTSDIR and PREFIX variables can override the default directories. For example: &prompt.root; make PORTSDIR=/usr/home/example/ports install will compile the port in /usr/home/example/ports and install everything under /usr/local. &prompt.root; make PREFIX=/usr/home/example/local install will compile it in /usr/ports and install it in /usr/home/example/local. And of course, &prompt.root; make PORTSDIR=../ports PREFIX=../local install will combine the two (it is too long to completely write on this page, but it should give you the general idea). Alternatively, these variables can also be set as part of your environment. Read the manual page for your shell for instructions on doing so. Dealing with <command>imake</command> Some ports that use imake (a part of the X Window System) do not work well with PREFIX, and will insist on installing under /usr/X11R6. Similarly, some Perl ports ignore PREFIX and install in the Perl tree. Making these ports respect PREFIX is a difficult or impossible job. - Removing Installed Ports + ²¾°£¤w¦w¸Ëªº Ports ports removing Now that you know how to install ports, you are probably wondering how to remove them, just in case you install one and later on decide that you installed the wrong port. We will remove our previous example (which was lsof for those of you not paying attention). Ports are being removed exactly the same as the packages (discussed in the Packages section), using the &man.pkg.delete.1; command: &prompt.root; pkg_delete lsof-4.57 - Upgrading Ports + ¤É¯Å¤w¦w¸Ëªº Ports ports upgrading First, list outdated ports that have a newer version available in the Ports Collection with the &man.pkg.version.1; command: &prompt.root; pkg_version -v Once you updated your Ports Collection, before attempting a port upgrade, you should check the /usr/ports/UPDATING file. This file describes various issues and additional steps users may encounter and need to perform when updating a port. - Upgrading Ports using Portupgrade + ¥H Portupgrade ¨Ó¤É¯Å¤w¦w¸Ëªº Ports portupgrade The portupgrade utility is designed to easily upgrade installed ports. It is available from the sysutils/portupgrade port. Install it like any other port, using the make install clean command: &prompt.root; cd /usr/ports/sysutils/portupgrade &prompt.root; make install clean Scan the list of installed ports with the pkgdb -F command and fix all the inconsistencies it reports. It is a good idea to do this regularly, before every upgrade. When you run portupgrade -a, portupgrade will begin to upgrade all the outdated ports installed on your system. Use the flag if you want to be asked for confirmation of every individual upgrade. &prompt.root; portupgrade -ai If you want to upgrade only a certain application, not all available ports, use portupgrade pkgname. Include the flag if portupgrade should first upgrade all the ports required by the given application. &prompt.root; portupgrade -R firefox To use packages instead of ports for installation, provide flag. With this option portupgrade searches the local directories listed in PKG_PATH, or fetches packages from remote site if it is not found locally. If packages can not be found locally or fetched remotely, portupgrade will use ports. To avoid using ports, specify . &prompt.root; portupgrade -PR gnome2 To just fetch distfiles (or packages, if is specified) without building or installing anything, use . For further information see &man.portupgrade.1;. - Upgrading Ports using Portmanager + ¥H Portmanager ¨Ó¤É¯Å¤w¦w¸Ëªº Ports portmanager Portmanager is another utility for easy upgrading of installed ports. It is available from the sysutils/portmanager port: &prompt.root; cd /usr/ports/sysutils/portmanager &prompt.root; make install clean All the installed ports can be upgraded using this simple command: &prompt.root; portmanager -u You can add the flag to get asked for confirmation of every step Portmanager will perform. Portmanager can also be used to install new ports on the system. Unlike the usual make install clean command, it will upgrade all the dependencies prior to building and installing the selected port. &prompt.root; portmanager x11/gnome2 If there are any problems regarding the dependencies for the selected port, you can use Portmanager to rebuild all of them in the correct order. Once finished, the problematic port will be rebuilt too. &prompt.root; portmanager graphics/gimp -f For more information see Portmanager's manual page. - Ports and Disk Space + Ports »PµwºÐªÅ¶¡ ports disk-space Using the Ports Collection will use up disk space over time. After building and installing software from the ports, you should always remember to clean up the temporary work directories using the make clean command. You can sweep the whole Ports Collection with the following command: &prompt.root; portsclean -C You will accumulate a lot of old source distribution files in the distfiles directory over time. You can remove them by hand, or you can use the following command to delete all the distfiles that are no longer referenced by any ports: &prompt.root; portsclean -D The portsclean utility is part of the portupgrade suite. Do not forget to remove the installed ports once you no longer need them. A nice tool to help automate this task is available from the sysutils/pkg_cutleaves port. - Post-installation Activities + ¦w¸Ë¤§«á¡A¦³¤°»ò«áÄòª`·N¨Æ¶µ¶Ü¡H - After installing a new application you will normally want to - read any documentation it may have included, edit any - configuration files that are required, ensure that the - application starts at boot time (if it is a daemon), and so - on. + ³q±`¡A¦w¸Ë§¹³nÅé«á¡A§Ú­Ì¥i¥H¾\Ū©Òªþªº¤@¨Ç¤å¥ó¡A©Î»Ý­n½s¿è³]©wÀÉ¡A + ¨Ó½T«O³o­Ó³nÅé¯à¶¶§Q¹B§@¡A©Î¦b¾÷¾¹¶}¾÷ªº®É­Ô±Ò°Ê(¦pªG¬O daemon ªº¸Ü)µ¥µ¥¡C - The exact steps you need to take to configure each - application will obviously be different. However, if you have - just installed a new application and are wondering What - now? these tips might help: + ¤£¦Pªº³nÅé·|¦³¤£¦Pªº³]©w¨BÆJ¡C¤£ºÞ«ç¼Ë¡A¦pªG¸Ë¦n¤F³nÅé¡A + ¦ý¬O¤£ª¾¹D¤U¤@¨B«ç»ò¿ìªº®É­Ô¡A ¥i¥H¸Õ¸Õ¬Ý³o¨Ç¤p§Þ¥©¡G - Use &man.pkg.info.1; to find out which files were installed, - and where. For example, if you have just - installed FooPackage version 1.0.0, then this command + µ½¥Î &man.pkg.info.1; ¡A³o«ü¥O¥i¥HÅã¥Ü¡G³z¹L®M¥óºÞ²z¨t²Î(Packages/Ports)¸Ë¤F­þ¨Ç³nÅé¡BÀɮ׸˦b­þÃä¡CÁ|¨Ò¨Ó»¡¡A­Y­è¸Ë¤F FooPackage (ª©¥» 1.0.0)¡A¨º»ò¤U­±³o«ü¥O¡G &prompt.root; pkg_info -L foopackage-1.0.0 | less - will show all the files installed by the package. Pay + ´N·|Åã¥Ü³o³nÅé©Ò¦w¸ËªºÀɮײM³æ¡C Pay special attention to files in man/ directories, which will be manual pages, etc/ directories, which will be configuration files, and doc/, which will be more comprehensive documentation. If you are not sure which version of the application was just installed, a command like this &prompt.root; pkg_info | grep -i foopackage will find all the installed packages that have foopackage in the package name. Replace foopackage in your command line as necessary. Once you have identified where the application's manual pages have been installed, review them using &man.man.1;. Similarly, look over the sample configuration files, and any additional documentation that may have been provided. If the application has a web site, check it for additional documentation, frequently asked questions, and so forth. If you are not sure of the web site address it may be listed in the output from &prompt.root; pkg_info foopackage-1.0.0 A WWW: line, if present, should provide a URL for the application's web site. Ports that should start at boot (such as Internet servers) will usually install a sample script in /usr/local/etc/rc.d. You should review this script for correctness and edit or rename it if needed. See Starting Services for more information. - Dealing with Broken Ports + ¦p¦ó³B²zÄê±¼(Broken)ªº Ports¡H - If you come across a port that does not work for you, - there are a few things you can do, including: + ¦pªGµo²{¬Y­Ó port µLªk¶¶§Q¦w¸Ë¡B¹B§@¡A ¦³´XºØ¤èªk¥i¥H¸Õ¸Õ¬Ý¡G - Find out if there is a fix pending for the port in - the Problem Report - database. If so, you may be able to use the - proposed fix. + ±q Problem Report + ¸ê®Æ®w ¤¤«õÄ_¬Ý¬Ý¡A»¡¤£©w¤w¸g¦³¤H°e¥i¥Îªº patch ¤W¥hÅo¡A + ¨º»ò©Î³\´N¥i¥H¶¶§Q¸Ñ¨M°ÝÃD­ù¡C - Ask the maintainer of the port for help. Type - make maintainer or read the - Makefile to find the maintainer's - email address. Remember to include the name and version - of the port (send the $FreeBSD: - line from the Makefile) and the - output leading up to the error when you email the - maintainer. + ¦V¸Ó port ªº maintainer ´M¨D¨ó§U¡G½Ð¥´ + make maintainer ©Î½¾\ + Makefile ¥H¬d¸ß maintainer ªº + email address¡C°O±o±H«Hµ¹ maintainer ®É¡A­nªþµù¸Ó port ªº¦WºÙ¡Bª©¥»(©Î¬O§â Makefile ¤ºªº $FreeBSD: ¨º¤@¾ã¦æªþ¤W) ¥H¤Î¬ÛÃö¿ù»~°T®§¡C Some ports are not maintained by an individual but instead by a mailing list. Many, but not all, of these addresses look like freebsd-listname@FreeBSD.org. Please take this into account when phrasing your questions. - In particular, ports shown as maintained by - freebsd-ports@FreeBSD.org are - actually not maintained by anyone. Fixes and support, if - any, come from the general community who subscribe to that - mailing list. More volunteers are always needed! + ¤×¨ä·í port ªº maintainer Äæ¦ì¬O + freebsd-ports@FreeBSD.org + ®É¡A¨Æ¹ê¤W¤w¸g¨S¤H·í¸Ó port maintainer ¤F¡C + ¦]¦¹­Y¸Ó port ¤´¦³­×¥¿©Î¨ä¥L§Þ³N¤ä´©ªº¸Ü¡A¬ÛÃö°Q½×³£·|¦b freebsd-ports ¶l»¼½×¾Â¤W¥X²{¡C + ³á¡A¹ï¤F¡A¦pªG¦³¼ô±x¸Ó³nÅéªÌ¡A§ÓÄ@·í¸Ó port maintainer ªº¸Ü¡A§Ú­Ì¤]³£«ÜÅwªï±zªº¥[¤J³á¡C - If you do not get a response, - you can use &man.send-pr.1; to submit a bug - report (see ­Y port maintainer ¨S¦³¦^Âбzªº«H¥ó¡A «h¥i¥H¥Î &man.send-pr.1; + ¨Ó´£¥æ°ÝÃD³ø§i PR¡C(½Ð°Ñ¾\ Writing - FreeBSD Problem Reports). + FreeBSD Problem Reports)¡C - Fix it! The ¸Õ¸Õ¬Ý­×¥¿¥¦§a! Porter's - Handbook includes detailed information on the - Ports infrastructure so that you can fix the occasional - broken port or even submit your own! + Handbook ¥]¬A¤F Ports + ¬[ºcªº²Ó¸`³¡¥÷¡A³o¨Ç®Ñ¤¤¤º®e¦³§U±z­×¦n¦³°ÝÃDªº port ¬Æ¦Ü´£¥æ¦Û¤vªº port¡T - Grab the package from an FTP site near you. The - master package collection is on ftp.FreeBSD.org in the ±q¸ûªñªº FTP ¯¸ÂI¤U¸ü½sͦnªº package¡C + package collection ªº³Ì¤W´å¯¸¬O¦b ftp.FreeBSD.org ¤Wªº packages - directory, but be sure to check your ¤º¡A¦ý½Ð°O±o¥ýÀˬd¬O§_¤w¦³ local mirror - first! These are more likely to work - than trying to compile from source and are a lot faster as - well. Use the &man.pkg.add.1; program to install the - package on your system. + ¯¸! ³q±`±¡ªp¤U³o¨Ç package ³£¥i¥Hª½±µ¨Ï¥Î¡A¦Ó¥BÀ³¸Ó¤ñ¦Û¦æ½s֤ͧ@¨Ç¡C + ¥Î &man.pkg.add.1; §Y¥i¶¶§Q¦w¸Ë package ¡C diff --git a/zh_TW.Big5/books/handbook/security/chapter.sgml b/zh_TW.Big5/books/handbook/security/chapter.sgml index 58d2b80de9..0ec3c4b8db 100644 --- a/zh_TW.Big5/books/handbook/security/chapter.sgml +++ b/zh_TW.Big5/books/handbook/security/chapter.sgml @@ -1,5123 +1,5087 @@ Matthew Dillon Much of this chapter has been taken from the security(7) manual page by - Security + ¨t²Î¦w¥þ security - Synopsis + ·§­z - This chapter will provide a basic introduction to system security - concepts, some general good rules of thumb, and some advanced topics - under &os;. A lot of the topics covered here can be applied - to system and Internet security in general as well. The Internet - is no longer a friendly place in which everyone - wants to be your kind neighbor. Securing your system is imperative - to protect your data, intellectual property, time, and much more - from the hands of hackers and the like. + ³o¤@³¹±N¹ï¨t²Î¦w¥þªº°ò¥»·§©À¶i¦æ¤¶²Ð¡A°£¦¹¤§¥~¡AÁÙ±N¤¶²Ð¤@¨Ç¦nªº²ßºD¡A¥H¤Î + &os; ¤Uªº¤@¨Ç§ó²`¤Jªº¸ÜÃD¡C³o³¹ªº³\¦h¤º®e¹ï©ó¤@¯ëªº¨t²Î©M Internet + ¦w¥þ¤]¾A¥Î¡C¦p¤µ¡AInternet ¤w¸g¤£¦A¹³¥H«e¨º¼Ë¬O­Ó¤H¤H³£Ä@·N»P±z§@¦n¾F©~ªº¡y¤Íµ½³õ©Ò¡z¡C + ¥²¶·Åý¨t²Î§ó¦w¥þ¡A¤~¯à¥h«OÅ@±zªº¸ê®Æ¡B´¼¼z°]²£¡BÄ_¶Q®É¶¡¥H¤Î¨ä¥L«Ü¦hªF¦è¡A + ¦Ó¤£¦Ü©ó³Q¤J«IªÌ©Î¤ß¦s´c·Nªº¤H©ÒÅѨú¡C - &os; provides an array of utilities and mechanisms to ensure - the integrity and security of your system and network. + &os; ´£¨Ñ¤F¤@¨t¦C¤u¨ã©M¬ÛÃö¾÷¨î¡A¨Ó½T«O¨t²Î©Mºô¸ôªº§¹¾ã¡B¦w¥þ¡C - After reading this chapter, you will know: + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡J - Basic system security concepts, in respect to &os;. + &os; ¨t²Îªº°ò¥»¦w¥þ·§©À¡C - About the various crypt mechanisms available in &os;, - such as DES and MD5. + &os; ¤¤³\¦h¥i¥Îªº¥[±K¾÷¨î¡A¨Ò¦p DES ¤Î + MD5¡C - How to set up one-time password authentication. + ¦p¦ó«Ø¥ß¤@¦¸©Ê(one-time)±K½XÅçÃÒ¾÷¨î¡C - How to configure TCP Wrappers for use - with inetd. + ¦p¦ó³]©w TCP Wrappers + ¥H«K»P inetd °t¦X¨Ï¥Î¡C - How to set up KerberosIV on &os; - releases prior to 5.0. + ¦p¦ó¦b &os; 5.0. ¤§«eªºª©¥»¤W³]©w KerberosIV¡C - How to set up Kerberos5 on - post &os; 5.0 releases. + ¦p¦ó¦b &os; 5.0 (§t¤§«áª©¥»)¤W³]©w Kerberos5¡C - How to configure IPsec and create a VPN between - &os;/&windows; machines. + ¦p¦ó³]©w IPsec ¥H¤Î¦b &os;/&windows; ¤W«Ø¥ß VPN ºô¸ô¡C - How to configure and use OpenSSH, &os;'s SSH - implementation. + ¦p¦ó³]©w¡B¹B¥Î OpenSSH¡A¥H¤Î &os; ªº + SSH ¹ê§@¤è¦¡(implementation) - What file system ACLs are and how to use them. + ¤F¸ÑÀɮרt²Îªº ACLs ¾÷¨î¬°¦ó¡A¥H¤Î¦p¦ó¹B¥Î¡C - How to use the Portaudit - utility to audit third party software packages installed - from the Ports Collection. + ¦p¦ó¨Ï¥Î Portaudit + ¤u¨ã¨ÓÀËÅç(audit) ±q Ports Collection ¦w¸Ëªº³nÅé¦w¥þ©Ê¡C - How to utilize the &os; security advisories - publications. + ¦p¦óµ½¥Î &os; ¦w¥þ¤½§i(Security Advisories)¡A¨Ã±Ä¨ú¬ÛÀ³±¹¬I¡C - Have an idea of what Process Accounting is and how to - enable it on &os;. + ÁA¸Ñ Process Accounting ¾÷¨î¤Î¦p¦ó¦b &os; ¤W±Ò°Ê¡C - Before reading this chapter, you should: + ¦b¶}©l¾\Ū³o³¹¤§«e¡A±z»Ý­n¡J - Understand basic &os; and Internet concepts. + ÁA¸Ñ &os; ¤Î Internet ªº°ò¥»·§©À¡C - Additional security topics are covered throughout this book. - For example, Mandatory Access Control is discussed in and Internet Firewalls are discussed in . + ¥»®Ñ¤¤¨ä¥L³¹¸`¡A¤]¦³¤¶²Ð¦w¥þ¤è­±ªº¨ä¥L¸ÜÃD¡C¨Ò¦p¡G + ¦b ¦³½Í¨ì Mandatory Access Control¡A Internet Firewalls «h¦b ¡C - Introduction - - Security is a function that begins and ends with the system - administrator. While all BSD &unix; multi-user systems have some - inherent security, the job of building and maintaining additional - security mechanisms to keep those users honest is - probably one of the single largest undertakings of the sysadmin. - Machines are only as secure as you make them, and security concerns - are ever competing with the human necessity for convenience. &unix; - systems, in general, are capable of running a huge number of - simultaneous processes and many of these processes operate as - servers — meaning that external entities can connect and talk - to them. As yesterday's mini-computers and mainframes become - today's desktops, and as computers become networked and - internetwork, security becomes an even bigger issue. - - Security is best implemented through a layered - onion approach. In a nutshell, what you want to do is - to create as many layers of security as are convenient and then - carefully monitor the system for intrusions. You do not want to + ¤¶²Ð + + ¦w¥þ¡A¹ï¨t²ÎºÞ²zªÌ¦Ó¨¥¡A¬O¦Ü©l¦Ü²×³Ì°ò¥»ªº­n¨D¡C¥Ñ©ó©Ò¦³ªº BSD &unix; multi-user + ¨t²Î³£´£¨Ñ¤F»P¥Í­Ñ¨Óªº°ò¥»¦w¥þ¡A©Ò¥H«Ø¥ß¡BºûÅ@ÃB¥~ªº¦w¥þ¾÷¨î¡A¥H½T«O¨Ï¥ÎªÌªº¡y¥i¾a¡z¡A + ¥i¯à¤]´N¬O¨t²ÎºÞ²z­û³Ì»Ý­n·V«äªºÁ}¥¨¥ô°È¤F¡C¾÷¾¹ªº¦w¥þ©Ê¨ú¨M©ó±z©Ò«Ø¥ßªº¦w¥þ±¹¬I¡A + ¦Ó³\¦h¦w¥þ¤è­±ªº¦Ò¶q¡A«h·|»P¤H­Ì¨Ï¥Î¹q¸£®Éªº«K§Q¬Û¥Ù¬Þ¡C¤@¯ë¨Ó»¡¡A &unix; + ¨t²Î¥i¦P®É°õ¦æ³\¦h¼Æ¥Øªºµ{¦¡ process ¡A¨Ã¥B¨ä¤¤³\¦h process ¤]¦P®É¥H Server ºÝ¨Ó¹B§@¡C + ¢w¢w ³o·N¨ýµÛ¡A¥~³¡¹êÅé¾÷¾¹¯à°÷»P¥¦­Ì¤¬¬Û³s±µ¡A¨Ã²£¥Í¤¬°Ê¡C²{¦bªº¤@¯ë®à¾÷¡A + ¤w¸g¯à°÷¹F¨ì¥H«e¤p«¬¥D¾÷¬Æ¦Ü¤j«¬¥D¾÷ªº©Ê¯à¡A¦ÓÀHµÛ³o¨Ç¹q¸£ªººô¸ô³s±µ©M¦b§ó¤j½d³ò¤º¤¬¬Û³s±µ + ¡A¦w¥þ¤]¦¨¬°¤F¤@­Ó¤é¯qÄY®mªº½ÒÃD¡C + + ¦w¥þ³Ì¦nªº¤è¦¡¡A¬O¯à°÷³z¹L¹³¡y¬v½µ¡z¨º¼Ëªº¼h¼h¨¾Å@¼Ò¦¡¡C + ²³æÁ¿¡AÀ³¸Ó¾¨¥i¯àªº«Ø¥ß¦h¼h¦¸¦w¥þ¨¾Å@¡A¨Ã¤p¤ß¦aºÊµø¦UÃþ°w¹ï¨t²Îªº¤J«IºÃÂI¡C + You do not want to overbuild your security or you will interfere with the detection side, and detection is one of the single most important aspects of any security mechanism. For example, it makes little sense to set the schg flag (see &man.chflags.1;) on every system binary because while this may temporarily protect the binaries, it prevents an attacker who has broken in from making an easily detectable change that may result in your security mechanisms not detecting the attacker at all. System security also pertains to dealing with various forms of attack, including attacks that attempt to crash, or otherwise make a system unusable, but do not attempt to compromise the root account (break root). Security concerns can be split up into several categories: - Denial of service attacks. + ªA°ÈªýÂ_§ðÀ»(DoS) - User account compromises. + ÅѨú¨ä¥L¨Ï¥ÎªÌªº±b¸¹¡C - Root compromise through accessible servers. + ³z¹L¦U¦¡ Server ¤W©Ò´£¨Ñªº Service ¨ÓÅѨú root ±b¸¹¡C - Root compromise via user accounts. + ³z¹L¨Ï¥ÎªÌ±b¸¹ÅѨú root ±b¸¹¡C - Backdoor creation. + ¶}«áªù¡C DoS attacks Denial of Service (DoS) security DoS attacks Denial of Service (DoS) Denial of Service (DoS) A denial of service attack is an action that deprives the machine of needed resources. Typically, DoS attacks are brute-force mechanisms that attempt to crash or otherwise make a machine unusable by overwhelming its servers or network stack. Some DoS attacks try to take advantage of bugs in the networking stack to crash a machine with a single packet. The latter can only be fixed by applying a bug fix to the kernel. Attacks on servers can often be fixed by properly specifying options to limit the load the servers incur on the system under adverse conditions. Brute-force network attacks are harder to deal with. A spoofed-packet attack, for example, is nearly impossible to stop, short of cutting your system off from the Internet. It may not be able to take your machine down, but it can saturate your Internet connection. security account compromises A user account compromise is even more common than a DoS attack. Many sysadmins still run standard telnetd, rlogind, rshd, and ftpd servers on their machines. These servers, by default, do not operate over encrypted connections. The result is that if you have any moderate-sized user base, one or more of your users logging into your system from a remote location (which is the most common and convenient way to login to a system) will have his or her password sniffed. The attentive system admin will analyze his remote access logs looking for suspicious source addresses even for successful logins. One must always assume that once an attacker has access to a user account, the attacker can break root. However, the reality is that in a well secured and maintained system, access to a user account does not necessarily give the attacker access to root. The distinction is important because without access to root the attacker cannot generally hide his tracks and may, at best, be able to do nothing more than mess with the user's files, or crash the machine. User account compromises are very common because users tend not to take the precautions that sysadmins take. security backdoors System administrators must keep in mind that there are potentially many ways to break root on a machine. The attacker may know the root password, the attacker may find a bug in a root-run server and be able to break root over a network connection to that server, or the attacker may know of a bug in a suid-root program that allows the attacker to break root once he has broken into a user's account. If an attacker has found a way to break root on a machine, the attacker may not have a need to install a backdoor. Many of the root holes found and closed to date involve a considerable amount of work by the attacker to cleanup after himself, so most attackers install backdoors. A backdoor provides the attacker with a way to easily regain root access to the system, but it also gives the smart system administrator a convenient way to detect the intrusion. Making it impossible for an attacker to install a backdoor may actually be detrimental to your security, because it will not close off the hole the attacker found to break in the first place. Security remedies should always be implemented with a multi-layered onion peel approach and can be categorized as follows: Securing root and staff accounts. Securing root–run servers and suid/sgid binaries. Securing user accounts. Securing the password file. Securing the kernel core, raw devices, and file systems. Quick detection of inappropriate changes made to the system. Paranoia. The next section of this chapter will cover the above bullet items in greater depth. - Securing &os; + &os; ªº¨t²Î¦w¥þ security securing &os; Command vs. Protocol Throughout this document, we will use bold text to refer to an application, and a monospaced font to refer to specific commands. Protocols will use a normal font. This typographical distinction is useful for instances such as ssh, since it is a protocol as well as command. The sections that follow will cover the methods of securing your &os; system that were mentioned in the last section of this chapter. Securing the <username>root</username> Account and Staff Accounts su First off, do not bother securing staff accounts if you have not secured the root account. Most systems have a password assigned to the root account. The first thing you do is assume that the password is always compromised. This does not mean that you should remove the password. The password is almost always necessary for console access to the machine. What it does mean is that you should not make it possible to use the password outside of the console or possibly even with the &man.su.1; command. For example, make sure that your ptys are specified as being insecure in the /etc/ttys file so that direct root logins via telnet or rlogin are disallowed. If using other login services such as sshd, make sure that direct root logins are disabled there as well. You can do this by editing your /etc/ssh/sshd_config file, and making sure that PermitRootLogin is set to NO. Consider every access method — services such as FTP often fall through the cracks. Direct root logins should only be allowed via the system console. wheel Of course, as a sysadmin you have to be able to get to root, so we open up a few holes. But we make sure these holes require additional password verification to operate. One way to make root accessible is to add appropriate staff accounts to the wheel group (in /etc/group). The staff members placed in the wheel group are allowed to su to root. You should never give staff members native wheel access by putting them in the wheel group in their password entry. Staff accounts should be placed in a staff group, and then added to the wheel group via the /etc/group file. Only those staff members who actually need to have root access should be placed in the wheel group. It is also possible, when using an authentication method such as Kerberos, to use Kerberos' .k5login file in the root account to allow a &man.ksu.1; to root without having to place anyone at all in the wheel group. This may be the better solution since the wheel mechanism still allows an intruder to break root if the intruder has gotten hold of your password file and can break into a staff account. While having the wheel mechanism is better than having nothing at all, it is not necessarily the safest option. An indirect way to secure staff accounts, and ultimately root access is to use an alternative login access method and do what is known as starring out the encrypted password for the staff accounts. Using the &man.vipw.8; command, one can replace each instance of an encrypted password with a single * character. This command will update the /etc/master.passwd file and user/password database to disable password-authenticated logins. A staff account entry such as: foobar:R9DT/Fa1/LV9U:1000:1000::0:0:Foo Bar:/home/foobar:/usr/local/bin/tcsh Should be changed to this: foobar:*:1000:1000::0:0:Foo Bar:/home/foobar:/usr/local/bin/tcsh This change will prevent normal logins from occurring, since the encrypted password will never match *. With this done, staff members must use another mechanism to authenticate themselves such as &man.kerberos.1; or &man.ssh.1; using a public/private key pair. When using something like Kerberos, one generally must secure the machines which run the Kerberos servers and your desktop workstation. When using a public/private key pair with ssh, one must generally secure the machine used to login from (typically one's workstation). An additional layer of protection can be added to the key pair by password protecting the key pair when creating it with &man.ssh-keygen.1;. Being able to star out the passwords for staff accounts also guarantees that staff members can only login through secure access methods that you have set up. This forces all staff members to use secure, encrypted connections for all of their sessions, which closes an important hole used by many intruders: sniffing the network from an unrelated, less secure machine. The more indirect security mechanisms also assume that you are logging in from a more restrictive server to a less restrictive server. For example, if your main box is running all sorts of servers, your workstation should not be running any. In order for your workstation to be reasonably secure you should run as few servers as possible, up to and including no servers at all, and you should run a password-protected screen blanker. Of course, given physical access to a workstation an attacker can break any sort of security you put on it. This is definitely a problem that you should consider, but you should also consider the fact that the vast majority of break-ins occur remotely, over a network, from people who do not have physical access to your workstation or servers. KerberosIV Using something like Kerberos also gives you the ability to disable or change the password for a staff account in one place, and have it immediately affect all the machines on which the staff member may have an account. If a staff member's account gets compromised, the ability to instantly change his password on all machines should not be underrated. With discrete passwords, changing a password on N machines can be a mess. You can also impose re-passwording restrictions with Kerberos: not only can a Kerberos ticket be made to timeout after a while, but the Kerberos system can require that the user choose a new password after a certain period of time (say, once a month). Securing Root-run Servers and SUID/SGID Binaries ntalk comsat finger sandboxes sshd telnetd rshd rlogind The prudent sysadmin only runs the servers he needs to, no more, no less. Be aware that third party servers are often the most bug-prone. For example, running an old version of imapd or popper is like giving a universal root ticket out to the entire world. Never run a server that you have not checked out carefully. Many servers do not need to be run as root. For example, the ntalk, comsat, and finger daemons can be run in special user sandboxes. A sandbox is not perfect, unless you go through a large amount of trouble, but the onion approach to security still stands: If someone is able to break in through a server running in a sandbox, they still have to break out of the sandbox. The more layers the attacker must break through, the lower the likelihood of his success. Root holes have historically been found in virtually every server ever run as root, including basic system servers. If you are running a machine through which people only login via sshd and never login via telnetd or rshd or rlogind, then turn off those services! &os; now defaults to running ntalkd, comsat, and finger in a sandbox. Another program which may be a candidate for running in a sandbox is &man.named.8;. /etc/defaults/rc.conf includes the arguments necessary to run named in a sandbox in a commented-out form. Depending on whether you are installing a new system or upgrading an existing system, the special user accounts used by these sandboxes may not be installed. The prudent sysadmin would research and implement sandboxes for servers whenever possible. sendmail There are a number of other servers that typically do not run in sandboxes: sendmail, popper, imapd, ftpd, and others. There are alternatives to some of these, but installing them may require more work than you are willing to perform (the convenience factor strikes again). You may have to run these servers as root and rely on other mechanisms to detect break-ins that might occur through them. The other big potential root holes in a system are the suid-root and sgid binaries installed on the system. Most of these binaries, such as rlogin, reside in /bin, /sbin, /usr/bin, or /usr/sbin. While nothing is 100% safe, the system-default suid and sgid binaries can be considered reasonably safe. Still, root holes are occasionally found in these binaries. A root hole was found in Xlib in 1998 that made xterm (which is typically suid) vulnerable. It is better to be safe than sorry and the prudent sysadmin will restrict suid binaries, that only staff should run, to a special group that only staff can access, and get rid of (chmod 000) any suid binaries that nobody uses. A server with no display generally does not need an xterm binary. Sgid binaries can be almost as dangerous. If an intruder can break an sgid-kmem binary, the intruder might be able to read /dev/kmem and thus read the encrypted password file, potentially compromising any passworded account. Alternatively an intruder who breaks group kmem can monitor keystrokes sent through ptys, including ptys used by users who login through secure methods. An intruder that breaks the tty group can write to almost any user's tty. If a user is running a terminal program or emulator with a keyboard-simulation feature, the intruder can potentially generate a data stream that causes the user's terminal to echo a command, which is then run as that user. Securing User Accounts User accounts are usually the most difficult to secure. While you can impose Draconian access restrictions on your staff and star out their passwords, you may not be able to do so with any general user accounts you might have. If you do have sufficient control, then you may win out and be able to secure the user accounts properly. If not, you simply have to be more vigilant in your monitoring of those accounts. Use of ssh and Kerberos for user accounts is more problematic, due to the extra administration and technical support required, but still a very good solution compared to a crypted password file. Securing the Password File The only sure fire way is to * out as many passwords as you can and use ssh or Kerberos for access to those accounts. Even though the encrypted password file (/etc/spwd.db) can only be read by root, it may be possible for an intruder to obtain read access to that file even if the attacker cannot obtain root-write access. Your security scripts should always check for and report changes to the password file (see the Checking file integrity section below). Securing the Kernel Core, Raw Devices, and File systems If an attacker breaks root he can do just about anything, but there are certain conveniences. For example, most modern kernels have a packet sniffing device driver built in. Under &os; it is called the bpf device. An intruder will commonly attempt to run a packet sniffer on a compromised machine. You do not need to give the intruder the capability and most systems do not have the need for the bpf device compiled in. sysctl But even if you turn off the bpf device, you still have /dev/mem and /dev/kmem to worry about. For that matter, the intruder can still write to raw disk devices. Also, there is another kernel feature called the module loader, &man.kldload.8;. An enterprising intruder can use a KLD module to install his own bpf device, or other sniffing device, on a running kernel. To avoid these problems you have to run the kernel at a higher secure level, at least securelevel 1. The securelevel can be set with a sysctl on the kern.securelevel variable. Once you have set the securelevel to 1, write access to raw devices will be denied and special chflags flags, such as schg, will be enforced. You must also ensure that the schg flag is set on critical startup binaries, directories, and script files — everything that gets run up to the point where the securelevel is set. This might be overdoing it, and upgrading the system is much more difficult when you operate at a higher secure level. You may compromise and run the system at a higher secure level but not set the schg flag for every system file and directory under the sun. Another possibility is to simply mount / and /usr read-only. It should be noted that being too Draconian in what you attempt to protect may prevent the all-important detection of an intrusion. Checking File Integrity: Binaries, Configuration Files, Etc. When it comes right down to it, you can only protect your core system configuration and control files so much before the convenience factor rears its ugly head. For example, using chflags to set the schg bit on most of the files in / and /usr is probably counterproductive, because while it may protect the files, it also closes a detection window. The last layer of your security onion is perhaps the most important — detection. The rest of your security is pretty much useless (or, worse, presents you with a false sense of safety) if you cannot detect potential incursions. Half the job of the onion is to slow down the attacker, rather than stop him, in order to give the detection side of the equation a chance to catch him in the act. The best way to detect an incursion is to look for modified, missing, or unexpected files. The best way to look for modified files is from another (often centralized) limited-access system. Writing your security scripts on the extra-secure limited-access system makes them mostly invisible to potential attackers, and this is important. In order to take maximum advantage you generally have to give the limited-access box significant access to the other machines in the business, usually either by doing a read-only NFS export of the other machines to the limited-access box, or by setting up ssh key-pairs to allow the limited-access box to ssh to the other machines. Except for its network traffic, NFS is the least visible method — allowing you to monitor the file systems on each client box virtually undetected. If your limited-access server is connected to the client boxes through a switch, the NFS method is often the better choice. If your limited-access server is connected to the client boxes through a hub, or through several layers of routing, the NFS method may be too insecure (network-wise) and using ssh may be the better choice even with the audit-trail tracks that ssh lays. Once you give a limited-access box, at least read access to the client systems it is supposed to monitor, you must write scripts to do the actual monitoring. Given an NFS mount, you can write scripts out of simple system utilities such as &man.find.1; and &man.md5.1;. It is best to physically md5 the client-box files at least once a day, and to test control files such as those found in /etc and /usr/local/etc even more often. When mismatches are found, relative to the base md5 information the limited-access machine knows is valid, it should scream at a sysadmin to go check it out. A good security script will also check for inappropriate suid binaries and for new or deleted files on system partitions such as / and /usr. When using ssh rather than NFS, writing the security script is much more difficult. You essentially have to scp the scripts to the client box in order to run them, making them visible, and for safety you also need to scp the binaries (such as find) that those scripts use. The ssh client on the client box may already be compromised. All in all, using ssh may be necessary when running over insecure links, but it is also a lot harder to deal with. A good security script will also check for changes to user and staff members access configuration files: .rhosts, .shosts, .ssh/authorized_keys and so forth… files that might fall outside the purview of the MD5 check. If you have a huge amount of user disk space, it may take too long to run through every file on those partitions. In this case, setting mount flags to disallow suid binaries and devices on those partitions is a good idea. The nodev and nosuid options (see &man.mount.8;) are what you want to look into. You should probably scan them anyway, at least once a week, since the object of this layer is to detect a break-in whether or not the break-in is effective. Process accounting (see &man.accton.8;) is a relatively low-overhead feature of the operating system which might help as a post-break-in evaluation mechanism. It is especially useful in tracking down how an intruder has actually broken into a system, assuming the file is still intact after the break-in occurs. Finally, security scripts should process the log files, and the logs themselves should be generated in as secure a manner as possible — remote syslog can be very useful. An intruder tries to cover his tracks, and log files are critical to the sysadmin trying to track down the time and method of the initial break-in. One way to keep a permanent record of the log files is to run the system console to a serial port and collect the information on a continuing basis through a secure machine monitoring the consoles. Paranoia A little paranoia never hurts. As a rule, a sysadmin can add any number of security features, as long as they do not affect convenience, and can add security features that do affect convenience with some added thought. Even more importantly, a security administrator should mix it up a bit — if you use recommendations such as those given by this document verbatim, you give away your methodologies to the prospective attacker who also has access to this document. - Denial of Service Attacks + DoS(Denial of Service)ªA°ÈªýÂ_§ðÀ» Denial of Service (DoS) - This section covers Denial of Service attacks. A DoS attack - is typically a packet attack. While there is not much you can do - about modern spoofed packet attacks that saturate your network, - you can generally limit the damage by ensuring that the attacks - cannot take down your servers. + ³o¤@¸`±N¤¶²ÐªA°ÈªýÂ_§ðÀ»¡C DoS §ðÀ»³q±`¬O¥H«Ê¥]ªº¤è¦¡¶i¦æ§ðÀ»¡A + ¾¨ºÞ´X¥G¨S¦³¥ô¦ó¿ìªk¨Óªý¤î¤j¶qªº°°³y«Ê¥]¯ÓºÉºô¸ô¸ê·½¡A + ¦ý³q±`¥i¥H³z¹L¤@¨Ç¤è¦¡¨Ó­°§C³oÃþ§ðÀ»ªº·l®`¡A¨Ï¥¦­ÌµLªkÀ»«±¦øªA¾¹¡C Limiting server forks. - Limiting springboard attacks (ICMP response attacks, ping - broadcast, etc.). + Limiting springboard attacks (ICMP response §ðÀ»¡Aping + broadcastµ¥µ¥) Kernel Route Cache. A common DoS attack is against a forking server that attempts to cause the server to eat processes, file descriptors, and memory, until the machine dies. inetd (see &man.inetd.8;) has several options to limit this sort of attack. It should be noted that while it is possible to prevent a machine from going down, it is not generally possible to prevent a service from being disrupted by the attack. Read the inetd manual page carefully and pay specific attention to the , , and options. Note that spoofed-IP attacks will circumvent the option to inetd, so typically a combination of options must be used. Some standalone servers have self-fork-limitation parameters. Sendmail has its option, which tends to work much better than trying to use sendmail's load limiting options due to the load lag. You should specify a MaxDaemonChildren parameter, when you start sendmail, high enough to handle your expected load, but not so high that the computer cannot handle that number of sendmails without falling on its face. It is also prudent to run sendmail in queued mode () and to run the daemon (sendmail -bd) separate from the queue-runs (sendmail -q15m). If you still want real-time delivery you can run the queue at a much lower interval, such as , but be sure to specify a reasonable MaxDaemonChildren option for that sendmail to prevent cascade failures. Syslogd can be attacked directly and it is strongly recommended that you use the option whenever possible, and the option otherwise. You should also be fairly careful with connect-back services such as TCP Wrapper's reverse-identd, which can be attacked directly. You generally do not want to use the reverse-ident feature of TCP Wrapper for this reason. It is a very good idea to protect internal services from external access by firewalling them off at your border routers. The idea here is to prevent saturation attacks from outside your LAN, not so much to protect internal services from network-based root compromise. Always configure an exclusive firewall, i.e., firewall everything except ports A, B, C, D, and M-Z. This way you can firewall off all of your low ports except for certain specific services such as named (if you are primary for a zone), ntalkd, sendmail, and other Internet-accessible services. If you try to configure the firewall the other way — as an inclusive or permissive firewall, there is a good chance that you will forget to close a couple of services, or that you will add a new internal service and forget to update the firewall. You can still open up the high-numbered port range on the firewall, to allow permissive-like operation, without compromising your low ports. Also take note that &os; allows you to control the range of port numbers used for dynamic binding, via the various net.inet.ip.portrange sysctl's (sysctl -a | fgrep portrange), which can also ease the complexity of your firewall's configuration. For example, you might use a normal first/last range of 4000 to 5000, and a hiport range of 49152 to 65535, then block off everything under 4000 in your firewall (except for certain specific Internet-accessible ports, of course). Another common DoS attack is called a springboard attack — to attack a server in a manner that causes the server to generate responses which overloads the server, the local network, or some other machine. The most common attack of this nature is the ICMP ping broadcast attack. The attacker spoofs ping packets sent to your LAN's broadcast address with the source IP address set to the actual machine they wish to attack. If your border routers are not configured to stomp on ping's to broadcast addresses, your LAN winds up generating sufficient responses to the spoofed source address to saturate the victim, especially when the attacker uses the same trick on several dozen broadcast addresses over several dozen different networks at once. Broadcast attacks of over a hundred and twenty megabits have been measured. A second common springboard attack is against the ICMP error reporting system. By constructing packets that generate ICMP error responses, an attacker can saturate a server's incoming network and cause the server to saturate its outgoing network with ICMP responses. This type of attack can also crash the server by running it out of mbuf's, especially if the server cannot drain the ICMP responses it generates fast enough. &os; 4.X kernels have a kernel compile option called which limits the effectiveness of these sorts of attacks. Later kernels use the sysctl variable net.inet.icmp.icmplim. The last major class of springboard attacks is related to certain internal inetd services such as the udp echo service. An attacker simply spoofs a UDP packet with the source address being server A's echo port, and the destination address being server B's echo port, where server A and B are both on your LAN. The two servers then bounce this one packet back and forth between each other. The attacker can overload both servers and their LANs simply by injecting a few packets in this manner. Similar problems exist with the internal chargen port. A competent sysadmin will turn off all of these inetd-internal test services. Spoofed packet attacks may also be used to overload the kernel route cache. Refer to the net.inet.ip.rtexpire, rtminexpire, and rtmaxcache sysctl parameters. A spoofed packet attack that uses a random source IP will cause the kernel to generate a temporary cached route in the route table, viewable with netstat -rna | fgrep W3. These routes typically timeout in 1600 seconds or so. If the kernel detects that the cached route table has gotten too big it will dynamically reduce the rtexpire but will never decrease it to less than rtminexpire. There are two problems: The kernel does not react quickly enough when a lightly loaded server is suddenly attacked. The rtminexpire is not low enough for the kernel to survive a sustained attack. If your servers are connected to the Internet via a T3 or better, it may be prudent to manually override both rtexpire and rtminexpire via &man.sysctl.8;. Never set either parameter to zero (unless you want to crash the machine). Setting both parameters to 2 seconds should be sufficient to protect the route table from attack. Access Issues with Kerberos and SSH ssh KerberosIV There are a few issues with both Kerberos and ssh that need to be addressed if you intend to use them. Kerberos V is an excellent authentication protocol, but there are bugs in the kerberized telnet and rlogin applications that make them unsuitable for dealing with binary streams. Also, by default Kerberos does not encrypt a session unless you use the option. ssh encrypts everything by default. ssh works quite well in every respect except that it forwards encryption keys by default. What this means is that if you have a secure workstation holding keys that give you access to the rest of the system, and you ssh to an insecure machine, your keys are usable. The actual keys themselves are not exposed, but ssh installs a forwarding port for the duration of your login, and if an attacker has broken root on the insecure machine he can utilize that port to use your keys to gain access to any other machine that your keys unlock. We recommend that you use ssh in combination with Kerberos whenever possible for staff logins. ssh can be compiled with Kerberos support. This reduces your reliance on potentially exposed ssh keys while at the same time protecting passwords via Kerberos. ssh keys should only be used for automated tasks from secure machines (something that Kerberos is unsuited to do). We also recommend that you either turn off key-forwarding in the ssh configuration, or that you make use of the from=IP/DOMAIN option that ssh allows in its authorized_keys file to make the key only usable to entities logging in from specific machines. Bill Swingle Parts rewritten and updated by DES, MD5, and Crypt security crypt crypt DES MD5 Every user on a &unix; system has a password associated with their account. It seems obvious that these passwords need to be known only to the user and the actual operating system. In order to keep these passwords secret, they are encrypted with what is known as a one-way hash, that is, they can only be easily encrypted but not decrypted. In other words, what we told you a moment ago was obvious is not even true: the operating system itself does not really know the password. It only knows the encrypted form of the password. The only way to get the plain-text password is by a brute force search of the space of possible passwords. Unfortunately the only secure way to encrypt passwords when &unix; came into being was based on DES, the Data Encryption Standard. This was not such a problem for users resident in the US, but since the source code for DES could not be exported outside the US, &os; had to find a way to both comply with US law and retain compatibility with all the other &unix; variants that still used DES. The solution was to divide up the encryption libraries so that US users could install the DES libraries and use DES but international users still had an encryption method that could be exported abroad. This is how &os; came to use MD5 as its default encryption method. MD5 is believed to be more secure than DES, so installing DES is offered primarily for compatibility reasons. Recognizing Your Crypt Mechanism Before &os; 4.4 libcrypt.a was a symbolic link pointing to the library which was used for encryption. &os; 4.4 changed libcrypt.a to provide a configurable password authentication hash library. Currently the library supports DES, MD5 and Blowfish hash functions. By default &os; uses MD5 to encrypt passwords. It is pretty easy to identify which encryption method &os; is set up to use. Examining the encrypted passwords in the /etc/master.passwd file is one way. Passwords encrypted with the MD5 hash are longer than those encrypted with the DES hash and also begin with the characters $1$. Passwords starting with $2a$ are encrypted with the Blowfish hash function. DES password strings do not have any particular identifying characteristics, but they are shorter than MD5 passwords, and are coded in a 64-character alphabet which does not include the $ character, so a relatively short string which does not begin with a dollar sign is very likely a DES password. The password format used for new passwords is controlled by the passwd_format login capability in /etc/login.conf, which takes values of des, md5 or blf. See the &man.login.conf.5; manual page for more information about login capabilities. One-time Passwords one-time passwords security one-time passwords S/Key is a one-time password scheme based on a one-way hash function. &os; uses the MD4 hash for compatibility but other systems have used MD5 and DES-MAC. S/Key has been part of the &os; base system since version 1.1.5 and is also used on a growing number of other operating systems. S/Key is a registered trademark of Bell Communications Research, Inc. From version 5.0 of &os;, S/Key has been replaced with the functionally equivalent OPIE (One-time Passwords In Everything). OPIE uses the MD5 hash by default. There are three different sorts of passwords which we will discuss below. The first is your usual &unix; style or Kerberos password; we will call this a &unix; password. The second sort is the one-time password which is generated by the S/Key key program or the OPIE &man.opiekey.1; program and accepted by the keyinit or &man.opiepasswd.1; programs and the login prompt; we will call this a one-time password. The final sort of password is the secret password which you give to the key/opiekey programs (and sometimes the keyinit/opiepasswd programs) which it uses to generate one-time passwords; we will call it a secret password or just unqualified password. The secret password does not have anything to do with your &unix; password; they can be the same but this is not recommended. S/Key and OPIE secret passwords are not limited to 8 characters like old &unix; passwordsUnder &os; the standard login password may be up to 128 characters in length., they can be as long as you like. Passwords of six or seven word long phrases are fairly common. For the most part, the S/Key or OPIE system operates completely independently of the &unix; password system. Besides the password, there are two other pieces of data that are important to S/Key and OPIE. One is what is known as the seed or key, consisting of two letters and five digits. The other is what is called the iteration count, a number between 1 and 100. S/Key creates the one-time password by concatenating the seed and the secret password, then applying the MD4/MD5 hash as many times as specified by the iteration count and turning the result into six short English words. These six English words are your one-time password. The authentication system (primarily PAM) keeps track of the last one-time password used, and the user is authenticated if the hash of the user-provided password is equal to the previous password. Because a one-way hash is used it is impossible to generate future one-time passwords if a successfully used password is captured; the iteration count is decremented after each successful login to keep the user and the login program in sync. When the iteration count gets down to 1, S/Key and OPIE must be reinitialized. There are three programs involved in each system which we will discuss below. The key and opiekey programs accept an iteration count, a seed, and a secret password, and generate a one-time password or a consecutive list of one-time passwords. The keyinit and opiepasswd programs are used to initialize S/Key and OPIE respectively, and to change passwords, iteration counts, or seeds; they take either a secret passphrase, or an iteration count, seed, and one-time password. The keyinfo and opieinfo programs examine the relevant credentials files (/etc/skeykeys or /etc/opiekeys) and print out the invoking user's current iteration count and seed. There are four different sorts of operations we will cover. The first is using keyinit or opiepasswd over a secure connection to set up one-time-passwords for the first time, or to change your password or seed. The second operation is using keyinit or opiepasswd over an insecure connection, in conjunction with key or opiekey over a secure connection, to do the same. The third is using key/opiekey to log in over an insecure connection. The fourth is using key or opiekey to generate a number of keys which can be written down or printed out to carry with you when going to some location without secure connections to anywhere. Secure Connection Initialization To initialize S/Key for the first time, change your password, or change your seed while logged in over a secure connection (e.g. on the console of a machine or via ssh), use the keyinit command without any parameters while logged in as yourself: &prompt.user; keyinit Adding unfurl: Reminder - Only use this method if you are directly connected. If you are using telnet or rlogin exit with no password and use keyinit -s. Enter secret password: Again secret password: ID unfurl s/key is 99 to17757 DEFY CLUB PRO NASH LACE SOFT For OPIE, opiepasswd is used instead: &prompt.user; opiepasswd -c [grimreaper] ~ $ opiepasswd -f -c Adding unfurl: Only use this method from the console; NEVER from remote. If you are using telnet, xterm, or a dial-in, type ^C now or exit with no password. Then run opiepasswd without the -c parameter. Using MD5 to compute responses. Enter new secret pass phrase: Again new secret pass phrase: ID unfurl OTP key is 499 to4268 MOS MALL GOAT ARM AVID COED At the Enter new secret pass phrase: or Enter secret password: prompts, you should enter a password or phrase. Remember, this is not the password that you will use to login with, this is used to generate your one-time login keys. The ID line gives the parameters of your particular instance: your login name, the iteration count, and seed. When logging in the system will remember these parameters and present them back to you so you do not have to remember them. The last line gives the particular one-time password which corresponds to those parameters and your secret password; if you were to re-login immediately, this one-time password is the one you would use. Insecure Connection Initialization To initialize or change your secret password over an insecure connection, you will need to already have a secure connection to some place where you can run key or opiekey; this might be in the form of a desk accessory on a &macintosh;, or a shell prompt on a machine you trust. You will also need to make up an iteration count (100 is probably a good value), and you may make up your own seed or use a randomly-generated one. Over on the insecure connection (to the machine you are initializing), use the keyinit -s command: &prompt.user; keyinit -s Updating unfurl: Old key: to17758 Reminder you need the 6 English words from the key command. Enter sequence count from 1 to 9999: 100 Enter new key [default to17759]: s/key 100 to 17759 s/key access password: s/key access password:CURE MIKE BANE HIM RACY GORE For OPIE, you need to use opiepasswd: &prompt.user; opiepasswd Updating unfurl: You need the response from an OTP generator. Old secret pass phrase: otp-md5 498 to4268 ext Response: GAME GAG WELT OUT DOWN CHAT New secret pass phrase: otp-md5 499 to4269 Response: LINE PAP MILK NELL BUOY TROY ID mark OTP key is 499 gr4269 LINE PAP MILK NELL BUOY TROY To accept the default seed (which the keyinit program confusingly calls a key), press Return. Then before entering an access password, move over to your secure connection or S/Key desk accessory, and give it the same parameters: &prompt.user; key 100 to17759 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: <secret password> CURE MIKE BANE HIM RACY GORE Or for OPIE: &prompt.user; opiekey 498 to4268 Using the MD5 algorithm to compute response. Reminder: Don't use opiekey from telnet or dial-in sessions. Enter secret pass phrase: GAME GAG WELT OUT DOWN CHAT Now switch back over to the insecure connection, and copy the one-time password generated over to the relevant program. Generating a Single One-time Password Once you have initialized S/Key or OPIE, when you login you will be presented with a prompt like this: &prompt.user; telnet example.com Trying 10.0.0.1... Connected to example.com Escape character is '^]'. FreeBSD/i386 (example.com) (ttypa) login: <username> s/key 97 fw13894 Password: Or for OPIE: &prompt.user; telnet example.com Trying 10.0.0.1... Connected to example.com Escape character is '^]'. FreeBSD/i386 (example.com) (ttypa) login: <username> otp-md5 498 gr4269 ext Password: As a side note, the S/Key and OPIE prompts have a useful feature (not shown here): if you press Return at the password prompt, the prompter will turn echo on, so you can see what you are typing. This can be extremely useful if you are attempting to type in a password by hand, such as from a printout. MS-DOS Windows MacOS At this point you need to generate your one-time password to answer this login prompt. This must be done on a trusted system that you can run key or opiekey on. (There are versions of these for DOS, &windows; and &macos; as well.) They need both the iteration count and the seed as command line options. You can cut-and-paste these right from the login prompt on the machine that you are logging in to. On the trusted system: &prompt.user; key 97 fw13894 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: WELD LIP ACTS ENDS ME HAAG For OPIE: &prompt.user; opiekey 498 to4268 Using the MD5 algorithm to compute response. Reminder: Don't use opiekey from telnet or dial-in sessions. Enter secret pass phrase: GAME GAG WELT OUT DOWN CHAT Now that you have your one-time password you can continue logging in: login: <username> s/key 97 fw13894 Password: <return to enable echo> s/key 97 fw13894 Password [echo on]: WELD LIP ACTS ENDS ME HAAG Last login: Tue Mar 21 11:56:41 from 10.0.0.2 ... Generating Multiple One-time Passwords Sometimes you have to go places where you do not have access to a trusted machine or secure connection. In this case, it is possible to use the key and opiekey commands to generate a number of one-time passwords beforehand to be printed out and taken with you. For example: &prompt.user; key -n 5 30 zz99999 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: <secret password> 26: SODA RUDE LEA LIND BUDD SILT 27: JILT SPY DUTY GLOW COWL ROT 28: THEM OW COLA RUNT BONG SCOT 29: COT MASH BARR BRIM NAN FLAG 30: CAN KNEE CAST NAME FOLK BILK Or for OPIE: &prompt.user; opiekey -n 5 30 zz99999 Using the MD5 algorithm to compute response. Reminder: Don't use opiekey from telnet or dial-in sessions. Enter secret pass phrase: <secret password> 26: JOAN BORE FOSS DES NAY QUIT 27: LATE BIAS SLAY FOLK MUCH TRIG 28: SALT TIN ANTI LOON NEAL USE 29: RIO ODIN GO BYE FURY TIC 30: GREW JIVE SAN GIRD BOIL PHI The requests five keys in sequence, the specifies what the last iteration number should be. Note that these are printed out in reverse order of eventual use. If you are really paranoid, you might want to write the results down by hand; otherwise you can cut-and-paste into lpr. Note that each line shows both the iteration count and the one-time password; you may still find it handy to scratch off passwords as you use them. Restricting Use of &unix; Passwords S/Key can place restrictions on the use of &unix; passwords based on the host name, user name, terminal port, or IP address of a login session. These restrictions can be found in the configuration file /etc/skey.access. The &man.skey.access.5; manual page has more information on the complete format of the file and also details some security cautions to be aware of before depending on this file for security. If there is no /etc/skey.access file (this is the default on &os; 4.X systems), then all users will be allowed to use &unix; passwords. If the file exists, however, then all users will be required to use S/Key unless explicitly permitted to do otherwise by configuration statements in the skey.access file. In all cases, &unix; passwords are permitted on the console. Here is a sample skey.access configuration file which illustrates the three most common sorts of configuration statements: permit internet 192.168.0.0 255.255.0.0 permit user fnord permit port ttyd0 The first line (permit internet) allows users whose IP source address (which is vulnerable to spoofing) matches the specified value and mask, to use &unix; passwords. This should not be considered a security mechanism, but rather, a means to remind authorized users that they are using an insecure network and need to use S/Key for authentication. The second line (permit user) allows the specified username, in this case fnord, to use &unix; passwords at any time. Generally speaking, this should only be used for people who are either unable to use the key program, like those with dumb terminals, or those who are ineducable. The third line (permit port) allows all users logging in on the specified terminal line to use &unix; passwords; this would be used for dial-ups. OPIE can restrict the use of &unix; passwords based on the IP address of a login session just like S/Key does. The relevant file is /etc/opieaccess, which is present by default on &os; 5.0 and newer systems. Please check &man.opieaccess.5; for more information on this file and which security considerations you should be aware of when using it. Here is a sample opieaccess file: permit 192.168.0.0 255.255.0.0 This line allows users whose IP source address (which is vulnerable to spoofing) matches the specified value and mask, to use &unix; passwords at any time. If no rules in opieaccess are matched, the default is to deny non-OPIE logins. Tom Rhodes Written by: TCP Wrappers TCP Wrappers - Anyone familiar with &man.inetd.8; has probably heard - of TCP Wrappers at some point. But few - individuals seem to fully comprehend its usefulness in a - network environment. It seems that everyone wants to - install a firewall to handle network connections. While a - firewall has a wide variety of uses, there are some things - that a firewall not handle such as sending text back to the - connection originator. The TCP software - does this and much more. In the next few sections many of - the TCP Wrappers features will be discussed, - and, when applicable, example configuration lines will be - provided. - - The TCP Wrappers software extends the - abilities of inetd to provide support for - every server daemon under its control. Using this method it - is possible to provide logging support, return messages to - connections, permit a daemon to only accept internal connections, - etc. While some of these features can be provided by implementing - a firewall, this will add not only an extra layer of protection - but go beyond the amount of control a firewall can - provide. - - The added functionality of TCP Wrappers - should not be considered a replacement for a good firewall. - TCP Wrappers can be used in conjunction - with a firewall or other security enhancements though and - it can serve nicely as an extra layer of protection - for the system. - - Since this is an extension to the configuration of - inetd, the reader is expected have - read the inetd configuration - section. + ¨C­Ó¼ô &man.inetd.8; ªº¤H´X¥G³£·|Å¥¹L TCP + Wrappers ³o­ÓªF¦è¡A¦ý«Ü¤Ö¤H¯à§¹¥þÁA¸Ñ¥¦¦bºô¸ôÀô¹Ò¤Wªº¦n¥Î¦b­þ¡C + ¤j¦h¼Æªº¤H³£·|¸Ë¨¾¤õÀð¨Ó«OÅ@ºô¸ô¡AÁöµM¡A¨¾¤õÀð¥Î³~«D±`¼sªx¡A¦ý¨Ã«D¸U¯à¡C + ¨Ò¦p¡G­Y¥´ºâ¦^¶Ç¤@¬q¤å¦rµ¹³s½u¨Ó·½ªÌµ¥¤§Ãþªº¡C¦Ó TCP + ³nÅé«o¥i¥H°µ¨ì³oÂI¡AÁÙ¦³¨ä¥L§ó¦h¨Æ±¡¡C¦b¥H¤U¬q¸¨¤º¡A§Ú­Ì±NÄ~Äò¤¶²Ð + TCP Wrappers ´£¨Ñªº¥\¯à¡A¥H¤Î¤@¨Ç¹ê»Ú¹B¥Îªº¨Ò¤l¡C + + TCP Wrappers ¥i¥HÅý inetd + ©ÒºÞ²zªº¨C­Ó server daemon ¡A³£·|¦b TCP Wrappers + ªº´x´¤¤§¤U¡C³z¹L TCP Wrappers ³oºØ¤è¦¡¥i¥H¤ä´©³s½u¬ö¿ý(logging) + ¡B¦^¶Ç¤@¬q¤å¦rµ¹³s½u¨Ó·½ªÌ¡B¥i¥HÅý daemon ¥u±µ¨ü¤º³¡³s½uµ¥µ¥¡C + ÁöµM¨ä¤¤³¡¥÷¥\¯à¥Î¨¾¤õÀð¤]¥i¥H°µ¨ì¡A¦ý TCP Wrappers + ¤£¥u¬O¼W¥[¤F¤@¼h«OÅ@¡AÁÙ´£¨Ñ¤F¨¾¤õÀð©Ò¿ì¤£¨ìªº¨Æ±¡¡C + + µM¦Ó¡A ¥Ñ TCP Wrappers ©Ò´£¨Ñªº³o¨ÇÃB¥~¦w¥þ¥\¯à¡A + ¤£À³¸Óµø¬°Àu¨q¨¾¤õÀ𪺴À¥N¤è®×¡CÀ³¸Óµ²¦X TCP Wrappers + ¤Î¨¾¤õÀð¡B¨ä¥L¥[±j¦w¥þ±¹¬I¨Ó¤@¨Ö¹B¥Î¤~¹ï¡A³o¼Ë¤~¥i¥H¬°¨t²Î´£¨Ñ¦h¼h¦w¥þ¨¾Å@¡C + + ¥Ñ©ó³o¨Ç³]©w¬O¥D­n°w¹ï + inetd ©Ò´£¨Ñªº¡A©Ò¥H§Ú­Ì«ØÄ³±z¥ý°Ñ¾\ inetd ³]©w ¤@¸`¡C - While programs run by &man.inetd.8; are not exactly - daemons, they have traditionally been called - daemons. This is the term we will use in this section too. + ÁöµM &man.inetd.8; ©Ò±Ò°Êªºµ{¦¡¨Ã«D¥þ³¡³£¬O¯u¥¿ªº + ¡ydaemons¡z¡A¦ý¤@¯ë¨ÓÁ¿¡A§Ú­Ì³£ÁÙ¬O·|ºÙ©I¬°¡ydaemons¡z¡A + ¤U­±§Ú­Ì¤´±N¨Ï¥Î³o¦r²´¨Óªí¹F¡C Initial Configuration - The only requirement of using TCP - Wrappers in &os; is to ensure the inetd - server is started from rc.conf with the - option; this is the default setting. Of - course, proper configuration of - /etc/hosts.allow is also expected, but - &man.syslogd.8; will throw messages in the system logs in - these cases. + ­Y­n¦b &os; ¤¤¨Ï¥Î TCP + Wrappers ªº¸Ü¡A¥u­n½T©w inetd + ¦b±Ò°Ê®É¡A¦³¦b /etc/rc.conf ¥[¤W + ªº°Ñ¼Æ§Y¥i¡A³o­Ó³]©w¦b¨t²Î¹w³]´N¦³¤F¡C + ·íµMÁٻݭn¾A·í­×§ï /etc/hosts.allow ³]©wÀÉ¡A¦ý + &man.syslogd.8; ¤´·|¦b¨t²Î log Àɤº¡A¬ö¿ý¬ÛÃö¸ê®Æ¤U¨Ó¡C - Unlike other implementations of TCP - Wrappers, the use of hosts.deny has - been deprecated. All configuration options should be placed - in /etc/hosts.allow. + FreeBSD ªº TCP Wrappers ¹ê§@¤è¦¡»P¨ä¥L§@·~¨t²Î¤Wªº + TCP Wrappers ¤£¤Ó¤@¼Ë¡A¥Ø«e FreeBSD ¤w¸g¼o±ó¤£¥Î + /etc/hosts.deny ¡A¦Ó¤@«ß§ï¥Î + /etc/hosts.allow¡C - In the simplest configuration, daemon connection policies - are set to either be permitted or blocked depending on the - options in /etc/hosts.allow. The default + ³Ì²³æªº³]©w¤è¦¡¬O¡A¨C­Ó¹ï daemon ªº³s½u³£¥Ñ + /etc/hosts.allow ¨Ó¨M©w¬O§_¤¹³\©Î©Úµ´¡C The default configuration in &os; is to allow a connection to every daemon started with inetd. Changing this will be discussed only after the basic configuration is covered. Basic configuration usually takes the form of daemon : address : action. Where daemon is the daemon name which inetd started. The address can be a valid hostname, an IP address or an IPv6 address enclosed in brackets ([ ]). The action field can be either allow or deny to grant or deny access appropriately. Keep in mind that configuration works off a first rule match semantic, meaning that the configuration file is scanned in ascending order for a matching rule. When a match is found the rule is applied and the search process will halt. Several other options exist but they will be explained in a later section. A simple configuration line may easily be constructed from that information alone. For example, to allow POP3 connections via the mail/qpopper daemon, the following lines should be appended to hosts.allow: # This line is required for POP3 connections: qpopper : ALL : allow - After adding this line, inetd will need - restarted. This can be accomplished by use of the &man.kill.1; - command, or with the restart parameter - with /etc/rc.d/inetd. + ¥[¤W¤W­±³o¦æ¤§«á¡A¥²¶·­«·s±Ò°Ê inetd¡C­«·s±Ò°Êªº¤è¦¡¥i¥H¥Î + &man.kill.1; «ü¥O¡A©Î¥´¡y /etc/rc.d/inetd restart + ¡z ¨Ó§¹¦¨¡C Advanced Configuration TCP Wrappers has advanced options too; they will allow for more control over the way connections are handled. In some cases it may be a good idea to return a comment to certain hosts or daemon connections. In other cases, perhaps a log file should be recorded or an email sent to the administrator. Other situations may require the use of a service for local connections only. This is all possible through the use of configuration options known as wildcards, expansion characters and external command execution. The next two sections are written to cover these situations. External Commands Suppose that a situation occurs where a connection should be denied yet a reason should be sent to the individual who attempted to establish that connection. How could it be done? That action can be made possible by using the option. When a connection attempt is made, will be called to execute a shell command or script. An example already exists in the hosts.allow file: # The rest of the daemons are protected. ALL : ALL \ : severity auth.info \ : twist /bin/echo "You are not welcome to use %d from %h." This example shows that the message, You are not allowed to use daemon from hostname. will be returned for any daemon not previously configured in the access file. This is extremely useful for sending a reply back to the connection initiator right after the established connection is dropped. Note that any message returned must be wrapped in quote " characters; there are no exceptions to this rule. It may be possible to launch a denial of service attack on the server if an attacker, or group of attackers could flood these daemons with connection requests. Another possibility is to use the option in these cases. Like , the implicitly denies the connection and may be used to run external shell commands or scripts. Unlike , will not send a reply back to the individual who established the connection. For an example, consider the following configuration line: # We do not allow connections from example.com: ALL : .example.com \ : spawn (/bin/echo %a from %h attempted to access %d >> \ /var/log/connections.log) \ : deny This will deny all connection attempts from the *.example.com domain; simultaneously logging the hostname, IP address and the daemon which they attempted to access in the /var/log/connections.log file. Aside from the already explained substitution characters above, e.g. %a, a few others exist. See the &man.hosts.access.5; manual page for the complete list. Wildcard Options Thus far the ALL example has been used continuously throughout the examples. Other options exist which could extend the functionality a bit further. For instance, ALL may be used to match every instance of either a daemon, domain or an IP address. Another wildcard available is PARANOID which may be used to match any host which provides an IP address that may be forged. In other words, paranoid may be used to define an action to be taken whenever a connection is made from an IP address that differs from its hostname. The following example may shed some more light on this discussion: # Block possibly spoofed requests to sendmail: sendmail : PARANOID : deny In that example all connection requests to sendmail which have an IP address that varies from its hostname will be denied. Using the PARANOID may severely cripple servers if the client or server has a broken DNS setup. Administrator discretion is advised. To learn more about wildcards and their associated functionality, see the &man.hosts.access.5; manual page. Before any of the specific configuration lines above will work, the first configuration line should be commented out in hosts.allow. This was noted at the beginning of this section. Mark Murray Contributed by Mark Dapoz Based on a contribution by <application>KerberosIV</application> Kerberos is a network add-on system/protocol that allows users to authenticate themselves through the services of a secure server. Services such as remote login, remote copy, secure inter-system file copying and other high-risk tasks are made considerably safer and more controllable. The following instructions can be used as a guide on how to set up Kerberos as distributed for &os;. However, you should refer to the relevant manual pages for a complete description. Installing <application>KerberosIV</application> MIT KerberosIV installing Kerberos is an optional component of &os;. The easiest way to install this software is by selecting the krb4 or krb5 distribution in sysinstall during the initial installation of &os;. This will install the eBones (KerberosIV) or Heimdal (Kerberos5) implementation of Kerberos. These implementations are included because they are developed outside the USA/Canada and were thus available to system owners outside those countries during the era of restrictive export controls on cryptographic code from the USA. Alternatively, the MIT implementation of Kerberos is available from the Ports Collection as security/krb5. Creating the Initial Database This is done on the Kerberos server only. First make sure that you do not have any old Kerberos databases around. You should change to the directory /etc/kerberosIV and check that only the following files are present: &prompt.root; cd /etc/kerberosIV &prompt.root; ls README krb.conf krb.realms If any additional files (such as principal.* or master_key) exist, then use the kdb_destroy command to destroy the old Kerberos database, or if Kerberos is not running, simply delete the extra files. You should now edit the krb.conf and krb.realms files to define your Kerberos realm. In this case the realm will be EXAMPLE.COM and the server is grunt.example.com. We edit or create the krb.conf file: &prompt.root; cat krb.conf EXAMPLE.COM EXAMPLE.COM grunt.example.com admin server CS.BERKELEY.EDU okeeffe.berkeley.edu ATHENA.MIT.EDU kerberos.mit.edu ATHENA.MIT.EDU kerberos-1.mit.edu ATHENA.MIT.EDU kerberos-2.mit.edu ATHENA.MIT.EDU kerberos-3.mit.edu LCS.MIT.EDU kerberos.lcs.mit.edu TELECOM.MIT.EDU bitsy.mit.edu ARC.NASA.GOV trident.arc.nasa.gov In this case, the other realms do not need to be there. They are here as an example of how a machine may be made aware of multiple realms. You may wish to not include them for simplicity. The first line names the realm in which this system works. The other lines contain realm/host entries. The first item on a line is a realm, and the second is a host in that realm that is acting as a key distribution center. The words admin server following a host's name means that host also provides an administrative database server. For further explanation of these terms, please consult the Kerberos manual pages. Now we have to add grunt.example.com to the EXAMPLE.COM realm and also add an entry to put all hosts in the .example.com domain in the EXAMPLE.COM realm. The krb.realms file would be updated as follows: &prompt.root; cat krb.realms grunt.example.com EXAMPLE.COM .example.com EXAMPLE.COM .berkeley.edu CS.BERKELEY.EDU .MIT.EDU ATHENA.MIT.EDU .mit.edu ATHENA.MIT.EDU Again, the other realms do not need to be there. They are here as an example of how a machine may be made aware of multiple realms. You may wish to remove them to simplify things. The first line puts the specific system into the named realm. The rest of the lines show how to default systems of a particular subdomain to a named realm. Now we are ready to create the database. This only needs to run on the Kerberos server (or Key Distribution Center). Issue the kdb_init command to do this: &prompt.root; kdb_init Realm name [default ATHENA.MIT.EDU ]: EXAMPLE.COM You will be prompted for the database Master Password. It is important that you NOT FORGET this password. Enter Kerberos master key: Now we have to save the key so that servers on the local machine can pick it up. Use the kstash command to do this: &prompt.root; kstash Enter Kerberos master key: Current Kerberos master key version is 1. Master key entered. BEWARE! This saves the encrypted master password in /etc/kerberosIV/master_key. Making It All Run KerberosIV initial startup Two principals need to be added to the database for each system that will be secured with Kerberos. Their names are kpasswd and rcmd. These two principals are made for each system, with the instance being the name of the individual system. These daemons, kpasswd and rcmd allow other systems to change Kerberos passwords and run commands like &man.rcp.1;, &man.rlogin.1; and &man.rsh.1;. Now let us add these entries: &prompt.root; kdb_edit Opening database... Enter Kerberos master key: Current Kerberos master key version is 1. Master key entered. BEWARE! Previous or default values are in [brackets] , enter return to leave the same, or new value. Principal name: passwd Instance: grunt <Not found>, Create [y] ? y Principal: passwd, Instance: grunt, kdc_key_ver: 1 New Password: <---- enter RANDOM here Verifying password New Password: <---- enter RANDOM here Random password [y] ? y Principal's new key version = 1 Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ? Max ticket lifetime (*5 minutes) [ 255 ] ? Attributes [ 0 ] ? Edit O.K. Principal name: rcmd Instance: grunt <Not found>, Create [y] ? Principal: rcmd, Instance: grunt, kdc_key_ver: 1 New Password: <---- enter RANDOM here Verifying password New Password: <---- enter RANDOM here Random password [y] ? Principal's new key version = 1 Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ? Max ticket lifetime (*5 minutes) [ 255 ] ? Attributes [ 0 ] ? Edit O.K. Principal name: <---- null entry here will cause an exit Creating the Server File We now have to extract all the instances which define the services on each machine. For this we use the ext_srvtab command. This will create a file which must be copied or moved by secure means to each Kerberos client's /etc/kerberosIV directory. This file must be present on each server and client, and is crucial to the operation of Kerberos. &prompt.root; ext_srvtab grunt Enter Kerberos master key: Current Kerberos master key version is 1. Master key entered. BEWARE! Generating 'grunt-new-srvtab'.... Now, this command only generates a temporary file which must be renamed to srvtab so that all the servers can pick it up. Use the &man.mv.1; command to move it into place on the original system: &prompt.root; mv grunt-new-srvtab srvtab If the file is for a client system, and the network is not deemed safe, then copy the client-new-srvtab to removable media and transport it by secure physical means. Be sure to rename it to srvtab in the client's /etc/kerberosIV directory, and make sure it is mode 600: &prompt.root; mv grumble-new-srvtab srvtab &prompt.root; chmod 600 srvtab Populating the Database We now have to add some user entries into the database. First let us create an entry for the user jane. Use the kdb_edit command to do this: &prompt.root; kdb_edit Opening database... Enter Kerberos master key: Current Kerberos master key version is 1. Master key entered. BEWARE! Previous or default values are in [brackets] , enter return to leave the same, or new value. Principal name: jane Instance: <Not found>, Create [y] ? y Principal: jane, Instance: , kdc_key_ver: 1 New Password: <---- enter a secure password here Verifying password New Password: <---- re-enter the password here Principal's new key version = 1 Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ? Max ticket lifetime (*5 minutes) [ 255 ] ? Attributes [ 0 ] ? Edit O.K. Principal name: <---- null entry here will cause an exit Testing It All Out First we have to start the Kerberos daemons. Note that if you have correctly edited your /etc/rc.conf then this will happen automatically when you reboot. This is only necessary on the Kerberos server. Kerberos clients will automatically get what they need from the /etc/kerberosIV directory. &prompt.root; kerberos & Kerberos server starting Sleep forever on error Log file is /var/log/kerberos.log Current Kerberos master key version is 1. Master key entered. BEWARE! Current Kerberos master key version is 1 Local realm: EXAMPLE.COM &prompt.root; kadmind -n & KADM Server KADM0.0A initializing Please do not use 'kill -9' to kill this job, use a regular kill instead Current Kerberos master key version is 1. Master key entered. BEWARE! Now we can try using the kinit command to get a ticket for the ID jane that we created above: &prompt.user; kinit jane MIT Project Athena (grunt.example.com) Kerberos Initialization for "jane" Password: Try listing the tokens using klist to see if we really have them: &prompt.user; klist Ticket file: /tmp/tkt245 Principal: jane@EXAMPLE.COM Issued Expires Principal Apr 30 11:23:22 Apr 30 19:23:22 krbtgt.EXAMPLE.COM@EXAMPLE.COM Now try changing the password using &man.passwd.1; to check if the kpasswd daemon can get authorization to the Kerberos database: &prompt.user; passwd realm EXAMPLE.COM Old password for jane: New Password for jane: Verifying password New Password for jane: Password changed. Adding <command>su</command> Privileges Kerberos allows us to give each user who needs root privileges their own separate &man.su.1; password. We could now add an ID which is authorized to &man.su.1; to root. This is controlled by having an instance of root associated with a principal. Using kdb_edit we can create the entry jane.root in the Kerberos database: &prompt.root; kdb_edit Opening database... Enter Kerberos master key: Current Kerberos master key version is 1. Master key entered. BEWARE! Previous or default values are in [brackets] , enter return to leave the same, or new value. Principal name: jane Instance: root <Not found>, Create [y] ? y Principal: jane, Instance: root, kdc_key_ver: 1 New Password: <---- enter a SECURE password here Verifying password New Password: <---- re-enter the password here Principal's new key version = 1 Expiration date (enter yyyy-mm-dd) [ 2000-01-01 ] ? Max ticket lifetime (*5 minutes) [ 255 ] ? 12 <--- Keep this short! Attributes [ 0 ] ? Edit O.K. Principal name: <---- null entry here will cause an exit Now try getting tokens for it to make sure it works: &prompt.root; kinit jane.root MIT Project Athena (grunt.example.com) Kerberos Initialization for "jane.root" Password: Now we need to add the user to root's .klogin file: &prompt.root; cat /root/.klogin jane.root@EXAMPLE.COM Now try doing the &man.su.1;: &prompt.user; su Password: and take a look at what tokens we have: &prompt.root; klist Ticket file: /tmp/tkt_root_245 Principal: jane.root@EXAMPLE.COM Issued Expires Principal May 2 20:43:12 May 3 04:43:12 krbtgt.EXAMPLE.COM@EXAMPLE.COM Using Other Commands In an earlier example, we created a principal called jane with an instance root. This was based on a user with the same name as the principal, and this is a Kerberos default; that a <principal>.<instance> of the form <username>.root will allow that <username> to &man.su.1; to root if the necessary entries are in the .klogin file in root's home directory: &prompt.root; cat /root/.klogin jane.root@EXAMPLE.COM Likewise, if a user has in their own home directory lines of the form: &prompt.user; cat ~/.klogin jane@EXAMPLE.COM jack@EXAMPLE.COM This allows anyone in the EXAMPLE.COM realm who has authenticated themselves as jane or jack (via kinit, see above) to access to jane's account or files on this system (grunt) via &man.rlogin.1;, &man.rsh.1; or &man.rcp.1;. For example, jane now logs into another system using Kerberos: &prompt.user; kinit MIT Project Athena (grunt.example.com) Password: &prompt.user; rlogin grunt Last login: Mon May 1 21:14:47 from grumble Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995 Or jack logs into jane's account on the same machine (jane having set up the .klogin file as above, and the person in charge of Kerberos having set up principal jack with a null instance): &prompt.user; kinit &prompt.user; rlogin grunt -l jane MIT Project Athena (grunt.example.com) Password: Last login: Mon May 1 21:16:55 from grumble Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995 Tillman Hodgson Contributed by Mark Murray Based on a contribution by <application>Kerberos5</application> Every &os; release beyond &os;-5.1 includes support only for Kerberos5. Hence Kerberos5 is the only version included, and its configuration is similar in many aspects to that of KerberosIV. The following information only applies to Kerberos5 in post &os;-5.0 releases. Users who wish to use the KerberosIV package may install the security/krb4 port. Kerberos is a network add-on system/protocol that allows users to authenticate themselves through the services of a secure server. Services such as remote login, remote copy, secure inter-system file copying and other high-risk tasks are made considerably safer and more controllable. Kerberos can be described as an identity-verifying proxy system. It can also be described as a trusted third-party authentication system. Kerberos provides only one function — the secure authentication of users on the network. It does not provide authorization functions (what users are allowed to do) or auditing functions (what those users did). After a client and server have used Kerberos to prove their identity, they can also encrypt all of their communications to assure privacy and data integrity as they go about their business. Therefore it is highly recommended that Kerberos be used with other security methods which provide authorization and audit services. The following instructions can be used as a guide on how to set up Kerberos as distributed for &os;. However, you should refer to the relevant manual pages for a complete description. For purposes of demonstrating a Kerberos installation, the various name spaces will be handled as follows: The DNS domain (zone) will be example.org. The Kerberos realm will be EXAMPLE.ORG. Please use real domain names when setting up Kerberos even if you intend to run it internally. This avoids DNS problems and assures inter-operation with other Kerberos realms. History Kerberos5 history Kerberos was created by MIT as a solution to network security problems. The Kerberos protocol uses strong cryptography so that a client can prove its identity to a server (and vice versa) across an insecure network connection. Kerberos is both the name of a network authentication protocol and an adjective to describe programs that implement the program (Kerberos telnet, for example). The current version of the protocol is version 5, described in RFC 1510. Several free implementations of this protocol are available, covering a wide range of operating systems. The Massachusetts Institute of Technology (MIT), where Kerberos was originally developed, continues to develop their Kerberos package. It is commonly used in the US as a cryptography product, as such it has historically been affected by US export regulations. The MIT Kerberos is available as a port (security/krb5). Heimdal Kerberos is another version 5 implementation, and was explicitly developed outside of the US to avoid export regulations (and is thus often included in non-commercial &unix; variants). The Heimdal Kerberos distribution is available as a port (security/heimdal), and a minimal installation of it is included in the base &os; install. In order to reach the widest audience, these instructions assume the use of the Heimdal distribution included in &os;. Setting up a Heimdal <acronym>KDC</acronym> Kerberos5 Key Distribution Center The Key Distribution Center (KDC) is the centralized authentication service that Kerberos provides — it is the computer that issues Kerberos tickets. The KDC is considered trusted by all other computers in the Kerberos realm, and thus has heightened security concerns. Note that while running the Kerberos server requires very few computing resources, a dedicated machine acting only as a KDC is recommended for security reasons. To begin setting up a KDC, ensure that your /etc/rc.conf file contains the correct settings to act as a KDC (you may need to adjust paths to reflect your own system): kerberos5_server_enable="YES" kadmind5_server_enable="YES" kerberos_stash="YES" The is only available in &os; 4.X. Next we will set up your Kerberos config file, /etc/krb5.conf: [libdefaults] default_realm = EXAMPLE.ORG [realms] EXAMPLE.ORG = { kdc = kerberos.example.org admin_server = kerberos.example.org } [domain_realm] .example.org = EXAMPLE.ORG Note that this /etc/krb5.conf file implies that your KDC will have the fully-qualified hostname of kerberos.example.org. You will need to add a CNAME (alias) entry to your zone file to accomplish this if your KDC has a different hostname. For large networks with a properly configured BIND DNS server, the above example could be trimmed to: [libdefaults] default_realm = EXAMPLE.ORG With the following lines being appended to the example.org zonefile: _kerberos._udp IN SRV 01 00 88 kerberos.example.org. _kerberos._tcp IN SRV 01 00 88 kerberos.example.org. _kpasswd._udp IN SRV 01 00 464 kerberos.example.org. _kerberos-adm._tcp IN SRV 01 00 749 kerberos.example.org. _kerberos IN TXT EXAMPLE.ORG For clients to be able to find the Kerberos services, you must have either a fully configured /etc/krb5.conf or a miminally configured /etc/krb5.conf and a properly configured DNS server. Next we will create the Kerberos database. This database contains the keys of all principals encrypted with a master password. You are not required to remember this password, it will be stored in a file (/var/heimdal/m-key). To create the master key, run kstash and enter a password. Once the master key has been created, you can initialize the database using the kadmin program with the -l option (standing for local). This option instructs kadmin to modify the database files directly rather than going through the kadmind network service. This handles the chicken-and-egg problem of trying to connect to the database before it is created. Once you have the kadmin prompt, use the init command to create your realms initial database. Lastly, while still in kadmin, create your first principal using the add command. Stick to the defaults options for the principal for now, you can always change them later with the modify command. Note that you can use the ? command at any prompt to see the available options. A sample database creation session is shown below: &prompt.root; kstash Master key: xxxxxxxx Verifying password - Master key: xxxxxxxx &prompt.root; kadmin -l kadmin> init EXAMPLE.ORG Realm max ticket life [unlimited]: kadmin> add tillman Max ticket life [unlimited]: Max renewable life [unlimited]: Attributes []: Password: xxxxxxxx Verifying password - Password: xxxxxxxx Now it is time to start up the KDC services. Run /etc/rc.d/kerberos start and /etc/rc.d/kadmind start to bring up the services. Note that you will not have any kerberized daemons running at this point but you should be able to confirm the that the KDC is functioning by obtaining and listing a ticket for the principal (user) that you just created from the command-line of the KDC itself: &prompt.user; k5init tillman tillman@EXAMPLE.ORG's Password: &prompt.user; k5list Credentials cache: FILE:/tmp/krb5cc_500 Principal: tillman@EXAMPLE.ORG Issued Expires Principal Aug 27 15:37:58 Aug 28 01:37:58 krbtgt/EXAMPLE.ORG@EXAMPLE.ORG <application>Kerberos</application> enabling a server with Heimdal services Kerberos5 enabling services First, we need a copy of the Kerberos configuration file, /etc/krb5.conf. To do so, simply copy it over to the client computer from the KDC in a secure fashion (using network utilities, such as &man.scp.1;, or physically via a floppy disk). Next you need a /etc/krb5.keytab file. This is the major difference between a server providing Kerberos enabled daemons and a workstation — the server must have a keytab file. This file contains the servers host key, which allows it and the KDC to verify each others identity. It must be transmitted to the server in a secure fashion, as the security of the server can be broken if the key is made public. This explicitly means that transferring it via a clear text channel, such as FTP, is a very bad idea. Typically, you transfer to the keytab to the server using the kadmin program. This is handy because you also need to create the host principal (the KDC end of the krb5.keytab) using kadmin. Note that you must have already obtained a ticket and that this ticket must be allowed to use the kadmin interface in the kadmind.acl. See the section titled Remote administration in the Heimdal info pages (info heimdal) for details on designing access control lists. If you do not want to enable remote kadmin access, you can simply securely connect to the KDC (via local console, &man.ssh.1; or Kerberos &man.telnet.1;) and perform administration locally using kadmin -l. After installing the /etc/krb5.conf file, you can use kadmin from the Kerberos server. The add --random-key command will let you add the servers host principal, and the ext command will allow you to extract the servers host principal to its own keytab. For example: &prompt.root; kadmin kadmin> add --random-key host/myserver.example.org Max ticket life [unlimited]: Max renewable life [unlimited]: Attributes []: kadmin> ext host/myserver.example.org kadmin> exit Note that the ext command (short for extract) stores the extracted key in /etc/krb5.keytab by default. If you do not have kadmind running on the KDC (possibly for security reasons) and thus do not have access to kadmin remotely, you can add the host principal (host/myserver.EXAMPLE.ORG) directly on the KDC and then extract it to a temporary file (to avoid over-writing the /etc/krb5.keytab on the KDC) using something like this: &prompt.root; kadmin kadmin> ext --keytab=/tmp/example.keytab host/myserver.example.org kadmin> exit You can then securely copy the keytab to the server computer (using scp or a floppy, for example). Be sure to specify a non-default keytab name to avoid over-writing the keytab on the KDC. At this point your server can communicate with the KDC (due to its krb5.conf file) and it can prove its own identity (due to the krb5.keytab file). It is now ready for you to enable some Kerberos services. For this example we will enable the telnet service by putting a line like this into your /etc/inetd.conf and then restarting the &man.inetd.8; service with /etc/rc.d/inetd restart: telnet stream tcp nowait root /usr/libexec/telnetd telnetd -a user The critical bit is that the -a (for authentication) type is set to user. Consult the &man.telnetd.8; manual page for more details. <application>Kerberos</application> enabling a client with Heimdal Kerberos5 configure clients Setting up a client computer is almost trivially easy. As far as Kerberos configuration goes, you only need the Kerberos configuration file, located at /etc/krb5.conf. Simply securely copy it over to the client computer from the KDC. Test your client computer by attempting to use kinit, klist, and kdestroy from the client to obtain, show, and then delete a ticket for the principal you created above. You should also be able to use Kerberos applications to connect to Kerberos enabled servers, though if that does not work and obtaining a ticket does the problem is likely with the server and not with the client or the KDC. When testing an application like telnet, try using a packet sniffer (such as &man.tcpdump.1;) to confirm that your password is not sent in the clear. Try using telnet with the -x option, which encrypts the entire data stream (similar to ssh). The core Kerberos client applications (traditionally named kinit, klist, kdestroy, and kpasswd) are installed in the base &os; install. Note that &os; versions prior to 5.0 renamed them to k5init, k5list, k5destroy, k5passwd, and k5stash (though it is typically only used once). Various non-core Kerberos client applications are also installed by default. This is where the minimal nature of the base Heimdal installation is felt: telnet is the only Kerberos enabled service. The Heimdal port adds some of the missing client applications: Kerberos enabled versions of ftp, rsh, rcp, rlogin, and a few other less common programs. The MIT port also contains a full suite of Kerberos client applications. User configuration files: <filename>.k5login</filename> and <filename>.k5users</filename> .k5login .k5users Users within a realm typically have their Kerberos principal (such as tillman@EXAMPLE.ORG) mapped to a local user account (such as a local account named tillman). Client applications such as telnet usually do not require a user name or a principal. Occasionally, however, you want to grant access to a local user account to someone who does not have a matching Kerberos principal. For example, tillman@EXAMPLE.ORG may need access to the local user account webdevelopers. Other principals may also need access to that local account. The .k5login and .k5users files, placed in a users home directory, can be used similar to a powerful combination of .hosts and .rhosts, solving this problem. For example, if a .k5login with the following contents: tillman@example.org jdoe@example.org Were to be placed into the home directory of the local user webdevelopers then both principals listed would have access to that account without requiring a shared password. Reading the manual pages for these commands is recommended. Note that the ksu manual page covers .k5users. <application>Kerberos</application> Tips, Tricks, and Troubleshooting Kerberos5 troubleshooting When using either the Heimdal or MIT Kerberos ports ensure that your PATH environment variable lists the Kerberos versions of the client applications before the system versions. Do all the computers in your realm have synchronized time settings? If not, authentication may fail. describes how to synchronize clocks using NTP. MIT and Heimdal inter-operate nicely. Except for kadmin, the protocol for which is not standardized. If you change your hostname, you also need to change your host/ principal and update your keytab. This also applies to special keytab entries like the www/ principal used for Apache's www/mod_auth_kerb. All hosts in your realm must be resolvable (both forwards and reverse) in DNS (or /etc/hosts as a minimum). CNAMEs will work, but the A and PTR records must be correct and in place. The error message is not very intuitive: Kerberos5 refuses authentication because Read req failed: Key table entry not found. Some operating systems that may being acting as clients to your KDC do not set the permissions for ksu to be setuid root. This means that ksu does not work, which is a good security idea but annoying. This is not a KDC error. With MIT Kerberos, if you want to allow a principal to have a ticket life longer than the default ten hours, you must use modify_principal in kadmin to change the maxlife of both the principal in question and the krbtgt principal. Then the principal can use the -l option with kinit to request a ticket with a longer lifetime. If you run a packet sniffer on your KDC to add in troubleshooting and then run kinit from a workstation, you will notice that your TGT is sent immediately upon running kinit — even before you type your password! The explanation is that the Kerberos server freely transmits a TGT (Ticket Granting Ticket) to any unauthorized request; however, every TGT is encrypted in a key derived from the user's password. Therefore, when a user types their password it is not being sent to the KDC, it is being used to decrypt the TGT that kinit already obtained. If the decryption process results in a valid ticket with a valid time stamp, the user has valid Kerberos credentials. These credentials include a session key for establishing secure communications with the Kerberos server in the future, as well as the actual ticket-granting ticket, which is actually encrypted with the Kerberos server's own key. This second layer of encryption is unknown to the user, but it is what allows the Kerberos server to verify the authenticity of each TGT. If you want to use long ticket lifetimes (a week, for example) and you are using OpenSSH to connect to the machine where your ticket is stored, make sure that Kerberos is set to no in your sshd_config or else your tickets will be deleted when you log out. Remember that host principals can have a longer ticket lifetime as well. If your user principal has a lifetime of a week but the host you are connecting to has a lifetime of nine hours, you will have an expired host principal in your cache and the ticket cache will not work as expected. When setting up a krb5.dict file to prevent specific bad passwords from being used (the manual page for kadmind covers this briefly), remember that it only applies to principals that have a password policy assigned to them. The krb5.dict files format is simple: one string per line. Creating a symbolic link to /usr/share/dict/words might be useful. Differences with the <acronym>MIT</acronym> port The major difference between the MIT and Heimdal installs relates to the kadmin program which has a different (but equivalent) set of commands and uses a different protocol. This has a large implications if your KDC is MIT as you will not be able to use the Heimdal kadmin program to administer your KDC remotely (or vice versa, for that matter). The client applications may also take slightly different command line options to accomplish the same tasks. Following the instructions on the MIT Kerberos web site () is recommended. Be careful of path issues: the MIT port installs into /usr/local/ by default, and the normal system applications may be run instead of MIT if your PATH environment variable lists the system directories first. With the MIT security/krb5 port that is provided by &os;, be sure to read the /usr/local/share/doc/krb5/README.FreeBSD file installed by the port if you want to understand why logins via telnetd and klogind behave somewhat oddly. Most importantly, correcting the incorrect permissions on cache file behavior requires that the login.krb5 binary be used for authentication so that it can properly change ownership for the forwarded credentials. Mitigating limitations found in <application>Kerberos</application> Kerberos5 limitations and shortcomings <application>Kerberos</application> is an all-or-nothing approach Every service enabled on the network must be modified to work with Kerberos (or be otherwise secured against network attacks) or else the users credentials could be stolen and re-used. An example of this would be Kerberos enabling all remote shells (via rsh and telnet, for example) but not converting the POP3 mail server which sends passwords in plain text. <application>Kerberos</application> is intended for single-user workstations In a multi-user environment, Kerberos is less secure. This is because it stores the tickets in the /tmp directory, which is readable by all users. If a user is sharing a computer with several other people simultaneously (i.e. multi-user), it is possible that the user's tickets can be stolen (copied) by another user. This can be overcome with the -c filename command-line option or (preferably) the KRB5CCNAME environment variable, but this is rarely done. In principal, storing the ticket in the users home directory and using simple file permissions can mitigate this problem. The KDC is a single point of failure By design, the KDC must be as secure as the master password database is contained on it. The KDC should have absolutely no other services running on it and should be physically secured. The danger is high because Kerberos stores all passwords encrypted with the same key (the master key), which in turn is stored as a file on the KDC. As a side note, a compromised master key is not quite as bad as one might normally fear. The master key is only used to encrypt the Kerberos database and as a seed for the random number generator. As long as access to your KDC is secure, an attacker cannot do much with the master key. Additionally, if the KDC is unavailable (perhaps due to a denial of service attack or network problems) the network services are unusable as authentication can not be performed, a recipe for a denial-of-service attack. This can alleviated with multiple KDCs (a single master and one or more slaves) and with careful implementation of secondary or fall-back authentication (PAM is excellent for this). <application>Kerberos</application> Shortcomings Kerberos allows users, hosts and services to authenticate between themselves. It does not have a mechanism to authenticate the KDC to the users, hosts or services. This means that a trojanned kinit (for example) could record all user names and passwords. Something like security/tripwire or other file system integrity checking tools can alleviate this. Resources and further information Kerberos5 external resources The Kerberos FAQ Designing an Authentication System: a Dialog in Four Scenes RFC 1510, The Kerberos Network Authentication Service (V5) MIT Kerberos home page Heimdal Kerberos home page Tom Rhodes Written by: OpenSSL security OpenSSL One feature that many users overlook is the OpenSSL toolkit included in &os;. OpenSSL provides an encryption transport layer on top of the normal communications layer; thus allowing it to be intertwined with many network applications and services. Some uses of OpenSSL may include encrypted authentication of mail clients, web based transactions such as credit card payments and more. Many ports such as www/apache13-ssl, and mail/sylpheed-claws will offer compilation support for building with OpenSSL. In most cases the Ports Collection will attempt to build the security/openssl port unless the WITH_OPENSSL_BASE make variable is explicitly set to yes. The version of OpenSSL included in &os; supports Secure Sockets Layer v2/v3 (SSLv2/SSLv3), Transport Layer Security v1 (TLSv1) network security protocols and can be used as a general cryptographic library. While OpenSSL supports the IDEA algorithm, it is disabled by default due to United States patents. To use it, the license should be reviewed and, if the restrictions are acceptable, the MAKE_IDEA variable must be set in make.conf. One of the most common uses of OpenSSL is to provide certificates for use with software applications. These certificates ensure that the credentials of the company or individual are valid and not fraudulent. If the certificate in question has not been verified by one of the several Certificate Authorities, or CAs, a warning is usually produced. A Certificate Authority is a company, such as VeriSign, which will sign certificates in order to validate credentials of individuals or companies. This process has a cost associated with it and is definitely not a requirement for using certificates; however, it can put some of the more paranoid users at ease. Generating Certificates OpenSSL certificate generation To generate a certificate, the following command is available: &prompt.root; openssl req -new -nodes -out req.pem -keyout cert.pem Generating a 1024 bit RSA private key ................++++++ .......................................++++++ writing new private key to 'cert.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:PA Locality Name (eg, city) []:Pittsburgh Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Company Organizational Unit Name (eg, section) []:Systems Administrator Common Name (eg, YOUR name) []:localhost.example.org Email Address []:trhodes@FreeBSD.org Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:SOME PASSWORD An optional company name []:Another Name Notice the response directly after the Common Name prompt shows a domain name. This prompt requires a server name to be entered for verification purposes; placing anything but a domain name would yield a useless certificate. Other options, for instance expire time, alternate encryption algorithms, etc. are available. A complete list may be obtained by viewing the &man.openssl.1; manual page. Two files should now exist in the directory in which the aforementioned command was issued. The certificate request, req.pem, may be sent to a certificate authority who will validate the credentials that you entered, sign the request and return the certificate to you. The second file created will be named cert.pem and is the private key for the certificate and should be protected at all costs; if this falls in the hands of others it can be used to impersonate you (or your server). In cases where a signature from a CA is not required, a self signed certificate can be created. First, generate the RSA key: &prompt.root; openssl dsaparam -rand -genkey -out myRSA.key 1024 Next, generate the CA key: &prompt.root; openssl gendsa -des3 -out myca.key myRSA.key Use this key to create the certificate: &prompt.root; openssl req -new -x509 -days 365 -key myca.key -out new.crt Two new files should appear in the directory: a certificate authority signature file, myca.key and the certificate itself, new.crt. These should be placed in a directory, preferably under /etc, which is readable only by root. Permissions of 0700 should be fine for this and they can be set with the chmod utility. Using Certificates, an Example So what can these files do? A good use would be to encrypt connections to the Sendmail MTA. This would dissolve the use of clear text authentication for users who send mail via the local MTA. This is not the best use in the world as some MUAs will present the user with an error if they have not installed the certificate locally. Refer to the documentation included with the software for more information on certificate installation. The following lines should be placed inside the local .mc file: dnl SSL Options define(`confCACERT_PATH',`/etc/certs')dnl define(`confCACERT',`/etc/certs/new.crt')dnl define(`confSERVER_CERT',`/etc/certs/new.crt')dnl define(`confSERVER_KEY',`/etc/certs/myca.key')dnl define(`confTLS_SRV_OPTIONS', `V')dnl Where /etc/certs/ is the directory to be used for storing the certificate and key files locally. The last few requirements are a rebuild of the local .cf file. This is easily achieved by typing make install within the /etc/mail directory. Follow that up with make restart which should start the Sendmail daemon. If all went well there will be no error messages in the /var/log/maillog file and Sendmail will show up in the process list. For a simple test, simply connect to the mail server using the &man.telnet.1; utility: &prompt.root; telnet example.com 25 Trying 192.0.34.166... Connected to example.com. Escape character is '^]'. 220 example.com ESMTP Sendmail 8.12.10/8.12.10; Tue, 31 Aug 2004 03:41:22 -0400 (EDT) ehlo example.com 250-example.com Hello example.com [192.0.34.166], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-AUTH LOGIN PLAIN 250-STARTTLS 250-DELIVERBY 250 HELP quit 221 2.0.0 example.com closing connection Connection closed by foreign host. If the STARTTLS line appears in the output then everything is working correctly. Nik Clayton
nik@FreeBSD.org
Written by
IPsec VPN over IPsec Creating a VPN between two networks, separated by the Internet, using FreeBSD gateways. Hiten M. Pandya
hmp@FreeBSD.org
Written by
Understanding IPsec This section will guide you through the process of setting up IPsec, and to use it in an environment which consists of FreeBSD and µsoft.windows; 2000/XP machines, to make them communicate securely. In order to set up IPsec, it is necessary that you are familiar with the concepts of building a custom kernel (see ). IPsec is a protocol which sits on top of the Internet Protocol (IP) layer. It allows two or more hosts to communicate in a secure manner (hence the name). The FreeBSD IPsec network stack is based on the KAME implementation, which has support for both protocol families, IPv4 and IPv6. FreeBSD 5.X contains a hardware accelerated IPsec stack, known as Fast IPsec, that was obtained from OpenBSD. It employs cryptographic hardware (whenever possible) via the &man.crypto.4; subsystem to optimize the performance of IPsec. This subsystem is new, and does not support all the features that are available in the KAME version of IPsec. However, in order to enable hardware-accelerated IPsec, the following kernel option has to be added to your kernel configuration file: kernel options FAST_IPSEC options FAST_IPSEC # new IPsec (cannot define w/ IPSEC) Note, that it is not currently possible to use the Fast IPsec subsystem in lue with the KAME implementation of IPsec. Consult the &man.fast.ipsec.4; manual page for more information. IPsec ESP IPsec AH IPsec consists of two sub-protocols: Encapsulated Security Payload (ESP), protects the IP packet data from third party interference, by encrypting the contents using symmetric cryptography algorithms (like Blowfish, 3DES). Authentication Header (AH), protects the IP packet header from third party interference and spoofing, by computing a cryptographic checksum and hashing the IP packet header fields with a secure hashing function. This is then followed by an additional header that contains the hash, to allow the information in the packet to be authenticated. ESP and AH can either be used together or separately, depending on the environment. VPN virtual private network VPN IPsec can either be used to directly encrypt the traffic between two hosts (known as Transport Mode); or to build virtual tunnels between two subnets, which could be used for secure communication between two corporate networks (known as Tunnel Mode). The latter is more commonly known as a Virtual Private Network (VPN). The &man.ipsec.4; manual page should be consulted for detailed information on the IPsec subsystem in FreeBSD. To add IPsec support to your kernel, add the following options to your kernel configuration file: kernel options IPSEC kernel options IPSEC_ESP options IPSEC #IP security options IPSEC_ESP #IP security (crypto; define w/ IPSEC) kernel options IPSEC_DEBUG If IPsec debugging support is desired, the following kernel option should also be added: options IPSEC_DEBUG #debug for IP security
The Problem There is no standard for what constitutes a VPN. VPNs can be implemented using a number of different technologies, each of which have their own strengths and weaknesses. This section presents a scenario, and the strategies used for implementing a VPN for this scenario. The Scenario: Two networks, connected to the Internet, to behave as one VPN creating The premise is as follows: You have at least two sites Both sites are using IP internally Both sites are connected to the Internet, through a gateway that is running FreeBSD. The gateway on each network has at least one public IP address. The internal addresses of the two networks can be public or private IP addresses, it does not matter. You can be running NAT on the gateway machine if necessary. The internal IP addresses of the two networks do not collide. While I expect it is theoretically possible to use a combination of VPN technology and NAT to get this to work, I expect it to be a configuration nightmare. If you find that you are trying to connect two networks, both of which, internally, use the same private IP address range (e.g. both of them use 192.168.1.x), then one of the networks will have to be renumbered. The network topology might look something like this: Network #1 [ Internal Hosts ] Private Net, 192.168.1.2-254 [ Win9x/NT/2K ] [ UNIX ] | | .---[fxp1]---. Private IP, 192.168.1.1 | FreeBSD | `---[fxp0]---' Public IP, A.B.C.D | | -=-=- Internet -=-=- | | .---[fxp0]---. Public IP, W.X.Y.Z | FreeBSD | `---[fxp1]---' Private IP, 192.168.2.1 | | Network #2 [ Internal Hosts ] [ Win9x/NT/2K ] Private Net, 192.168.2.2-254 [ UNIX ] Notice the two public IP addresses. I will use the letters to refer to them in the rest of this article. Anywhere you see those letters in this article, replace them with your own public IP addresses. Note also that internally, the two gateway machines have .1 IP addresses, and that the two networks have different private IP addresses (192.168.1.x and 192.168.2.x respectively). All the machines on the private networks have been configured to use the .1 machine as their default gateway. The intention is that, from a network point of view, each network should view the machines on the other network as though they were directly attached the same router -- albeit a slightly slow router with an occasional tendency to drop packets. This means that (for example), machine 192.168.1.20 should be able to run ping 192.168.2.34 and have it work, transparently. &windows; machines should be able to see the machines on the other network, browse file shares, and so on, in exactly the same way that they can browse machines on the local network. And the whole thing has to be secure. This means that traffic between the two networks has to be encrypted. Creating a VPN between these two networks is a multi-step process. The stages are as follows: Create a virtual network link between the two networks, across the Internet. Test it, using tools like &man.ping.8;, to make sure it works. Apply security policies to ensure that traffic between the two networks is transparently encrypted and decrypted as necessary. Test this, using tools like &man.tcpdump.1;, to ensure that traffic is encrypted. Configure additional software on the FreeBSD gateways, to allow &windows; machines to see one another across the VPN. Step 1: Creating and testing a <quote>virtual</quote> network link Suppose that you were logged in to the gateway machine on network #1 (with public IP address A.B.C.D, private IP address 192.168.1.1), and you ran ping 192.168.2.1, which is the private address of the machine with IP address W.X.Y.Z. What needs to happen in order for this to work? The gateway machine needs to know how to reach 192.168.2.1. In other words, it needs to have a route to 192.168.2.1. Private IP addresses, such as those in the 192.168.x range are not supposed to appear on the Internet at large. Instead, each packet you send to 192.168.2.1 will need to be wrapped up inside another packet. This packet will need to appear to be from A.B.C.D, and it will have to be sent to W.X.Y.Z. This process is called encapsulation. Once this packet arrives at W.X.Y.Z it will need to unencapsulated, and delivered to 192.168.2.1. You can think of this as requiring a tunnel between the two networks. The two tunnel mouths are the IP addresses A.B.C.D and W.X.Y.Z, and the tunnel must be told the addresses of the private IP addresses that will be allowed to pass through it. The tunnel is used to transfer traffic with private IP addresses across the public Internet. This tunnel is created by using the generic interface, or gif devices on FreeBSD. As you can imagine, the gif interface on each gateway host must be configured with four IP addresses; two for the public IP addresses, and two for the private IP addresses. Support for the gif device must be compiled in to the &os; kernel on both machines. You can do this by adding the line: device gif to the kernel configuration files on both machines, and then compile, install, and reboot as normal. Configuring the tunnel is a two step process. First the tunnel must be told what the outside (or public) IP addresses are, using &man.gifconfig.8;. Then the private IP addresses must be configured using &man.ifconfig.8;. In &os; 5.X, the functionality provided by the &man.gifconfig.8; utility has been merged into &man.ifconfig.8;. On the gateway machine on network #1 you would run the following two commands to configure the tunnel. gifconfig gif0 A.B.C.D W.X.Y.Z ifconfig gif0 inet 192.168.1.1 192.168.2.1 netmask 0xffffffff On the other gateway machine you run the same commands, but with the order of the IP addresses reversed. gifconfig gif0 W.X.Y.Z A.B.C.D ifconfig gif0 inet 192.168.2.1 192.168.1.1 netmask 0xffffffff You can then run: gifconfig gif0 to see the configuration. For example, on the network #1 gateway, you would see this: &prompt.root; gifconfig gif0 gif0: flags=8011<UP,POINTTOPOINT,MULTICAST> mtu 1280 inet 192.168.1.1 --> 192.168.2.1 netmask 0xffffffff physical address inet A.B.C.D --> W.X.Y.Z As you can see, a tunnel has been created between the physical addresses A.B.C.D and W.X.Y.Z, and the traffic allowed through the tunnel is that between 192.168.1.1 and 192.168.2.1. This will also have added an entry to the routing table on both machines, which you can examine with the command netstat -rn. This output is from the gateway host on network #1. &prompt.root; netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire ... 192.168.2.1 192.168.1.1 UH 0 0 gif0 ... As the Flags value indicates, this is a host route, which means that each gateway knows how to reach the other gateway, but they do not know how to reach the rest of their respective networks. That problem will be fixed shortly. It is likely that you are running a firewall on both machines. This will need to be circumvented for your VPN traffic. You might want to allow all traffic between both networks, or you might want to include firewall rules that protect both ends of the VPN from one another. It greatly simplifies testing if you configure the firewall to allow all traffic through the VPN. You can always tighten things up later. If you are using &man.ipfw.8; on the gateway machines then a command like ipfw add 1 allow ip from any to any via gif0 will allow all traffic between the two end points of the VPN, without affecting your other firewall rules. Obviously you will need to run this command on both gateway hosts. This is sufficient to allow each gateway machine to ping the other. On 192.168.1.1, you should be able to run ping 192.168.2.1 and get a response, and you should be able to do the same thing on the other gateway machine. However, you will not be able to reach internal machines on either network yet. This is because of the routing -- although the gateway machines know how to reach one another, they do not know how to reach the network behind each one. To solve this problem you must add a static route on each gateway machine. The command to do this on the first gateway would be: route add 192.168.2.0 192.168.2.1 netmask 0xffffff00 This says In order to reach the hosts on the network 192.168.2.0, send the packets to the host 192.168.2.1. You will need to run a similar command on the other gateway, but with the 192.168.1.x addresses instead. IP traffic from hosts on one network will now be able to reach hosts on the other network. That has now created two thirds of a VPN between the two networks, in as much as it is virtual and it is a network. It is not private yet. You can test this using &man.ping.8; and &man.tcpdump.1;. Log in to the gateway host and run tcpdump dst host 192.168.2.1 In another log in session on the same host run ping 192.168.2.1 You will see output that looks something like this: 16:10:24.018080 192.168.1.1 > 192.168.2.1: icmp: echo request 16:10:24.018109 192.168.1.1 > 192.168.2.1: icmp: echo reply 16:10:25.018814 192.168.1.1 > 192.168.2.1: icmp: echo request 16:10:25.018847 192.168.1.1 > 192.168.2.1: icmp: echo reply 16:10:26.028896 192.168.1.1 > 192.168.2.1: icmp: echo request 16:10:26.029112 192.168.1.1 > 192.168.2.1: icmp: echo reply As you can see, the ICMP messages are going back and forth unencrypted. If you had used the parameter to &man.tcpdump.1; to grab more bytes of data from the packets you would see more information. Obviously this is unacceptable. The next section will discuss securing the link between the two networks so that it all traffic is automatically encrypted. Summary: Configure both kernels with pseudo-device gif. Edit /etc/rc.conf on gateway host #1 and add the following lines (replacing IP addresses as necessary). gifconfig_gif0="A.B.C.D W.X.Y.Z" ifconfig_gif0="inet 192.168.1.1 192.168.2.1 netmask 0xffffffff" static_routes="vpn" route_vpn="192.168.2.0 192.168.2.1 netmask 0xffffff00" Edit your firewall script (/etc/rc.firewall, or similar) on both hosts, and add ipfw add 1 allow ip from any to any via gif0 Make similar changes to /etc/rc.conf on gateway host #2, reversing the order of IP addresses. Step 2: Securing the link To secure the link we will be using IPsec. IPsec provides a mechanism for two hosts to agree on an encryption key, and to then use this key in order to encrypt data between the two hosts. The are two areas of configuration to be considered here. There must be a mechanism for two hosts to agree on the encryption mechanism to use. Once two hosts have agreed on this mechanism there is said to be a security association between them. There must be a mechanism for specifying which traffic should be encrypted. Obviously, you do not want to encrypt all your outgoing traffic -- you only want to encrypt the traffic that is part of the VPN. The rules that you put in place to determine what traffic will be encrypted are called security policies. Security associations and security policies are both maintained by the kernel, and can be modified by userland programs. However, before you can do this you must configure the kernel to support IPsec and the Encapsulated Security Payload (ESP) protocol. This is done by configuring a kernel with: kernel options IPSEC options IPSEC options IPSEC_ESP and recompiling, reinstalling, and rebooting. As before you will need to do this to the kernels on both of the gateway hosts. IKE You have two choices when it comes to setting up security associations. You can configure them by hand between two hosts, which entails choosing the encryption algorithm, encryption keys, and so forth, or you can use daemons that implement the Internet Key Exchange protocol (IKE) to do this for you. I recommend the latter. Apart from anything else, it is easier to set up. IPsec security policies setkey Editing and displaying security policies is carried out using &man.setkey.8;. By analogy, setkey is to the kernel's security policy tables as &man.route.8; is to the kernel's routing tables. setkey can also display the current security associations, and to continue the analogy further, is akin to netstat -r in that respect. There are a number of choices for daemons to manage security associations with FreeBSD. This article will describe how to use one of these, racoon — which is available from security/ipsec-tools in the &os; Ports collection. racoon The racoon software must be run on both gateway hosts. On each host it is configured with the IP address of the other end of the VPN, and a secret key (which you choose, and must be the same on both gateways). The two daemons then contact one another, confirm that they are who they say they are (by using the secret key that you configured). The daemons then generate a new secret key, and use this to encrypt the traffic over the VPN. They periodically change this secret, so that even if an attacker were to crack one of the keys (which is as theoretically close to unfeasible as it gets) it will not do them much good -- by the time they have cracked the key the two daemons have chosen another one. The configuration file for racoon is stored in ${PREFIX}/etc/racoon. You should find a configuration file there, which should not need to be changed too much. The other component of racoon's configuration, which you will need to change, is the pre-shared key. The default racoon configuration expects to find this in the file ${PREFIX}/etc/racoon/psk.txt. It is important to note that the pre-shared key is not the key that will be used to encrypt your traffic across the VPN link, it is simply a token that allows the key management daemons to trust one another. psk.txt contains a line for each remote site you are dealing with. In this example, where there are two sites, each psk.txt file will contain one line (because each end of the VPN is only dealing with one other end). On gateway host #1 this line should look like this: W.X.Y.Z secret That is, the public IP address of the remote end, whitespace, and a text string that provides the secret. Obviously, you should not use secret as your key -- the normal rules for choosing a password apply. On gateway host #2 the line would look like this A.B.C.D secret That is, the public IP address of the remote end, and the same secret key. psk.txt must be mode 0600 (i.e., only read/write to root) before racoon will run. You must run racoon on both gateway machines. You will also need to add some firewall rules to allow the IKE traffic, which is carried over UDP to the ISAKMP (Internet Security Association Key Management Protocol) port. Again, this should be fairly early in your firewall ruleset. ipfw add 1 allow udp from A.B.C.D to W.X.Y.Z isakmp ipfw add 1 allow udp from W.X.Y.Z to A.B.C.D isakmp Once racoon is running you can try pinging one gateway host from the other. The connection is still not encrypted, but racoon will then set up the security associations between the two hosts -- this might take a moment, and you may see this as a short delay before the ping commands start responding. Once the security association has been set up you can view it using &man.setkey.8;. Run setkey -D on either host to view the security association information. That's one half of the problem. They other half is setting your security policies. To create a sensible security policy, let's review what's been set up so far. This discussions hold for both ends of the link. Each IP packet that you send out has a header that contains data about the packet. The header includes the IP addresses of both the source and destination. As we already know, private IP addresses, such as the 192.168.x.y range are not supposed to appear on the public Internet. Instead, they must first be encapsulated inside another packet. This packet must have the public source and destination IP addresses substituted for the private addresses. So if your outgoing packet started looking like this: .----------------------. | Src: 192.168.1.1 | | Dst: 192.168.2.1 | | <other header info> | +----------------------+ | <packet data> | `----------------------' Then it will be encapsulated inside another packet, looking something like this: .--------------------------. | Src: A.B.C.D | | Dst: W.X.Y.Z | | <other header info> | +--------------------------+ | .----------------------. | | | Src: 192.168.1.1 | | | | Dst: 192.168.2.1 | | | | <other header info> | | | +----------------------+ | | | <packet data> | | | `----------------------' | `--------------------------' This encapsulation is carried out by the gif device. As you can see, the packet now has real IP addresses on the outside, and our original packet has been wrapped up as data inside the packet that will be put out on the Internet. Obviously, we want all traffic between the VPNs to be encrypted. You might try putting this in to words, as: If a packet leaves from A.B.C.D, and it is destined for W.X.Y.Z, then encrypt it, using the necessary security associations. If a packet arrives from W.X.Y.Z, and it is destined for A.B.C.D, then decrypt it, using the necessary security associations. That's close, but not quite right. If you did this, all traffic to and from W.X.Y.Z, even traffic that was not part of the VPN, would be encrypted. That's not quite what you want. The correct policy is as follows If a packet leaves from A.B.C.D, and that packet is encapsulating another packet, and it is destined for W.X.Y.Z, then encrypt it, using the necessary security associations. If a packet arrives from W.X.Y.Z, and that packet is encapsulating another packet, and it is destined for A.B.C.D, then decrypt it, using the necessary security associations. A subtle change, but a necessary one. Security policies are also set using &man.setkey.8;. &man.setkey.8; features a configuration language for defining the policy. You can either enter configuration instructions via stdin, or you can use the option to specify a filename that contains configuration instructions. The configuration on gateway host #1 (which has the public IP address A.B.C.D) to force all outbound traffic to W.X.Y.Z to be encrypted is: spdadd A.B.C.D/32 W.X.Y.Z/32 ipencap -P out ipsec esp/tunnel/A.B.C.D-W.X.Y.Z/require; Put these commands in a file (e.g. /etc/ipsec.conf) and then run &prompt.root; setkey -f /etc/ipsec.conf tells &man.setkey.8; that we want to add a rule to the secure policy database. The rest of this line specifies which packets will match this policy. A.B.C.D/32 and W.X.Y.Z/32 are the IP addresses and netmasks that identify the network or hosts that this policy will apply to. In this case, we want it to apply to traffic between these two hosts. tells the kernel that this policy should only apply to packets that encapsulate other packets. says that this policy applies to outgoing packets, and says that the packet will be secured. The second line specifies how this packet will be encrypted. is the protocol that will be used, while indicates that the packet will be further encapsulated in an IPsec packet. The repeated use of A.B.C.D and W.X.Y.Z is used to select the security association to use, and the final mandates that packets must be encrypted if they match this rule. This rule only matches outgoing packets. You will need a similar rule to match incoming packets. spdadd W.X.Y.Z/32 A.B.C.D/32 ipencap -P in ipsec esp/tunnel/W.X.Y.Z-A.B.C.D/require; Note the instead of in this case, and the necessary reversal of the IP addresses. The other gateway host (which has the public IP address W.X.Y.Z) will need similar rules. spdadd W.X.Y.Z/32 A.B.C.D/32 ipencap -P out ipsec esp/tunnel/W.X.Y.Z-A.B.C.D/require; spdadd A.B.C.D/32 W.X.Y.Z/32 ipencap -P in ipsec esp/tunnel/A.B.C.D-W.X.Y.Z/require; Finally, you need to add firewall rules to allow ESP and IPENCAP packets back and forth. These rules will need to be added to both hosts. ipfw add 1 allow esp from A.B.C.D to W.X.Y.Z ipfw add 1 allow esp from W.X.Y.Z to A.B.C.D ipfw add 1 allow ipencap from A.B.C.D to W.X.Y.Z ipfw add 1 allow ipencap from W.X.Y.Z to A.B.C.D Because the rules are symmetric you can use the same rules on each gateway host. Outgoing packets will now look something like this: .------------------------------. --------------------------. | Src: A.B.C.D | | | Dst: W.X.Y.Z | | | <other header info> | | Encrypted +------------------------------+ | packet. | .--------------------------. | -------------. | contents | | Src: A.B.C.D | | | | are | | Dst: W.X.Y.Z | | | | completely | | <other header info> | | | |- secure | +--------------------------+ | | Encap'd | from third | | .----------------------. | | -. | packet | party | | | Src: 192.168.1.1 | | | | Original |- with real | snooping | | | Dst: 192.168.2.1 | | | | packet, | IP addr | | | | <other header info> | | | |- private | | | | +----------------------+ | | | IP addr | | | | | <packet data> | | | | | | | | `----------------------' | | -' | | | `--------------------------' | -------------' | `------------------------------' --------------------------' When they are received by the far end of the VPN they will first be decrypted (using the security associations that have been negotiated by racoon). Then they will enter the gif interface, which will unwrap the second layer, until you are left with the innermost packet, which can then travel in to the inner network. You can check the security using the same &man.ping.8; test from earlier. First, log in to the A.B.C.D gateway machine, and run: tcpdump dst host 192.168.2.1 In another log in session on the same host run ping 192.168.2.1 This time you should see output like the following: XXX tcpdump output Now, as you can see, &man.tcpdump.1; shows the ESP packets. If you try to examine them with the option you will see (apparently) gibberish, because of the encryption. Congratulations. You have just set up a VPN between two remote sites. Summary Configure both kernels with: options IPSEC options IPSEC_ESP Install security/ipsec-tools. Edit ${PREFIX}/etc/racoon/psk.txt on both gateway hosts, adding an entry for the remote host's IP address and a secret key that they both know. Make sure this file is mode 0600. Add the following lines to /etc/rc.conf on each host: ipsec_enable="YES" ipsec_file="/etc/ipsec.conf" Create an /etc/ipsec.conf on each host that contains the necessary spdadd lines. On gateway host #1 this would be: spdadd A.B.C.D/32 W.X.Y.Z/32 ipencap -P out ipsec esp/tunnel/A.B.C.D-W.X.Y.Z/require; spdadd W.X.Y.Z/32 A.B.C.D/32 ipencap -P in ipsec esp/tunnel/W.X.Y.Z-A.B.C.D/require; On gateway host #2 this would be: spdadd W.X.Y.Z/32 A.B.C.D/32 ipencap -P out ipsec esp/tunnel/W.X.Y.Z-A.B.C.D/require; spdadd A.B.C.D/32 W.X.Y.Z/32 ipencap -P in ipsec esp/tunnel/A.B.C.D-W.X.Y.Z/require; Add firewall rules to allow IKE, ESP, and IPENCAP traffic to both hosts: ipfw add 1 allow udp from A.B.C.D to W.X.Y.Z isakmp ipfw add 1 allow udp from W.X.Y.Z to A.B.C.D isakmp ipfw add 1 allow esp from A.B.C.D to W.X.Y.Z ipfw add 1 allow esp from W.X.Y.Z to A.B.C.D ipfw add 1 allow ipencap from A.B.C.D to W.X.Y.Z ipfw add 1 allow ipencap from W.X.Y.Z to A.B.C.D The previous two steps should suffice to get the VPN up and running. Machines on each network will be able to refer to one another using IP addresses, and all traffic across the link will be automatically and securely encrypted.
Chern Lee Contributed by OpenSSH OpenSSH security OpenSSH OpenSSH is a set of network connectivity tools used to access remote machines securely. It can be used as a direct replacement for rlogin, rsh, rcp, and telnet. Additionally, any other TCP/IP connections can be tunneled/forwarded securely through SSH. OpenSSH encrypts all traffic to effectively eliminate eavesdropping, connection hijacking, and other network-level attacks. OpenSSH is maintained by the OpenBSD project, and is based upon SSH v1.2.12 with all the recent bug fixes and updates. It is compatible with both SSH protocols 1 and 2. OpenSSH has been in the base system since FreeBSD 4.0. Advantages of Using OpenSSH Normally, when using &man.telnet.1; or &man.rlogin.1;, data is sent over the network in an clear, un-encrypted form. Network sniffers anywhere in between the client and server can steal your user/password information or data transferred in your session. OpenSSH offers a variety of authentication and encryption methods to prevent this from happening. Enabling sshd OpenSSH enabling The sshd daemon is enabled by default on &os; 4.X and is enabled or not during the installation by the user of &os; 5.X. To see if it is enabled, check the rc.conf file for: sshd_enable="YES" This will load &man.sshd.8;, the daemon program for OpenSSH, the next time your system initializes. Alternatively, you can simply run directly the sshd daemon by typing sshd on the command line. SSH Client OpenSSH client The &man.ssh.1; utility works similarly to &man.rlogin.1;. &prompt.root; ssh user@example.com Host key not found from the list of known hosts. Are you sure you want to continue connecting (yes/no)? yes Host 'example.com' added to the list of known hosts. user@example.com's password: ******* The login will continue just as it would have if a session was created using rlogin or telnet. SSH utilizes a key fingerprint system for verifying the authenticity of the server when the client connects. The user is prompted to enter yes only when connecting for the first time. Future attempts to login are all verified against the saved fingerprint key. The SSH client will alert you if the saved fingerprint differs from the received fingerprint on future login attempts. The fingerprints are saved in ~/.ssh/known_hosts, or ~/.ssh/known_hosts2 for SSH v2 fingerprints. By default, recent versions of the OpenSSH servers only accept SSH v2 connections. The client will use version 2 if possible and will fall back to version 1. The client can also be forced to use one or the other by passing it the or for version 1 or version 2, respectively. The version 1 compatability is maintained in the client for backwards compatability with older versions. Secure Copy OpenSSH secure copy scp The &man.scp.1; command works similarly to &man.rcp.1;; it copies a file to or from a remote machine, except in a secure fashion. &prompt.root; scp user@example.com:/COPYRIGHT COPYRIGHT user@example.com's password: ******* COPYRIGHT 100% |*****************************| 4735 00:00 &prompt.root; Since the fingerprint was already saved for this host in the previous example, it is verified when using &man.scp.1; here. The arguments passed to &man.scp.1; are similar to &man.cp.1;, with the file or files in the first argument, and the destination in the second. Since the file is fetched over the network, through SSH, one or more of the file arguments takes on the form . Configuration OpenSSH configuration The system-wide configuration files for both the OpenSSH daemon and client reside within the /etc/ssh directory. ssh_config configures the client settings, while sshd_config configures the daemon. Additionally, the (/usr/sbin/sshd by default), and rc.conf options can provide more levels of configuration. ssh-keygen Instead of using passwords, &man.ssh-keygen.1; can be used to generate DSA or RSA keys to authenticate a user: &prompt.user; ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/user/.ssh/id_dsa): Created directory '/home/user/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_dsa. Your public key has been saved in /home/user/.ssh/id_dsa.pub. The key fingerprint is: bb:48:db:f2:93:57:80:b6:aa:bc:f5:d5:ba:8f:79:17 user@host.example.com &man.ssh-keygen.1; will create a public and private key pair for use in authentication. The private key is stored in ~/.ssh/id_dsa or ~/.ssh/id_rsa, whereas the public key is stored in ~/.ssh/id_dsa.pub or ~/.ssh/id_rsa.pub, respectively for DSA and RSA key types. The public key must be placed in ~/.ssh/authorized_keys of the remote machine in order for the setup to work. Similarly, RSA version 1 public keys should be placed in ~/.ssh/authorized_keys. This will allow connection to the remote machine based upon SSH keys instead of passwords. If a passphrase is used in &man.ssh-keygen.1;, the user will be prompted for a password each time in order to use the private key. &man.ssh-agent.1; can alleviate the strain of repeatedly entering long passphrases, and is explored in the section below. The various options and files can be different according to the OpenSSH version you have on your system; to avoid problems you should consult the &man.ssh-keygen.1; manual page. ssh-agent and ssh-add The &man.ssh-agent.1; and &man.ssh-add.1; utilities provide methods for SSH keys to be loaded into memory for use, without needing to type the passphrase each time. The &man.ssh-agent.1; utility will handle the authentication using the private key(s) that are loaded into it. &man.ssh-agent.1; should be used to launch another application. At the most basic level, it could spawn a shell or at a more advanced level, a window manager. To use &man.ssh-agent.1; in a shell, first it will need to be spawned with a shell as an argument. Secondly, the identity needs to be added by running &man.ssh-add.1; and providing it the passphrase for the private key. Once these steps have been completed the user will be able to &man.ssh.1; to any host that has the corresponding public key installed. For example: &prompt.user; ssh-agent csh &prompt.user; ssh-add Enter passphrase for /home/user/.ssh/id_dsa: Identity added: /home/user/.ssh/id_dsa (/home/user/.ssh/id_dsa) &prompt.user; To use &man.ssh-agent.1; in X11, a call to &man.ssh-agent.1; will need to be placed in ~/.xinitrc. This will provide the &man.ssh-agent.1; services to all programs launched in X11. An example ~/.xinitrc file might look like this: exec ssh-agent startxfce4 This would launch &man.ssh-agent.1;, which would in turn launch XFCE, every time X11 starts. Then once that is done and X11 has been restarted so that the changes can take effect, simply run &man.ssh-add.1; to load all of your SSH keys. SSH Tunneling OpenSSH tunneling OpenSSH has the ability to create a tunnel to encapsulate another protocol in an encrypted session. The following command tells &man.ssh.1; to create a tunnel for telnet: &prompt.user; ssh -2 -N -f -L 5023:localhost:23 user@foo.example.com &prompt.user; The ssh command is used with the following options: Forces ssh to use version 2 of the protocol. (Do not use if you are working with older SSH servers) Indicates no command, or tunnel only. If omitted, ssh would initiate a normal session. Forces ssh to run in the background. Indicates a local tunnel in localport:remotehost:remoteport fashion. The remote SSH server. An SSH tunnel works by creating a listen socket on localhost on the specified port. It then forwards any connection received on the local host/port via the SSH connection to the specified remote host and port. In the example, port 5023 on localhost is being forwarded to port 23 on localhost of the remote machine. Since 23 is telnet, this would create a secure telnet session through an SSH tunnel. This can be used to wrap any number of insecure TCP protocols such as SMTP, POP3, FTP, etc. Using SSH to Create a Secure Tunnel for SMTP &prompt.user; ssh -2 -N -f -L 5025:localhost:25 user@mailserver.example.com user@mailserver.example.com's password: ***** &prompt.user; telnet localhost 5025 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 mailserver.example.com ESMTP This can be used in conjunction with an &man.ssh-keygen.1; and additional user accounts to create a more seamless/hassle-free SSH tunneling environment. Keys can be used in place of typing a password, and the tunnels can be run as a separate user. Practical SSH Tunneling Examples Secure Access of a POP3 Server At work, there is an SSH server that accepts connections from the outside. On the same office network resides a mail server running a POP3 server. The network, or network path between your home and office may or may not be completely trustable. Because of this, you need to check your e-mail in a secure manner. The solution is to create an SSH connection to your office's SSH server, and tunnel through to the mail server. &prompt.user; ssh -2 -N -f -L 2110:mail.example.com:110 user@ssh-server.example.com user@ssh-server.example.com's password: ****** When the tunnel is up and running, you can point your mail client to send POP3 requests to localhost port 2110. A connection here will be forwarded securely across the tunnel to mail.example.com. Bypassing a Draconian Firewall Some network administrators impose extremely draconian firewall rules, filtering not only incoming connections, but outgoing connections. You may be only given access to contact remote machines on ports 22 and 80 for SSH and web surfing. You may wish to access another (perhaps non-work related) service, such as an Ogg Vorbis server to stream music. If this Ogg Vorbis server is streaming on some other port than 22 or 80, you will not be able to access it. The solution is to create an SSH connection to a machine outside of your network's firewall, and use it to tunnel to the Ogg Vorbis server. &prompt.user; ssh -2 -N -f -L 8888:music.example.com:8000 user@unfirewalled-system.example.org user@unfirewalled-system.example.org's password: ******* Your streaming client can now be pointed to localhost port 8888, which will be forwarded over to music.example.com port 8000, successfully evading the firewall. The <varname>AllowUsers</varname> Users Option It is often a good idea to limit which users can log in and from where. The AllowUsers option is a good way to accomplish this. For example, to only allow the root user to log in from 192.168.1.32, something like this would be appropriate in the /etc/ssh/sshd_config file: AllowUsers root@192.168.1.32 To allow the user admin to log in from anywhere, just list the username by itself: AllowUsers admin Multiple users should be listed on the same line, like so: AllowUsers root@192.168.1.32 admin It is important that you list each user that needs to log in to this machine; otherwise they will be locked out. After making changes to /etc/ssh/sshd_config you must tell &man.sshd.8; to reload its config files, by running: &prompt.root; /etc/rc.d/sshd reload Further Reading OpenSSH &man.ssh.1; &man.scp.1; &man.ssh-keygen.1; &man.ssh-agent.1; &man.ssh-add.1; &man.ssh.config.5; &man.sshd.8; &man.sftp-server.8; &man.sshd.config.5; Tom Rhodes Contributed by ACL File System Access Control Lists In conjunction with file system enhancements like snapshots, FreeBSD 5.0 and later offers the security of File System Access Control Lists (ACLs). Access Control Lists extend the standard &unix; permission model in a highly compatible (&posix;.1e) way. This feature permits an administrator to make use of and take advantage of a more sophisticated security model. To enable ACL support for UFS file systems, the following: options UFS_ACL must be compiled into the kernel. If this option has not been compiled in, a warning message will be displayed when attempting to mount a file system supporting ACLs. This option is included in the GENERIC kernel. ACLs rely on extended attributes being enabled on the file system. Extended attributes are natively supported in the next generation &unix; file system, UFS2. A higher level of administrative overhead is required to configure extended attributes on UFS1 than on UFS2. The performance of extended attributes on UFS2 is also substantially higher. As a result, UFS2 is generally recommended in preference to UFS1 for use with access control lists. ACLs are enabled by the mount-time administrative flag, , which may be added to /etc/fstab. The mount-time flag can also be automatically set in a persistent manner using &man.tunefs.8; to modify a superblock ACLs flag in the file system header. In general, it is preferred to use the superblock flag for several reasons: The mount-time ACLs flag cannot be changed by a remount (&man.mount.8; ), only by means of a complete &man.umount.8; and fresh &man.mount.8;. This means that ACLs cannot be enabled on the root file system after boot. It also means that you cannot change the disposition of a file system once it is in use. Setting the superblock flag will cause the file system to always be mounted with ACLs enabled even if there is not an fstab entry or if the devices re-order. This prevents accidental mounting of the file system without ACLs enabled, which can result in ACLs being improperly enforced, and hence security problems. We may change the ACLs behavior to allow the flag to be enabled without a complete fresh &man.mount.8;, but we consider it desirable to discourage accidental mounting without ACLs enabled, because you can shoot your feet quite nastily if you enable ACLs, then disable them, then re-enable them without flushing the extended attributes. In general, once you have enabled ACLs on a file system, they should not be disabled, as the resulting file protections may not be compatible with those intended by the users of the system, and re-enabling ACLs may re-attach the previous ACLs to files that have since had their permissions changed, resulting in other unpredictable behavior. File systems with ACLs enabled will show a + (plus) sign in their permission settings when viewed. For example: drwx------ 2 robert robert 512 Dec 27 11:54 private drwxrwx---+ 2 robert robert 512 Dec 23 10:57 directory1 drwxrwx---+ 2 robert robert 512 Dec 22 10:20 directory2 drwxrwx---+ 2 robert robert 512 Dec 27 11:57 directory3 drwxr-xr-x 2 robert robert 512 Nov 10 11:54 public_html Here we see that the directory1, directory2, and directory3 directories are all taking advantage of ACLs. The public_html directory is not. Making Use of <acronym>ACL</acronym>s The file system ACLs can be viewed by the &man.getfacl.1; utility. For instance, to view the ACL settings on the test file, one would use the command: &prompt.user; getfacl test #file:test #owner:1001 #group:1001 user::rw- group::r-- other::r-- To change the ACL settings on this file, invoke the &man.setfacl.1; utility. Observe: &prompt.user; setfacl -k test The flag will remove all of the currently defined ACLs from a file or file system. The more preferable method would be to use as it leaves the basic fields required for ACLs to work. &prompt.user; setfacl -m u:trhodes:rwx,group:web:r--,o::--- test In the aforementioned command, the option was used to modify the default ACL entries. Since there were no pre-defined entries, as they were removed by the previous command, this will restore the default options and assign the options listed. Take care to notice that if you add a user or group which does not exist on the system, an Invalid argument error will be printed to stdout. Tom Rhodes Contributed by Portaudit Monitoring Third Party Security Issues In recent years, the security world has made many improvements to how vulnerability assessment is handled. The threat of system intrusion increases as third party utilities are installed and configured for virtually any operating system available today. Vulnerability assessment is a key factor in security, and while &os; releases advisories for the base system, doing so for every third party utility is beyond the &os; Project's capability. There is a way to mitigate third party vulnerabilities and warn administrators of known security issues. A &os; add on utility known as Portaudit exists solely for this purpose. The security/portaudit port polls a database, updated and maintained by the &os; Security Team and ports developers, for known security issues. To begin using Portaudit, one must install it from the Ports Collection: &prompt.root; cd /usr/ports/security/portaudit && make install clean During the install process, the configuration files for &man.periodic.8; will be updated, permitting Portaudit output in the daily security runs. Ensure the daily security run emails, which are sent to root's email account, are being read. No more configuration will be required here. After installation, an administrator must update the database stored locally in /var/db/portaudit by invoking the following command: &prompt.root; portaudit -F The database will automatically be updated during the &man.periodic.8; run; thus, the previous command is completely optional. It is only required for the following examples. To audit the third party utilities installed as part of the Ports Collection, an administrator need only run the following command: &prompt.root; portaudit -a An example of output is provided: Affected package: cups-base-1.1.22.0_1 Type of problem: cups-base -- HPGL buffer overflow vulnerability. Reference: <http://www.FreeBSD.org/ports/portaudit/40a3bca2-6809-11d9-a9e7-0001020eed82.html> 1 problem(s) in your installed packages found. You are advised to update or deinstall the affected package(s) immediately. By pointing a web browser to the URL shown, an administrator may obtain more information about the vulnerability in question. This will include versions affected, by &os; Port version, along with other web sites which may contain security advisories. In short, Portaudit is a powerful utility and extremely useful when coupled with the Portupgrade port. Tom Rhodes Contributed by FreeBSD Security Advisories &os; Security Advisories Like many production quality operating systems, &os; publishes Security Advisories. These advisories are usually mailed to the security lists and noted in the Errata only after the appropriate releases have been patched. This section will work to explain what an advisory is, how to understand it, and what measures to take in order to patch a system. What does an advisory look like? The &os; security advisories look similar to the one below, taken from the &a.security-notifications.name; mailing list. ============================================================================= &os;-SA-XX:XX.UTIL Security Advisory The &os; Project Topic: denial of service due to some problem Category: core Module: sys Announced: 2003-09-23 Credits: Person@EMAIL-ADDRESS Affects: All releases of &os; &os; 4-STABLE prior to the correction date Corrected: 2003-09-23 16:42:59 UTC (RELENG_4, 4.9-PRERELEASE) 2003-09-23 20:08:42 UTC (RELENG_5_1, 5.1-RELEASE-p6) 2003-09-23 20:07:06 UTC (RELENG_5_0, 5.0-RELEASE-p15) 2003-09-23 16:44:58 UTC (RELENG_4_8, 4.8-RELEASE-p8) 2003-09-23 16:47:34 UTC (RELENG_4_7, 4.7-RELEASE-p18) 2003-09-23 16:49:46 UTC (RELENG_4_6, 4.6-RELEASE-p21) 2003-09-23 16:51:24 UTC (RELENG_4_5, 4.5-RELEASE-p33) 2003-09-23 16:52:45 UTC (RELENG_4_4, 4.4-RELEASE-p43) 2003-09-23 16:54:39 UTC (RELENG_4_3, 4.3-RELEASE-p39) &os; only: NO For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit http://www.FreeBSD.org/security/. I. Background II. Problem Description III. Impact IV. Workaround V. Solution VI. Correction details VII. References The Topic field indicates exactly what the problem is. It is basically an introduction to the current security advisory and notes the utility with the vulnerability. The Category refers to the affected part of the system which may be one of core, contrib, or ports. The core category means that the vulnerability affects a core component of the &os; operating system. The contrib category means that the vulnerability affects software contributed to the &os; Project, such as sendmail. Finally the ports category indicates that the vulnerability affects add on software available as part of the Ports Collection. The Module field refers to the component location, for instance sys. In this example, we see that the module, sys, is affected; therefore, this vulnerability affects a component used within the kernel. The Announced field reflects the date said security advisory was published, or announced to the world. This means that the security team has verified that the problem does exist and that a patch has been committed to the &os; source code repository. The Credits field gives credit to the individual or organization who noticed the vulnerability and reported it. The Affects field explains which releases of &os; are affected by this vulnerability. For the kernel, a quick look over the output from ident on the affected files will help in determining the revision. For ports, the version number is listed after the port name in /var/db/pkg. If the system does not sync with the &os; CVS repository and rebuild daily, chances are that it is affected. The Corrected field indicates the date, time, time offset, and release that was corrected. The &os; only field indicates whether this vulnerability affects just &os;, or if it affects other operating systems as well. The Background field gives information on exactly what the affected utility is. Most of the time this is why the utility exists in &os;, what it is used for, and a bit of information on how the utility came to be. The Problem Description field explains the security hole in depth. This can include information on flawed code, or even how the utility could be maliciously used to open a security hole. The Impact field describes what type of impact the problem could have on a system. For example, this could be anything from a denial of service attack, to extra privileges available to users, or even giving the attacker superuser access. The Workaround field offers a feasible workaround to system administrators who may be incapable of upgrading the system. This may be due to time constraints, network availability, or a slew of other reasons. Regardless, security should not be taken lightly, and an affected system should either be patched or the security hole workaround should be implemented. The Solution field offers instructions on patching the affected system. This is a step by step tested and verified method for getting a system patched and working securely. The Correction Details field displays the CVS branch or release name with the periods changed to underscore characters. It also shows the revision number of the affected files within each branch. The References field usually offers sources of other information. This can included web URLs, books, mailing lists, and newsgroups. Tom Rhodes Contributed by Process Accounting Process Accounting Process accounting is a security method in which an administrator may keep track of system resources used, their allocation among users, provide for system monitoring, and minimally track a user's commands. This indeed has its own positive and negative points. One of the positives is that an intrusion may be narrowed down to the point of entry. A negative is the amount of logs generated by process accounting, and the disk space they may require. This section will walk an administrator through the basics of process accounting. Enable and Utilizing Process Accounting Before making use of process accounting, it must be enabled. To do this, execute the following commands: &prompt.root; touch /var/account/acct &prompt.root; accton /var/account/acct &prompt.root; echo 'accounting_enable="YES"' >> /etc/rc.conf Once enabled, accounting will begin to track CPU stats, commands, etc. All accounting logs are in a non-human readable format and may be viewed using the &man.sa.8; utility. If issued without any options, sa will print information relating to the number of per user calls, the total elapsed time in minutes, total CPU and user time in minutes, average number of I/O operations, etc. To view information about commands being issued, one would use the &man.lastcomm.1; utility. The lastcomm may be used to print out commands issued by users on specific &man.ttys.5;, for example: &prompt.root; lastcomm ls trhodes ttyp1 Would print out all known usage of the ls by trhodes on the ttyp1 terminal. Many other useful options exist and are explained in the &man.lastcomm.1;, &man.acct.5; and &man.sa.8; manual pages.
diff --git a/zh_TW.Big5/books/handbook/users/chapter.sgml b/zh_TW.Big5/books/handbook/users/chapter.sgml index 68c3ec3df0..3a3ade6f56 100644 --- a/zh_TW.Big5/books/handbook/users/chapter.sgml +++ b/zh_TW.Big5/books/handbook/users/chapter.sgml @@ -1,1118 +1,1110 @@ Neil Blakey-Milner Contributed by - Users and Basic Account Management + ¨Ï¥ÎªÌ»P°ò¥»±b¸¹ºÞ²z - Synopsis + ·§­z - FreeBSD allows multiple users to use the computer at the same time. - Obviously, only one of those users can be sitting in front of the screen and - keyboard at any one time + FreeBSD ¤¹³\¦h­Ó¨Ï¥ÎªÌ¦P®É¨Ï¥Î¹q¸£¡C·íµM¡A³o¨Ã¤£¬O«Ü¦h¤H¦P®É§¤¦b¦P¤@¥x¹q¸£«e - Well, unless you hook up multiple terminals, but we will - save that for . - , but any number of users can log in through the - network to get their work done. To use the system every user must have - an account. + Well..°£«D±z³s±µ multiple terminals¡A³oºØ±¡ªp§Ú­Ì·|¦b Á¿¨ì¡C + ¡A¦Ó¬O¨ä¥L¨Ï¥ÎªÌ¥i¥H³z¹Lºô¸ô¨Ó¨Ï¥Î¦P¤@¥x¹q¸£¥H§¹¦¨¥L­Ìªº¤u§@¡C + ­n¨Ï¥Î¨t²Îªº¸Ü¡A¨º»ò¨C­Ó¤H³£±o¦³¤@­Ó±b¸¹¡C - After reading this chapter, you will know: + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡G - The differences between the various user accounts on a FreeBSD - system. + ¦b FreeBSD ¨t²Î¤W¤£¦P±b¸¹¤§¶¡ªº°Ï§O¡C - How to add user accounts. + ¦p¦ó¼W¥[±b¸¹¡C - How to remove user accounts. + ¦p¦ó§R°£±b¸¹¡C - How to change account details, such as the user's full name, or - preferred shell. + ¦p¦ó§ó§ï±b¸¹ªº°ò¥»¸ê®Æ¡A¹³¬O±b¸¹¥þ¦W¡A©Î¬O¨Ï¥Îªº shell ºØÃþ¡C - How to set limits on a per-account basis, to control the - resources such as memory and CPU time that accounts and groups of - accounts are allowed to access. + ¦p¦ó°w¹ï±b¸¹¡B¸s²Õ¨Ó³]­­¡A¤ñ¦p¡G¤¹³\¦s¨ú°O¾ÐÅé©Î CPU ¸ê·½¦h¹èµ¥¡C - How to use groups to make account management easier. + ¦p¦ó¹B¥Î¸s²Õ¡A¨Ó§ó®e©ö¦aºÞ²z±b¸¹¡C - Before reading this chapter, you should: + ¦b¾\Ū³o³¹¤§«e¡A±zÀ³·í¤F¸Ñ¡G - Understand the basics of &unix; and FreeBSD (). + ÁA¸Ñ &unix; ¤Î FreeBSD ()ªº°ò¦·§©À¡C - Introduction + ¤¶²Ð - All access to the system is achieved via accounts, and all - processes are run by users, so user and account management are - of integral importance on FreeBSD systems. + ¨t²Îªº©Ò¦³¦s¨ú¬O¸g¥Ñ±b¸¹¨Ó¶i¦æ¡A¦Ó©Ò¦³ªºµ{¦¡ process ¬O¥Ñ¨Ï¥ÎªÌ¨Ó¶i¦æ¡A©Ò¥H + ¨Ï¥ÎªÌ¤Î±b¸¹ºÞ²z¡A¤D¬O FreeBSD ¨t²Î¤W¤£¥i©Î¯Êªº­«ÂI¡C Every account on a FreeBSD system has certain information associated with it to identify the account. User name The user name as it would be typed at the login: prompt. User names must be unique across the computer; you may not have two users with the same user name. There are a number of rules for creating valid user names, documented in &man.passwd.5;; you would typically use user names that consist of eight or fewer all lower case characters. Password Each account has a password associated with it. The password may be blank, in which case no password will be required to access the system. This is normally a very bad idea; every account should have a password. User ID (UID) The UID is a number, traditionally from 0 to 65535 It is possible to use UID/GIDs as large as 4294967295, but such IDs can cause serious problems with software that makes assumptions about the values of IDs. , used to uniquely identify the user to the system. Internally, FreeBSD uses the UID to identify users—any FreeBSD commands that allow you to specify a user name will convert it to the UID before working with it. This means that you can have several accounts with different user names but the same UID. As far as FreeBSD is concerned these accounts are one user. It is unlikely you will ever need to do this. Group ID (GID) The GID is a number, traditionally from 0 to 65535, used to uniquely identify the primary group that the user belongs to. Groups are a mechanism for controlling access to resources based on a user's GID rather than their UID. This can significantly reduce the size of some configuration files. A user may also be in more than one group. Login class Login classes are an extension to the group mechanism that provide additional flexibility when tailoring the system to different users. Password change time By default FreeBSD does not force users to change their passwords periodically. You can enforce this on a per-user basis, forcing some or all of your users to change their passwords after a certain amount of time has elapsed. Account expiry time By default FreeBSD does not expire accounts. If you are creating accounts that you know have a limited lifespan, for example, in a school where you have accounts for the students, then you can specify when the account expires. After the expiry time has elapsed the account cannot be used to log in to the system, although the account's directories and files will remain. User's full name The user name uniquely identifies the account to FreeBSD, but does not necessarily reflect the user's real name. This information can be associated with the account. Home directory The home directory is the full path to a directory on the system in which the user will start when logging on to the system. A common convention is to put all user home directories under /home/username or /usr/home/username. The user would store their personal files in their home directory, and any directories they may create in there. User shell The shell provides the default environment users use to interact with the system. There are many different kinds of shells, and experienced users will have their own preferences, which can be reflected in their account settings. There are three main types of accounts: the Superuser, system users, and user accounts. The Superuser account, usually called root, is used to manage the system with no limitations on privileges. System users run services. Finally, user accounts are used by real people, who log on, read mail, and so forth. The Superuser Account accounts superuser (root) The superuser account, usually called root, comes preconfigured to facilitate system administration, and should not be used for day-to-day tasks like sending and receiving mail, general exploration of the system, or programming. This is because the superuser, unlike normal user accounts, can operate without limits, and misuse of the superuser account may result in spectacular disasters. User accounts are unable to destroy the system by mistake, so it is generally best to use normal user accounts whenever possible, unless you especially need the extra privilege. You should always double and triple-check commands you issue as the superuser, since an extra space or missing character can mean irreparable data loss. So, the first thing you should do after reading this chapter is to create an unprivileged user account for yourself for general usage if you have not already. This applies equally whether you are running a multi-user or single-user machine. Later in this chapter, we discuss how to create additional accounts, and how to change between the normal user and superuser. System Accounts accounts system System users are those used to run services such as DNS, mail, web servers, and so forth. The reason for this is security; if all services ran as the superuser, they could act without restriction. accounts daemon accounts operator Examples of system users are daemon, operator, bind (for the Domain Name Service), news, and www. accounts nobody nobody is the generic unprivileged system user. However, it is important to keep in mind that the more services that use nobody, the more files and processes that user will become associated with, and hence the more privileged that user becomes. User Accounts accounts user User accounts are the primary means of access for real people to the system, and these accounts insulate the user and the environment, preventing the users from damaging the system or other users, and allowing users to customize their environment without affecting others. Every person accessing your system should have a unique user account. This allows you to find out who is doing what, prevent people from clobbering each others' settings or reading each others' mail, and so forth. Each user can set up their own environment to accommodate their use of the system, by using alternate shells, editors, key bindings, and language. Modifying Accounts accounts modifying There are a variety of different commands available in the &unix; environment to manipulate user accounts. The most common commands are summarized below, followed by more detailed examples of their usage. Command Summary &man.adduser.8; The recommended command-line application for adding new users. &man.rmuser.8; The recommended command-line application for removing users. &man.chpass.1; A flexible tool to change user database information. &man.passwd.1; The simple command-line tool to change user passwords. &man.pw.8; A powerful and flexible tool to modify all aspects of user accounts. <command>adduser</command> accounts adding adduser /usr/share/skel skeleton directory &man.adduser.8; is a simple program for adding new users. It creates entries in the system passwd and group files. It will also create a home directory for the new user, copy in the default configuration files (dotfiles) from /usr/share/skel, and can optionally mail the new user a welcome message. In &os; 5.0, &man.adduser.8; was rewritten from a Perl script to a shell script that acts as wrapper around &man.pw.8;, so its usage is slightly different on &os; 4.X and &os; 5.X. To create the initial configuration file, use adduser -s -config_create. The makes &man.adduser.8; default to quiet. We use later when we want to change defaults. Next, we configure &man.adduser.8; defaults, and create our first user account, since using root for normal usage is evil and nasty. Configuring <command>adduser</command> and adding a user on &os; 4.X &prompt.root; adduser -v Use option ``-silent'' if you don't want to see all warnings and questions. Check /etc/shells Check /etc/master.passwd Check /etc/group Enter your default shell: csh date no sh tcsh zsh [sh]: zsh Your default shell is: zsh -> /usr/local/bin/zsh Enter your default HOME partition: [/home]: Copy dotfiles from: /usr/share/skel no [/usr/share/skel]: Send message from file: /etc/adduser.message no [/etc/adduser.message]: no Do not send message Use passwords (y/n) [y]: y Write your changes to /etc/adduser.conf? (y/n) [n]: y Ok, let's go. Don't worry about mistakes. I will give you the chance later to correct any input. Enter username [a-z0-9_-]: jru Enter full name []: J. Random User Enter shell csh date no sh tcsh zsh [zsh]: Enter home directory (full path) [/home/jru]: Uid [1001]: Enter login class: default []: Login group jru [jru]: Login group is ``jru''. Invite jru into other groups: guest no [no]: wheel Enter password []: Enter password again []: Name: jru Password: **** Fullname: J. Random User Uid: 1001 Gid: 1001 (jru) Class: Groups: jru wheel HOME: /home/jru Shell: /usr/local/bin/zsh OK? (y/n) [y]: y Added user ``jru'' Copy files from /usr/share/skel to /home/jru Add another user? (y/n) [y]: n Goodbye! &prompt.root; In summary, we changed the default shell to zsh (an additional shell found in the Ports Collection), and turned off the sending of a welcome mail to added users. We then saved the configuration, created an account for jru, and made sure jru is in wheel group (so that she may assume the role of root with the &man.su.1; command.) The password you type in is not echoed, nor are asterisks displayed. Make sure that you do not mistype the password. Just use &man.adduser.8; without arguments from now on, and you will not have to go through changing the defaults. If the program asks you to change the defaults, exit the program, and try the option. Adding a user on &os; 5.X &prompt.root; adduser Username: jru Full name: J. Random User Uid (Leave empty for default): Login group [jru]: Login group is jru. Invite jru into other groups? []: wheel Login class [default]: Shell (sh csh tcsh zsh nologin) [sh]: zsh Home directory [/home/jru]: 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 : jru Password : **** Full Name : J. Random User Uid : 1001 Class : Groups : jru wheel Home : /home/jru Shell : /usr/local/bin/zsh Locked : no OK? (yes/no): yes adduser: INFO: Successfully added (jru) to the user database. Add another user? (yes/no): no Goodbye! &prompt.root; <command>rmuser</command> rmuser accounts removing You can use &man.rmuser.8; to completely remove a user from the system. &man.rmuser.8; performs the following steps: Removes the user's &man.crontab.1; entry (if any). Removes any &man.at.1; jobs belonging to the user. Kills all processes owned by the user. Removes the user from the system's local password file. Removes the user's home directory (if it is owned by the user). Removes the incoming mail files belonging to the user from /var/mail. Removes all files owned by the user from temporary file storage areas such as /tmp. Finally, removes the username from all groups to which it belongs in /etc/group. If a group becomes empty and the group name is the same as the username, the group is removed; this complements the per-user unique groups created by &man.adduser.8;. &man.rmuser.8; cannot be used to remove superuser accounts, since that is almost always an indication of massive destruction. By default, an interactive mode is used, which attempts to make sure you know what you are doing. <command>rmuser</command> Interactive Account Removal &prompt.root; rmuser jru Matching password entry: jru:*:1001:1001::0:0:J. Random User:/home/jru:/usr/local/bin/zsh Is this the entry you wish to remove? y Remove user's home directory (/home/jru)? y Updating password file, updating databases, done. Updating group file: trusted (removing group jru -- personal group is empty) done. Removing user's incoming mail file /var/mail/jru: done. Removing files belonging to jru from /tmp: done. Removing files belonging to jru from /var/tmp: done. Removing files belonging to jru from /var/tmp/vi.recover: done. &prompt.root; <command>chpass</command> chpass &man.chpass.1; changes user database information such as passwords, shells, and personal information. Only system administrators, as the superuser, may change other users' information and passwords with &man.chpass.1;. When passed no options, aside from an optional username, &man.chpass.1; displays an editor containing user information. When the user exists from the editor, the user database is updated with the new information. In &os; 5.X, you will be asked for your password after exiting the editor if you are not the superuser. Interactive <command>chpass</command> by Superuser #Changing user database information for jru. Login: jru Password: * Uid [#]: 1001 Gid [# or name]: 1001 Change [month day year]: Expire [month day year]: Class: Home directory: /home/jru Shell: /usr/local/bin/zsh Full Name: J. Random User Office Location: Office Phone: Home Phone: Other information: The normal user can change only a small subset of this information, and only for themselves. Interactive <command>chpass</command> by Normal User #Changing user database information for jru. Shell: /usr/local/bin/zsh Full Name: J. Random User Office Location: Office Phone: Home Phone: Other information: &man.chfn.1; and &man.chsh.1; are just links to &man.chpass.1;, as are &man.ypchpass.1;, &man.ypchfn.1;, and &man.ypchsh.1;. NIS support is automatic, so specifying the yp before the command is not necessary. If this is confusing to you, do not worry, NIS will be covered in . <command>passwd</command> passwd accounts changing password &man.passwd.1; is the usual way to change your own password as a user, or another user's password as the superuser. To prevent accidental or unauthorized changes, the original password must be entered before a new password can be set. Changing Your Password &prompt.user; passwd Changing local password for jru. Old password: New password: Retype new password: passwd: updating the database... passwd: done Changing Another User's Password as the Superuser &prompt.root; passwd jru Changing local password for jru. New password: Retype new password: passwd: updating the database... passwd: done As with &man.chpass.1;, &man.yppasswd.1; is just a link to &man.passwd.1;, so NIS works with either command. <command>pw</command> pw &man.pw.8; is a command line utility to create, remove, modify, and display users and groups. It functions as a front end to the system user and group files. &man.pw.8; has a very powerful set of command line options that make it suitable for use in shell scripts, but new users may find it more complicated than the other commands presented here. - Limiting Users + ¹ï±b¸¹ªº¸ê·½¹B¥Î§@­­¨î limiting users accounts limiting If you have users, the ability to limit their system use may have come to mind. FreeBSD provides several ways an administrator can limit the amount of system resources an individual may use. These limits are divided into two sections: disk quotas, and other resource limits. quotas limiting users quotas disk quotas Disk quotas limit disk usage to users, and they provide a way to quickly check that usage without calculating it every time. Quotas are discussed in . The other resource limits include ways to limit the amount of CPU, memory, and other resources a user may consume. These are defined using login classes and are discussed here. /etc/login.conf Login classes are defined in /etc/login.conf. The precise semantics are beyond the scope of this section, but are described in detail in the &man.login.conf.5; manual page. It is sufficient to say that each user is assigned to a login class (default by default), and that each login class has a set of login capabilities associated with it. A login capability is a name=value pair, where name is a well-known identifier and value is an arbitrary string processed accordingly depending on the name. Setting up login classes and capabilities is rather straight-forward and is also described in &man.login.conf.5;. The system does not read the configuration in /etc/login.conf directly, but reads the database file /etc/login.conf.db. To generate /etc/login.conf.db from /etc/login.conf, execute the following command: &prompt.root; cap_mkdb /etc/login.conf Resource limits are different from plain vanilla login capabilities in two ways. First, for every limit, there is a soft (current) and hard limit. A soft limit may be adjusted by the user or application, but may be no higher than the hard limit. The latter may be lowered by the user, but never raised. Second, most resource limits apply per process to a specific user, not the user as a whole. Note, however, that these differences are mandated by the specific handling of the limits, not by the implementation of the login capability framework (i.e., they are not really a special case of login capabilities). And so, without further ado, below are the most commonly used resource limits (the rest, along with all the other login capabilities, may be found in &man.login.conf.5;). coredumpsize coredumpsize limiting users coredumpsize The limit on the size of a core file generated by a program is, for obvious reasons, subordinate to other limits on disk usage (e.g., filesize, or disk quotas). Nevertheless, it is often used as a less-severe method of controlling disk space consumption: since users do not generate core files themselves, and often do not delete them, setting this may save them from running out of disk space should a large program (e.g., emacs) crash. cputime cputime limiting users cputime This is the maximum amount of CPU time a user's process may consume. Offending processes will be killed by the kernel. This is a limit on CPU time consumed, not percentage of the CPU as displayed in some fields by &man.top.1; and &man.ps.1;. A limit on the latter is, at the time of this writing, not possible, and would be rather useless: a compiler—probably a legitimate task—can easily use almost 100% of a CPU for some time. filesize filesize limiting users filesize This is the maximum size of a file the user may possess. Unlike disk quotas, this limit is enforced on individual files, not the set of all files a user owns. maxproc maxproc limiting users maxproc This is the maximum number of processes a user may be running. This includes foreground and background processes alike. For obvious reasons, this may not be larger than the system limit specified by the kern.maxproc &man.sysctl.8;. Also note that setting this too small may hinder a user's productivity: it is often useful to be logged in multiple times or execute pipelines. Some tasks, such as compiling a large program, also spawn multiple processes (e.g., &man.make.1;, &man.cc.1;, and other intermediate preprocessors). memorylocked memorylocked limiting users memorylocked This is the maximum amount a memory a process may have requested to be locked into main memory (e.g., see &man.mlock.2;). Some system-critical programs, such as &man.amd.8;, lock into main memory such that in the event of being swapped out, they do not contribute to a system's trashing in time of trouble. memoryuse memoryuse limiting users memoryuse This is the maximum amount of memory a process may consume at any given time. It includes both core memory and swap usage. This is not a catch-all limit for restricting memory consumption, but it is a good start. openfiles openfiles limiting users openfiles This is the maximum amount of files a process may have open. In FreeBSD, files are also used to represent sockets and IPC channels; thus, be careful not to set this too low. The system-wide limit for this is defined by the kern.maxfiles &man.sysctl.8;. sbsize sbsize limiting users sbsize This is the limit on the amount of network memory, and thus mbufs, a user may consume. This originated as a response to an old DoS attack by creating a lot of sockets, but can be generally used to limit network communications. stacksize stacksize limiting users stacksize This is the maximum size a process' stack may grow to. This alone is not sufficient to limit the amount of memory a program may use; consequently, it should be used in conjunction with other limits. There are a few other things to remember when setting resource limits. Following are some general tips, suggestions, and miscellaneous comments. Processes started at system startup by /etc/rc are assigned to the daemon login class. Although the /etc/login.conf that comes with the system is a good source of reasonable values for most limits, only you, the administrator, can know what is appropriate for your system. Setting a limit too high may open your system up to abuse, while setting it too low may put a strain on productivity. Users of the X Window System (X11) should probably be granted more resources than other users. X11 by itself takes a lot of resources, but it also encourages users to run more programs simultaneously. Remember that many limits apply to individual processes, not the user as a whole. For example, setting openfiles to 50 means that each process the user runs may open up to 50 files. Thus, the gross amount of files a user may open is the value of openfiles multiplied by the value of maxproc. This also applies to memory consumption. For further information on resource limits and login classes and capabilities in general, please consult the relevant manual pages: &man.cap.mkdb.1;, &man.getrlimit.2;, &man.login.conf.5;. Groups groups /etc/groups accounts groups A group is simply a list of users. Groups are identified by their group name and GID (Group ID). In FreeBSD (and most other &unix; like systems), the two factors the kernel uses to decide whether a process is allowed to do something is its user ID and list of groups it belongs to. Unlike a user ID, a process has a list of groups associated with it. You may hear some things refer to the group ID of a user or process; most of the time, this just means the first group in the list. The group name to group ID map is in /etc/group. This is a plain text file with four colon-delimited fields. The first field is the group name, the second is the encrypted password, the third the group ID, and the fourth the comma-delimited list of members. It can safely be edited by hand (assuming, of course, that you do not make any syntax errors!). For a more complete description of the syntax, see the &man.group.5; manual page. If you do not want to edit /etc/group manually, you can use the &man.pw.8; command to add and edit groups. For example, to add a group called teamtwo and then confirm that it exists you can use: Adding a Group Using &man.pw.8; &prompt.root; pw groupadd teamtwo &prompt.root; pw groupshow teamtwo teamtwo:*:1100: The number 1100 above is the group ID of the group teamtwo. Right now, teamtwo has no members, and is thus rather useless. Let's change that by inviting jru to the teamtwo group. Adding Somebody to a Group Using &man.pw.8; &prompt.root; pw groupmod teamtwo -M jru &prompt.root; pw groupshow teamtwo teamtwo:*:1100:jru The argument to the option is a comma-delimited list of users who are members of the group. From the preceding sections, we know that the password file also contains a group for each user. The latter (the user) is automatically added to the group list by the system; the user will not show up as a member when using the command to &man.pw.8;, but will show up when the information is queried via &man.id.1; or similar tool. In other words, &man.pw.8; only manipulates the /etc/group file; it will never attempt to read additionally data from /etc/passwd. Using &man.id.1; to Determine Group Membership &prompt.user; id jru uid=1001(jru) gid=1001(jru) groups=1001(jru), 1100(teamtwo) As you can see, jru is a member of the groups jru and teamtwo. For more information about &man.pw.8;, see its manual page, and for more information on the format of /etc/group, consult the &man.group.5; manual page. diff --git a/zh_TW.Big5/books/handbook/x11/chapter.sgml b/zh_TW.Big5/books/handbook/x11/chapter.sgml index c21eda03d2..532dd51106 100644 --- a/zh_TW.Big5/books/handbook/x11/chapter.sgml +++ b/zh_TW.Big5/books/handbook/x11/chapter.sgml @@ -1,1822 +1,1822 @@ Ken Tom Updated for X.Org's X11 server by Marc Fonvieille - The X Window System + X Window µøµ¡¨t²Î - Synopsis + ·§­z FreeBSD uses X11 to provide users with a powerful graphical user interface. X11 is an open-source implementation of the X Window System that includes both &xorg; and &xfree86;. &os; versions up to and including &os; 4.11-RELEASE and &os; 5.2.1-RELEASE will find the default installation to be &xfree86;, the X11 server released by The &xfree86; Project, Inc. As of &os; 5.3-RELEASE, the default and official flavor of X11 was changed to &xorg;, the X11 server developed by the X.Org Foundation. This chapter will cover the installation and configuration of X11 with emphasis on &xorg;. For more information on the video hardware that X11 supports, check either the &xorg; or &xfree86; web sites. - After reading this chapter, you will know: + Ū§¹³o³¹¡A±z±N¤F¸Ñ¡G The various components of the X Window System, and how they interoperate. How to install and configure X11. How to install and use different window managers. How to use &truetype; fonts in X11. How to set up your system for graphical logins (XDM). - Before reading this chapter, you should: + ¦b¶}©l¾\Ū³o³¹¤§«e¡A±z»Ý­n¡J Know how to install additional third-party software (). This chapter covers the installation and the configuration of both &xorg; and &xfree86; X11 servers. For the most part, configuration files, commands and syntaxes are identical. In the case where there are differences, both &xorg; and &xfree86; syntaxes will be shown. Understanding X Using X for the first time can be somewhat of a shock to someone familiar with other graphical environments, such as µsoft.windows; or &macos;. While it is not necessary to understand all of the details of various X components and how they interact, some basic knowledge makes it possible to take advantage of X's strengths. Why X? X is not the first window system written for &unix;, but it is the most popular of them. X's original development team had worked on another window system prior to writing X. That system's name was W (for Window). X was just the next letter in the Roman alphabet. X can be called X, X Window System, X11, and a number of other terms. You may find that using the term X Windows to describe X11 can be offensive to some people; for a bit more insight on this, see &man.X.7;. The X Client/Server Model X was designed from the beginning to be network-centric, and adopts a client-server model. In the X model, the X server runs on the computer that has the keyboard, monitor, and mouse attached. The server's responsibility includes tasks such as managing the display, handling input from the keyboard and mouse, and so on. Each X application (such as XTerm, or &netscape;) is a client. A client sends messages to the server such as Please draw a window at these coordinates, and the server sends back messages such as The user just clicked on the OK button. In a home or small office environment, the X server and the X clients commonly run on the same computer. However, it is perfectly possible to run the X server on a less powerful desktop computer, and run X applications (the clients) on, say, the powerful and expensive machine that serves the office. In this scenario the communication between the X client and server takes place over the network. This confuses some people, because the X terminology is exactly backward to what they expect. They expect the X server to be the big powerful machine down the hall, and the X client to be the machine on their desk. It is important to remember that the X server is the machine with the monitor and keyboard, and the X clients are the programs that display the windows. There is nothing in the protocol that forces the client and server machines to be running the same operating system, or even to be running on the same type of computer. It is certainly possible to run an X server on µsoft.windows; or Apple's &macos;, and there are various free and commercial applications available that do exactly that. Starting with &os; 5.3-RELEASE, the X server that installs with &os; is &xorg;, and is available for free, under a license very similar to the FreeBSD license. Commercial X servers for FreeBSD are also available. The Window Manager The X design philosophy is much like the &unix; design philosophy, tools, not policy. This means that X does not try to dictate how a task is to be accomplished. Instead, tools are provided to the user, and it is the user's responsibility to decide how to use those tools. This philosophy extends to X not dictating what windows should look like on screen, how to move them around with the mouse, what keystrokes should be used to move between windows (i.e., Alt Tab , in the case of µsoft.windows;), what the title bars on each window should look like, whether or not they have close buttons on them, and so on. Instead, X delegates this responsibility to an application called a Window Manager. There are dozens of window managers available for X: AfterStep, Blackbox, ctwm, Enlightenment, fvwm, Sawfish, twm, Window Maker, and more. Each of these window managers provides a different look and feel; some of them support virtual desktops; some of them allow customized keystrokes to manage the desktop; some have a Start button or similar device; some are themeable, allowing a complete change of look-and-feel by applying a new theme. These window managers, and many more, are available in the x11-wm category of the Ports Collection. In addition, the KDE and GNOME desktop environments both have their own window managers which integrate with the desktop. Each window manager also has a different configuration mechanism; some expect configuration file written by hand, others feature GUI tools for most of the configuration tasks; at least one (Sawfish) has a configuration file written in a dialect of the Lisp language. Focus Policy Another feature the window manager is responsible for is the mouse focus policy. Every windowing system needs some means of choosing a window to be actively receiving keystrokes, and should visibly indicate which window is active as well. A familiar focus policy is called click-to-focus. This is the model utilized by µsoft.windows;, in which a window becomes active upon receiving a mouse click. X does not support any particular focus policy. Instead, the window manager controls which window has the focus at any one time. Different window managers will support different focus methods. All of them support click to focus, and the majority of them support several others. The most popular focus policies are: focus-follows-mouse The window that is under the mouse pointer is the window that has the focus. This may not necessarily be the window that is on top of all the other windows. The focus is changed by pointing at another window, there is no need to click in it as well. sloppy-focus This policy is a small extension to focus-follows-mouse. With focus-follows-mouse, if the mouse is moved over the root window (or background) then no window has the focus, and keystrokes are simply lost. With sloppy-focus, focus is only changed when the cursor enters a new window, and not when exiting the current window. click-to-focus The active window is selected by mouse click. The window may then be raised, and appear in front of all other windows. All keystrokes will now be directed to this window, even if the cursor is moved to another window. Many window managers support other policies, as well as variations on these. Be sure to consult the documentation for the window manager itself. Widgets The X approach of providing tools and not policy extends to the widgets seen on screen in each application. Widget is a term for all the items in the user interface that can be clicked or manipulated in some way; buttons, check boxes, radio buttons, icons, lists, and so on. µsoft.windows; calls these controls. µsoft.windows; and Apple's &macos; both have a very rigid widget policy. Application developers are supposed to ensure that their applications share a common look and feel. With X, it was not considered sensible to mandate a particular graphical style, or set of widgets to adhere to. As a result, do not expect X applications to have a common look and feel. There are several popular widget sets and variations, including the original Athena widget set from MIT, &motif; (on which the widget set in µsoft.windows; was modeled, all bevelled edges and three shades of grey), OpenLook, and others. Most newer X applications today will use a modern-looking widget set, either Qt, used by KDE, or GTK+, used by the GNOME project. In this respect, there is some convergence in look-and-feel of the &unix; desktop, which certainly makes things easier for the novice user. - Installing X11 + ¦w¸Ë X11 &xorg; or &xfree86; may be installed on &os;. Beginning with &os; 5.3-RELEASE, &xorg; is the default X11 implementation for &os;. &xorg; is the X server of the open source X Window System implementation released by the X.Org Foundation. &xorg; is based on the code of &xfree86 4.4RC2 and X11R6.6. The X.Org Foundation released X11R6.7 in April 2004 and X11R6.8.2 in February 2005, this latter is the version currently available in the &os; Ports Collection. To build and install &xorg; from the Ports Collection: &prompt.root; cd /usr/ports/x11/xorg &prompt.root; make install clean To build &xorg; in its entirety, be sure to have at least 4 GB of free space available. To build and install &xfree86; from the Ports Collection: &prompt.root; cd /usr/ports/x11/XFree86-4 &prompt.root; make install clean Alternatively, X11 can be installed directly from packages. Binary packages to use with &man.pkg.add.1; tool are also available for X11. When the remote fetching feature of &man.pkg.add.1; is used, the version number of the package must be removed. &man.pkg.add.1; will automatically fetch the latest version of the application. So to fetch and install the package of &xorg;, simply type: &prompt.root; pkg_add -r xorg The &xfree86; 4.X package can be installed by typing: &prompt.root; pkg_add -r XFree86 The examples above will install the complete X11 distribution including the servers, clients, fonts etc. Separate packages and ports of X11 are also available. The rest of this chapter will explain how to configure X11, and how to set up a productive desktop environment. Moving from <application>&xfree86;</application> to <application>&xorg;</application> As with any port, you should check the /usr/ports/UPDATING file for changes. Included in this file are instructions for converting your system from &xfree86; to &xorg;. Use CVSup to update your ports tree prior to attempting any conversion. You will also need to install sysutils/portupgrade prior to converting your X11 installation. In your /etc/make.conf you will need to add the variable X_WINDOW_SYSTEM=xorg. This ensures that your system knows which X11 is being used. The older XFREE86_VERSION variable has been deprecated and has been replaced with the X_WINDOW_SYSTEM variable. Then, use the following commands: &prompt.root; pkg_delete -f /var/db/pkg/imake-4* /var/db/pkg/XFree86-* &prompt.root; cd /usr/ports/x11/xorg &prompt.root; make install clean &prompt.root; pkgdb -F The &man.pkgdb.1; command is part of the portupgrade software and will update various package dependencies. To build &xorg; in its entirety, be sure to have at least 4 GB of free space available. Christopher Shumway Contributed by - X11 Configuration + ³]©w X11 &xfree86; 4.X &xfree86; &xorg; X11 Before Starting Before configuration of X11 the following information about the target system is needed: Monitor specifications Video Adapter chipset Video Adapter memory horizontal scan rate vertical scan rate The specifications for the monitor are used by X11 to determine the resolution and refresh rate to run at. These specifications can usually be obtained from the documentation that came with the monitor or from the manufacturer's website. There are two ranges of numbers that are needed, the horizontal scan rate and the vertical synchronization rate. The video adapter's chipset defines what driver module X11 uses to talk to the graphics hardware. With most chipsets, this can be automatically determined, but it is still useful to know in case the automatic detection does not work correctly. Video memory on the graphic adapter determines the resolution and color depth which the system can run at. This is important to know so the user knows the limitations of the system. Configuring X11 Configuration of X11 is a multi-step process. The first step is to build an initial configuration file. As the super user, simply run: &prompt.root; Xorg -configure In the case of &xfree86; type: &prompt.root; XFree86 -configure This will generate an X11 configuration skeleton file in the /root directory called xorg.conf.new (whether you &man.su.1; or do a direct login affects the inherited supervisor $HOME directory variable). For &xfree86;, this configuration file is called XF86Config.new. The X11 program will attempt to probe the graphics hardware on the system and write a configuration file to load the proper drivers for the detected hardware on the target system. The next step is to test the existing configuration to verify that &xorg; can work with the graphics hardware on the target system. To perform this task, type: &prompt.root; Xorg -config xorg.conf.new &xfree86; users will type: &prompt.root; XFree86 -xf86config XF86Config.new If a black and grey grid and an X mouse cursor appear, the configuration was successful. To exit the test, just press Ctrl Alt Backspace simultaneously. If the mouse does not work, you will need to first configure it before proceeding. See in the &os; install chapter. X11 tuning Next, tune the xorg.conf.new (or XF86Config.new if you are running &xfree86;) configuration file to taste. Open the file in a text editor such as &man.emacs.1; or &man.ee.1;. First, add the frequencies for the target system's monitor. These are usually expressed as a horizontal and vertical synchronization rate. These values are added to the xorg.conf.new file under the "Monitor" section: Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor" ModelName "Monitor Model" HorizSync 30-107 VertRefresh 48-120 EndSection The HorizSync and VertRefresh keywords may be missing in the configuration file. If they are, they need to be added, with the correct horizontal synchronization rate placed after the HorizSync keyword and the vertical synchronization rate after the VertRefresh keyword. In the example above the target monitor's rates were entered. X allows DPMS (Energy Star) features to be used with capable monitors. The &man.xset.1; program controls the time-outs and can force standby, suspend, or off modes. If you wish to enable DPMS features for your monitor, you must add the following line to the monitor section: Option "DPMS" xorg.conf XF86Config While the xorg.conf.new (or XF86Config.new) configuration file is still open in an editor, select the default resolution and color depth desired. This is defined in the "Screen" section: Section "Screen" Identifier "Screen0" Device "Card0" Monitor "Monitor0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 Modes "1024x768" EndSubSection EndSection The DefaultDepth keyword describes the color depth to run at by default. This can be overridden with the command line switch to &man.Xorg.1; (or &man.XFree86.1;). The Modes keyword describes the resolution to run at for the given color depth. Note that only VESA standard modes are supported as defined by the target system's graphics hardware. In the example above, the default color depth is twenty-four bits per pixel. At this color depth, the accepted resolution is 1024 by 768 pixels. Finally, write the configuration file and test it using the test mode given above. One of the tools available to assist you during troubleshooting process are the X11 log files, which contain information on each device that the X11 server attaches to. &xorg; log file names are in the format of /var/log/Xorg.0.log (&xfree86; log file names follow the format of XFree86.0.log). The exact name of the log can vary from Xorg.0.log to Xorg.8.log and so forth. If all is well, the configuration file needs to be installed in a common location where &man.Xorg.1; (or &man.XFree86.1;) can find it. This is typically /etc/X11/xorg.conf or /usr/X11R6/etc/X11/xorg.conf (for &xfree86; it is called /etc/X11/XF86Config or /usr/X11R6/etc/X11/XF86Config). &prompt.root; cp xorg.conf.new /etc/X11/xorg.conf For &xfree86;: &prompt.root; cp XF86Config.new /etc/X11/XF86Config The X11 configuration process is now complete. In order to start &xfree86; 4.X with &man.startx.1;, install the x11/wrapper port. &xorg; already includes the wrapper code and does not require the installation of the wrapper port. The X11 server may also be started with the use of &man.xdm.1;. There is also a graphical configuration tool, &man.xorgcfg.1; (&man.xf86cfg.1; for &xfree86;), that comes with the X11 distribution. It allows you to interactively define your configuration by choosing the appropriate drivers and settings. This program can be invoked from the console, by typing the command xorgcfg -textmode. For more details, refer to the &man.xorgcfg.1; and &man.xf86cfg.1; manual pages. Alternatively, there is also a tool called &man.xorgconfig.1; (&man.xf86config.1; for &xfree86;), this program is a console utility that is less user friendly, but it may work in situations where the other tools do not. Advanced Configuration Topics Configuration with &intel; i810 Graphics Chipsets Intel i810 graphic chipset Configuration with &intel; i810 integrated chipsets requires the agpgart AGP programming interface for X11 to drive the card. The &man.agp.4; driver is in the GENERIC kernel since releases 4.8-RELEASE and 5.0-RELEASE. On prior releases, you will have to add the following line: device agp in your kernel configuration file and rebuild a new kernel. Instead, you may want to load the agp.ko kernel module automatically with the &man.loader.8; at boot time. For that, simply add this line to /boot/loader.conf: agp_load="YES" Next, if you are running FreeBSD 4.X or earlier, a device node needs to be created for the programming interface. To create the AGP device node, run &man.MAKEDEV.8; in the /dev directory: &prompt.root; cd /dev &prompt.root; sh MAKEDEV agpgart FreeBSD 5.X or later will use &man.devfs.5; to allocate device nodes transparently, therefore the &man.MAKEDEV.8; step is not required. This will allow configuration of the hardware as any other graphics board. Note on systems without the &man.agp.4; driver compiled in the kernel, trying to load the module with &man.kldload.8; will not work. This driver has to be in the kernel at boot time through being compiled in or using /boot/loader.conf. If you are using &xfree86; 4.1.0 (or later) and messages about unresolved symbols like fbPictureInit appear, try adding the following line after Driver "i810" in the X11 configuration file: Option "NoDDC" Murray Stokely Contributed by - Using Fonts in X11 + ¦b X11 ¤¤¨Ï¥Î¦r«¬ - Type1 Fonts + Type1 ³W®æªº¦r«¬ The default fonts that ship with X11 are less than ideal for typical desktop publishing applications. Large presentation fonts show up jagged and unprofessional looking, and small fonts in &netscape; are almost completely unintelligible. However, there are several free, high quality Type1 (&postscript;) fonts available which can be readily used with X11. For instance, the URW font collection (x11-fonts/urwfonts) includes high quality versions of standard type1 fonts (Times Roman, Helvetica, Palatino and others). The Freefonts collection (x11-fonts/freefonts) includes many more fonts, but most of them are intended for use in graphics software such as the Gimp, and are not complete enough to serve as screen fonts. In addition, X11 can be configured to use &truetype; fonts with a minimum of effort. For more details on this, see the &man.X.7; manual page or the section on &truetype; fonts. To install the above Type1 font collections from the ports collection, run the following commands: &prompt.root; cd /usr/ports/x11-fonts/urwfonts &prompt.root; make install clean And likewise with the freefont or other collections. To have the X server detect these fonts, add an appropriate line to the X server configuration file in /etc/X11/ (xorg.conf for &xorg; and XF86Config for &xfree86;), which reads: FontPath "/usr/X11R6/lib/X11/fonts/URW/" Alternatively, at the command line in the X session run: &prompt.user; xset fp+ /usr/X11R6/lib/X11/fonts/URW &prompt.user; xset fp rehash This will work but will be lost when the X session is closed, unless it is added to the startup file (~/.xinitrc for a normal startx session, or ~/.xsession when logging in through a graphical login manager like XDM). A third way is to use the new /usr/X11R6/etc/fonts/local.conf file: see the section on anti-aliasing. - &truetype; Fonts + &truetype; ³W®æªº¦r«¬ TrueType Fonts fonts TrueType Both &xfree86; 4.X and &xorg; have built in support for rendering &truetype; fonts. There are two different modules that can enable this functionality. The freetype module is used in this example because it is more consistent with the other font rendering back-ends. To enable the freetype module just add the following line to the "Module" section of the /etc/X11/xorg.conf or /etc/X11/XF86Config file. Load "freetype" For &xfree86; 3.3.X, a separate &truetype; font server is needed. Xfstt is commonly used for this purpose. To install Xfstt, simply install the port x11-servers/Xfstt. Now make a directory for the &truetype; fonts (for example, /usr/X11R6/lib/X11/fonts/TrueType) and copy all of the &truetype; fonts into this directory. Keep in mind that &truetype; fonts cannot be directly taken from a &macintosh;; they must be in &unix;/&ms-dos;/&windows; format for use by X11. Once the files have been copied into this directory, use ttmkfdir to create a fonts.dir file, so that the X font renderer knows that these new files have been installed. ttmkfdir is available from the FreeBSD Ports Collection as x11-fonts/ttmkfdir. &prompt.root; cd /usr/X11R6/lib/X11/fonts/TrueType &prompt.root; ttmkfdir > fonts.dir Now add the &truetype; directory to the font path. This is just the same as described above for Type1 fonts, that is, use &prompt.user; xset fp+ /usr/X11R6/lib/X11/fonts/TrueType &prompt.user; xset fp rehash or add a FontPath line to the xorg.conf (or XF86Config) file. That's it. Now &netscape;, Gimp, &staroffice;, and all of the other X applications should now recognize the installed &truetype; fonts. Extremely small fonts (as with text in a high resolution display on a web page) and extremely large fonts (within &staroffice;) will look much better now. Joe Marcus Clarke Updated by - Anti-Aliased Fonts + Anti-Aliased ³W®æªº¦r«¬ anti-aliased fonts fonts anti-aliased Anti-aliasing has been available in X11 since &xfree86; 4.0.2. However, font configuration was cumbersome before the introduction of &xfree86; 4.3.0. Beginning with &xfree86; 4.3.0, all fonts in X11 that are found in /usr/X11R6/lib/X11/fonts/ and ~/.fonts/ are automatically made available for anti-aliasing to Xft-aware applications. Not all applications are Xft-aware, but many have received Xft support. Examples of Xft-aware applications include Qt 2.3 and higher (the toolkit for the KDE desktop), GTK+ 2.0 and higher (the toolkit for the GNOME desktop), and Mozilla 1.2 and higher. In order to control which fonts are anti-aliased, or to configure anti-aliasing properties, create (or edit, if it already exists) the file /usr/X11R6/etc/fonts/local.conf. Several advanced features of the Xft font system can be tuned using this file; this section describes only some simple possibilities. For more details, please see &man.fonts-conf.5;. XML This file must be in XML format. Pay careful attention to case, and make sure all tags are properly closed. The file begins with the usual XML header followed by a DOCTYPE definition, and then the <fontconfig> tag: <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> As previously stated, all fonts in /usr/X11R6/lib/X11/fonts/ as well as ~/.fonts/ are already made available to Xft-aware applications. If you wish to add another directory outside of these two directory trees, add a line similar to the following to /usr/X11R6/etc/fonts/local.conf: <dir>/path/to/my/fonts</dir> After adding new fonts, and especially new font directories, you should run the following command to rebuild the font caches: &prompt.root; fc-cache -f Anti-aliasing makes borders slightly fuzzy, which makes very small text more readable and removes staircases from large text, but can cause eyestrain if applied to normal text. To exclude font sizes smaller than 14 point from anti-aliasing, include these lines: <match target="font"> <test name="size" compare="less"> <double>14</double> </test> <edit name="antialias" mode="assign"> <bool>false</bool> </edit> </match> <match target="font"> <test name="pixelsize" compare="less" qual="any"> <double>14</double> </test> <edit mode="assign" name="antialias"> <bool>false</bool> </edit> </match> fonts spacing Spacing for some monospaced fonts may also be inappropriate with anti-aliasing. This seems to be an issue with KDE, in particular. One possible fix for this is to force the spacing for such fonts to be 100. Add the following lines: <match target="pattern" name="family"> <test qual="any" name="family"> <string>fixed</string> </test> <edit name="family" mode="assign"> <string>mono</string> </edit> </match> <match target="pattern" name="family"> <test qual="any" name="family"> <string>console</string> </test> <edit name="family" mode="assign"> <string>mono</string> </edit> </match> (this aliases the other common names for fixed fonts as "mono"), and then add: <match target="pattern" name="family"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="spacing" mode="assign"> <int>100</int> </edit> </match> Certain fonts, such as Helvetica, may have a problem when anti-aliased. Usually this manifests itself as a font that seems cut in half vertically. At worst, it may cause applications such as Mozilla to crash. To avoid this, consider adding the following to local.conf: <match target="pattern" name="family"> <test qual="any" name="family"> <string>Helvetica</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match> Once you have finished editing local.conf make sure you end the file with the </fontconfig> tag. Not doing this will cause your changes to be ignored. The default font set that comes with X11 is not very desirable when it comes to anti-aliasing. A much better set of default fonts can be found in the x11-fonts/bitstream-vera port. This port will install a /usr/X11R6/etc/fonts/local.conf file if one does not exist already. If the file does exist, the port will create a /usr/X11R6/etc/fonts/local.conf-vera file. Merge the contents of this file into /usr/X11R6/etc/fonts/local.conf, and the Bitstream fonts will automatically replace the default X11 Serif, Sans Serif, and Monospaced fonts. Finally, users can add their own settings via their personal .fonts.conf files. To do this, each user should simply create a ~/.fonts.conf. This file must also be in XML format. LCD screen Fonts LCD screen One last point: with an LCD screen, sub-pixel sampling may be desired. This basically treats the (horizontally separated) red, green and blue components separately to improve the horizontal resolution; the results can be dramatic. To enable this, add the line somewhere in the local.conf file: <match target="font"> <test qual="all" name="rgba"> <const>unknown</const> </test> <edit name="rgba" mode="assign"> <const>rgb</const> </edit> </match> Depending on the sort of display, rgb may need to be changed to bgr, vrgb or vbgr: experiment and see which works best. Mozilla disabling anti-aliased fonts Anti-aliasing should be enabled the next time the X server is started. However, programs must know how to take advantage of it. At present, the Qt toolkit does, so the entire KDE environment can use anti-aliased fonts (see on KDE for details). GTK+ and GNOME can also be made to use anti-aliasing via the Font capplet (see for details). By default, Mozilla 1.2 and greater will automatically use anti-aliasing. To disable this, rebuild Mozilla with the -DWITHOUT_XFT flag. Seth Kingsley Contributed by The X Display Manager Overview X Display Manager The X Display Manager (XDM) is an optional part of the X Window System that is used for login session management. This is useful for several types of situations, including minimal X Terminals, desktops, and large network display servers. Since the X Window System is network and protocol independent, there are a wide variety of possible configurations for running X clients and servers on different machines connected by a network. XDM provides a graphical interface for choosing which display server to connect to, and entering authorization information such as a login and password combination. Think of XDM as providing the same functionality to the user as the &man.getty.8; utility (see for details). That is, it performs system logins to the display being connected to and then runs a session manager on behalf of the user (usually an X window manager). XDM then waits for this program to exit, signaling that the user is done and should be logged out of the display. At this point, XDM can display the login and display chooser screens for the next user to login. Using XDM The XDM daemon program is located in /usr/X11R6/bin/xdm. This program can be run at any time as root and it will start managing the X display on the local machine. If XDM is to be run every time the machine boots up, a convenient way to do this is by adding an entry to /etc/ttys. For more information about the format and usage of this file, see . There is a line in the default /etc/ttys file for running the XDM daemon on a virtual terminal: ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure By default this entry is disabled; in order to enable it change field 5 from off to on and restart &man.init.8; using the directions in . The first field, the name of the terminal this program will manage, is ttyv8. This means that XDM will start running on the 9th virtual terminal. Configuring XDM The XDM configuration directory is located in /usr/X11R6/lib/X11/xdm. In this directory there are several files used to change the behavior and appearance of XDM. Typically these files will be found: File Description Xaccess Client authorization ruleset. Xresources Default X resource values. Xservers List of remote and local displays to manage. Xsession Default session script for logins. Xsetup_* Script to launch applications before the login interface. xdm-config Global configuration for all displays running on this machine. xdm-errors Errors generated by the server program. xdm-pid The process ID of the currently running XDM. Also in this directory are a few scripts and programs used to set up the desktop when XDM is running. The purpose of each of these files will be briefly described. The exact syntax and usage of all of these files is described in &man.xdm.1;. The default configuration is a simple rectangular login window with the hostname of the machine displayed at the top in a large font and Login: and Password: prompts below. This is a good starting point for changing the look and feel of XDM screens. Xaccess The protocol for connecting to XDM controlled displays is called the X Display Manager Connection Protocol (XDMCP). This file is a ruleset for controlling XDMCP connections from remote machines. It's ignored unless the xdm-config is changed to listen for remote connections. By default, it does not allow any clients to connect. Xresources This is an application-defaults file for the display chooser and the login screens. This is where the appearance of the login program can be modified. The format is identical to the app-defaults file described in the X11 documentation. Xservers This is a list of the remote displays the chooser should provide as choices. Xsession This is the default session script for XDM to run after a user has logged in. Normally each user will have a customized session script in ~/.xsession that overrides this script. Xsetup_* These will be run automatically before displaying the chooser or login interfaces. There is a script for each display being used, named Xsetup_ followed by the local display number (for instance Xsetup_0). Typically these scripts will run one or two programs in the background such as xconsole. xdm-config This contains settings in the form of app-defaults that are applicable to every display that this installation manages. xdm-errors This contains the output of the X servers that XDM is trying to run. If a display that XDM is trying to start hangs for some reason, this is a good place to look for error messages. These messages are also written to the user's ~/.xsession-errors file on a per-session basis. Running a Network Display Server In order for other clients to connect to the display server, edit the access control rules, and enable the connection listener. By default these are set to conservative values. To make XDM listen for connections, first comment out a line in the xdm-config file: ! SECURITY: do not listen for XDMCP or Chooser requests ! Comment out this line if you want to manage X terminals with xdm DisplayManager.requestPort: 0 and then restart XDM. Remember that comments in app-defaults files begin with a ! character, not the usual #. More strict access controls may be desired. Look at the example entries in Xaccess, and refer to the &man.xdm.1; manual page. Replacements for XDM Several replacements for the default XDM program exist. One of them, kdm (bundled with KDE) is described later in this chapter. The kdm display manager offers many visual improvements and cosmetic frills, as well as the functionality to allow users to choose their window manager of choice at login time. Valentino Vaschetto Contributed by Desktop Environments This section describes the different desktop environments available for X on FreeBSD. A desktop environment can mean anything ranging from a simple window manager to a complete suite of desktop applications, such as KDE or GNOME. GNOME About GNOME GNOME GNOME is a user-friendly desktop environment that enables users to easily use and configure their computers. GNOME includes a panel (for starting applications and displaying status), a desktop (where data and applications can be placed), a set of standard desktop tools and applications, and a set of conventions that make it easy for applications to cooperate and be consistent with each other. Users of other operating systems or environments should feel right at home using the powerful graphics-driven environment that GNOME provides. More information regarding GNOME on FreeBSD can be found on the FreeBSD GNOME Project's web site. The web site also contains fairly comprehensive FAQs about installing, configuring, and managing GNOME. Installing GNOME The easiest way to install GNOME is through the Desktop Configuration menu during the FreeBSD installation process as described in of Chapter 2. It can also be easily installed from a package or the ports collection: To install the GNOME package from the network, simply type: &prompt.root; pkg_add -r gnome2 To build GNOME from source, use the ports tree: &prompt.root; cd /usr/ports/x11/gnome2 &prompt.root; make install clean Once GNOME is installed, the X server must be told to start GNOME instead of a default window manager. The easiest way to start GNOME is with GDM, the GNOME Display Manager. GDM, which is installed as a part of the GNOME desktop (but is disabled by default), can be enabled by adding gdm_enable="YES" to /etc/rc.conf. Once you have rebooted, GNOME will start automatically once you log in — no further configuration is necessary. GNOME may also be started from the command-line by properly configuring a file named .xinitrc. If a custom .xinitrc is already in place, simply replace the line that starts the current window manager with one that starts /usr/X11R6/bin/gnome-session instead. If nothing special has been done to the configuration file, then it is enough simply to type: &prompt.user; echo "/usr/X11R6/bin/gnome-session" > ~/.xinitrc Next, type startx, and the GNOME desktop environment will be started. If an older display manager, like XDM, is being used, this will not work. Instead, create an executable .xsession file with the same command in it. To do this, edit the file and replace the existing window manager command with /usr/X11R6/bin/gnome-session: &prompt.user; echo "#!/bin/sh" > ~/.xsession &prompt.user; echo "/usr/X11R6/bin/gnome-session" >> ~/.xsession &prompt.user; chmod +x ~/.xsession Yet another option is to configure the display manager to allow choosing the window manager at login time; the section on KDE details explains how to do this for kdm, the display manager of KDE. Anti-aliased Fonts with GNOME GNOME anti-aliased fonts X11 supports anti-aliasing via its RENDER extension. GTK+ 2.0 and greater (the toolkit used by GNOME) can make use of this functionality. Configuring anti-aliasing is described in . So, with up-to-date software, anti-aliasing is possible within the GNOME desktop. Just go to Applications Desktop Preferences Font, and select either Best shapes, Best contrast, or Subpixel smoothing (LCDs). For a GTK+ application that is not part of the GNOME desktop, set the environment variable GDK_USE_XFT to 1 before launching the program. KDE KDE About KDE KDE is an easy to use contemporary desktop environment. Some of the things that KDE brings to the user are: A beautiful contemporary desktop A desktop exhibiting complete network transparency An integrated help system allowing for convenient, consistent access to help on the use of the KDE desktop and its applications Consistent look and feel of all KDE applications Standardized menu and toolbars, keybindings, color-schemes, etc. Internationalization: KDE is available in more than 40 languages Centralized consisted dialog driven desktop configuration A great number of useful KDE applications KDE has an office application suite based on KDE's KParts technology consisting of a spread-sheet, a presentation application, an organizer, a news client and more. KDE also comes with a web browser called Konqueror, which represents a solid competitor to other existing web browsers on &unix; systems. More information on KDE can be found on the KDE website. For FreeBSD specific information and resources on KDE, consult the FreeBSD-KDE team's website. Installing KDE Just as with GNOME or any other desktop environment, the easiest way to install KDE is through the Desktop Configuration menu during the FreeBSD installation process as described in of Chapter 2. Once again, the software can be easily installed from a package or from the Ports Collection: To install the KDE package from the network, simply type: &prompt.root; pkg_add -r kde &man.pkg.add.1; will automatically fetch the latest version of the application. To build KDE from source, use the ports tree: &prompt.root; cd /usr/ports/x11/kde3 &prompt.root; make install clean After KDE has been installed, the X server must be told to launch this application instead of the default window manager. This is accomplished by editing the .xinitrc file: &prompt.user; echo "exec startkde" > ~/.xinitrc Now, whenever the X Window System is invoked with startx, KDE will be the desktop. If a display manager such as XDM is being used, the configuration is slightly different. Edit the .xsession file instead. Instructions for kdm are described later in this chapter. More Details on KDE Now that KDE is installed on the system, most things can be discovered through the help pages, or just by pointing and clicking at various menus. &windows; or &mac; users will feel quite at home. The best reference for KDE is the on-line documentation. KDE comes with its own web browser, Konqueror, dozens of useful applications, and extensive documentation. The remainder of this section discusses the technical items that are difficult to learn by random exploration. The KDE Display Manager KDE display manager An administrator of a multi-user system may wish to have a graphical login screen to welcome users. XDM can be used, as described earlier. However, KDE includes an alternative, kdm, which is designed to look more attractive and include more login-time options. In particular, users can easily choose (via a menu) which desktop environment (KDE, GNOME, or something else) to run after logging on. To begin with, run the KDE control panel, kcontrol, as root. It is generally considered unsafe to run the entire X environment as root. Instead, run the window manager as a normal user, open a terminal window (such as xterm or KDE's konsole), become root with su (the user must be in the wheel group in /etc/group for this), and then type kcontrol. Click on the icon on the left marked System, then on Login manager. On the right there are various configurable options, which the KDE manual will explain in greater detail. Click on sessions on the right. Click New type to add various window managers and desktop environments. These are just labels, so they can say KDE and GNOME rather than startkde or gnome-session. Include a label failsafe. Play with the other menus as well, they are mainly cosmetic and self-explanatory. When you are done, click on Apply at the bottom, and quit the control center. To make sure kdm understands what the labels (KDE, GNOME etc) mean, edit the files used by XDM. In KDE 2.2 this has changed: kdm now uses its own configuration files. Please see the KDE 2.2 documentation for details. In a terminal window, as root, edit the file /usr/X11R6/lib/X11/xdm/Xsession. There is a section in the middle like this: case $# in 1) case $1 in failsafe) exec xterm -geometry 80x24-0-0 ;; esac esac A few lines need to be added to this section. Assuming the labels from used were KDE and GNOME, use the following: case $# in 1) case $1 in kde) exec /usr/local/bin/startkde ;; GNOME) exec /usr/X11R6/bin/gnome-session ;; failsafe) exec xterm -geometry 80x24-0-0 ;; esac esac For the KDE login-time desktop background to be honored, the following line needs to be added to /usr/X11R6/lib/X11/xdm/Xsetup_0: /usr/local/bin/krootimage Now, make sure kdm is listed in /etc/ttys to be started at the next bootup. To do this, simply follow the instructions from the previous section on XDM and replace references to the /usr/X11R6/bin/xdm program with /usr/local/bin/kdm. Anti-aliased Fonts KDE anti-aliased fonts X11 supports anti-aliasing via its RENDER extension, and starting with version 2.3, Qt (the toolkit used by KDE) supports this extension. Configuring this is described in on antialiasing X11 fonts. So, with up-to-date software, anti-aliasing is possible on a KDE desktop. Just go to the KDE menu, go to Preferences Look and Feel Fonts, and click on the check box Use Anti-Aliasing for Fonts and Icons. For a Qt application which is not part of KDE, the environment variable QT_XFT needs to be set to true before starting the program. XFce About XFce XFce is a desktop environment based on the GTK+ toolkit used by GNOME, but is much more lightweight and meant for those who want a simple, efficient desktop which is nevertheless easy to use and configure. Visually, it looks very much like CDE, found on commercial &unix; systems. Some of XFce's features are: A simple, easy-to-handle desktop Fully configurable via mouse, with drag and drop, etc Main panel similar to CDE, with menus, applets and applications launchers Integrated window manager, file manager, sound manager, GNOME compliance module, and other things Themeable (since it uses GTK+) Fast, light and efficient: ideal for older/slower machines or machines with memory limitations More information on XFce can be found on the XFce website. Installing XFce A binary package for XFce exists (at the time of writing). To install, simply type: &prompt.root; pkg_add -r xfce4 Alternatively, to build from source, use the ports collection: &prompt.root; cd /usr/ports/x11-wm/xfce4 &prompt.root; make install clean Now, tell the X server to launch XFce the next time X is started. Simply type this: &prompt.user; echo "/usr/X11R6/bin/startxfce4" > ~/.xinitrc The next time X is started, XFce will be the desktop. As before, if a display manager like XDM is being used, create an .xsession, as described in the section on GNOME, but with the /usr/X11R6/bin/startxfce4 command; or, configure the display manager to allow choosing a desktop at login time, as explained in the section on kdm. diff --git a/zh_TW.Big5/books/porters-handbook/book.sgml b/zh_TW.Big5/books/porters-handbook/book.sgml index b9a77a6283..f160957394 100644 --- a/zh_TW.Big5/books/porters-handbook/book.sgml +++ b/zh_TW.Big5/books/porters-handbook/book.sgml @@ -1,9888 +1,9957 @@ %books.ent; ]> FreeBSD Porter's Handbook FreeBSD ¤å¥ó­p¹º April 2000 2000 2001 2002 2003 2004 2005 + 2006 FreeBSD ¤å¥ó­p¹º &bookinfo.trademarks; &bookinfo.legalnotice; ·¤¤l ´X¥G¨C­Ó FreeBSD ·R¥ÎªÌ³£¬O³z¹L FreeBSD Ports Collection ¨Ó¸Ë¦U¦¡À³¥Îµ{¦¡("ports")¡C¦p¦P FreeBSD ªº¨ä¥L³¡¤À¤@¼Ë¡A ³o¨Ç ports ³£¥D­n¨Ó¦Û³\¦h§Ó¤uªº§V¤O¦¨ªG¡A©Ò¥H¦b¾\Ū³o¥÷¤å¥ó®É¡A ½Ð°È¥²·P®¦¦b¤ß¡C ¦b FreeBSD ¤W­±¡A¨C­Ó¤H³£¥i¥H´£¥æ·sªº port¡A ©Î°²¦p¸Ó port ¨Ã¨S¦³¤HºûÅ@ªº¸Ü¡A¥i¥H¦ÛÄ@ºûÅ@ — ³oÂI¨Ã¤£»Ý­n¥ô¦ó commit ªºÅv­­¡A´N¥i¥H¨Ó°µ³o¥ó¨Æ±¡¡C - ¦Û¦æ»s§@ port + ¦Û¦æ¥´³y port ¨º»ò¡A¶}©l¹ï¦Û¦æ»s§@ port ©Î§ó·s²{¦³ port ¦³¤@¨Ç¿³½ì¤F¶Ü¡H¤Ó¦nÅo¡I ¤U­±±N¤¶²Ð¤@¨Ç«Ø¥ß port ®É¸Óª`·Nªº¨Æ¶µ¡C¦pªG¬O·Q¤É¯Å²{¦³ªº port ¡A¨º»ò¤]½Ð°Ñ¾\ »¡©ú¡C ¦]¬°³o¥÷¤å¥ó¥i¯àÁ¿±o¤£¬O¤Q¤À¸Ô²Ó¡A¥i¯à»Ý­n°Ñ¦Ò /usr/ports/Mk/bsd.port.mk ³oÀɬO©Ò¦³ port ªº Makefile Àɳ£·|¥Î¨ìªº¡C´Nºâ§A¤£¬O¨C¤Ñ¤£Â_ hacking Makefiles ¡A¤]³£¥i¥HÂǥѥ¦¨Ó¹ï¾ã­Ó port ¾÷¨î¡BMakefile §óÁA¸Ñ¡A¸Ì­±ªºµùÄÀ¬Û·í¸Ô²Ó¡C ¦¹¥~¡A­Y¦³¨ä¥L¯S©w port ªº°ÝÃD¡A¤]¥i¥H¨ì &a.ports; ¨ÓÀò±oµª®×¡C Only a fraction of the variables (VAR) that can be overridden are mentioned in this document. Most (if not all) are documented at the start of /usr/ports/Mk/bsd.port.mk; the others probably ought to be. Note that this file uses a non-standard tab setting: Emacs and Vim should recognize the setting on loading the file. Both &man.vi.1; and &man.ex.1; can be set to use the correct value by typing :set tabstop=4 once the file has been loaded. ¥´³y Port §Ö³t¤W¤â½g ¥»¸`¥D­n¤¶²Ð¦p¦ó¨Ó§Ö³t¥´³y port¡AµM¦Ó¡A«Ü¦h®É­Ô³o¨Ç¤º®e¨Ã¤£¬O«Ü°÷¥Î¡A «ØÄ³¾\Ū¥»¤å¥ó¤¤§ó²`¶øªº¦a¤è¡C ­º¥ý¨ú±o¸ÓÀ³¥Îµ{¦¡ªº­ì©lµ{¦¡½XÀ£ÁYÀÉ(tarball)¡A¨Ã§â¥¦©ñ¨ì DISTDIR¡A¹w³]¸ô®|À³¸Ó¬O /usr/ports/distfiles¡C ¤U­±ªº¨Ò¤l¡A¬O°²³]¨Ã¤£»Ý­n¦A­×§ï¸ÓÀ³¥Îµ{¦¡ªº­ì©l½X¡A´N¥i¥H¦b FreeBSD ¤W½sͦ¨¥\ªº¡F°²¦pÁٻݭn¥t¥~­×§ï¤~¯à¦¨¥\½sĶªº¸Ü¡A¨º»ò½Ð°Ñ¦Ò¤U¤@³¹ªº»¡©ú¡C ½s¼g <filename>Makefile</filename> ³Ì²³æªº Makefile ¤j·§¬O¹³³o¼Ë¡G # New ports collection makefile for: oneko # Date created: 5 December 1994 # Whom: asami # # $FreeBSD$ # PORTNAME= oneko PORTVERSION= 1.1b CATEGORIES= games MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/ MAINTAINER= asami@FreeBSD.org COMMENT= A cat chasing a mouse all over the screen MAN1= oneko.1 MANCOMPRESSED= yes USE_IMAKE= yes .include <bsd.port.mk> ¶â¡A¤j­P´N¬O³o¼Ë¡A¬Ý¬Ý§A¤w¸g»â²¤¦h¤Ö¤F©O¡H¬Ý¨ì $FreeBSD$ ³o¤@¦æªº¸Ü¡A§O·Q¤Ó¦h¡A¥¦¬O CVS ID tag ¥Î³~¡A·í¸Ó port ¥¿¦¡¶i¤J port tree ®É¡A´N·|¦Û°ÊÂà´«¬°¬ÛÃö¦r¦êÅo¡C ¦³Ãö³oÂIªº²Ó¸`³¡¥÷¡A¥i¥H°Ñ¾\ sample Makefile ³¹¸`¡C ¼¶¼g¸Ó³nÅ骺»¡©úÀÉ - µL½×¬O§_¥´ºâ¦A¥[¤u°µ¦¨ package¡A¦³ 2 ­Ó»¡©úÀɬO¥ô¦ó¹êÅé port (Slave port«h¤£¤@©w)³£¥²¶·­n¨ã³Æªº¡C + µL½×¬O§_¥´ºâ¦A¥[¤u°µ¦¨ package¡A¦³ 2 ­ÓÀɮ׬O¥ô¦ó¹êÅé port (Slave port«h¤£¤@©w)³£¥²¶·­n¨ã³Æªº¡C ³o 2 ­ÓÀɤÀ§O¬O pkg-descr ÀɤΠpkg-plist ÀÉ¡C³o¨â­ÓÀÉ®×ÀɦW«e­±³£¦³ pkg- ¥H¸ò¨ä¥LÀÉ®×°µ°Ï§O¡C <filename>pkg-descr</filename> ³o¬O¦¹ port ªº¸Ô²Ó»¡©úÀÉ¡A½Ð¥Î¤@¬q©Î´X¬q¤å¦r¨Ó»¡©ú¸Ó port ªº§@¥Î¡A¨Ãªþ¤W WWW ºô§}(­Y¦³ªº¸Ü) ½Ðª`·N¡A³oÀɵ´«D¡u¸Ó³nÅ骺»¡©ú¤â¥U¡v©Î¬O¡u¦p¦ó½sĶ¡B¨Ï¥Î¸Ó port ªº»¡©ú¡v¡C ­Y¬O±q¸Ó³nÅ骺 README ©Î manpage ª½±µ½Æ»s¹L¨Óªº¸Ü¡A ½Ðª`·N¡A¦]¬°¥¦­Ì³q±`³£¼g±o¤Ó¸Ô²Ó¡B®æ¦¡¸û¯S§O(¤ñ¦p manpage ·|¦Û°Ê½Õ¾ãªÅ¥Õ)¡A ½Ð¾¨¶qÁ×§K³o¨Ç¤¾ªøÂصü©Î±Ä¥Î¯S®í®æ¦¡¡C­Y¸Ó³nÅ馳©x¤èª©­º­¶ªº¸Ü¡A½Ð¦b¦¹¦C¥X¨Ó¡C ¨C­Óºô§}½Ð¥Î WWW: §@¬°¶}ÀY¡A³o¼Ë¤l¬ÛÃö¤u¨ãµ{¦¡´N·|¦Û°Ê³B²z§¹²¦¡C - ¸Ó port - ªº pkg-descr ¤º®e¡A¤j­P¦p¤U­±¨Ò¤l: + ¸Ó port ªº pkg-descr ¤º®e¡A¤j­P¦p¤U­±¨Ò¤l¡G This is a port of oneko, in which a cat chases a poor mouse all over the screen. : (etc.) WWW: http://www.oneko.org/ <filename>pkg-plist</filename> - This file lists all the files installed by the port. It is - also called the packing list because the package is - generated by packing the files listed here. The pathnames are - relative to the installation prefix (usually - /usr/local or - /usr/X11R6). If you are using the - MANn variables (as - you should be), do not list any manpages here. If the port creates - directories during installation, make sure to add - @dirrm lines to remove them when the package is - deleted. + ³o¬O¸Ó port ©Ò·|¸Ëªº©Ò¦³ÀɮײM³æ¡A¥t¥~¦]¬° package ·|¥Ñ³o²M³æ©Ò²£¥Í¡A¦]¦¹¤]³QºÙ¬°¡ypacking list + (¥´¥]²M³æ)¡z¡C ¥H ${PREFIX} ¬°°ò·ÇÂI¡A¦Ó¥Î¬Û¹ï¸ô®|ªí¥Ü¡C + (${PREFIX} ³q±`¬O /usr/local ©Î + /usr/X11R6) ¦ý¬O¦pªG¸Óµ{¦¡¦³¦w¸Ë man page ªº¸Ü¡A«h­n¥HÃþ¦ü + MANn= ªº¤è¦¡¼g¦b + Makefile ¤º¡A¤£¯à¦C¦b pkg-plist ®@¡C + °£¤F¦C¥XÀÉ®×¥H¥~¡A¤]­n§â¸Ó port ©Ò·|«Ø¥ßªº¥Ø¿ý¤]¦C¶i¥h¡A¤è¦¡¦³¨âºØ¡G¤@ºØ¬O¼g¦b + pkg-plist ¤ºªº¤è¦¡¡A¤ñ¦p¡G + @dirrm ¡C¦Ü©ó¥t¥~¤@ºØ¤è¦¡¡A«h¬O¼g¦b Makefile ¤º¡A¤ñ¦p + ¡GPLIST_FILES= ¤§Ãþªº¤è¦¡¡C - Here is a small example: + ¸Ó port ªº pkg-plist ¤º®e¡A¤j­P¦p¤U­±¨Ò¤l: bin/oneko lib/X11/app-defaults/Oneko lib/X11/oneko/cat1.xpm lib/X11/oneko/cat2.xpm lib/X11/oneko/mouse.xpm @dirrm lib/X11/oneko - Refer to the &man.pkg.create.1; manual page for details on the - packing list. + Ãö©ó packing list ¤è­±¡A¥i¥H°Ñ¾\ &man.pkg.create.1; ·|¦³¸Ô¸Ñ¡C - It is recommended that you keep all the filenames in this - file sorted alphabetically. It will make verifying the changes - when you upgrade the port much easier. + «ØÄ³²M³æ¤ºªºÀɦW¡A¨Ì·Ó¦r¥À¶¶§Ç§@±Æ§Ç¡A¨º»ò¤U¦¸­n¤É¯Å®É¡A·|¤ñ¸û²M·¡¡B¤è«K¨Ó§ó·s³o¥÷²M³æ¡C - Creating a packing list manually can be a very tedious - task. If the port installs a large numbers of files, creating the packing list - automatically might save time. + ¤â°Ê¥Í³o¥÷²M³æ¹ê¦b¤Ó­W¤F¡C¤×¨ä­Y¸Ó port ·|¸Ë¤@¤j°ïÀɮתº¸Ü¡A½Ð¦hµ½¥Î ¦Û°Ê²£¥Í packing list ·|¤ñ¸û¬Ù®É¬Ù¤O­ò¡C - There is only one case when pkg-plist - can be omitted from a port. If the port installs just a handful + ¥u¦³¦b¤@ ºØ±¡ªp¤U¥i¥H¬Ù²¤¤£¥Î¥Í pkg-plist ÀÉ¡C If the port installs just a handful of files, and perhaps directories, the files and directories may be listed in the variables PLIST_FILES and PLIST_DIRS, respectively, within the port's Makefile. For instance, we could get along without pkg-plist in the above oneko port by adding the following lines to the Makefile: PLIST_FILES= bin/oneko \ lib/X11/app-defaults/Oneko \ lib/X11/oneko/cat1.xpm \ lib/X11/oneko/cat2.xpm \ lib/X11/oneko/mouse.xpm PLIST_DIRS= lib/X11/oneko Of course, PLIST_DIRS should be left unset if a port installs no directories of its own. The price for this way of listing port's files and directories is that you cannot use command sequences described in &man.pkg.create.1;. Therefore, it is suitable only for simple ports and makes them even simpler. At the same time, it has the advantage of reducing the number of files in the ports collection. Please consider using this technique before you resort to pkg-plist. Later we will see how pkg-plist and PLIST_FILES can be used to fulfil more sophisticated tasks. - Creating the checksum file + ²£¥Í checksum ¥Î³~ªº distinfo ÀÉ - Just type make makesum. The ports make rules - will automatically generate the file - distinfo. + ¥u­n¥´¡ymake makesum¡z´N¦n¤F¡A±µ¤U¨Ó´N·|¦Û°Ê²£¥Í¬Û¹ïÀ³ªº + distinfo ÀÉ­ù¡C If a file fetched has its checksum changed regularly and you are certain the source is trusted (i.e. it comes from manufacturer CDs or documentation generated daily), you should specify these files in the IGNOREFILES variable. Then the checksum is not calculated for that file when you run make makesum, but set to IGNORE. - Testing the port + ÀËÅç port ¬O§_§¹¾ã¡B¥i¦æ You should make sure that the port rules do exactly what you want them to do, including packaging up the port. These are the important points you need to verify. pkg-plist does not contain anything not installed by your port pkg-plist contains everything that is installed by your port Your port can be installed multiple times using the reinstall target Your port cleans up after itself upon deinstall - Recommended test ordering + «ØÄ³±Ä¦æªº´ú¸Õ¶¶§Ç¡G make install make package make deinstall pkg_add package-name make deinstall make reinstall make package Make sure that there are not any warnings issued in any of the package and deinstall stages. After step 3, check to see if all the new directories are correctly deleted. Also, try using the software after step 4, to ensure that it works correctly when installed from a package. - Checking your port with <command>portlint</command> + ¥H <command>portlint</command> ¨Ó§@ÀËÅç Please use portlint to see if your port conforms to our guidelines. The devel/portlint program is part of the ports collection. In particular, you may want to check if the Makefile is in the right shape and the package is named appropriately. - Submitting the port + ´£¥æ(Submit) port First, make sure you have read the DOs and DON'Ts section. Now that you are happy with your port, the only thing remaining is to put it in the main FreeBSD ports tree and make everybody else happy about it too. We do not need your work directory or the pkgname.tgz package, so delete them now. Next, simply include the output of shar `find port_dir` in a bug report and send it with the &man.send-pr.1; program (see Bug Reports and General Commentary for more information about &man.send-pr.1;). Be sure to classify the bug report as category ports and class change-request (Do not mark the report confidential!). Also add a short description of the program you ported to the Description field of the PR and the shar to the Fix field. You can make our work a lot easier, if you use a good description in the synopsis of the problem report. We prefer something like New port: <category>/<portname> <short description of the port> for new ports and Update port: <category>/<portname> <short description of the update> for port updates. If you stick to this scheme, the chance that someone will take a look at your PR soon is much better. One more time, do not include the original source distfile, the work directory, or the package you built with make package. After you have submitted your port, please be patient. Sometimes it can take a few months before a port is included in FreeBSD, although it might only take a few days. You can view the list of ports waiting to be committed to FreeBSD. Once we have looked at your port, we will get back to you if necessary, and put it in the tree. Your name will also appear in the list of Additional FreeBSD Contributors and other files. Isn't that great?!? :-) Slow Porting Ok, so it was not that simple, and the port required some modifications to get it to work. In this section, we will explain, step by step, how to modify it to get it to work with the ports paradigm. How things work First, this is the sequence of events which occurs when the user first types make in your port's directory. You may find that having bsd.port.mk in another window while you read this really helps to understand it. But do not worry if you do not really understand what bsd.port.mk is doing, not many people do... :-> The fetch target is run. The fetch target is responsible for making sure that the tarball exists locally in DISTDIR. If fetch cannot find the required files in DISTDIR it will look up the URL MASTER_SITES, which is set in the Makefile, as well as our main FTP site at , where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with FETCH, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in DISTDIR for future use and proceed. The extract target is run. It looks for your port's distribution file (typically a gzip'd tarball) in DISTDIR and unpacks it into a temporary subdirectory specified by WRKDIR (defaults to work). The patch target is run. First, any patches defined in PATCHFILES are applied. Second, if any patch files named patch-* are found in PATCHDIR (defaults to the files subdirectory), they are applied at this time in alphabetical order. The configure target is run. This can do any one of many different things. If it exists, scripts/configure is run. If HAS_CONFIGURE or GNU_CONFIGURE is set, WRKSRC/configure is run. If USE_IMAKE is set, XMKMF (default: xmkmf -a) is run. The build target is run. This is responsible for descending into the port's private working directory (WRKSRC) and building it. If USE_GMAKE is set, GNU make will be used, otherwise the system make will be used. The above are the default actions. In addition, you can define targets pre-something or post-something, or put scripts with those names, in the scripts subdirectory, and they will be run before or after the default actions are done. For example, if you have a post-extract target defined in your Makefile, and a file pre-build in the scripts subdirectory, the post-extract target will be called after the regular extraction actions, and the pre-build script will be executed before the default build rules are done. It is recommended that you use Makefile targets if the actions are simple enough, because it will be easier for someone to figure out what kind of non-default action the port requires. The default actions are done by the bsd.port.mk targets do-something. For example, the commands to extract a port are in the target do-extract. If you are not happy with the default target, you can fix it by redefining the do-something target in your Makefile. The main targets (e.g., extract, configure, etc.) do nothing more than make sure all the stages up to that one are completed and call the real targets or scripts, and they are not intended to be changed. If you want to fix the extraction, fix do-extract, but never ever change the way extract operates! Now that you understand what goes on when the user types make, let us go through the recommended steps to create the perfect port. Getting the original sources Get the original sources (normally) as a compressed tarball (foo.tar.gz or foo.tar.Z) and copy it into DISTDIR. Always use mainstream sources when and where you can. You will need to set the variable MASTER_SITES to reflect where the original tarball resides. You will find convenient shorthand definitions for most mainstream sites in bsd.sites.mk. Please use these sites—and the associated definitions—if at all possible, to help avoid the problem of having the same information repeated over again many times in the source base. As these sites tend to change over time, this becomes a maintenance nightmare for everyone involved. If you cannot find a FTP/HTTP site that is well-connected to the net, or can only find sites that have irritatingly non-standard formats, you might want to put a copy on a reliable FTP or HTTP server that you control (e.g., your home page). If you cannot find somewhere convenient and reliable to put the distfile we can house it ourselves on ftp.FreeBSD.org; however, this is the least-preferred solution. The distfile must be placed into ~/public_distfiles/ of someone's freefall account. Ask the person who commits your port to do this. This person will also set MASTER_SITES to MASTER_SITE_LOCAL and MASTER_SITE_SUBDIR to their freefall username. If your port's distfile changes all the time without any kind of version update by the author, consider putting the distfile on your home page and listing it as the first MASTER_SITES. If you can, try to talk the port author out of doing this; it really does help to establish some kind of source code control. Hosting your own version will prevent users from getting checksum mismatch errors, and also reduce the workload of maintainers of our FTP site. Also, if there is only one master site for the port, it is recommended that you house a backup at your site and list it as the second MASTER_SITES. If your port requires some additional `patches' that are available on the Internet, fetch them too and put them in DISTDIR. Do not worry if they come from a site other than where you got the main source tarball, we have a way to handle these situations (see the description of PATCHFILES below). Modifying the port Unpack a copy of the tarball in a private directory and make whatever changes are necessary to get the port to compile properly under the current version of FreeBSD. Keep careful track of everything you do, as you will be automating the process shortly. Everything, including the deletion, addition, or modification of files should be doable using an automated script or patch file when your port is finished. If your port requires significant user interaction/customization to compile or install, you should take a look at one of Larry Wall's classic Configure scripts and perhaps do something similar yourself. The goal of the new ports collection is to make each port as plug-and-play as possible for the end-user while using a minimum of disk space. Unless explicitly stated, patch files, scripts, and other files you have created and contributed to the FreeBSD ports collection are assumed to be covered by the standard BSD copyright conditions. Patching In the preparation of the port, files that have been added or changed can be picked up with a recursive &man.diff.1; for later feeding to &man.patch.1;. Each set of patches you wish to apply should be collected into a file named patch-* where * indicates the pathnames of the files that are patched, such as patch-Imakefile or patch-src-config.h. These files should be stored in PATCHDIR, from where they will be automatically applied. All patches must be relative to WRKSRC (generally the directory your port's tarball unpacks itself into, that being where the build is done). To make fixes and upgrades easier, you should avoid having more than one patch fix the same file (e.g., patch-file and patch-file2 both changing WRKSRC/foobar.c). Please only use characters [-+._a-zA-Z0-9] for naming your patches. Do not use any other characters besides them. Do not name your patches like patch-aa or patch-ab etc, always mention path and file name in patch names. Do not put RCS strings in patches. CVS will mangle them when we put the files into the ports tree, and when we check them out again, they will come out different and the patch will fail. RCS strings are surrounded by dollar ($) signs, and typically start with $Id or $RCS. Using the recurse () option to &man.diff.1; to generate patches is fine, but please take a look at the resulting patches to make sure you do not have any unnecessary junk in there. In particular, diffs between two backup files, Makefiles when the port uses Imake or GNU configure, etc., are unnecessary and should be deleted. If you had to edit configure.in and run autoconf to regenerate configure, do not take the diffs of configure (it often grows to a few thousand - lines!); define USE_AUTOCONF_VER=213 and take the + lines!); define USE_AUTOTOOLS=autoconf:253 and take the diffs of configure.in. Quite often, there is a situation when the software being ported, especially if it is primarily developed on &windows;, uses the CR/LF convention for most of its source files. This may cause problems with further patching, compiler warnings, scripts execution (/bin/sh^M not found), etc. To quickly convert those files from CR/LF to just LF, you can do something like this: USE_REINPLACE= yes post-extract: @${FIND} -E ${WRKDIR} -type f -iregex ".*\.(c|cpp|h|txt)" -print0 | \ ${XARGS} -0 ${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' Of course, if you need to process each and every file, above can be omitted. Be aware that this piece of code will strip all trailing control characters from each line of processed file (except \n). Also, if you had to delete a file, then you can do it in the post-extract target rather than as part of the patch. Once you are happy with the resulting diff, please split it up into one source file per patch file. Configuring Include any additional customization commands in your configure script and save it in the scripts subdirectory. As mentioned above, you can also do this with Makefile targets and/or scripts with the name pre-configure or post-configure. Handling user input If your port requires user input to build, configure, or install, you must set IS_INTERACTIVE in your Makefile. This will allow overnight builds to skip your port if the user sets the variable BATCH in his environment (and if the user sets the variable INTERACTIVE, then only those ports requiring interaction are built). This will save a lot of wasted time on the set of machines that continually build ports (see below). It is also recommended that if there are reasonable default answers to the questions, you check the PACKAGE_BUILDING variable and turn off the interactive script when it is set. This will allow us to build the packages for CDROMs and FTP. Configuring the Makefile Configuring the Makefile is pretty simple, and again we suggest that you look at existing examples before starting. Also, there is a sample Makefile in this handbook, so take a look and please follow the ordering of variables and sections in that template to make your port easier for others to read. Now, consider the following problems in sequence as you design your new Makefile: The original source Does it live in DISTDIR as a standard gzip'd tarball named something like foozolix-1.2.tar.gz? If so, you can go on to the next step. If not, you should look at overriding any of the DISTVERSION, DISTNAME, EXTRACT_CMD, EXTRACT_BEFORE_ARGS, EXTRACT_AFTER_ARGS, EXTRACT_SUFX, or DISTFILES variables, depending on how alien a format your port's distribution file is. (The most common case is EXTRACT_SUFX=.tar.Z, when the tarball is condensed by regular compress, not gzip.) In the worst case, you can simply create your own do-extract target to override the default, though this should be rarely, if ever, necessary. Naming The first part of the port's Makefile names the port, describes its version number, and lists it in the correct category. <makevar>PORTNAME</makevar> and <makevar>PORTVERSION</makevar> You should set PORTNAME to the base name of your port, and PORTVERSION to the version number of the port. <makevar>PORTREVISION</makevar> and <makevar>PORTEPOCH</makevar> <makevar>PORTREVISION</makevar> The PORTREVISION variable is a monotonically increasing value which is reset to 0 with every increase of PORTVERSION (i.e. every time a new official vendor release is made), and appended to the package name if non-zero. Changes to PORTREVISION are used by automated tools (e.g. &man.pkg.version.1;) to highlight the fact that a new package is available. PORTREVISION should be increased each time a change is made to the port which significantly affects the content or structure of the derived package. Examples of when PORTREVISION should be bumped: Addition of patches to correct security vulnerabilities, bugs, or to add new functionality to the port. Changes to the port Makefile to enable or disable compile-time options in the package. Changes in the packing list or the install-time behavior of the package (e.g. change to a script which generates initial data for the package, like ssh host keys). Version bump of a port's shared library dependency (in this case, someone trying to install the old package after installing a newer version of the dependency will fail since it will look for the old libfoo.x instead of libfoo.(x+1)). Silent changes to the port distfile which have significant functional differences, i.e. changes to the distfile requiring a correction to distinfo with no corresponding change to PORTVERSION, where a diff -ru of the old and new versions shows non-trivial changes to the code. Examples of changes which do not require a PORTREVISION bump: Style changes to the port skeleton with no functional change to what appears in the resulting package. Changes to MASTER_SITES or other functional changes to the port which do not affect the resulting package. Trivial patches to the distfile such as correction of typos, which are not important enough that users of the package should go to the trouble of upgrading. Build fixes which cause a package to become compilable where it was previously failing (as long as the changes do not introduce any functional change on any other platforms on which the port did previously build). Since PORTREVISION reflects the content of the package, if the package was not previously buildable then there is no need to increase PORTREVISION to mark a change. A rule of thumb is to ask yourself whether a change committed to a port is something which everyone would benefit from having (either because of an enhancement, fix, or by virtue that the new package will actually work at all), and weigh that against that fact that it will cause everyone who regularly updates their ports tree to be compelled to update. If yes, the PORTREVISION should be bumped. <makevar>PORTEPOCH</makevar> From time to time a software vendor or FreeBSD porter will do something silly and release a version of their software which is actually numerically less than the previous version. An example of this is a port which goes from foo-20000801 to foo-1.0 (the former will be incorrectly treated as a newer version since 20000801 is a numerically greater value than 1). In situations such as this, the PORTEPOCH version should be increased. If PORTEPOCH is nonzero it is appended to the package name as described in section 0 above. PORTEPOCH must never be decreased or reset to zero, because that would cause comparison to a package from an earlier epoch to fail (i.e. the package would not be detected as out of date): the new version number (e.g. 1.0,1 in the above example) is still numerically less than the previous version (20000801), but the ,1 suffix is treated specially by automated tools and found to be greater than the implied suffix ,0 on the earlier package. Dropping or resetting PORTEPOCH incorrectly leads to no end of grief; if you do not understand the above discussion, please keep after it until you do, or ask questions on the mailing lists. It is expected that PORTEPOCH will not be used for the majority of ports, and that sensible use of PORTVERSION can often pre-empt it becoming necessary if a future release of the software should change the version structure. However, care is needed by FreeBSD porters when a vendor release is made without an official version number — such as a code snapshot release. The temptation is to label the release with the release date, which will cause problems as in the example above when a new official release is made. For example, if a snapshot release is made on the date 20000917, and the previous version of the software was version 1.2, the snapshot release should be given a PORTVERSION of 1.2.20000917 or similar, not 20000917, so that the succeeding release, say 1.3, is still a numerically greater value. Example of <makevar>PORTREVISION</makevar> and <makevar>PORTEPOCH</makevar> usage The gtkmumble port, version 0.10, is committed to the ports collection: PORTNAME= gtkmumble PORTVERSION= 0.10 PKGNAME becomes gtkmumble-0.10. A security hole is discovered which requires a local FreeBSD patch. PORTREVISION is bumped accordingly. PORTNAME= gtkmumble PORTVERSION= 0.10 PORTREVISION= 1 PKGNAME becomes gtkmumble-0.10_1 A new version is released by the vendor, numbered 0.2 (it turns out the author actually intended 0.10 to actually mean 0.1.0, not what comes after 0.9 - oops, too late now). Since the new minor version 2 is numerically less than the previous version 10, the PORTEPOCH must be bumped to manually force the new package to be detected as newer. Since it is a new vendor release of the code, PORTREVISION is reset to 0 (or removed from the Makefile). PORTNAME= gtkmumble PORTVERSION= 0.2 PORTEPOCH= 1 PKGNAME becomes gtkmumble-0.2,1 The next release is 0.3. Since PORTEPOCH never decreases, the version variables are now: PORTNAME= gtkmumble PORTVERSION= 0.3 PORTEPOCH= 1 PKGNAME becomes gtkmumble-0.3,1 If PORTEPOCH were reset to 0 with this upgrade, someone who had installed the gtkmumble-0.10_1 package would not detect the gtkmumble-0.3 package as newer, since 3 is still numerically less than 10. Remember, this is the whole point of PORTEPOCH in the first place. <makevar>PKGNAMEPREFIX</makevar> and <makevar>PKGNAMESUFFIX</makevar> Two optional variables, PKGNAMEPREFIX and PKGNAMESUFFIX, are combined with PORTNAME and PORTVERSION to form PKGNAME as ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}. Make sure this conforms to our guidelines for a good package name. In particular, you are not allowed to use a hyphen (-) in PORTVERSION. Also, if the package name has the language- or the -compiled.specifics part (see below), use PKGNAMEPREFIX and PKGNAMESUFFIX, respectively. Do not make them part of PORTNAME. Package Naming Conventions The following are the conventions you should follow in naming your packages. This is to have our package directory easy to scan, as there are already thousands of packages and users are going to turn away if they hurt their eyes! The package name should look like language_region-name-compiled.specifics-version.numbers. The package name is defined as ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}. Make sure to set the variables to conform to that format. FreeBSD strives to support the native language of its users. The language- part should be a two letter abbreviation of the natural language defined by ISO-639 if the port is specific to a certain language. Examples are ja for Japanese, ru for Russian, vi for Vietnamese, zh for Chinese, ko for Korean and de for German. If the port is specific to a certain region within the language area, add the two letter country code as well. Examples are en_US for US English and fr_CH for Swiss French. The language- part should be set in the PKGNAMEPREFIX variable. The first letter of name part should be lowercase. (The rest of the name can contain capital letters, so use your own discretion when you are converting a software name that has some capital letters in it.) There is a tradition of naming perl 5 modules by prepending p5- and converting the double-colon separator to a hyphen; for example, the Data::Dumper module becomes p5-Data-Dumper. If the software in question has numbers, hyphens, or underscores in its name, you may include them as well (like kinput2). If the port can be built with different hardcoded defaults (usually part of the directory name in a family of ports), the -compiled.specifics part should state the compiled-in defaults (the hyphen is optional). Examples are papersize and font units. The -compiled.specifics part should be set in the PKGNAMESUFFIX variable. The version string should follow a dash (-) and be a period-separated list of integers and single lowercase alphabetics. In particular, it is not permissible to have another dash inside the version string. The only exception is the string pl (meaning patchlevel), which can be used only when there are no major and minor version numbers in the software. If the software version has strings like alpha, beta, rc, or pre, take the first letter and put it immediately after a period. If the version string continues after those names, the numbers should follow the single alphabet without an extra period between them. The idea is to make it easier to sort ports by looking at the version string. In particular, make sure version number components are always delimited by a period, and if the date is part of the string, use the yyyy.mm.dd format, not dd.mm.yyyy or the non-Y2K compliant yy.mm.dd format. Here are some (real) examples on how to convert the name as called by the software authors to a suitable package name: Distribution Name PKGNAMEPREFIX PORTNAME PKGNAMESUFFIX PORTVERSION Reason mule-2.2.2 (empty) mule (empty) 2.2.2 No changes required XFree86-3.3.6 (empty) XFree86 (empty) 3.3.6 No changes required EmiClock-1.0.2 (empty) emiclock (empty) 1.0.2 No uppercase names for single programs rdist-1.3alpha (empty) rdist (empty) 1.3.a No strings like alpha allowed es-0.9-beta1 (empty) es (empty) 0.9.b1 No strings like beta allowed mailman-2.0rc3 (empty) mailman (empty) 2.0.r3 No strings like rc allowed v3.3beta021.src (empty) tiff (empty) 3.3 What the heck was that anyway? tvtwm (empty) tvtwm (empty) pl11 Version string always required piewm (empty) piewm (empty) 1.0 Version string always required xvgr-2.10pl1 (empty) xvgr (empty) 2.10.1 pl allowed only when no major/minor version numbers gawk-2.15.6 ja- gawk (empty) 2.15.6 Japanese language version psutils-1.13 (empty) psutils -letter 1.13 Papersize hardcoded at package build time pkfonts (empty) pkfonts 300 1.0 Package for 300dpi fonts If there is absolutely no trace of version information in the original source and it is unlikely that the original author will ever release another version, just set the version string to 1.0 (like the piewm example above). Otherwise, ask the original author or use the date string (yyyy.mm.dd) as the version. Categorization <makevar>CATEGORIES</makevar> When a package is created, it is put under /usr/ports/packages/All and links are made from one or more subdirectories of /usr/ports/packages. The names of these subdirectories are specified by the variable CATEGORIES. It is intended to make life easier for the user when he is wading through the pile of packages on the FTP site or the CDROM. Please take a look at the current list of categories and pick the ones that are suitable for your port. This list also determines where in the ports tree the port is imported. If you put more than one category here, it is assumed that the port files will be put in the subdirectory with the name in the first category. See below for more discussion about how to pick the right categories. Current list of categories Here is the current list of port categories. Those marked with an asterisk (*) are virtual categories—those that do not have a corresponding subdirectory in the ports tree. They are only used as secondary categories, and only for search purposes. For non-virtual categories, you will find a one-line description in the COMMENT in that subdirectory's Makefile. Category Description Notes accessibility Ports to help disabled users. afterstep* Ports to support the AfterStep window manager. arabic Arabic language support. archivers Archiving tools. astro Astronomical ports. audio Sound support. benchmarks Benchmarking utilities. biology Biology-related software. cad Computer aided design tools. chinese Chinese language support. comms Communication software. Mostly software to talk to your serial port. converters Character code converters. databases Databases. deskutils Things that used to be on the desktop before computers were invented. devel Development utilities. Do not put libraries here just because they are libraries—unless they truly do not belong anywhere else, they should not be in this category. dns DNS-related software. editors General editors. Specialized editors go in the section for those tools (e.g., a mathematical-formula editor will go in math). elisp* Emacs-lisp ports. emulators Emulators for other operating systems. Terminal emulators do not belong here—X-based ones should go to x11 and text-based ones to either comms or misc, depending on the exact functionality. finance Monetary, financial and related applications. french French language support. ftp FTP client and server utilities. If your port speaks both FTP and HTTP, put it in ftp with a secondary category of www. games Games. german German language support. gnome* Ports from the GNOME Project. graphics Graphics utilities. haskell* Software related to the Haskell language. hebrew Hebrew language support. hungarian Hungarian language support. ipv6* IPv6 related software. irc Internet Relay Chat utilities. japanese Japanese language support. java Software related to the Java language. The java category shall not be the only one for a port. Save for ports directly related to the Java language, porters are also encouraged not to use java as the main category of a port. kde* Ports from the K Desktop Environment (KDE) Project. korean Korean language support. lang Programming languages. linux* Linux applications and support utilities. lisp* Software related to the Lisp language. mail Mail software. math Numerical computation software and other utilities for mathematics. mbone MBone applications. misc Miscellaneous utilities Basically things that do not belong anywhere else. If at all possible, try to find a better category for your port than misc, as ports tend to get overlooked in here. multimedia Multimedia software. net Miscellaneous networking software. net-im Instant messaging software. net-mgmt Networking management software. news USENET news software. offix* Ports from the OffiX suite. palm Software support for the Palm™ series. parallel* Applications dealing with parallelism in computing. pear* Ports related to the Pear PHP framework. perl5* Ports that require Perl version 5 to run. plan9* Various programs from Plan9. polish Polish language support. portuguese Portuguese language support. print Printing software. Desktop publishing tools (previewers, etc.) belong here too. python* Software related to the Python language. ruby* Software related to the Ruby language. russian Russian language support. scheme* Software related to the Scheme language. science Scientific ports that do not fit into other categories such as astro, biology and math. security Security utilities. shells Command line shells. sysutils System utilities. tcl80* Ports that use Tcl version 8.0 to run. tcl81* Ports that use Tcl version 8.1 to run. tcl82* Ports that use Tcl version 8.2 to run. tcl83* Ports that use Tcl version 8.3 to run. tcl84* Ports that use Tcl version 8.4 to run. textproc Text processing utilities. It does not include desktop publishing tools, which go to print. tk80* Ports that use Tk version 8.0 to run. tk82* Ports that use Tk version 8.2 to run. tk83* Ports that use Tk version 8.3 to run. tk84* Ports that use Tk version 8.4 to run. tkstep80* Ports that use TkSTEP version 8.0 to run. ukrainian Ukrainian language support. vietnamese Vietnamese language support. windowmaker* Ports to support the WindowMaker window manager. www Software related to the World Wide Web. HTML language support belongs here too. x11 The X Window System and friends. This category is only for software that directly supports the window system. Do not put regular X applications here; most of them should go into other x11-* categories (see below). If your port is an X application, define USE_XLIB (implied by USE_IMAKE) and put it in the appropriate category. x11-clocks X11 clocks. x11-fm X11 file managers. x11-fonts X11 fonts and font utilities. x11-servers X11 servers. x11-themes X11 themes. x11-toolkits X11 toolkits. x11-wm X11 window managers. xfce* Ports relating to the Xfce desktop environment. zope* Zope support. Choosing the right category As many of the categories overlap, you often have to choose which of the categories should be the primary category of your port. There are several rules that govern this issue. Here is the list of priorities, in decreasing order of precedence: The first category must be a physical category (see above). This is necessary to make the packaging work. Virtual categories and physical categories may be intermixed after that. Language specific categories always come first. For example, if your port installs Japanese X11 fonts, then your CATEGORIES line would read japanese x11-fonts. Specific categories are listed before less-specific ones. For instance, an HTML editor should be listed as www editors, not the other way around. Also, you should not list net when the port belongs to any of irc, mail, mbone, news, security, or www, as net is included implicitly. x11 is used as a secondary category only when the primary category is a natural language. In particular, you should not put x11 in the category line for X applications. Emacs modes should be placed in the same ports category as the application supported by the mode, not in editors. For example, an Emacs mode to edit source files of some programming language should go into lang. misc should not appear with any other non-virtual category. If you have misc with something else in your CATEGORIES line, that means you can safely delete misc and just put the port in that other subdirectory! If your port truly does not belong anywhere else, put it in misc. If you are not sure about the category, please put a comment to that effect in your &man.send-pr.1; submission so we can discuss it before we import it. If you are a committer, send a note to the &a.ports; so we can discuss it first. Too often, new ports are imported to the wrong category only to be moved right away. This causes unnecessary and undesirable bloat in the master source repository. Proposing a new category As the Ports Collection has grown over time, various new categories have been introduced. New categories can either be virtual categories—those that do not have a corresponding subdirectory in the ports tree— or physical categories—those that do. The following text discusses the issues involved in creating a new physical category so that you can understand them before you propose one. Our existing practice has been to avoid creating a new physical category unless either a large number of ports would logically belong to it, or the ports that would belong to it are a logically distinct group that is of limited general interest (for instance, categories related to spoken human languages), or preferably both. The rationale for this is that such a change creates a fair amount of work for both the committers and also for all users who track changes to the Ports Collection. In addition, proposed category changes just naturally seem to attract controversy. (Perhaps this is because there is no clear consensus on when a category is too big, nor whether categories should lend themselves to browsing (and thus what number of categories would be an ideal number), and so forth.) Here is the procedure: Propose the new category on &a.ports;. You should include a detailed rationale for the new category, including why you feel the existing categories are not sufficient, and the list of existing ports proposed to move. (If there are new ports pending in GNATS that would fit this category, list them too.) If you are the maintainer and/or submitter, respectively, mention that as it may help you to make your case. Participate in the discussion. If it seems that there is support for your idea, file a PR which includes both the rationale and the list of existing ports that need to be moved. Ideally, this PR should also include patches for the following: Makefiles for the new ports once they are repocopied Makefile for the new category Makefile for the old ports' categories Makefiles for ports that depend on the old ports (for extra credit, you can include the other files that have to change, as per the procedure in the Committer's Guide.) Since it affects the ports infrastructure and involves not only performing repo-copies but also possibly running regression tests on the build cluster, the PR should be assigned to the &a.portmgr;. If that PR is approved, a committer will need to follow the rest of the procedure that is outlined in the Committer's Guide. Proposing a new virtual category should be similar to the above but much less involved, since no ports will actually have to move. In this case, the only patches to include in the PR would be those to add the new category to the CATEGORIESs of the affected ports. Proposing reorganizing all the categories Occasionally someone proposes reorganizing the categories with either a 2-level structure, or some other kind of keyword structure. To date, nothing has come of any of these proposals because, while they are very easy to make, the effort involved to retrofit the entire existing ports collection with any kind of reorganization is daunting to say the very least. Please read the history of these proposals in the mailing list archives before you post this idea; furthermore, you should be prepared to be challenged to offer a working prototype. The distribution files The second part of the Makefile describes the files that must be downloaded in order to build the port, and where they can be downloaded from. <makevar>DISTVERSION/DISTNAME</makevar> DISTNAME is the name of the port as called by the authors of the software. DISTNAME defaults to ${PORTNAME}-${PORTVERSION}, so override it only if necessary. DISTNAME is only used in two places. First, the distribution file list (DISTFILES) defaults to ${DISTNAME}${EXTRACT_SUFX}. Second, the distribution file is expected to extract into a subdirectory named WRKSRC, which defaults to work/${DISTNAME}. Some vendor's distribution names which do not fit into the ${PORTNAME}-${PORTVERSION}-scheme can be handled automatically by setting DISTVERSION. PORTVERSION and DISTNAME will be derived automatically, but can of course be overridden. The following table lists some examples: DISTVERSION PORTVERSION 0.7.1d 0.7.1.d 10Alpha3 10.a3 3Beta7-pre2 3.b7.p2 8:f_17 8f.17 PKGNAMEPREFIX and PKGNAMESUFFIX do not affect DISTNAME. Also note that if WRKSRC is equal to work/${PORTNAME}-${PORTVERSION} while the original source archive is named something other than ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}, you should probably leave DISTNAME alone— you are better off defining DISTFILES than having to set both DISTNAME and WRKSRC (and possibly EXTRACT_SUFX). <makevar>MASTER_SITES</makevar> Record the directory part of the FTP/HTTP-URL pointing at the original tarball in MASTER_SITES. Do not forget the trailing slash (/)! The make macros will try to use this specification for grabbing the distribution file with FETCH if they cannot find it already on the system. It is recommended that you put multiple sites on this list, preferably from different continents. This will safeguard against wide-area network problems. We are even planning to add support for automatically determining the closest master site and fetching from there; having multiple sites will go a long way towards helping this effort. If the original tarball is part of one of the popular archives such as X-contrib, GNU, or Perl CPAN, you may be able refer to those sites in an easy compact form using MASTER_SITE_* (e.g., MASTER_SITE_XCONTRIB and MASTER_SITE_PERL_GNU). Simply set MASTER_SITES to one of these variables and MASTER_SITE_SUBDIR to the path within the archive. Here is an example: MASTER_SITES= ${MASTER_SITE_XCONTRIB} MASTER_SITE_SUBDIR= applications These variables are defined in /usr/ports/Mk/bsd.sites.mk. There are new entries added all the time, so make sure to check the latest version of this file before submitting a port. The user can also set the MASTER_SITE_* variables in /etc/make.conf to override our choices, and use their favorite mirrors of these popular archives instead. <makevar>EXTRACT_SUFX</makevar> If you have one distribution file, and it uses an odd suffix to indicate the compression mechanism, set EXTRACT_SUFX. For example, if the distribution file was named foo.tgz instead of the more normal foo.tar.gz, you would write: DISTNAME= foo EXTRACT_SUFX= .tgz The USE_BZIP2 and USE_ZIP variables automatically set EXTRACT_SUFX to .tar.bz2 or .zip as necessary. If neither of these are set then EXTRACT_SUFX defaults to .tar.gz. You never need to set both EXTRACT_SUFX and DISTFILES. <makevar>DISTFILES</makevar> Sometimes the names of the files to be downloaded have no resemblance to the name of the port. For example, it might be called source.tar.gz or similar. In other cases the application's source code might be in several different archives, all of which must be downloaded. If this is the case, set DISTFILES to be a space separated list of all the files that must be downloaded. DISTFILES= source1.tar.gz source2.tar.gz If not explicitly set, DISTFILES defaults to ${DISTNAME}${EXTRACT_SUFX}. <makevar>EXTRACT_ONLY</makevar> If only some of the DISTFILES must be extracted—for example, one of them is the source code, while another is an uncompressed document—list the filenames that must be extracted in EXTRACT_ONLY. DISTFILES= source.tar.gz manual.html EXTRACT_ONLY= source.tar.gz If none of the DISTFILES should be uncompressed then set EXTRACT_ONLY to the empty string. EXTRACT_ONLY= <makevar>PATCHFILES</makevar> If your port requires some additional patches that are available by FTP or HTTP, set PATCHFILES to the names of the files and PATCH_SITES to the URL of the directory that contains them (the format is the same as MASTER_SITES). If the patch is not relative to the top of the source tree (i.e., WRKSRC) because it contains some extra pathnames, set PATCH_DIST_STRIP accordingly. For instance, if all the pathnames in the patch have an extra foozolix-1.0/ in front of the filenames, then set PATCH_DIST_STRIP=-p1. Do not worry if the patches are compressed; they will be decompressed automatically if the filenames end with .gz or .Z. If the patch is distributed with some other files, such as documentation, in a gzip'd tarball, you cannot just use PATCHFILES. If that is the case, add the name and the location of the patch tarball to DISTFILES and MASTER_SITES. Then, use the EXTRA_PATCHES variable to point to those files and bsd.port.mk will automatically apply them for you. In particular, do not copy patch files into the PATCHDIR directory—that directory may not be writable. The tarball will have been extracted alongside the regular source by then, so there is no need to explicitly extract it if it is a regular gzip'd or compress'd tarball. If you do the latter, take extra care not to overwrite something that already exists in that directory. Also, do not forget to add a command to remove the copied patch in the pre-clean target. Multiple distribution files or patches from different sites and subdirectories (<literal>MASTER_SITES:n</literal>) (Consider this to be a somewhat advanced topic; those new to this document may wish to skip this section at first). This section has information on the fetching mechanism known as both MASTER_SITES:n and MASTER_SITES_NN. We will refer to this mechanism as MASTER_SITES:n hereon. A little background first. OpenBSD has a neat feature inside both DISTFILES and PATCHFILES variables, both files and patches can be postfixed with :n identifiers where n both can be [0-9] and denote a group designation. For example: DISTFILES= alpha:0 beta:1 In OpenBSD, distribution file alpha will be associated with variable MASTER_SITES0 instead of our common MASTER_SITES and beta with MASTER_SITES1. This is a very interesting feature which can decrease that endless search for the correct download site. Just picture 2 files in DISTFILES and 20 sites in MASTER_SITES, the sites slow as hell where beta is carried by all sites in MASTER_SITES, and alpha can only be found in the 20th site. It would be such a waste to check all of them if maintainer knew this beforehand, would it not? Not a good start for that lovely weekend! Now that you have the idea, just imagine more DISTFILES and more MASTER_SITES. Surely our distfiles survey meister would appreciate the relief to network strain that this would bring. In the next sections, information will follow on the FreeBSD implementation of this idea. We improved a bit on OpenBSD's concept. Simplified information This section tells you how to quickly prepare fine grained fetching of multiple distribution files and patches from different sites and subdirectories. We describe here a case of simplified MASTER_SITES:n usage. This will be sufficient for most scenarios. However, if you need further information, you will have to refer to the next section. Some applications consist of multiple distribution files that must be downloaded from a number of different sites. For example, Ghostscript consists of the core of the program, and then a large number of driver files that are used depending on the user's printer. Some of these driver files are supplied with the core, but many others must be downloaded from a variety of different sites. To support this, each entry in DISTFILES may be followed by a colon and a tag name. Each site listed in MASTER_SITES is then followed by a colon, and the tag that indicates which distribution files should be downloaded from this site. For example, consider an application with the source split in two parts, source1.tar.gz and source2.tar.gz, which must be downloaded from two different sites. The port's Makefile would include lines like . Simplified use of <literal>MASTER_SITES:n</literal> with 1 file per site MASTER_SITES= ftp://ftp.example1.com/:source1 \ ftp://ftp.example2.com/:source2 DISTFILES= source1.tar.gz:source1 \ source2.tar.gz:source2 Multiple distribution files can have the same tag. Continuing the previous example, suppose that there was a third distfile, source3.tar.gz, that should be downloaded from ftp.example2.com. The Makefile would then be written like . Simplified use of <literal>MASTER_SITES:n</literal> with more than 1 file per site MASTER_SITES= ftp://ftp.example1.com/:source1 \ ftp://ftp.example2.com/:source2 DISTFILES= source1.tar.gz:source1 \ source2.tar.gz:source2 \ source3.tar.gz:source2 Detailed information Okay, so the previous section example did not reflect your needs? In this section we will explain in detail how the fine grained fetching mechanism MASTER_SITES:n works and how you can modify your ports to use it. Elements can be postfixed with :n where n is [^:,]+, i.e., n could conceptually be any alphanumeric string but we will limit it to [a-zA-Z_][0-9a-zA-Z_]+ for now. Moreover, string matching is case sensitive; i.e., n is different from N. However, the following words cannot be used for postfixing purposes since they yield special meaning: default, all and ALL (they are used internally in item ). Furthermore, DEFAULT is a special purpose word (check item ). Elements postfixed with :n belong to the group n, :m belong to group m and so forth. Elements without a postfix are groupless, i.e., they all belong to the special group DEFAULT. If you postfix any elements with DEFAULT, you are just being redundant unless you want to have an element belonging to both DEFAULT and other groups at the same time (check item ). The following examples are equivalent but the first one is preferred: MASTER_SITES= alpha MASTER_SITES= alpha:DEFAULT Groups are not exclusive, an element may belong to several different groups at the same time and a group can either have either several different elements or none at all. Repeated elements within the same group will be simply that, repeated elements. When you want an element to belong to several groups at the same time, you can use the comma operator (,). Instead of repeating it several times, each time with a different postfix, we can list several groups at once in a single postfix. For instance, :m,n,o marks an element that belongs to group m, n and o. All the following examples are equivalent but the last one is preferred: MASTER_SITES= alpha alpha:SOME_SITE MASTER_SITES= alpha:DEFAULT alpha:SOME_SITE MASTER_SITES= alpha:SOME_SITE,DEFAULT MASTER_SITES= alpha:DEFAULT,SOME_SITE All sites within a given group are sorted according to MASTER_SORT_AWK. All groups within MASTER_SITES and PATCH_SITES are sorted as well. Group semantics can be used in any of the following variables MASTER_SITES, PATCH_SITES, MASTER_SITE_SUBDIR, PATCH_SITE_SUBDIR, DISTFILES, and PATCHFILES according to the following syntax: All MASTER_SITES, PATCH_SITES, MASTER_SITE_SUBDIR and PATCH_SITE_SUBDIR elements must be terminated with the forward slash / character. If any elements belong to any groups, the group postfix :n must come right after the terminator /. The MASTER_SITES:n mechanism relies on the existence of the terminator / to avoid confusing elements where a :n is a valid part of the element with occurrences where :n denotes group n. For compatibility purposes, since the / terminator was not required before in both MASTER_SITE_SUBDIR and PATCH_SITE_SUBDIR elements, if the postfix immediate preceding character is not a / then :n will be considered a valid part of the element instead of a group postfix even if an element is postfixed with :n. See both and . Detailed use of <literal>MASTER_SITES:n</literal> in <makevar>MASTER_SITE_SUBDIR</makevar> MASTER_SITE_SUBDIR= old:n new/:NEW Directories within group - DEFAULT -> old:n + DEFAULT -> old:n Directories within group - NEW -> new + NEW -> new Detailed use of <literal>MASTER_SITES:n</literal> with comma operator, multiple files, multiple sites and multiple subdirectories MASTER_SITES= http://site1/%SUBDIR%/ http://site2/:DEFAULT \ http://site3/:group3 http://site4/:group4 \ http://site5/:group5 http://site6/:group6 \ http://site7/:DEFAULT,group6 \ http://site8/%SUBDIR%/:group6,group7 \ http://site9/:group8 DISTFILES= file1 file2:DEFAULT file3:group3 \ file4:group4,group5,group6 file5:grouping \ file6:group7 MASTER_SITE_SUBDIR= directory-trial:1 directory-n/:groupn \ directory-one/:group6,DEFAULT \ directory The previous example results in the following fine grained fetching. Sites are listed in the exact order they will be used. file1 will be fetched from MASTER_SITE_OVERRIDE http://site1/directory-trial:1/ http://site1/directory-one/ http://site1/directory/ http://site2/ http://site7/ MASTER_SITE_BACKUP file2 will be fetched exactly as file1 since they both belong to the same group MASTER_SITE_OVERRIDE http://site1/directory-trial:1/ http://site1/directory-one/ http://site1/directory/ http://site2/ http://site7/ MASTER_SITE_BACKUP file3 will be fetched from MASTER_SITE_OVERRIDE http://site3/ MASTER_SITE_BACKUP file4 will be fetched from MASTER_SITE_OVERRIDE http://site4/ http://site5/ http://site6/ http://site7/ http://site8/directory-one/ MASTER_SITE_BACKUP file5 will be fetched from MASTER_SITE_OVERRIDE MASTER_SITE_BACKUP file6 will be fetched from MASTER_SITE_OVERRIDE http://site8/ MASTER_SITE_BACKUP How do I group one of the special variables from bsd.sites.mk, e.g., MASTER_SITE_SOURCEFORGE? See . Detailed use of <literal>MASTER_SITES:n</literal> with <makevar>MASTER_SITE_SOURCEFORGE</makevar> MASTER_SITES= http://site1/ ${MASTER_SITE_SOURCEFORGE:S/$/:sourceforge,TEST/} DISTFILES= something.tar.gz:sourceforge something.tar.gz will be fetched from all sites within MASTER_SITE_SOURCEFORGE. How do I use this with PATCH* variables? All examples were done with MASTER* variables but they work exactly the same for PATCH* ones as can be seen in . Simplified use of <literal>MASTER_SITES:n</literal> with <makevar>PATCH_SITES</makevar>. PATCH_SITES= http://site1/ http://site2/:test PATCHFILES= patch1:test What does change for ports? What does not? All current ports remain the same. The MASTER_SITES:n feature code is only activated if there are elements postfixed with :n like elements according to the aforementioned syntax rules, especially as shown in item . The port targets remain the same: checksum, makesum, patch, configure, build, etc. With the obvious exceptions of do-fetch, fetch-list, master-sites and patch-sites. do-fetch: deploys the new grouping postfixed DISTFILES and PATCHFILES with their matching group elements within both MASTER_SITES and PATCH_SITES which use matching group elements within both MASTER_SITE_SUBDIR and PATCH_SITE_SUBDIR. Check . fetch-list: works like old fetch-list with the exception that it groups just like do-fetch. master-sites and patch-sites: (incompatible with older versions) only return the elements of group DEFAULT; in fact, they execute targets master-sites-default and patch-sites-default respectively. Furthermore, using target either master-sites-all or patch-sites-all is preferred to directly checking either MASTER_SITES or PATCH_SITES. Also, directly checking is not guaranteed to work in any future versions. Check item for more information on these new port targets. New port targets There are master-sites-n and patch-sites-n targets which will list the elements of the respective group n within MASTER_SITES and PATCH_SITES respectively. For instance, both master-sites-DEFAULT and patch-sites-DEFAULT will return the elements of group DEFAULT, master-sites-test and patch-sites-test of group test, and thereon. There are new targets master-sites-all and patch-sites-all which do the work of the old master-sites and patch-sites ones. They return the elements of all groups as if they all belonged to the same group with the caveat that it lists as many MASTER_SITE_BACKUP and MASTER_SITE_OVERRIDE as there are groups defined within either DISTFILES or PATCHFILES; respectively for master-sites-all and patch-sites-all. <makevar>DIST_SUBDIR</makevar> Do not let your port clutter /usr/ports/distfiles. If your port requires a lot of files to be fetched, or contains a file that has a name that might conflict with other ports (e.g., Makefile), set DIST_SUBDIR to the name of the port (${PORTNAME} or ${PKGNAMEPREFIX}${PORTNAME} should work fine). This will change DISTDIR from the default /usr/ports/distfiles to /usr/ports/distfiles/DIST_SUBDIR, and in effect puts everything that is required for your port into that subdirectory. It will also look at the subdirectory with the same name on the backup master site at ftp.FreeBSD.org. (Setting DISTDIR explicitly in your Makefile will not accomplish this, so please use DIST_SUBDIR.) This does not affect the MASTER_SITES you define in your Makefile. <makevar>MAINTAINER</makevar> Set your mail-address here. Please. :-) Note that only a single address without the comment part is allowed as a MAINTAINER value. The format used should be user@hostname.domain. Please do not include any descriptive text such as your real name in this entry—that merely confuses bsd.port.mk. For a detailed description of the responsibilities of maintainers, refer to the MAINTAINER on Makefiles section. If the maintainer of a port does not respond to an update request from a user after two weeks (excluding major public holidays), then that is considered a maintainer timeout, and the update may be made without explicit maintainer approval. If the maintainer does not respond within three months, then that maintainer is considered absent without leave, and can be replaced as the maintainer of the particular port in question. Exceptions to this are anything maintained by the &a.portmgr;, or the &a.security-officer;. No unauthorized commits may ever be made to ports maintained by those groups. The &a.portmgr; reserves the right to revoke or override anyone's maintainership for any reason, and the &a.security-officer; reserves the right to revoke or override maintainership for security reasons. <makevar>COMMENT</makevar> This is a one-line description of the port. Please do not include the package name (or version number of the software) in the comment. The comment should begin with a capital and end without a period. Here is an example: COMMENT= A cat chasing a mouse all over the screen The COMMENT variable should immediately follow the MAINTAINER variable in the Makefile. Please try to keep the COMMENT line less than 70 characters, as it is displayed to users as a one-line summary of the port. Dependencies Many ports depend on other ports. There are seven variables that you can use to ensure that all the required bits will be on the user's machine. There are also some pre-supported dependency variables for common cases, plus a few more to control the behavior of dependencies. <makevar>LIB_DEPENDS</makevar> This variable specifies the shared libraries this port depends on. It is a list of lib:dir:target tuples where lib is the name of the shared library, dir is the directory in which to find it in case it is not available, and target is the target to call in that directory. For example, LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg:install will check for a shared jpeg library with major version 9, and descend into the graphics/jpeg subdirectory of your ports tree to build and install it if it is not found. The target part can be omitted if it is equal to DEPENDS_TARGET (which defaults to install). The lib part is a regular expression which is being looked up in the ldconfig -r output. Values such as intl.[5-7] and intl are allowed. The first pattern, intl.[5-7], will match any of: intl.5, intl.6 or intl.7. The second pattern, intl, will match any version of the intl library. The dependency is checked twice, once from within the extract target and then from within the install target. Also, the name of the dependency is put into the package so that &man.pkg.add.1; will automatically install it if it is not on the user's system. <makevar>RUN_DEPENDS</makevar> This variable specifies executables or files this port depends on during run-time. It is a list of path:dir:target tuples where path is the name of the executable or file, dir is the directory in which to find it in case it is not available, and target is the target to call in that directory. If path starts with a slash (/), it is treated as a file and its existence is tested with test -e; otherwise, it is assumed to be an executable, and which -s is used to determine if the program exists in the search path. For example, RUN_DEPENDS= ${LOCALBASE}/etc/innd:${PORTSDIR}/news/inn \ wish8.0:${PORTSDIR}/x11-toolkits/tk80 will check if the file or directory /usr/local/etc/innd exists, and build and install it from the news/inn subdirectory of the ports tree if it is not found. It will also see if an executable called wish8.0 is in the search path, and descend into the x11-toolkits/tk80 subdirectory of your ports tree to build and install it if it is not found. In this case, innd is actually an executable; if an executable is in a place that is not expected to be in the search path, you should use the full pathname. The official search PATH used on the ports build cluster is /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin The dependency is checked from within the install target. Also, the name of the dependency is put into the package so that &man.pkg.add.1; will automatically install it if it is not on the user's system. The target part can be omitted if it is the same as DEPENDS_TARGET. <makevar>BUILD_DEPENDS</makevar> This variable specifies executables or files this port requires to build. Like RUN_DEPENDS, it is a list of path:dir:target tuples. For example, BUILD_DEPENDS= unzip:${PORTSDIR}/archivers/unzip will check for an executable called unzip, and descend into the archivers/unzip subdirectory of your ports tree to build and install it if it is not found. build here means everything from extraction to compilation. The dependency is checked from within the extract target. The target part can be omitted if it is the same as DEPENDS_TARGET <makevar>FETCH_DEPENDS</makevar> This variable specifies executables or files this port requires to fetch. Like the previous two, it is a list of path:dir:target tuples. For example, FETCH_DEPENDS= ncftp2:${PORTSDIR}/net/ncftp2 will check for an executable called ncftp2, and descend into the net/ncftp2 subdirectory of your ports tree to build and install it if it is not found. The dependency is checked from within the fetch target. The target part can be omitted if it is the same as DEPENDS_TARGET. <makevar>EXTRACT_DEPENDS</makevar> This variable specifies executables or files this port requires for extraction. Like the previous, it is a list of path:dir:target tuples. For example, EXTRACT_DEPENDS= unzip:${PORTSDIR}/archivers/unzip will check for an executable called unzip, and descend into the archivers/unzip subdirectory of your ports tree to build and install it if it is not found. The dependency is checked from within the extract target. The target part can be omitted if it is the same as DEPENDS_TARGET. Use this variable only if the extraction does not already work (the default assumes gzip) and cannot be made to work using USE_ZIP or USE_BZIP2 described in . <makevar>PATCH_DEPENDS</makevar> This variable specifies executables or files this port requires to patch. Like the previous, it is a list of path:dir:target tuples. For example, PATCH_DEPENDS= ${NONEXISTENT}:${PORTSDIR}/java/jfc:extract will descend into the java/jfc subdirectory of your ports tree to build and install it if it is not found. The dependency is checked from within the patch target. The target part can be omitted if it is the same as DEPENDS_TARGET. <makevar>DEPENDS</makevar> If there is a dependency that does not fall into either of the above categories, or your port requires having the source of the other port extracted in addition to having it installed, then use this variable. This is a list of dir:target, as there is nothing to check, unlike the previous four. The target part can be omitted if it is the same as DEPENDS_TARGET. <makevar>USE_<replaceable>*</replaceable></makevar> A number of variables exist in order to encapsulate common dependencies that many ports have. Although their use is optional, they can help to reduce the verbosity of the port Makefiles. Each of them is styled as USE_*. The usage of these variables is restricted to the port Makefiles and ports/Mk/bsd.*.mk and is not designed to encapsulate user-settable options — use WITH_* and WITHOUT_* for that purpose. It is always incorrect to set any USE_* in /etc/make.conf. For instance, setting USE_GCC=3.2 would adds a dependency on gcc32 for every port, including gcc32 itself! The <makevar>USE_<replaceable>*</replaceable></makevar> variables Variable Means USE_BZIP2 The port's tarballs are compressed with bzip2. USE_ZIP The port's tarballs are compressed with zip. USE_BISON The port uses bison for building. USE_GCC The port requires a specific version of gcc to build. The exact version can be specified with value such as 3.2. The minimal required version can be specified as 3.2+. The gcc from the base system is used when it satisfies the requested version, otherwise an appropriate gcc is compiled from ports and the CC and CXX variables are adjusted. USE_GCC can't be used together with - USE_LIBTOOL_VER. + USE_AUTOTOOLS=libtool:XX.
Variables related to gmake and the configure script are described in , while autoconf, automake and libtool are described in . Perl related variables are described in . X11 variables are listed in . deals with GNOME and with KDE related variables. documents Java variables, while contains information on Apache, PHP and PEAR modules. Python is discussed in , while Ruby in . Finally, provides variables used for SDL applications.
Notes on dependencies As mentioned above, the default target to call when a dependency is required is DEPENDS_TARGET. It defaults to install. This is a user variable; it is never defined in a port's Makefile. If your port needs a special way to handle a dependency, use the :target part of the *_DEPENDS variables instead of redefining DEPENDS_TARGET. When you type make clean, its dependencies are automatically cleaned too. If you do not wish this to happen, define the variable NOCLEANDEPENDS in your environment. This may be particularly desirable if the port has something that takes a long time to rebuild in its dependency list, such as KDE, GNOME or Mozilla. To depend on another port unconditionally, use the variable ${NONEXISTENT} as the first field of BUILD_DEPENDS or RUN_DEPENDS. Use this only when you need to get the source of the other port. You can often save compilation time by specifying the target too. For instance BUILD_DEPENDS= ${NONEXISTENT}:${PORTSDIR}/graphics/jpeg:extract will always descend to the jpeg port and extract it. Do not use DEPENDS unless there is no other way the behavior you want can be accomplished. It will cause the other port to always be built (and installed, by default), and the dependency will go into the packages as well. If this is really what you need, you should probably write it as BUILD_DEPENDS and RUN_DEPENDS instead—at least the intention will be clear. Circular dependencies are fatal Do not introduce any circular dependencies into the ports tree! The ports building technology does not tolerate circular dependencies. If you introduce one, you will have someone, somewhere in the world, whose FreeBSD installation will break almost immediately, with many others quickly to follow. These can really be hard to detect; if in doubt, before you make that change, make sure you have done the following: cd /usr/ports; make index. That process can be quite slow on older machines, but you may be able to save a large number of people—including yourself— a lot of grief in the process.
<makevar>MASTERDIR</makevar> If your port needs to build slightly different versions of packages by having a variable (for instance, resolution, or paper size) take different values, create one subdirectory per package to make it easier for users to see what to do, but try to share as many files as possible between ports. Typically you only need a very short Makefile in all but one of the directories if you use variables cleverly. In the sole Makefile, you can use MASTERDIR to specify the directory where the rest of the files are. Also, use a variable as part of PKGNAMESUFFIX so the packages will have different names. This will be best demonstrated by an example. This is part of japanese/xdvi300/Makefile; PORTNAME= xdvi PORTVERSION= 17 PKGNAMEPREFIX= ja- PKGNAMESUFFIX= ${RESOLUTION} : # default RESOLUTION?= 300 .if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \ ${RESOLUTION} != 300 && ${RESOLUTION} != 400 @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\"" @${ECHO} "Possible values are: 118, 240, 300 (default) and 400." @${FALSE} .endif japanese/xdvi300 also has all the regular patches, package files, etc. If you type make there, it will take the default value for the resolution (300) and build the port normally. As for other resolutions, this is the entire xdvi118/Makefile: RESOLUTION= 118 MASTERDIR= ${.CURDIR}/../xdvi300 .include "${MASTERDIR}/Makefile" (xdvi240/Makefile and xdvi400/Makefile are similar). The MASTERDIR definition tells bsd.port.mk that the regular set of subdirectories like FILESDIR and SCRIPTDIR are to be found under xdvi300. The RESOLUTION=118 line will override the RESOLUTION=300 line in xdvi300/Makefile and the port will be built with resolution set to 118. Manpages The MAN[1-9LN] variables will automatically add any manpages to pkg-plist (this means you must not list manpages in the pkg-plist—see generating PLIST for more). It also makes the install stage automatically compress or uncompress manpages depending on the setting of NOMANCOMPRESS in /etc/make.conf. If your port tries to install multiple names for manpages using symlinks or hardlinks, you must use the MLINKS variable to identify these. The link installed by your port will be destroyed and recreated by bsd.port.mk to make sure it points to the correct file. Any manpages listed in MLINKS must not be listed in the pkg-plist. To specify whether the manpages are compressed upon installation, use the MANCOMPRESSED variable. This variable can take three values, yes, no and maybe. yes means manpages are already installed compressed, no means they are not, and maybe means the software already respects the value of NOMANCOMPRESS so bsd.port.mk does not have to do anything special. MANCOMPRESSED is automatically set to yes if USE_IMAKE is set and NO_INSTALL_MANPAGES is not set, and to no otherwise. You do not have to explicitly define it unless the default is not suitable for your port. If your port anchors its man tree somewhere other than PREFIX, you can use the MANPREFIX to set it. Also, if only manpages in certain sections go in a non-standard place, such as some perl modules ports, you can set individual man paths using MANsectPREFIX (where sect is one of 1-9, L or N). If your manpages go to language-specific subdirectories, set the name of the languages to MANLANG. The value of this variable defaults to "" (i.e., English only). Here is an example that puts it all together. MAN1= foo.1 MAN3= bar.3 MAN4= baz.4 MLINKS= foo.1 alt-name.8 MANLANG= "" ja MAN3PREFIX= ${PREFIX}/share/foobar MANCOMPRESSED= yes This states that six files are installed by this port; ${PREFIX}/man/man1/foo.1.gz ${PREFIX}/man/ja/man1/foo.1.gz ${PREFIX}/share/foobar/man/man3/bar.3.gz ${PREFIX}/share/foobar/man/ja/man3/bar.3.gz ${PREFIX}/man/man4/baz.4.gz ${PREFIX}/man/ja/man4/baz.4.gz Additionally ${PREFIX}/man/man8/alt-name.8.gz may or may not be installed by your port. Regardless, a symlink will be made to join the foo(1) manpage and alt-name(8) manpage. Info files If your package needs to install GNU info files, they should be listed in the INFO variable (without the trailing .info), and appropriate installation/de-installation code will be automatically added to the temporary pkg-plist before package registration. Makefile Options Some large applications can be built in a number of configurations, adding functionality if one of a number of libraries or applications is available. Examples include choice of natural (human) language, GUI versus command-line, or type of database to support. Since not all users want those libraries or applications, the ports system provides hooks that the port author can use to control which configuration should be built. Supporting these properly will make users happy, and effectively provide 2 or more ports for the price of one. <makevar>KNOBS</makevar> <makevar>WITH_<replaceable>*</replaceable></makevar> and <makevar>WITHOUT_<replaceable>*</replaceable></makevar> These variables are designed to be set by the system administrator. There are many that are standardized in ports/Mk/bsd.*.mk; others are not, which can be confusing. If you need to add such a configuration variable, please consider using one of the ones from the following list. You should not assume that a WITH_* necessarily has a corresponding WITHOUT_* variable and vice versa. In general, the default is simply assumed. Unless otherwise specified, these variables are only tested for being set or not set, rather than being set to some kind of variable such as YES or NO. The <makevar>WITH_<replaceable>*</replaceable></makevar> and <makevar>WITHOUT_<replaceable>*</replaceable></makevar> variables Variable Means WITH_APACHE2 If set, use www/apache2 instead of the default of www/apache. WITH_BERKELEY_DB Define this variable to specify the ability to use a variant of the Berkeley database package such as databases/db41. An associated variable, WITH_BDB_VER, may be set to values such as 2, 3, 4, 41 or 42. WITH_MYSQL Define this variable to specify the ability to use a variant of the MySQL database package such as databases/mysql40-server. An associated variable, WANT_MYSQL_VER, may be set to values such as 323, 40, 41, or 50. WITHOUT_NLS If set, says that internationalization is not needed, which can save compile time. By default, internationalization is used. WITH_OPENSSL_BASE Use the version of OpenSSL in the base system. WITH_OPENSSL_PORT Use the version of OpenSSL from security/openssh, overwriting the version that was originally installed in the base system. WITH_POSTGRESQL Define this variable to specify the ability to use a variant of the PostGreSQL database package such as databases/postgresql72. WITHOUT_X11 If the port can be built both with and without X support, then it should normally be built with X support. If this variable is defined, then the version that does not have X support should be built instead.
Knob naming It is recommended that porters use like-named knobs, for the benefit of end-users and to help keep the number of knob names down. A list of popular knob names can be found in the KNOBS file. Knob names should reflect what the knob is and does. When a port has a lib-prefix in the PORTNAME the lib-prefix should be dropped in knob naming.
<makevar>OPTIONS</makevar> Background The OPTIONS variable gives the user who installs the port a dialog with the available options and saves them to /var/db/ports/portname/options. Next time when the port has to be rebuild, the options are reused. Never again you will have to remember all the twenty WITH_* and WITHOUT_* options you used to build this port! When the user runs make config (or runs make build for the first time), the framework will check for /var/db/ports/portname/options. If that file does not exist, it will use the values of OPTIONS to create a dialogbox where the options can be enabled or disabled. Then the options file is saved and the selected variables will be used when building the port. Use make showconfig to see the saved configuration. Use make rmconfig to remove the saved configuration. Syntax The syntax for the OPTIONS variable is: OPTIONS= OPTION "descriptive text" default ... The value for default is either ON or OFF. Multiple repetitions of these three fields are allowed. OPTIONS definition must appear before the inclusion of bsd.port.pre.mk. The WITH_* and WITHOUT_* variables can only be tested after the inclusion of bsd.port.pre.mk. Due to a deficiency in the infrastructure, you can only test WITH_* variables for options, which are OFF by default, and WITHOUT_* variables for options, which defaults to ON. Example Simple use of <makevar>OPTIONS</makevar> OPTIONS= FOO "Enable option foo" On \ BAR "Support feature bar" Off .include <bsd.port.pre.mk> .if defined(WITHOUT_FOO) CONFIGURE_ARGS+= --without-foo .else CONFIGURE_ARGS+= --with-foo .endif .if defined(WITH_BAR) RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar .endif .include <bsd.port.post.mk>
Specifying the working directory Each port is extracted in to a working directory, which must be writable. The ports system defaults to having the DISTFILES unpack in to a directory called ${DISTNAME}. In other words, if you have set: PORTNAME= foo PORTVERSION= 1.0 then the port's distribution files contain a top-level directory, foo-1.0, and the rest of the files are located under that directory. There are a number of variables you can override if that is not the case. <makevar>WRKSRC</makevar> The variable lists the name of the directory that is created when the application's distfiles are extracted. If our previous example extracted into a directory called foo (and not foo-1.0) you would write: WRKSRC= ${WRKDIR}/foo or possibly WRKSRC= ${WRKDIR}/${PORTNAME} <makevar>NO_WRKSUBDIR</makevar> If the port does not extract in to a subdirectory at all then you should set NO_WRKSUBDIR to indicate that. NO_WRKSUBDIR= yes <makevar>CONFLICTS</makevar> If your package cannot coexist with other packages (because of file conflicts, runtime incompatibility, etc.), list the other package names in the CONFLICTS variable. You can use shell globs like * and ? here. Packages names should be enumerated the same way they appear in /var/db/pkg. Please make sure that CONFLICTS does not match this port's package itself, or else forcing its installation with FORCE_PKG_REGISTER will no longer work. CONFLICTS automatically sets IGNORE, which is more fully documented in .
Special considerations There are some more things you have to take into account when you create a port. This section explains the most common of those. Shared Libraries If your port installs one or more shared libraries, define a INSTALLS_SHLIB make variable, which will instruct a bsd.port.mk to run ${LDCONFIG} -m on the directory where the new library is installed (usually PREFIX/lib) during post-install target to register it into the shared library cache. This variable, when defined, will also facilitate addition of an appropriate @exec /sbin/ldconfig -m and @unexec /sbin/ldconfig -R pair into your pkg-plist file, so that a user who installed the package can start using the shared library immediately and de-installation will not cause the system to still believe the library is there. If you need, you can override the default location where the new library is installed by defining the LDCONFIG_DIRS make variable, which should contain a list of directories into which shared libraries are to be installed. For example if your port installs shared libraries into PREFIX/lib/foo and PREFIX/lib/bar directories you could use the following in your Makefile: INSTALLS_SHLIB= yes LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar Remember that non-standard directories will not be passed to &man.ldconfig.8; on (re-)boot! If any port really needs this to work, install a startup-script as x11/kdelibs3 does. Please double-check, often this is not necessary at all or can be avoided through -rpath or setting LD_RUN_PATH during linking (see lang/moscow_ml for an example), or through a shell-wrapper which sets LD_LIBRARY_PATH before invoking the binary, like www/mozilla does. Note that content of LDCONFIG_DIRS is passed through &man.sed.1; just like the rest of pkg-plist, so PLIST_SUB substitutions also apply here. It is recommended that you use %%PREFIX%% for PREFIX, %%LOCALBASE%% for LOCALBASE and %%X11BASE%% for X11BASE. Try to keep shared library version numbers in the libfoo.so.0 format. Our runtime linker only cares for the major (first) number. When the major library version number increments in the update to the new port version, all other ports that link to the affected library should have their PORTREVISION incremented, to force recompilation with the new library version. Ports with distribution restrictions Licenses vary, and some of them place restrictions on how the application can be packaged, whether it can be sold for profit, and so on. It is your responsibility as a porter to read the licensing terms of the software and make sure that the FreeBSD project will not be held accountable for violating them by redistributing the source or compiled binaries either via FTP/HTTP or CD-ROM. If in doubt, please contact the &a.ports;. In situations like this, the variables described in the following sections can be set. <makevar>NO_PACKAGE</makevar> This variable indicates that we may not generate a binary package of the application. For instance, the license may disallow binary redistribution, or it may prohibit distribution of packages created from patched sources. However, the port's DISTFILES may be freely mirrored on FTP/HTTP. They may also be distributed on a CD-ROM (or similar media) unless NO_CDROM is set as well. NO_PACKAGE should also be used if the binary package is not generally useful, and the application should always be compiled from the source code. For example, if the application has configuration information that is site specific hard coded in to it at compile time, set NO_PACKAGE. NO_PACKAGE should be set to a string describing the reason why the package should not be generated. <makevar>NO_CDROM</makevar> This variable alone indicates that, although we are allowed to generate binary packages, we may put neither those packages nor the port's DISTFILES onto a CD-ROM (or similar media) for resale. However, the binary packages and the port's DISTFILES will still be available via FTP/HTTP. If this variable is set along with NO_PACKAGE, then only the port's DISTFILES will be available, and only via FTP/HTTP. NO_CDROM should be set to a string describing the reason why the port cannot be redistributed on CD-ROM. For instance, this should be used if the port's license is for non-commercial use only. <makevar>RESTRICTED</makevar> Set this variable alone if the application's license permits neither mirroring the application's DISTFILES nor distributing the binary package in any way. NO_CDROM or NO_PACKAGE should not be set along with RESTRICTED since the latter variable implies the former ones. RESTRICTED should be set to a string describing the reason why the port cannot be redistributed. Typically, this indicates that the port contains proprietary software and that the user will need to manually download the DISTFILES, possibly after registering for the software or agreeing to accept the terms of an EULA. <makevar>RESTRICTED_FILES</makevar> When RESTRICTED or NO_CDROM is set, this variable defaults to ${DISTFILES} ${PATCHFILES}, otherwise it is empty. If only some of the distribution files are restricted, then set this variable to list them. Note that the port committer should add an entry to /usr/ports/LEGAL for every listed distribution file, describing exactly what the restriction entails. Building mechanisms <command>make</command>, <command>gmake</command>, and <command>imake</command> If your port uses GNU make, set USE_GMAKE=yes. Variables for ports related to gmake Variable Means USE_GMAKE The port requires gmake to build. GMAKE The full path for gmake if it is not in the PATH.
If your port is an X application that creates Makefile files from Imakefile files using imake, then set USE_IMAKE=yes. This will cause the configure stage to automatically do an xmkmf -a. If the flag is a problem for your port, set XMKMF=xmkmf. If the port uses imake but does not understand the install.man target, NO_INSTALL_MANPAGES=yes should be set. If your port's source Makefile has something else than all as the main build target, set ALL_TARGET accordingly. Same goes for install and INSTALL_TARGET.
<command>configure</command> script If your port uses the configure script to generate Makefile files from Makefile.in files, set GNU_CONFIGURE=yes. If you want to give extra arguments to the configure script (the default argument is --prefix=${PREFIX} ${CONFIGURE_TARGET}), set those extra arguments in CONFIGURE_ARGS. Extra environment variables can be passed using CONFIGURE_ENV variable. If your package uses GNU configure, and the resulting executable file has a strange name like i386-portbld-freebsd4.7-appname, you will need to additionally override the CONFIGURE_TARGET variable to specify the target in the way required by scripts generated by recent versions of autoconf. Add the following line immediately after the GNU_CONFIGURE=yes line in your Makefile: CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL} Variables for ports that use configure Variable Means GNU_CONFIGURE The port uses configure script to prepare build. HAS_CONFIGURE Same as GNU_CONFIGURE, except default configure target is not added to CONFIGURE_ARGS. CONFIGURE_ARGS Additional arguments passed to configure script. CONFIGURE_ENV Additional environment variables to be set for configure script run. CONFIGURE_TARGET Override default configure target. Default value is ${MACHINE_ARCH}-portbld-freebsd${OSREL}.
Using GNU autotools Introduction The various GNU autotools provide an abstraction mechanism for building a piece of software over a wide variety of operating systems and machine architectures. Within the Ports Collection, an individual port can make use of these tools via a simple construct: USE_AUTOTOOLS= tool:version[:operation] ... At the time of writing, tool can be one of libtool, libltdl, autoconf, autoheader, automake or aclocal. version specifies the particular tool revision to be used (see devel/{automake,autoconf,libtool}[0-9]+ for valid versions). operation is an optional extension to modify how the tool is used. Multiple tools can be specified at once, either by including them all on a single line, or using the += Makefile construct. Before proceeding any further, it cannot be stressed highly enough that the constructs discussed here are for use ONLY in building other ports. For cross-development work, the devel/gnu-{automake,autoconf,libtool} ports should be used, such as within an IDE. devel/anjuta and devel/kdevelop (GNOME and KDE respectively) are good examples of how to achieve this. <command>libtool</command> Shared libraries using the GNU building framework usually use libtool to adjust the compilation and installation of shared libraries to match the specifics of the underlying operating system. The Ports Collection provides a number of versions of libtool modified for use by &os;. USE_AUTOTOOLS= libtool:version[:inc|:env] With no additional operations, libtool:version tells the building framework that the port uses libtool, implying GNU_CONFIGURE. The configure script will be patched with the system-installed copy of libtool. Further, a number of make and shell variables will be assigned for onward use by the port. See bsd.autotools.mk for details. With the :inc operation, the environment will be set up, and a slightly different set of patching will be performed. With the :env operation, only the environment will be set up. Previously USE_AUTOTOOLS construct USE_LIBTOOL_VER=13 libtool:13 USE_INC_LIBTOOL_VER=15 libtool:15:inc WANT_LIBTOOL_VER=15 libtool:15:env Finally, LIBTOOLFLAGS and LIBTOOLFILES can be optionally set to override the most likely arguments to, and files patched by, libtool. Most ports are unlikely to need this. See bsd.autotools.mk for further details. <command>libltdl</command> Some ports make use of the libltdl library package, which is part of the libtool suite. Use of this library does not automatically necessitate the use of libtool itself, so a separate construct is provided. USE_AUTOTOOLS= libltdl:version Currently, all this does is to bring in a LIB_DEPENDS on the appropriate libltdl port, and is provided as a convenience function to help eliminate any dependencies on the autotools ports outside of the USE_AUTOTOOLS framework. There are no optional operations for this tool. Previously USE_AUTOTOOLS construct USE_LIBLTDL=YES libltdl:15 <command>autoconf</command> and <command>autoheader</command> Some ports do not contain a configure script, but do contain an autoconf template in the configure.ac file. You can use the following assignments to let autoconf create the configure script, and also have autoheader create template headers for use by the configure script. USE_AUTOTOOLS= autoconf:version[:env] and USE_AUTOTOOLS= autoheader:version which also implies the use of autoconf:version. Similarly to libtool, the inclusion of the optional :env operation simply sets up the environment for further use. Without it, patching and reconfiguration of the port is carried out. Previously USE_AUTOTOOLS construct USE_AUTOCONF_VER=213 autoconf:213 WANT_AUTOCONF_VER=259 autoconf:259:env USE_AUTOHEADER_VER=253 autoheader:253 (implies autoconf:253) The additional optional variables AUTOCONF_ARGS and AUTOHEADER_ARGS can be overridden by the port Makefile if specifically requested. As with the libtool equivalents, most ports are unlikely to need this. <command>automake</command> and <command>aclocal</command> Some packages only contain Makefile.am files. These have to be converted into Makefile.in files using automake, and the further processed by configure to generate an actual Makefile. Similarly, packages occasionally do not ship with included aclocal.m4 files, again required to build the software. This can be achieved with aclocal, which scans configure.ac or configure.in. aclocal has a similar relationship to automake as autoheader does to autoconf, described in the previous section. aclocal implies the use of automake, thus we have: USE_AUTOTOOLS= automake:version[:env] and USE_AUTOTOOLS= aclocal:version which also implies the use of automake:version. Similarly to libtool and autoconf, the inclusion of the optional :env operation simply sets up the environment for further use. Without it, reconfiguration of the port is carried out. Previously USE_AUTOTOOLS construct USE_AUTOMAKE_VER=14 automake:14 WANT_AUTOMAKE_VER=15 automake:15:env USE_ACLOCAL_VER=19 aclocal:19 (implies automake:19) As with autoconf and autoheader, both automake and aclocal have optional argument variables, AUTOMAKE_ARGS and ACLOCAL_ARGS respectively, which may be overriden by the port Makefile if required. Using <literal>perl</literal> Variables for ports that use <literal>perl</literal> Variable Means USE_PERL5 Says that the port uses perl 5 to build and run. USE_PERL5_BUILD Says that the port uses perl 5 to build. USE_PERL5_RUN Says that the port uses perl 5 to run. PERL The full path of perl 5, either in the system or installed from a port, but without the version number. Use this if you need to replace #!lines in scripts. PERL_CONFIGURE Configure using Perl's MakeMaker. It implies USE_PERL5. PERL_MODBUILD Configure, build and install using Module::Build. It implies PERL_CONFIGURE. Read only variables PERL_VERSION The full version of perl installed (e.g., 5.00503). PERL_VER The short version of perl installed (e.g., 5.005). PERL_LEVEL The installed perl version as an integer of the form MNNNPP (e.g., 500503). PERL_ARCH Where perl stores architecture dependent libraries. Defaults to ${ARCH}-freebsd. PERL_PORT Name of the perl port that is installed (e.g., perl5). SITE_PERL Directory name where site specific perl packages go. This value is added to PLIST_SUB.
Ports of Perl modules, which do not have an official website, should link cpan.org in the WWW line of a pkg-descr file. The suggested URL scheme is http://search.cpan.org/dist/Module-Name.
Using X11 Variable definitions Variables for ports that use X USE_X_PREFIX The port installs in X11BASE, not PREFIX. USE_XLIB The port uses the X libraries. USE_MOTIF The port uses the Motif toolkit. Implies USE_XPM. USE_IMAKE The port uses imake. Implies USE_X_PREFIX. XMKMF Set to the path of xmkmf if not in the PATH. Defaults to xmkmf -a.
Variables for depending on individual parts of X11 X_IMAKE_PORT Port providing imake and several other utilities used to build X11. X_LIBRARIES_PORT Port providing X11 libraries. X_CLIENTS_PORT Port providing X clients. X_SERVER_PORT Port providing X server. X_FONTSERVER_PORT Port providing font server. X_PRINTSERVER_PORT Port providing print server. X_VFBSERVER_PORT Port providing virtual framebuffer server. X_NESTSERVER_PORT Port providing a nested X server. X_FONTS_ENCODINGS_PORT Port providing encodings for fonts. X_FONTS_MISC_PORT Port providing miscellaneous bitmap fonts. X_FONTS_100DPI_PORT Port providing 100dpi bitmap fonts. X_FONTS_75DPI_PORT Port providing 75dpi bitmap fonts. X_FONTS_CYRILLIC_PORT Port providing cyrillic bitmap fonts. X_FONTS_TTF_PORT Port providing &truetype; fonts. X_FONTS_TYPE1_PORT Port providing Type1 fonts. X_MANUALS_PORT Port providing developer oriented manual pages
Using X11 related variables in port # Use X11 libraries and depend on # font server as well as cyrillic fonts. RUN_DEPENDS= ${X11BASE}/bin/xfs:${X_FONTSERVER_PORT} \ ${X11BASE}/lib/X11/fonts/cyrillic/crox1c.pcf.gz:${X_FONTS_CYRILLIC_PORT} USE_XLIB= yes
Ports that require Motif If your port requires a Motif library, define USE_MOTIF in the Makefile. Default Motif implementation is x11-toolkits/open-motif. Users can choose x11-toolkits/lesstif instead by setting WANT_LESSTIF variable. The MOTIFLIB variable will be set by bsd.port.mk to reference the appropriate Motif library. Please patch the source of your port to use ${MOTIFLIB} wherever the Motif library is referenced in the original Makefile or Imakefile. There are two common cases: If the port refers to the Motif library as -lXm in its Makefile or Imakefile, simply substitute ${MOTIFLIB} for it. If the port uses XmClientLibs in its Imakefile, change it to ${MOTIFLIB} ${XTOOLLIB} ${XLIB}. Note that MOTIFLIB (usually) expands to -L/usr/X11R6/lib -lXm or /usr/X11R6/lib/libXm.a, so there is no need to add -L or -l in front. X11 fonts If your port installs fonts for the X Window System, put them in X11BASE/lib/X11/fonts/local. + + Getting fake <envar>DISPLAY</envar> using Xvfb + + Some applications require a working X11 display for compilation to + succeed. This pose a problem for the FreeBSD package building + cluster, which operates headless. When the following canonical hack + is used, the package cluster will start the virtual framebuffer + X server. The working DISPLAY is then passed + to the build. + + .if defined(PACKAGE_BUILDING) +BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT} \ + ${X11BASE}/lib/X11/fonts/misc/8x13O.pcf.gz:${X_FONTS_MISC_PORT} +.endif + + +
Using GNOME The FreeBSD/GNOME project uses its own set of variables to define which GNOME components a particular port uses. A comprehensive list of these variables exists within the FreeBSD/GNOME project's homepage. Your port does not need to depend on GNOME if it merely installs pkg-config metadata files to PREFIX/libdata/pkgconfig. As usual, your port should be prepared to clean up after itself and remove that directory if it becomes empty. Assuming that your port installs a file named gtkmumble.pc to the said location, just add the following lines to pkg-plist: libdata/pkgconfig/gtkmumble.pc @unexec rmdir %B 2>/dev/null || true The latter line must appear immediately after the former one so that %B expands correctly. Please refer to &man.pkg.create.1; for a detailed description of the syntax used in pkg-plist. Using KDE Variables for ports that use KDE USE_QT_VER The port uses the Qt toolkit. Possible values are 1 and 3; each specify the major version of Qt to use. Sets both MOC and QTCPPFLAGSto default appropriate values. USE_KDELIBS_VER The port uses KDE libraries. Possible values are 3; each specify the major version of KDE to use. Implies USE_QT_VER of the appropriate version. USE_KDEBASE_VER The port uses KDE base. Possible values are 3; each specify the major version of KDE to use. Implies USE_KDELIBS_VER of the appropriate version. MOC Set to the path of moc. Default set according to USE_QT_VER value. QTCPPFLAGS Set the CPPFLAGS to use when processing Qt code. Default set according to USE_QT_VER value.
Using Java Variable definitions If your port needs a Java™ Development Kit (JDK) to either build, run or even extract the distfile, then it should define USE_JAVA. There are several JDKs in the ports collection, from various vendors, and in several versions. If your port must use one of these versions, you can define which one. The most current version is java/jdk14. Variables that may be set by ports that use Java Variable Means USE_JAVA Should be defined for the remaining variables to have any effect. JAVA_VERSION List of space-separated suitable Java versions for the port. An optional "+" allows you to specify a range of versions (allowed values: 1.1[+] 1.2[+] 1.3[+] 1.4[+]). JAVA_OS List of space-separated suitable JDK port operating systems for the port (allowed values: native linux). JAVA_VENDOR List of space-separated suitable JDK port vendors for the port (allowed values: freebsd bsdjava sun ibm blackdown). JAVA_BUILD When set, it means that the selected JDK port should be added to the build dependencies of the port. JAVA_RUN When set, it means that the selected JDK port should be added to the run dependencies of the port. JAVA_EXTRACT When set, it means that the selected JDK port should be added to the extract dependencies of the port. USE_JIKES Whether the port should or should not use the jikes bytecode compiler to build. When no value is set for this variable, the port will use jikes to build if available. You may also explicitly forbid or enforce the use of jikes (by setting 'no' or 'yes'). In the later case, devel/jikes will be added to build dependencies of the port. In any case that jikes is actually used in place of javac, then the HAVE_JIKES variable is defined by bsd.java.mk.
Below is the list of all settings a port will receive after setting USE_JAVA: Variables provided to ports that use Java Variable Value JAVA_PORT The name of the JDK port (e.g. 'java/jdk14'). JAVA_PORT_VERSION The full version of the JDK port (e.g. '1.4.2'). If you only need the first two digits of this version number, use ${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1.\2/}. JAVA_PORT_OS The operating system used by the JDK port (e.g. 'linux'). JAVA_PORT_VENDOR The vendor of the JDK port (e.g. 'sun'). JAVA_PORT_OS_DESCRIPTION Description of the operating system used by the JDK port (e.g. 'Linux'). JAVA_PORT_VENDOR_DESCRIPTION Description of the vendor of the JDK port (e.g. 'FreeBSD Foundation'). JAVA_HOME Path to the installation directory of the JDK (e.g. '/usr/local/jdk1.3.1'). JAVAC Path to the Java compiler to use (e.g. '/usr/local/jdk1.1.8/bin/javac' or '/usr/local/bin/jikes'). JAR Path to the jar tool to use (e.g. '/usr/local/jdk1.2.2/bin/jar' or '/usr/local/bin/fastjar'). APPLETVIEWER Path to the appletviewer utility (e.g. '/usr/local/linux-jdk1.2.2/bin/appletviewer'). JAVA Path to the java executable. Use this for executing Java programs (e.g. '/usr/local/jdk1.3.1/bin/java'). JAVADOC Path to the javadoc utility program. JAVAH Path to the javah program. JAVAP Path to the javap program. JAVA_KEYTOOL Path to the keytool utility program. This variable is available only if the JDK is Java 1.2 or higher. JAVA_N2A Path to the native2ascii tool. JAVA_POLICYTOOL Path to the policytool program. This variable is available only if the JDK is Java 1.2 or higher. JAVA_SERIALVER Path to the serialver utility program. RMIC Path to the RMI stub/skeleton generator, rmic. RMIREGISTRY Path to the RMI registry program, rmiregistry. RMID Path to the RMI daemon program rmid. This variable is only available if the JDK is Java 1.2 or higher. JAVA_CLASSES Path to the archive that contains the JDK class files. On JDK 1.2 or later, this is ${JAVA_HOME}/jre/lib/rt.jar. Earlier JDKs used ${JAVA_HOME}/lib/classes.zip. HAVE_JIKES Defined whenever jikes is used by the port (see USE_JIKES above).
You may use the java-debug make target to get information for debugging your port. It will display the value of many of the forecited variables. Additionally, the following constants are defined so all Java ports may be installed in a consistent way: Constants defined for ports that use Java Constant Value JAVASHAREDIR The base directory for everything related to Java. Default: ${PREFIX}/share/java. JAVAJARDIR The directory where JAR files should be installed. Default: ${JAVASHAREDIR}/classes. JAVALIBDIR The directory where JAR files installed by other ports are located. Default: ${LOCALBASE}/share/java/classes.
The related entries are defined in both PLIST_SUB (documented in ) and SUB_LIST.
Building with Ant When the port is to be built using Apache Ant, it has to define USE_ANT. Ant is thus considered to be the sub-make command. When no do-build target is defined by the port, a default one will be set that simply runs Ant according to MAKE_ENV, MAKE_ARGS and ALL_TARGETS. This is similar to the USE_GMAKE mechanism, which is documented in . If jikes is used in place of javac (see USE_JIKES in ), then Ant will automatically use it to build the port. Best practices When porting a Java library, your port should install the JAR file(s) in ${JAVAJARDIR}, and everything else under ${JAVASHAREDIR}/${PORTNAME} (except for the documentation, see below). In order to reduce the packing file size, you may reference the JAR file(s) directly in the Makefile. Just use the following statement (where myport.jar is the name of the JAR file installed as part of the port): PLIST_FILES+= %%JAVAJARDIR%%/myport.jar When porting a Java application, the port usually installs everything under a single directory (including its JAR dependencies). The use of ${JAVASHAREDIR}/${PORTNAME} is strongly encouraged in this regard. It is up the porter to decide whether the port should install the additional JAR dependencies under this directory or directly use the already installed ones (from ${JAVAJARDIR}). Regardless of the type of your port (library or application), the additional documentation should be installed in the same location as for any other port. The JavaDoc tool is known to produce a different set of files depending on the version of the JDK that is used. For ports that do not enforce the use of a particular JDK, it is therefore a complex task to specify the packing list (pkg-plist). This is one reason why porters are strongly encouraged to use the PORTDOCS macro. Moreover, even if you can predict the set of files that will be generated by javadoc, the size of the resulting pkg-plist advocates for the use of PORTDOCS. The default value for DATADIR is ${PREFIX}/share/${PORTNAME}. It is a good idea to override DATADIR to ${JAVASHAREDIR}/${PORTNAME} for Java ports. Indeed, DATADIR is automatically added to PLIST_SUB (documented in ) so you may use %%DATADIR%% directly in pkg-plist. As for the choice of building Java ports from source or directly installing them from a binary distribution, there is no defined policy at the time of writing. However, people from the &os; Java Project encourage porters to have their ports built from source whenever it is a trivial task. All the features that have been presented in this section are implemented in bsd.java.mk. If you ever think that your port needs more sophisticated Java support, please first have a look at the bsd.java.mk CVS log as it usually takes some time to document the latest features. Then, if you think the support you are lacking would be beneficial to many other Java ports, feel free to discuss it on the &a.java;. Although there is a java category for PRs, it refers to the JDK porting effort from the &os; Java project. Therefore, you should submit your Java port in the ports category as for any other port, unless the issue you are trying to resolve is related to either a JDK implementation or bsd.java.mk. Similarly, there is a defined policy regarding the CATEGORIES of a Java port, which is detailed in .
Using Apache and PHP Apache Variables for ports that use Apache USE_APACHE The port requires Apache. WITH_APACHE2 The port requires Apache 2.0. Without this variable, the port will depend on Apache 1.3. APXS Full path to the apxs binary (read-only variable).
PHP Variables for ports that use PHP USE_PHP The port requires PHP. The value yes adds a dependency on PHP. The list of required PHP extensions can be specified instead. Example: pcre xml gettext DEFAULT_PHP_VER Selects which major version of PHP will be installed as a dependency when no PHP is installed yet. Default is 4. Possible values: 4, 5 BROKEN_WITH_PHP The port does not work with PHP of the given version. Possible values: 4, 5 USE_PHPIZE The port will be built as a PHP extension. USE_PHPEXT The port will be treated as a PHP extension, including installation and registration in the extension registry. USE_PHP_BUILD Set PHP as a build dependency. WANT_PHP_CLI Want the CLI (command line) version of PHP. WANT_PHP_CGI Want the CGI version of PHP. WANT_PHP_MOD Want the Apache module version of PHP. WANT_PHP_SCR Want the CLI or the CGI version of PHP. WANT_PHP_WEB Want the Apache module or the CGI version of PHP. WANT_PHP_PEAR Want the PEAR framework.
PEAR modules Porting PEAR modules is a very simple process. Use the variables FILES, TESTS, DATA, SQLS, SCRIPTFILES, DOCS and EXAMPLES to list the files you want to install. All listed files will be automatically installed into the appropriate locations and added to pkg-plist. Include ${PORTSDIR}/devel/pear-PEAR/Makefile.common on the last line of the Makefile. Example Makefile for PEAR class PORTNAME= Date PORTVERSION= 1.4.3 CATEGORIES= devel www pear MAINTAINER= example@domain.com COMMENT= PEAR Date and Time Zone Classes BUILD_DEPENDS= ${PEARDIR}/PEAR.php:${PORTSDIR}/devel/pear-PEAR RUN_DEPENDS= ${BUILD_DEPENDS} FILES= Date.php Date/Calc.php Date/Human.php Date/Span.php \ Date/TimeZone.php TESTS= test_calc.php test_date_methods_span.php testunit.php \ testunit_date.php testunit_date_span.php wknotest.txt \ bug674.php bug727_1.php bug727_2.php bug727_3.php \ bug727_4.php bug967.php weeksinmonth_4_monday.txt \ weeksinmonth_4_sunday.txt weeksinmonth_rdm_monday.txt \ weeksinmonth_rdm_sunday.txt DOCS= TODO _DOCSDIR= . .include <bsd.port.pre.mk> .include "${PORTSDIR}/devel/pear-PEAR/Makefile.common" .include <bsd.port.post.mk>
Using Python Most useful variables for ports that use Python USE_PYTHON The port needs Python. Minimal required version can be specified with values such as 2.3+. Version ranges can also be specified, by separating two version numbers with a dash, e.g.: 2.1-2.3 USE_PYDISTUTILS Use Python distutils for configuring, compiling and installing. This is required when the port comes with setup.py. This overrides the do-build and do-install targets and may also override do-configure if GNU_CONFIGURE is not defined. PYTHON_PKGNAMEPREFIX Used as a PKGNAMEPREFIX to distinguish packages for different Python versions. Example: py24- PYTHON_SITELIBDIR Location of the site-packages tree, that contains installation path of Python (usually LOCALBASE). The PYTHON_SITELIBDIR variable can be very useful when installing Python modules. PYTHONPREFIX_SITELIBDIR The PREFIX-clean variant of PYTHON_SITELIBDIR. Always use %%PYTHON_SITELIBDIR%% in pkg-plist when possible. The default value of %%PYTHON_SITELIBDIR%% is lib/python%%PYTHON_VERSION%%/site-packages PYTHON_CMD Python interpreter command line, including version number. PYNUMERIC Dependency line for numeric extension. PYXML Dependency line for XML extension (not needed for Python 2.0 and higher as it is also in base distribution). USE_TWISTED Add dependency on twistedCore. The list of required components can be specified as a value of this variable. Example: web lore pair flow USE_ZOPE Add dependency on Zope, a web application platform. Change Python dependency to Python 2.3. Set ZOPEBASEDIR containing a directory with Zope installation.
A complete list of available variables can be found in /usr/ports/Mk/bsd.python.mk.
Using Emacs This section is yet to be written. Using Ruby Useful variables for ports that use Ruby Variable Description USE_RUBY The port requires Ruby. USE_RUBY_EXTCONF The port uses extconf.rb to configure. USE_RUBY_SETUP The port uses setup.rb to configure. RUBY_SETUP Set to the alternative name of setup.rb. Common value is install.rb.
The following table shows the selected variables available to port authors via the ports infrastructure. These variables should be used to install files into their proper locations. Use them in pkg-plist as much as possible. These variables should not be redefined in the port. Selected read-only variables for ports that use Ruby Variable Description Example value RUBY_PKGNAMEPREFIX Used as a PKGNAMEPREFIX to distinguish packages for different Ruby versions. ruby18- RUBY_VERSION Full version of Ruby in the form of x.y.z. 1.8.2 RUBY_SITELIBDIR Architecture independent libraries installation path. /usr/local/lib/ruby/site_ruby/1.8 RUBY_SITEARCHILIBDIR Architecture dependent libraries installation path. /usr/local/lib/ruby/site_ruby/1.8/amd64-freebsd6 RUBY_MODDOCDIR Module documentation installation path. /usr/local/share/doc/ruby18/patsy RUBY_MODEXAMPLESDIR Module examples installation path. /usr/local/share/examples/ruby18/patsy
A complete list of available variables can be found in /usr/ports/Mk/bsd.ruby.mk.
Using SDL The USE_SDL variable is used to autoconfigure the dependencies for ports which use an SDL based library like devel/sdl12 and x11-toolkits/sdl_gui. The following SDL libraries are recognized at the moment: sdl: devel/sdl12 gfx: graphics/sdl_gfx gui: x11-toolkits/sdl_gui image: graphics/sdl_image ldbad: devel/sdl_ldbad mixer: audio/sdl_mixer mm: devel/sdlmm net: net/sdl_net sound: audio/sdl_sound ttf: graphics/sdl_ttf Therefore, if a port has a dependency on net/sdl_net and audio/sdl_mixer, the syntax will be: USE_SDL= net mixer The dependency devel/sdl12, which is required by net/sdl_net and audio/sdl_mixer, is automatically added as well. If you use USE_SDL, it will automatically: Add a dependency on sdl12-config to BUILD_DEPENDS Add the variable SDL_CONFIG to CONFIGURE_ENV Add the dependencies of the selected libraries to the LIB_DEPENDS To check whether an SDL library is available, you can do it with the WANT_SDL variable: WANT_SDL=yes .include <bsd.port.pre.mk> .if ${HAVE_SDL:Mmixer}!="" USE_SDL+= mixer .endif .include <bsd.port.post.mk> Starting and stopping services (rc scripts) - Startup scripts are used to start services on system - startup, and to give administrator a standard way of stopping, - starting and restarting the service. Ports integrates into + rc.d scripts are used to start services on system + startup, and to give administrators a standard way of stopping, + starting and restarting the service. Ports integrate into the system rc.d framework. Details on usage can be found in - the Handbook - chapter. Detailed explanation of available commands is in - &man.rc.subr.8;. + the rc.d Handbook + chapter. Detailed explanation of available commands are in + &man.rc.8; and .&man.rc.subr.8;. One or more rc scripts can be installed: USE_RC_SUBR= doorman.sh Scripts must be placed in the files subdirectory and a .in suffix must be added to their - filename. The only difference from a base system rc script is that the - . /etc/rc.subr line must be replaced with + filename. The only difference from a base system rc.d script is that the + . /etc/rc.subr line must be replaced with the . %%RC_SUBR%%, because older versions of &os; do not have an /etc/rc.subr file. Standard - SUB_LIST expansions are used too. Especially using - %%PREFIX%% is advised. More on + SUB_LIST expansions are used too. + Use of the %%PREFIX%%, + %%LOCALBASE%%, and + %%X11BASE%% expansions is strongly encouraged as well. + More on SUB_LIST in the relevant section. - Integration with &man.rcorder.8; is available by using + Prior to &os; 6.1-RELEASE, integration with &man.rcorder.8; is available by using USE_RCORDER instead of USE_RC_SUBR. + However, use of this method is deprecated. + + As of &os; 6.1-RELEASE, local rc.d + scripts (including those installed by ports) are included in + the overall &man.rcorder.8; of the base system. - Example simple rc script: + Example simple rc.d script: #!/bin/sh # PROVIDE: doorman # REQUIRE: LOGIN -# KEYWORD: FreeBSD # -# Add the following lines to /etc/rc.conf to enable doorman: +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable doorman: # doorman_enable (bool): Set to "NO" by default. # Set it to "YES" to enable doorman # doorman_config (path): Set to "%%PREFIX%%/etc/doormand/doormand.cf" by default. # . %%RC_SUBR%% name="doorman" rcvar=`set_rcvar` load_rc_config $name : ${doorman_enable="NO"} : ${doorman_config="%%PREFIX%%/etc/doormand/doormand.cf"} command=%%PREFIX%%/sbin/doormand pidfile=/var/run/doormand.pid command_args="-p $pidfile -f $doorman_config" run_rc_command "$1" + The "=" style of default variable assignment + is preferable to the ":=" style here, since the + former sets a default value only if the variable is unset, + and the latter sets one if the variable is unset + or null. + A user might very well include something like + doorman_flags="" in their + rc.conf.local file, and a variable + substitution using ":=" would inappropriately + override the user's intention. +
Advanced <filename>pkg-plist</filename> practices Changing <filename>pkg-plist</filename> based on make variables Some ports, particularly the p5- ports, need to change their pkg-plist depending on what options they are configured with (or version of perl, in the case of p5- ports). To make this easy, any instances in the pkg-plist of %%OSREL%%, %%PERL_VER%%, and %%PERL_VERSION%% will be substituted for appropriately. The value of %%OSREL%% is the numeric revision of the operating system (e.g., 4.9). %%PERL_VERSION%% is the full version number of perl (e.g., 5.00502) and %%PERL_VER%% is the perl version number minus the patchlevel (e.g., 5.005). Several other %%VARS%% related to port's documentation files are described in the relevant section. If you need to make other substitutions, you can set the PLIST_SUB variable with a list of VAR=VALUE pairs and instances of %%VAR%% will be substituted with VALUE in the pkg-plist. For instance, if you have a port that installs many files in a version-specific subdirectory, you can put something like OCTAVE_VERSION= 2.0.13 PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION} in the Makefile and use %%OCTAVE_VERSION%% wherever the version shows up in pkg-plist. That way, when you upgrade the port, you will not have to change dozens (or in some cases, hundreds) of lines in the pkg-plist. This substitution (as well as addition of any manual pages) will be done between the pre-install and do-install targets, by reading from PLIST and writing to TMPPLIST (default: WRKDIR/.PLIST.mktmp). So if your port builds PLIST on the fly, do so in or before pre-install. Also, if your port needs to edit the resulting file, do so in post-install to a file named TMPPLIST. Another possibility to modify port's packing list is based on setting the variables PLIST_FILES and PLIST_DIRS. The value of each variable is regarded as a list of pathnames to write to TMPPLIST along with PLIST contents. Names listed in PLIST_FILES and PLIST_DIRS are subject to %%VAR%% substitution, as described above. Except for that, names from PLIST_FILES will appear in the final packing list unchanged, while @dirrm will be prepended to names from PLIST_DIRS. To take effect, PLIST_FILES and PLIST_DIRS must be set before TMPPLIST is written, i.e. in pre-install or earlier. Empty directories Cleaning up empty directories Do make your ports remove empty directories when they are de-installed. This is usually accomplished by adding @dirrm lines for all directories that are specifically created by the port. You need to delete subdirectories before you can delete parent directories. : lib/X11/oneko/pixmaps/cat.xpm lib/X11/oneko/sounds/cat.au : @dirrm lib/X11/oneko/pixmaps @dirrm lib/X11/oneko/sounds @dirrm lib/X11/oneko However, sometimes @dirrm will give you errors because other ports share the same directory. You can call rmdir from @unexec to remove only empty directories without warning. @unexec rmdir %D/share/doc/gimp 2>/dev/null || true This will neither print any error messages nor cause &man.pkg.delete.1; to exit abnormally even if PREFIX/share/doc/gimp is not empty due to other ports installing some files in there. Creating empty directories Empty directories created during port installation need special attention. They will not get created when installing the package, because packages only store the files, and &man.pkg.add.1; creates directories for them as needed. To make sure the empty directory is created when installing the package, add this line to pkg-plist above the corresponding @dirrm line: @exec mkdir -p %D/share/foo/templates Configuration files If your port requires some configuration files in PREFIX/etc, do not just install them and list them in pkg-plist. That will cause &man.pkg.delete.1; to delete files carefully edited by the user and a new installation to wipe them out. Instead, install sample files with a suffix (filename.sample will work well). Copy the sample file as the real configuration file, if it does not exist. On deinstall, delete the configuration file, but only if it was not modified by the user. You need to handle this both in the port Makefile, and in the pkg-plist (for installation from the package). Example of the Makefile part: post-install: @if [ ! -f ${PREFIX}/etc/orbit.conf ]; then \ ${CP} -p ${PREFIX}/etc/orbit.conf.sample ${PREFIX}/etc/orbit.conf ; \ fi Example of the pkg-plist part: @unexec if cmp -s %D/etc/orbit.conf.sample %D/etc/orbit.conf; then rm -f %D/etc/orbit.conf; fi etc/orbit.conf.sample @exec if [ ! -f %D/etc/orbit.conf ] ; then cp -p %D/%F %B/orbit.conf; fi Alternatively, print out a message pointing out that the user has to copy and edit the file before the software can be made to work. Dynamic vs. static package list A static package list is a package list which is available in the Ports Collection either as a pkg-plist file (with or without variable substitution), or embedded into the Makefile via PLIST_FILES and PLIST_DIRS. Even if the contents are auto-generated by a tool or a target in the Makefile before the inclusion into the Ports Collection by a committer, this is still considered a static list, since it is possible to examine it without having to download or compile the distfile. A dynamic package list is a package list which is generated at the time the port is compiled based upon the files and directories which are installed. It is not possible to examine it before the source code of the ported application is downloaded and compiled, or after running a make clean. While the use of dynamic package lists is not forbidden, maintainers should use static package lists wherever possible, as it enables users to &man.grep.1; through available ports to discover, for example, which port installs a certain file. Dynamic lists should be primarily used for complex ports where the package list changes drastically based upon optional features of the port (and thus maintaining a static package list is infeasible), or ports which change the package list based upon the version of dependent software used (e.g. ports which generate docs with Javadoc). Maintainers who prefer dynamic package lists are encouraged to add a new target to their port which generates the pkg-plist file so that users may examine the contents. - Automated package list creation + ¦Û°Ê²£¥Í package list - First, make sure your port is almost complete, with only - pkg-plist missing. + ­º¥ý¡A¥ý½T»{±zªº port °£¤F pkg-plist ©|¥¼·d©w¤§¥~¡A¨ä¥L³£§¹¦¨¤F¡C - Next, create a temporary directory tree into which your port can be + ±µµÛ¡A create a temporary directory tree into which your port can be installed, and install any dependencies. port-type should be local for non-X ports and x11-4 or x11 for ports which install into the directory hierarchy of XFree86 4 or an earlier XFree86 release, respectively. &prompt.root; mkdir /var/tmp/port-name &prompt.root; mtree -U -f /etc/mtree/BSD.port-type.dist -d -e -p /var/tmp/port-name &prompt.root; make depends PREFIX=/var/tmp/port-name Store the directory structure in a new file. &prompt.root; (cd /var/tmp/port-name && find -d * -type d) | sort > OLD-DIRS Create an empty pkg-plist file: &prompt.root; touch pkg-plist If your port honors PREFIX (which it should) you can then install the port and create the package list. &prompt.root; make install PREFIX=/var/tmp/port-name &prompt.root; (cd /var/tmp/port-name && find -d * \! -type d) | sort > pkg-plist You must also add any newly created directories to the packing list. &prompt.root; (cd /var/tmp/port-name && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' >> pkg-plist Finally, you need to tidy up the packing list by hand; it is not all automated. Manual pages should be listed in the port's Makefile under MANn, and not in the package list. User configuration files should be removed, or installed as filename.sample. The info/dir file should not be listed and appropriate install-info lines should be added as noted in the info files section. Any libraries installed by the port should be listed as specified in the shared libraries section. Alternatively, use the plist script in /usr/ports/Tools/scripts/ to build the package list automatically. The first step is the same as above: take the first three lines, that is, mkdir, mtree and make depends. Then build and install the port: &prompt.root; make install PREFIX=/var/tmp/port-name And let plist create the pkg-plist file: &prompt.root; /usr/ports/Tools/scripts/plist -Md -m /etc/mtree/BSD.port-type.dist /var/tmp/port-name > pkg-plist The packing list still has to be tidied up by hand as stated above. The <filename>pkg-<replaceable>*</replaceable></filename> files There are some tricks we have not mentioned yet about the pkg-* files that come in handy sometimes. <filename>pkg-message</filename> If you need to display a message to the installer, you may place the message in pkg-message. This capability is often useful to display additional installation steps to be taken after a &man.pkg.add.1; or to display licensing information. The pkg-message file does not need to be added to pkg-plist. Also, it will not get automatically printed if the user is using the port, not the package, so you should probably display it from the post-install target yourself. <filename>pkg-install</filename> If your port needs to execute commands when the binary package is installed with &man.pkg.add.1; you can do this via the pkg-install script. This script will automatically be added to the package, and will be run twice by &man.pkg.add.1;: the first time as ${SH} pkg-install ${PKGNAME} PRE-INSTALL and the second time as ${SH} pkg-install ${PKGNAME} POST-INSTALL. $2 can be tested to determine which mode the script is being run in. The PKG_PREFIX environmental variable will be set to the package installation directory. See &man.pkg.add.1; for additional information. This script is not run automatically if you install the port with make install. If you are depending on it being run, you will have to explicitly call it from your port's Makefile, with a line like PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL. <filename>pkg-deinstall</filename> This script executes when a package is removed. This script will be run twice by &man.pkg.delete.1;. The first time as ${SH} pkg-deinstall ${PKGNAME} DEINSTALL and the second time as ${SH} pkg-deinstall ${PKGNAME} POST-DEINSTALL. <filename>pkg-req</filename> If your port needs to determine if it should install or not, you can create a pkg-req requirements script. It will be invoked automatically at installation/de-installation time to determine whether or not installation/de-installation should proceed. The script will be run at installation time by &man.pkg.add.1; as pkg-req ${PKGNAME} INSTALL. At de-installation time it will be run by &man.pkg.delete.1; as pkg-req ${PKGNAME} DEINSTALL. Changing the names of <filename>pkg-<replaceable>*</replaceable></filename> files All the names of pkg-* files are defined using variables so you can change them in your Makefile if need be. This is especially useful when you are sharing the same pkg-* files among several ports or have to write to one of the above files (see writing to places other than WRKDIR for why it is a bad idea to write directly into the pkg-* subdirectory). Here is a list of variable names and their default values. (PKGDIR defaults to ${MASTERDIR}.) Variable Default value DESCR ${PKGDIR}/pkg-descr PLIST ${PKGDIR}/pkg-plist PKGINSTALL ${PKGDIR}/pkg-install PKGDEINSTALL ${PKGDIR}/pkg-deinstall PKGREQ ${PKGDIR}/pkg-req PKGMESSAGE ${PKGDIR}/pkg-message Please change these variables rather than overriding PKG_ARGS. If you change PKG_ARGS, those files will not correctly be installed in /var/db/pkg upon install from a port. Making use of <makevar>SUB_FILES</makevar> and <makevar>SUB_LIST</makevar> The SUB_FILES and SUB_LIST variables are useful for dynamic values in port files, such as the installation PREFIX in pkg-message. The SUB_FILES variable specifies a list of files to be automatically modified. Each file in the SUB_FILES list must have a corresponding file.in present in FILESDIR. A modified version will be created in WRKDIR. Files defined as a - value of USE_RC_SUBR and - USE_RCORDER are automatically added to + value of USE_RC_SUBR (or the deprecated + USE_RCORDER) + are automatically added to the SUB_FILES. For the files pkg-message, pkg-install, pkg-deinstall and pkg-reg, the corresponding Makefile variable is automatically set to point to the processed version. The SUB_LIST variable is a list of VAR=VALUE pairs. For each pair %%VAR%% will get replaced with VALUE in each file listed in SUB_FILES. Several common pairs are automatically defined: PREFIX, LOCALBASE, X11BASE, DATADIR, DOCSDIR, EXAMPLESDIR. Any line beginning with @comment will be deleted from resulting files after a variable substitution. The following example will replace %%ARCH%% with the system architecture in a pkg-message: SUB_FILES= pkg-message SUB_LIST= ARCH=${ARCH} Note that for this example, the pkg-message.in file must exist in FILESDIR. Example of a good pkg-message.in: Now it's time to configure this package. Copy %%PREFIX%%/share/examples/putsy/%%ARCH%%.conf into your home directory as .putsy.conf and edit it. Testing your port Running <command>make describe</command> Several of the &os; port maintenance tools, such as &man.portupgrade.1;, rely on a database called /usr/ports/INDEX which keeps track of such items as port dependencies. INDEX is created by the top-level ports/Makefile via make index, which descends into each port subdirectory and executes make describe there. Thus, if make describe fails in any port, no one can generate INDEX, and many people will quickly become unhappy. It is important to be able to generate this file no matter what options are present in make.conf, so please avoid doing things such as using .error statements when (for instance) a dependency is not satisfied. (See .) If make describe produces a string rather than an error message, you are probably safe. See bsd.port.mk for the meaning of the string produced. Also note that running a recent version of portlint (as specified in the next section) will cause make describe to be run automatically. Portlint Do check your work with portlint before you submit or commit it. portlint warns you about many common errors, both functional and stylistic. For a new (or repocopied) port, portlint -A is the most thorough; for an existing port, portlint -C is sufficient. Since portlint uses heuristics to try to figure out errors, it can produce false positive warnings. In addition, occasionally something that is flagged as a problem really cannot be done in any other way due to limitations in the ports framework. When in doubt, the best thing to do is ask on &a.ports;. <makevar>PREFIX</makevar> Do try to make your port install relative to PREFIX. The value of this variable will be set to LOCALBASE (default /usr/local). If USE_X_PREFIX or USE_IMAKE is set, PREFIX will be X11BASE (default /usr/X11R6). If USE_LINUX_PREFIX is set, PREFIX will be LINUXBASE (default /compat/linux). Avoiding the hard-coding of /usr/local or /usr/X11R6 anywhere in the source will make the port much more flexible and able to cater to the needs of other sites. For X ports that use imake, this is automatic; otherwise, this can often be done by simply replacing the occurrences of /usr/local (or /usr/X11R6 for X ports that do not use imake) in the various scripts/Makefiles in the port to read ${PREFIX}, as this variable is automatically passed down to every stage of the build and install processes. Make sure your application is not installing things in /usr/local instead of PREFIX. A quick test for this is to do this is: &prompt.root; make clean; make package PREFIX=/var/tmp/port-name If anything is installed outside of PREFIX, the package creation process will complain that it cannot find the files. This does not test for the existence of internal references, or correct use of LOCALBASE for references to files from other ports. Testing the installation in /var/tmp/port-name to do that while you have it installed would do that. Do not set USE_X_PREFIX unless your port truly requires it (i.e., it links against X libs or it needs to reference files in X11BASE). The variable PREFIX can be reassigned in your Makefile or in the user's environment. However, it is strongly discouraged for individual ports to set this variable explicitly in the Makefiles. Also, refer to programs/files from other ports with the variables mentioned above, not explicit pathnames. For instance, if your port requires a macro PAGER to be the full pathname of less, use the compiler flag: -DPAGER=\"${LOCALBASE}/bin/less\" instead of -DPAGER=\"/usr/local/bin/less\". This way it will have a better chance of working if the system administrator has moved the whole /usr/local tree somewhere else. Upgrading When you notice that a port is out of date compared to the latest version from the original authors, you should first ensure that you have the latest port. You can find them in the ports/ports-current directory of the &os; FTP mirror sites. However, if you are working with more than a few ports, you will probably find it easier to use CVSup to keep your whole ports collection up-to-date, as described in the Handbook. This will have the added benefit of tracking all the ports' dependencies. The next step is to see if there is an update already pending. To do this, you have two options. There is a searchable interface to the FreeBSD Problem Report (PR) database (also known as GNATS). Select ports in the dropdown, and enter the name of the port. However, sometimes people forget to put the name of the port into the Synopsis field in an unambiguous fashion. In that case, you can try the FreeBSD Ports Monitoring System (also known as portsmon). This system attempts to classify port PRs by portname. To search for PRs about a particular port, use the Overview of One Port. If there is no pending PR, the next step is to send an email to the port's maintainer, as shown by make maintainer. That person may already be working on an upgrade, or have a reason to not upgrade the port right now (because of, for example, stability problems of the new version); you would not want to duplicate their work. Note that unmaintained ports are listed with a maintainer of ports@FreeBSD.org, which is just the general ports mailing list, so sending mail there probably will not help in this case. If the maintainer asks you to do the upgrade or there is no maintainer, then you have a chance to help out &os; by preparing the update yourself! Please make the changes and save the result of the recursive diff output of the new and old ports directories (e.g., if your modified port directory is called superedit and the original is in our tree as superedit.bak, then save the result of diff -ruN superedit.bak superedit). Either unified or context diff is fine, but port committers generally prefer unified diffs. Note the use of the -N option—this is the accepted way to force diff to properly deal with the case of new files being added or old files being deleted. Before sending us the diff, please examine the output to make sure all the changes make sense. To simplify common operations with patch files, you can use /usr/ports/Tools/scripts/patchtool.py. Before using it, please read /usr/ports/Tools/scripts/README.patchtool. If the port is unmaintained, and you are actively using it yourself, please consider volunteering to become its maintainer. &os; has over 2000 ports without maintainers, and this is an area where more volunteers are always needed. (For a detailed description of the responsibilities of maintainers, refer to the MAINTAINER on Makefiles section.) The best way to send us the diff is by including it via &man.send-pr.1; (category ports). If you are volunteering to maintain the port, be sure to put [maintainer update] at the beginning of your synopsis line and set the Class of your PR to maintainer-update. Otherwise, the Class of your PR should be change-request. Please mention any added or deleted files in the message, as they have to be explicitly specified to &man.cvs.1; when doing a commit. If the diff is more than about 20KB, please compress and uuencode it; otherwise, just include it in the PR as is. Before you &man.send-pr.1;, you should review the Writing the problem report section in the Problem Reports article; it contains far more information about how to write useful problem reports. If your upgrade is motivated by security concerns or a serious fault in the currently committed port, please notify the &a.portmgr; to request immediate rebuilding and redistribution of your port's package. Unsuspecting users of &man.pkg.add.1; will otherwise continue to install the old version via pkg_add -r for several weeks. Once again, please use &man.diff.1; and not &man.shar.1; to send updates to existing ports! Now that you have done all that, you will want to read about how to keep up-to-date in . Ports security Why security is so important Bugs are occasionally introduced to the software. Arguably, the most dangerous of them are those opening security vulnerabilities. From the technical viewpoint, such vulnerabilities are to be closed by exterminating the bugs that caused them. However, the policies for handling mere bugs and security vulnerabilities are very different. A typical small bug affects only those users who have enabled some combination of options triggering the bug. The developer will eventually release a patch followed by a new version of the software, free of the bug, but the majority of users will not take the trouble of upgrading immediately because the bug has never vexed them. A critical bug that may cause data loss represents a graver issue. Nevertheless, prudent users know that a lot of possible accidents, besides software bugs, are likely to lead to data loss, and so they make backups of important data; in addition, a critical bug will be discovered really soon. A security vulnerability is all different. First, it may remain unnoticed for years because often it does not cause software malfunction. Second, a malicious party can use it to gain unauthorized access to a vulnerable system, to destroy or alter sensitive data; and in the worst case the user will not even notice the harm caused. Third, exposing a vulnerable system often assists attackers to break into other systems that could not be compromised otherwise. Therefore closing a vulnerability alone is not enough: the audience should be notified of it in most clear and comprehensive manner, which will allow to evaluate the danger and take appropriate actions. Fixing security vulnerabilities While on the subject of ports and packages, a security vulnerability may initially appear in the original distribution or in the port files. In the former case, the original software developer is likely to release a patch or a new version instantly, and you will only need to update the port promptly with respect to the author's fix. If the fix is delayed for some reason, you should either mark the port as FORBIDDEN or introduce a patch file of your own to the port. In the case of a vulnerable port, just fix the port as soon as possible. In either case, the standard procedure for submitting your change should be followed unless you have rights to commit it directly to the ports tree. Being a ports committer is not enough to commit to an arbitrary port. Remember that ports usually have maintainers, whom you should respect. Please make sure that the port's revision is bumped as soon as the vulnerability has been closed. That is how the users who upgrade installed packages on a regular basis will see they need to run an update. Besides, a new package will be built and distributed over FTP and WWW mirrors, replacing the vulnerable one. PORTREVISION should be bumped unless PORTVERSION has changed in the course of correcting the vulnerability. That is you should bump PORTREVISION if you have added a patch file to the port, but you should not if you have updated the port to the latest software version and thus already touched PORTVERSION. Please refer to the corresponding section for more information. Keeping the community informed The VuXML database A very important and urgent step to take as early as a security vulnerability is discovered is to notify the community of port users about the jeopardy. Such notification serves two purposes. First, should the danger be really severe, it will be wise to apply an instant workaround, e.g., stop the affected network service or even deinstall the port completely, until the vulnerability is closed. Second, a lot of users tend to upgrade installed packages just occasionally. They will know from the notification that they must update the package without delay as soon as a corrected version is available. Given the huge number of ports in the tree, a security advisory cannot be issued on each incident without creating a flood and losing the attention of the audience by the time it comes to really serious matters. Therefore security vulnerabilities found in ports are recorded in the FreeBSD VuXML database. The Security Officer Team members are monitoring it for issues requiring their intervention. If you have committer rights, you can update the VuXML database by yourself. So you will both help the Security Officer Team and deliver the crucial information to the community earlier. However, if you are not a committer, or you believe you have found an exceptionally severe vulnerability, or whatever, please do not hesitate to contact the Security Officer Team directly as described on the FreeBSD Security Information page. All right, you elected the hard way. As it may be obvious from its title, the VuXML database is essentially an XML document. Its source file vuln.xml is kept right inside the port security/vuxml. Therefore the file's full pathname will be PORTSDIR/security/vuxml/vuln.xml. Each time you discover a security vulnerability in a port, please add an entry for it to that file. Until you are familiar with VuXML, the best thing you can do is to find an existing entry fitting your case, then copy it and use as a template. A short introduction to VuXML The full-blown XML is complex and far beyond the scope of this book. However, to gain basic insight on the structure of a VuXML entry, you need only the notion of tags. XML tag names are enclosed in angle brackets. Each opening <tag> must have a matching closing </tag>. Tags may be nested. If nesting, the inner tags must be closed before the outer ones. There is a hierarchy of tags, i.e. more complex rules of nesting them. Sounds very similar to HTML, doesn't it? The major difference is that XML is eXtensible, i.e. based on defining custom tags. Due to its intrinsic structure, XML puts otherwise amorphous data into shape. VuXML is particularly tailored to mark up descriptions of security vulnerabilities. Now let's consider a realistic VuXML entry: <vuln vid="f4bc80f4-da62-11d8-90ea-0004ac98a7b9"> <topic>Several vulnerabilities found in Foo</topic> <affects> <package> <name>foo</name> <name>foo-devel</name> <name>ja-foo</name> <range><ge>1.6</ge><lt>1.9</lt></range> <range><ge>2.*</ge><lt>2.4_1</lt></range> <range><eq>3.0b1</eq></range> </package> <package> <name>openfoo</name> <range><lt>1.10_7</lt></range> <range><ge>1.2,1</ge><lt>1.3_1,1</lt></range> </package> </affects> <description> <body xmlns="http://www.w3.org/1999/xhtml"> <p>J. Random Hacker reports:</p> <blockquote cite="http://j.r.hacker.com/advisories/1"> <p>Several issues in the Foo software may be exploited via carefully crafted QUUX requests. These requests will permit the injection of Bar code, mumble theft, and the readability of the Foo administrator account.</p> </blockquote> </body> </description> <references> <freebsdsa>SA-10:75.foo</freebsdsa> <freebsdpr>ports/987654</freebsdpr> <cvename>CAN-2010-0201</cvename> <cvename>CAN-2010-0466</cvename> <bid>96298</bid> <certsa>CA-2010-99</certsa> <certvu>740169</certvu> <uscertsa>SA10-99A</uscertsa> <uscertta>SA10-99A</uscertta> <mlist msgid="201075606@hacker.com">http://marc.theaimsgroup.com/?l=bugtraq&amp;m=203886607825605</mlist> <url>http://j.r.hacker.com/advisories/1</url> </references> <dates> <discovery>2010-05-25</discovery> <entry>2010-07-13</entry> <modified>2010-09-17</entry> </dates> </vuln> The tag names are supposed to be self-descriptive, so we shall take a closer look only at fields you will need to fill in by yourself: This is the top-level tag of a VuXML entry. It has a mandatory attribute, vid, specifying a universally unique identifier (UUID) for this entry (in quotes). You should generate a UUID for each new VuXML entry (and do not forget to substitute it for the template UUID unless you are writing the entry from scratch). You can use &man.uuidgen.1; in FreeBSD 5.x, or you may install the port devel/p5-Data-UUID and issue the following command: perl -MData::UUID -le 'print lc new Data::UUID->create_str' This is a one-line description of the issue found. The names of packages affected are listed there. Multiple names can be given since several packages may be based on a single master port or software product. This may include stable and development branches, localized versions, and slave ports featuring different choices of important build-time configuration options. It is your responsibility to find all such related packages when writing a VuXML entry. Keep in mind that make search name=foo is your friend. The primary points to look for are as follows: the foo-devel variant for a foo port; other variants with a suffix like -a4 (for print-related packages), -without-gui (for packages with X support disabled), or similar; jp-, ru-, zh-, and other possible localized variants in the corresponding national categories of the ports collection. Affected versions of the package(s) are specified there as one or more ranges using a combination of <lt>, <le>, <eq>, <ge>, and <gt> elements. The version ranges given should not overlap. In a range specification, * (asterisk) denotes the smallest version number. In particular, 2.* is less than 2.a. Therefore an asterisk may be used for a range to match all possible alpha, beta, and RC versions. For instance, <ge>2.*</ge><lt>3.*</lt> will selectively match every 2.x version while <ge>2.0</ge><lt>3.0</lt> will obviously not since the latter misses 2.r3 and matches 3.b. The above example specifies that affected are versions from 1.6 to 1.9 inclusive, versions 2.x before 2.4_1, and version 3.0b1. Several related package groups (essentially, ports) can be listed in the <affected> section. This can be used if several software products (say FooBar, FreeBar and OpenBar) grow from the same code base and still share its bugs and vulnerabilities. Note the difference from listing multiple names within a single <package> section. The version ranges should allow for PORTEPOCH and PORTREVISION if applicable. Please remember that according to the collation rules, a version with a non-zero PORTEPOCH is greater than any version without PORTEPOCH, e.g., 3.0,1 is greater than 3.1 or even than 8.9. This is a summary of the issue. XHTML is used in this field. At least enclosing <p> and </p> should appear. More complex mark-up may be used, but only for the sake of accuracy and clarity: No eye candy please. This section contains references to relevant documents. As many references as apply are encouraged. This is a FreeBSD security advisory. This is a FreeBSD problem report. This is a Mitre CVE identifier. This is a SecurityFocus Bug ID. This is a US-CERT security advisory. This is a US-CERT vulnerability note. This is a US-CERT Cyber Security Alert. This is a US-CERT Technical Cyber Security Alert. This is a URL to an archived posting in a mailing list. The attribute msgid is optional and may specify the message ID of the posting. This is a generic URL. It should be used only if none of the other reference categories apply. This is the date when the issue was disclosed (YYYY-MM-DD). This is the date when the entry was added (YYYY-MM-DD). This is the date when any information in the entry was last modified (YYYY-MM-DD). New entries must not include this field. It should be added upon editing an existing entry. Testing your changes to the VuXML database Assume you just wrote or filled in an entry for a vulnerability in the package clamav that has been fixed in version 0.65_7. As a prerequisite, you need to install fresh versions of the ports security/portaudit and security/portaudit-db. First, check whether there already is an entry for this vulnerability. If there were such entry, it would match the previous version of the package, 0.65_6: &prompt.user; packaudit &prompt.user; portaudit clamav-0.65_6 To run packaudit, you must have permission to write to its DATABASEDIR, typically /var/db/portaudit. If there is none found, you get the green light to add a new entry for this vulnerability. Now you can generate a brand-new UUID (assume it's 74a9541d-5d6c-11d8-80e3-0020ed76ef5a) and add your new entry to the VuXML database. Please verify its syntax after that as follows: &prompt.user; cd ${PORTSDIR}/security/vuxml && make validate You will need at least one of the following packages installed: textproc/libxml2, textproc/jade. Now rebuild the portaudit database from the VuXML file: &prompt.user; packaudit To verify that the <affected> section of your entry will match correct package(s), issue the following command: &prompt.user; portaudit -f /usr/ports/INDEX -r 74a9541d-5d6c-11d8-80e3-0020ed76ef5a Please refer to &man.portaudit.1; for better understanding of the command syntax. Make sure that your entry produces no spurious matches in the output. Now check whether the right package versions are matched by your entry: &prompt.user; portaudit clamav-0.65_6 clamav-0.65_7 Affected package: clamav-0.65_6 (matched by clamav<0.65_7) Type of problem: clamav remote denial-of-service. Reference: <http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-0020ed76ef5a.html> 1 problem(s) found. Obviously, the former version should match while the latter one should not. Finally, verify whether the web page generated from the VuXML database looks like expected: &prompt.user; mkdir -p ~/public_html/portaudit &prompt.user; packaudit &prompt.user; lynx ~/public_html/portaudit/74a9541d-5d6c-11d8-80e3-0020ed76ef5a.html If VuXML still scares you... As an easy alternative to writing VuXML, you may opt to add a single line to a different file with much simpler syntax, PORTSDIR/security/portaudit-db/database/portaudit.txt, which resides within the port security/portaudit-db, and send a request for review to the Security Officer Team as described on the FreeBSD Security Information page. A line in that file consists of four fields separated by |, a pipe character. The first field is a &man.pkg.version.1; pattern expression matching the vulnerable packages. The second field contains URLs to relevant information, separated by space characters. The third field is a one-line description of the issue. The fourth and last field is the entry's UUID. You may want take a closer look at existing entries in portaudit.txt before adding your first line to that file. Dos and Don'ts Introduction Here is a list of common dos and don'ts that you encounter during the porting process. You should check your own port against this list, but you can also check ports in the PR database that others have submitted. Submit any comments on ports you check as described in Bug Reports and General Commentary. Checking ports in the PR database will both make it faster for us to commit them, and prove that you know what you are doing. Stripping Binaries Do not strip binaries manually unless you have to. All binaries should be stripped, but the INSTALL_PROGRAM macro will install and strip a binary at the same time (see the next section). If you need to strip a file, but do not wish to use the INSTALL_PROGRAM macro, ${STRIP_CMD} will strip your program. This is typically done within the post-install target. For example: post-install: ${STRIP_CMD} ${PREFIX}/bin/xdl Use the &man.file.1; command on the installed executable to check whether the binary is stripped or not. If it does not say not stripped, it is stripped. Additionally, &man.strip.1; will not strip a previously stripped program; it will instead exit cleanly. INSTALL_* macros Do use the macros provided in bsd.port.mk to ensure correct modes and ownership of files in your own *-install targets. INSTALL_PROGRAM is a command to install binary executables. INSTALL_SCRIPT is a command to install executable scripts. INSTALL_DATA is a command to install sharable data. INSTALL_MAN is a command to install manpages and other documentation (it does not compress anything). These are basically the install command with all the appropriate flags. See below for an example on how to use them. <makevar>WRKDIR</makevar> Do not write anything to files outside WRKDIR. WRKDIR is the only place that is guaranteed to be writable during the port build (see installing ports from a CDROM for an example of building ports from a read-only tree). If you need to modify one of the pkg-* files, do so by redefining a variable, not by writing over it. <makevar>WRKDIRPREFIX</makevar> Make sure your port honors WRKDIRPREFIX. Most ports do not have to worry about this. In particular, if you are referring to a WRKDIR of another port, note that the correct location is WRKDIRPREFIXPORTSDIR/subdir/name/work not PORTSDIR/subdir/name/work or .CURDIR/../../subdir/name/work or some such. Also, if you are defining WRKDIR yourself, make sure you prepend ${WRKDIRPREFIX}${.CURDIR} in the front. Differentiating operating systems and OS versions You may come across code that needs modifications or conditional compilation based upon what version of Unix it is running under. If you need to make such changes to the code for conditional compilation, make sure you make the changes as general as possible so that we can back-port code to older FreeBSD systems and cross-port to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD, NetBSD, and OpenBSD. The preferred way to tell 4.3BSD/Reno (1990) and newer versions of the BSD code apart is by using the BSD macro defined in sys/param.h. Hopefully that file is already included; if not, add the code: #if (defined(__unix__) || defined(unix)) && !defined(USG) #include <sys/param.h> #endif to the proper place in the .c file. We believe that every system that defines these two symbols has sys/param.h. If you find a system that does not, we would like to know. Please send mail to the &a.ports;. Another way is to use the GNU Autoconf style of doing this: #ifdef HAVE_SYS_PARAM_H #include <sys/param.h> #endif Do not forget to add -DHAVE_SYS_PARAM_H to the CFLAGS in the Makefile for this method. Once you have sys/param.h included, you may use: #if (defined(BSD) && (BSD >= 199103)) to detect if the code is being compiled on a 4.3 Net2 code base or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386 1.1 and below). Use: #if (defined(BSD) && (BSD >= 199306)) to detect if the code is being compiled on a 4.4 code base or newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or above). The value of the BSD macro is 199506 for the 4.4BSD-Lite2 code base. This is stated for informational purposes only. It should not be used to distinguish between versions of FreeBSD based only on 4.4-Lite vs. versions that have merged in changes from 4.4-Lite2. The __FreeBSD__ macro should be used instead. Use sparingly: __FreeBSD__ is defined in all versions of FreeBSD. Use it if the change you are making only affects FreeBSD. Porting gotchas like the use of sys_errlist[] vs strerror() are Berkeley-isms, not FreeBSD changes. In FreeBSD 2.x, __FreeBSD__ is defined to be 2. In earlier versions, it is 1. Later versions always bump it to match their major version number. If you need to tell the difference between a FreeBSD 1.x system and a FreeBSD 2.x or above system, usually the right answer is to use the BSD macros described above. If there actually is a FreeBSD specific change (such as special shared library options when using ld) then it is OK to use __FreeBSD__ and #if __FreeBSD__ > 1 to detect a FreeBSD 2.x and later system. If you need more granularity in detecting FreeBSD systems since 2.0-RELEASE you can use the following: #if __FreeBSD__ >= 2 #include <osreldate.h> # if __FreeBSD_version >= 199504 /* 2.0.5+ release specific code here */ # endif #endif In the hundreds of ports that have been done, there have only been one or two cases where __FreeBSD__ should have been used. Just because an earlier port screwed up and used it in the wrong place does not mean you should do so too. - __FreeBSD_version values + FreeBSD ª©¥»³t¬dªí(__FreeBSD_version) - Here is a convenient list of - __FreeBSD_version values as defined in - sys/param.h: + ¥H¤U¬O sys/param.h ¤ºªº __FreeBSD_version ª©¥»³t¬dªí¡G __FreeBSD_version values Release __FreeBSD_version 2.0-RELEASE 119411 2.1-CURRENT 199501, 199503 2.0.5-RELEASE 199504 2.2-CURRENT before 2.1 199508 2.1.0-RELEASE 199511 2.2-CURRENT before 2.1.5 199512 2.1.5-RELEASE 199607 2.2-CURRENT before 2.1.6 199608 2.1.6-RELEASE 199612 2.1.7-RELEASE 199612 2.2-RELEASE 220000 2.2.1-RELEASE 220000 (no change) 2.2-STABLE after 2.2.1-RELEASE 220000 (no change) 2.2-STABLE after texinfo-3.9 221001 2.2-STABLE after top 221002 2.2.2-RELEASE 222000 2.2-STABLE after 2.2.2-RELEASE 222001 2.2.5-RELEASE 225000 2.2-STABLE after 2.2.5-RELEASE 225001 2.2-STABLE after ldconfig -R merge 225002 2.2.6-RELEASE 226000 2.2.7-RELEASE 227000 2.2-STABLE after 2.2.7-RELEASE 227001 2.2-STABLE after &man.semctl.2; change 227002 2.2.8-RELEASE 228000 2.2-STABLE after 2.2.8-RELEASE 228001 3.0-CURRENT before &man.mount.2; change 300000 3.0-CURRENT after &man.mount.2; change 300001 3.0-CURRENT after &man.semctl.2; change 300002 3.0-CURRENT after ioctl arg changes 300003 3.0-CURRENT after ELF conversion 300004 3.0-RELEASE 300005 3.0-CURRENT after 3.0-RELEASE 300006 3.0-STABLE after 3/4 branch 300007 3.1-RELEASE 310000 3.1-STABLE after 3.1-RELEASE 310001 3.1-STABLE after C++ constructor/destructor order change 310002 3.2-RELEASE 320000 3.2-STABLE 320001 3.2-STABLE after binary-incompatible IPFW and socket changes 320002 3.3-RELEASE 330000 3.3-STABLE 330001 3.3-STABLE after adding &man.mkstemp.3; to libc 330002 3.4-RELEASE 340000 3.4-STABLE 340001 3.5-RELEASE 350000 3.5-STABLE 350001 4.0-CURRENT after 3.4 branch 400000 4.0-CURRENT after change in dynamic linker handling 400001 4.0-CURRENT after C++ constructor/destructor order change 400002 4.0-CURRENT after functioning &man.dladdr.3; 400003 4.0-CURRENT after __deregister_frame_info dynamic linker bug fix (also 4.0-CURRENT after EGCS 1.1.2 integration) 400004 4.0-CURRENT after &man.suser.9; API change (also 4.0-CURRENT after newbus) 400005 4.0-CURRENT after cdevsw registration change 400006 4.0-CURRENT after the addition of so_cred for socket level credentials 400007 4.0-CURRENT after the addition of a poll syscall wrapper to libc_r 400008 4.0-CURRENT after the change of the kernel's dev_t type to struct specinfo pointer 400009 4.0-CURRENT after fixing a hole in &man.jail.2; 400010 4.0-CURRENT after the sigset_t datatype change 400011 4.0-CURRENT after the cutover to the GCC 2.95.2 compiler 400012 4.0-CURRENT after adding pluggable linux-mode ioctl handlers 400013 4.0-CURRENT after importing OpenSSL 400014 4.0-CURRENT after the C++ ABI change in GCC 2.95.2 from -fvtable-thunks to -fno-vtable-thunks by default 400015 4.0-CURRENT after importing OpenSSH 400016 4.0-RELEASE 400017 4.0-STABLE after 4.0-RELEASE 400018 4.0-STABLE after the introduction of delayed checksums. 400019 4.0-STABLE after merging libxpg4 code into libc. 400020 4.0-STABLE after upgrading Binutils to 2.10.0, ELF branding changes, and tcsh in the base system. 400021 4.1-RELEASE 410000 4.1-STABLE after 4.1-RELEASE 410001 4.1-STABLE after &man.setproctitle.3; moved from libutil to libc. 410002 4.1.1-RELEASE 411000 4.1.1-STABLE after 4.1.1-RELEASE 411001 4.2-RELEASE 420000 4.2-STABLE after combining libgcc.a and libgcc_r.a, and associated GCC linkage changes. 420001 4.3-RELEASE 430000 4.3-STABLE after wint_t introduction. 430001 4.3-STABLE after PCI powerstate API merge. 430002 4.4-RELEASE 440000 4.4-STABLE after d_thread_t introduction. 440001 4.4-STABLE after mount structure changes (affects filesystem klds). 440002 4.4-STABLE after the userland components of smbfs were imported. 440003 4.5-RELEASE 450000 4.5-STABLE after the usb structure element rename. 450001 4.5-STABLE after the sendmail_enable &man.rc.conf.5; variable was made to take the value NONE. 450004 4.5-STABLE after moving to XFree86 4 by default for package builds. 450005 4.5-STABLE after accept filtering was fixed so that is no longer susceptible to an easy DoS. 450006 4.6-RELEASE 460000 4.6-STABLE &man.sendfile.2; fixed to comply with documentation, not to count any headers sent against the amount of data to be sent from the file. 460001 4.6.2-RELEASE 460002 4.6-STABLE 460100 4.6-STABLE after MFC of `sed -i'. 460101 4.6-STABLE after MFC of many new pkg_install features from the HEAD. 460102 4.7-RELEASE 470000 4.7-STABLE 470100 Start generated __std{in,out,err}p references rather than __sF. This changes std{in,out,err} from a compile time expression to a runtime one. 470101 4.7-STABLE after MFC of mbuf changes to replace m_aux mbufs by m_tag's 470102 4.7-STABLE gets OpenSSL 0.9.7 470103 4.8-RELEASE 480000 4.8-STABLE 480100 4.8-STABLE after &man.realpath.3; has been made thread-safe 480101 4.8-STABLE 3ware API changes to twe. 480102 4.9-RELEASE 490000 4.9-STABLE 490100 4.9-STABLE after e_sid was added to struct kinfo_eproc. 490101 4.9-STABLE after MFC of libmap functionality for rtld. 490102 4.10-RELEASE 491000 4.10-STABLE 491100 4.10-STABLE after MFC of revision 20040629 of the package tools 491101 4.10-STABLE after VM fix dealing with unwiring of fictitious pages 491102 4.11-RELEASE 492000 4.11-STABLE 492100 5.0-CURRENT 500000 5.0-CURRENT after adding addition ELF header fields, and changing our ELF binary branding method. 500001 5.0-CURRENT after kld metadata changes. 500002 5.0-CURRENT after buf/bio changes. 500003 5.0-CURRENT after binutils upgrade. 500004 5.0-CURRENT after merging libxpg4 code into libc and after TASKQ interface introduction. 500005 5.0-CURRENT after the addition of AGP interfaces. 500006 5.0-CURRENT after Perl upgrade to 5.6.0 500007 5.0-CURRENT after the update of KAME code to 2000/07 sources. 500008 5.0-CURRENT after ether_ifattach() and ether_ifdetach() changes. 500009 5.0-CURRENT after changing mtree defaults back to original variant, adding -L to follow symlinks. 500010 5.0-CURRENT after kqueue API changed. 500011 5.0-CURRENT after &man.setproctitle.3; moved from libutil to libc. 500012 5.0-CURRENT after the first SMPng commit. 500013 5.0-CURRENT after <sys/select.h> moved to <sys/selinfo.h>. 500014 5.0-CURRENT after combining libgcc.a and libgcc_r.a, and associated GCC linkage changes. 500015 5.0-CURRENT after change allowing libc and libc_r to be linked together, deprecating -pthread option. 500016 5.0-CURRENT after switch from struct ucred to struct xucred to stabilize kernel-exported API for mountd et al. 500017 5.0-CURRENT after addition of CPUTYPE make variable for controlling CPU-specific optimizations. 500018 5.0-CURRENT after moving machine/ioctl_fd.h to sys/fdcio.h 500019 5.0-CURRENT after locale names renaming. 500020 5.0-CURRENT after Bzip2 import. Also signifies removal of S/Key. 500021 5.0-CURRENT after SSE support. 500022 5.0-CURRENT after KSE Milestone 2. 500023 5.0-CURRENT after d_thread_t, and moving UUCP to ports. 500024 5.0-CURRENT after ABI change for descriptor and creds passing on 64 bit platforms. 500025 5.0-CURRENT after moving to XFree86 4 by default for package builds, and after the new libc strnstr() function was added. 500026 5.0-CURRENT after the new libc strcasestr() function was added. 500027 5.0-CURRENT after the userland components of smbfs were imported. 500028 5.0-CURRENT after the new C99 specific-width integer types were added. (Not incremented.) 5.0-CURRENT after a change was made in the return value of &man.sendfile.2;. 500029 5.0-CURRENT after the introduction of the type fflags_t, which is the appropriate size for file flags. 500030 5.0-CURRENT after the usb structure element rename. 500031 5.0-CURRENT after the introduction of Perl 5.6.1. 500032 5.0-CURRENT after the sendmail_enable &man.rc.conf.5; variable was made to take the value NONE. 500033 5.0-CURRENT after mtx_init() grew a third argument. 500034 5.0-CURRENT with Gcc 3.1. 500035 5.0-CURRENT without Perl in /usr/src 500036 5.0-CURRENT after the addition of &man.dlfunc.3; 500037 5.0-CURRENT after the types of some struct sockbuf members were changed and the structure was reordered. 500038 5.0-CURRENT after GCC 3.2.1 import. Also after headers stopped using _BSD_FOO_T_ and started using _FOO_T_DECLARED. This value can also be used as a conservative estimate of the start of &man.bzip2.1; package support. 500039 5.0-CURRENT after various changes to disk functions were made in the name of removing dependency on disklabel structure internals. 500040 5.0-CURRENT after the addition of &man.getopt.long.3; to libc. 500041 5.0-CURRENT after Binutils 2.13 upgrade, which included new FreeBSD emulation, vec, and output format. 500042 5.0-CURRENT after adding weak pthread_XXX stubs to libc, obsoleting libXThrStub.so. 5.0-RELEASE. 500043 5.0-CURRENT after branching for RELENG_5_0 500100 <sys/dkstat.h> is empty and should not be included. 500101 5.0-CURRENT after the d_mmap_t interface change. 500102 5.0-CURRENT after taskqueue_swi changed to run without Giant, and taskqueue_swi_giant added to run with Giant. 500103 cdevsw_add() and cdevsw_remove() no longer exists. Appearance of MAJOR_AUTO allocation facility. 500104 5.0-CURRENT after new cdevsw initialization method. 500105 devstat_add_entry() has been replaced by devstat_new_entry() 500106 Devstat interface change; see sys/sys/param.h 1.149 500107 Token-Ring interface changes. 500108 Addition of vm_paddr_t. 500109 5.0-CURRENT after &man.realpath.3; has been made thread-safe 500110 5.0-CURRENT after &man.usbhid.3; has been synced with NetBSD 500111 5.0-CURRENT after new NSS implementation and addition of POSIX.1 getpw*_r, getgr*_r functions 500112 5.0-CURRENT after removal of the old rc system. 500113 5.1-RELEASE. 501000 5.1-CURRENT after branching for RELENG_5_1. 501100 5.1-CURRENT after correcting the semantics of sigtimedwait(2) and sigwaitinfo(2). 501101 5.1-CURRENT after adding the lockfunc and lockfuncarg fields to &man.bus.dma.tag.create.9;. 501102 5.1-CURRENT after GCC 3.3.1-pre 20030711 snapshot integration. 501103 5.1-CURRENT 3ware API changes to twe. 501104 5.1-CURRENT dynamically-linked /bin and /sbin support and movement of libraries to /lib. 501105 5.1-CURRENT after adding kernel support for Coda 6.x. 501106 5.1-CURRENT after 16550 UART constants moved from <dev/sio/sioreg.h> to <dev/ic/ns16550.h>. Also when libmap functionality was unconditionally supported by rtld. 501107 5.1-CURRENT after PFIL_HOOKS API update 501108 5.1-CURRENT after adding kiconv(3) 501109 5.1-CURRENT after changing default operations for open and close in cdevsw 501110 5.1-CURRENT after changed layout of cdevsw 501111 5.1-CURRENT after adding kobj multiple inheritance 501112 5.1-CURRENT after the if_xname change in struct ifnet 501113 5.1-CURRENT after changing /bin and /sbin to be dynamically linked 501114 5.2-RELEASE 502000 5.2.1-RELEASE 502010 5.2-CURRENT after branching for RELENG_5_2 502100 5.2-CURRENT after __cxa_atexit/__cxa_finalize functions were added to libc. 502101 5.2-CURRENT after change of default thread library from libc_r to libpthread. 502102 5.2-CURRENT after device driver API megapatch. 502103 5.2-CURRENT after getopt_long_only() addition. 502104 5.2-CURRENT after NULL is made into ((void *)0) for C, creating more warnings. 502105 5.2-CURRENT after pf is linked to the build and install. 502106 5.2-CURRENT after time_t is changed to a 64-bit value on sparc64. 502107 5.2-CURRENT after Intel C/C++ compiler support in some headers and execve(2) changes to be more strictly conforming to POSIX. 502108 5.2-CURRENT after the introduction of the bus_alloc_resource_any API 502109 5.2-CURRENT after the addition of UTF-8 locales 502110 5.2-CURRENT after the removal of the getvfsent(3) API 502111 5.2-CURRENT after the addition of the .warning directive for make. 502112 5.2-CURRENT after ttyioctl() was made mandatory for serial drivers. 502113 5.2-CURRENT after import of the ALTQ framework. 502114 5.2-CURRENT after changing sema_timedwait(9) to return 0 on success and a non-zero error code on failure. 502115 5.2-CURRENT after changing kernel dev_t to be pointer to struct cdev *. 502116 5.2-CURRENT after changing kernel udev_t to dev_t. 502117 5.2-CURRENT after adding support for CLOCK_VIRTUAL and CLOCK_PROF to clock_gettime(2) and clock_getres(2). 502118 5.2-CURRENT after changing network interface cloning overhaul. 502119 5.2-CURRENT after the update of the package tools to revision 20040629. 502120 5.2-CURRENT after marking Bluetooth code as non-i386 specific. 502121 5.2-CURRENT after the introduction of the KDB debugger framework, the conversion of DDB into a backend and the introduction of the GDB backend. 502122 5.2-CURRENT after change to make VFS_ROOT take a struct thread argument as does vflush. Struct kinfo_proc now has a user data pointer. The switch of the default X implementation to xorg was also made at this time. 502123 5.2-CURRENT after the change to separate the way ports rc.d and legacy scripts are started. 502124 5.2-CURRENT after the backout of the previous change. 502125 5.2-CURRENT after the removal of kmem_alloc_pageable() and the import of gcc 3.4.2. 502126 5.2-CURRENT after changing the UMA kernel API to allow ctors/inits to fail. 502127 5.2-CURRENT after the change of the vfs_mount signature as well as global replacement of PRISON_ROOT with SUSER_ALLOWJAIL for the suser(9) API. 502128 5.3-BETA/RC before the pfil API change 503000 5.3-RELEASE 503001 5.3-STABLE after branching for RELENG_5_3 503100 5.3-STABLE after addition of glibc style &man.strftime.3; padding options. 503101 5.3-STABLE after OpenBSD's nc(1) import MFC. 503102 5.4-PRERELEASE after the MFC of the fixes in <src/include/stdbool.h> and <src/sys/i386/include/_types.h> for using the GCC-compatibility of the Intel C/C++ compiler. 503103 5.4-PRERELEASE after the MFC of the change of ifi_epoch from wall clock time to uptime. 503104 5.4-PRERELEASE after the MFC of the fix of EOVERFLOW check in vswprintf(3). 503105 5.4-RELEASE. 504000 5.4-STABLE after branching for RELENG_5_4 504100 5.4-STABLE after increasing the default thread stacksizes 504101 5.4-STABLE after the addition of sha256 504102 5.4-STABLE after the MFC of if_bridge 504103 5.4-STABLE after the MFC of bsdiff and portsnap 504104 + + 5.4-STABLE after MFC of ldconfig_local_dirs + change. + 504105 + 6.0-CURRENT 600000 6.0-CURRENT after permanently enabling PFIL_HOOKS in the kernel. 600001 6.0-CURRENT after initial addition of ifi_epoch to struct if_data. Backed out after a few days. Do not use this value. 600002 6.0-CURRENT after the re-addition of the ifi_epoch member of struct if_data. 600003 6.0-CURRENT after addition of the struct inpcb argument to the pfil API. 600004 6.0-CURRENT after addition of the "-d DESTDIR" argument to newsyslog. 600005 6.0-CURRENT after addition of glibc style &man.strftime.3; padding options. 600006 6.0-CURRENT after addition of 802.11 framework updates. 600007 6.0-CURRENT after changes to VOP_*VOBJECT() functions and introduction of MNTK_MPSAFE flag for Giantfree filesystems. 600008 6.0-CURRENT after addition of the cpufreq framework and drivers. 600009 6.0-CURRENT after importing OpenBSD's nc(1). 600010 6.0-CURRENT after removing semblance of SVID2 matherr() support. 600011 6.0-CURRENT after increase of default thread stacks' size. 600012 6.0-CURRENT after fixes in <src/include/stdbool.h> and <src/sys/i386/include/_types.h> for using the GCC-compatibility of the Intel C/C++ compiler. 600013 6.0-CURRENT after EOVERFLOW checks in vswprintf(3) fixed. 600014 6.0-CURRENT after changing the struct if_data member, ifi_epoch, from wall clock time to uptime. 600015 6.0-CURRENT after LC_CTYPE disk format changed. 600016 6.0-CURRENT after NLS catalogs disk format changed. 600017 6.0-CURRENT after LC_COLLATE disk format changed. 600018 Installation of acpica includes into /usr/include. 600019 Addition of MSG_NOSIGNAL flag to send(2) API. 600020 Addition of fields to cdevsw 600021 Removed gtar from base system. 600022 LOCAL_CREDS, LOCAL_CONNWAIT socket options added to unix(4). 600023 &man.hwpmc.4; and related tools added to 6.0-CURRENT. 600024 struct icmphdr added to 6.0-CURRENT. 600025 pf updated to 3.7. 600026 Kernel libalias and ng_nat introduced. 600027 POSIX ttyname_r(3) made available through unistd.h and libc. 600028 6.0-CURRENT after libpcap updated to v0.9.1 alpha 096. 600029 6.0-CURRENT after importing NetBSD's if_bridge(4). 600030 6.0-CURRENT after struct ifnet was broken out of the driver softcs. 600031 6.0-CURRENT after the import of libpcap v0.9.1. 600032 6.0-STABLE after bump of all shared library versions that had not been changed since RELENG_5. 600033 6.0-STABLE after credential argument is added to dev_clone vent handler. 6.0-RELEASE. 600034 6.0-STABLE after 6.0-RELEASE 600100 6.0-STABLE after incorporating scripts from the - local_startup directories into the base rcorder. + local_startup directories into the base &man.rcorder.8;. 600101 + + 6.0-STABLE after updating the ELF types and + constants. + 600102 + + + 6.0-STABLE after MFC of pidfile(3) API. + 600103 + + + 6.0-STABLE after MFC of ldconfig_local_dirs + change. + 600104 + 7.0-CURRENT. 700000 7.0-CURRENT after bump of all shared library versions that had not been changed since RELENG_5. 700001 7.0-CURRENT after credential argument is added to dev_clone vent handler. 700002 7.0-CURRENT after memmem(3) is added to libc. 700003 7.0-CURRENT after solisten(9) kernel arguments are modified to accept a backlog paramater. 700004 7.0-CURRENT after IFP2ENADDR() was changed to return a pointer to IF_LLADDR(). 700005 7.0-CURRENT after addition of if_addr member to struct ifnet and IFP2ENADDR() removal. 700006 7.0-CURRENT after incorporating scripts from the - local_startup directories into the base rcorder. + local_startup directories into the base &man.rcorder.8;. 700007 7.0-CURRENT after removal of MNT_NODEV mount option. 700008 7.0-CURRENT after ELF-64 type changes and symbol versioning. 700009 7.0-CURRENT after addition of hostb and vgapci drivers, addition of pci_find_extcap(), and changing the AGP drivers to no longer map the aperture. 700010 + + 7-0.CURRENT after tv_sec was made time_t on + all platforms but Alpha. + 700011 + + + 7-0.CURRENT after ldconfig_local_dirs change. + 700012 +
Note that 2.2-STABLE sometimes identifies itself as 2.2.5-STABLE after the 2.2.5-RELEASE. The pattern used to be year followed by the month, but we decided to change it to a more straightforward major/minor system starting from 2.2. This is because the parallel development on several branches made it infeasible to classify the releases simply by their real release dates. If you are making a port now, you do not have to worry about old -CURRENTs; they are listed here just for your reference.
Writing something after <filename>bsd.port.mk</filename> Do not write anything after the .include <bsd.port.mk> line. It usually can be avoided by including bsd.port.pre.mk somewhere in the middle of your Makefile and bsd.port.post.mk at the end. You need to include either the bsd.port.pre.mk/bsd.port.post.mk pair or bsd.port.mk only; do not mix these two usages. bsd.port.pre.mk only defines a few variables, which can be used in tests in the Makefile, bsd.port.post.mk defines the rest. Here are some important variables defined in bsd.port.pre.mk (this is not the complete list, please read bsd.port.mk for the complete list). Variable Description ARCH The architecture as returned by uname -m (e.g., i386) OPSYS The operating system type, as returned by uname -s (e.g., FreeBSD) OSREL The release version of the operating system (e.g., 2.1.5 or 2.2.7) OSVERSION The numeric version of the operating system; the same as __FreeBSD_version. PORTOBJFORMAT The object format of the system (elf or aout; note that for modern versions of FreeBSD, aout is deprecated.) LOCALBASE The base of the local tree (e.g., /usr/local/) X11BASE The base of the X11 tree (e.g., /usr/X11R6) PREFIX Where the port installs itself (see more on PREFIX). If you have to define the variables USE_IMAKE, USE_X_PREFIX, or MASTERDIR, do so before including bsd.port.pre.mk. Here are some examples of things you can write after bsd.port.pre.mk: # no need to compile lang/perl5 if perl5 is already in system -.if ${OSVERSION} > 300003 +.if ${OSVERSION} > 300003 BROKEN= perl is in system .endif # only one shlib version number for ELF .if ${PORTOBJFORMAT} == "elf" TCL_LIB_FILE= ${TCL_LIB}.${SHLIB_MAJOR} .else TCL_LIB_FILE= ${TCL_LIB}.${SHLIB_MAJOR}.${SHLIB_MINOR} .endif # software already makes link for ELF, but not for a.out post-install: .if ${PORTOBJFORMAT} == "aout" ${LN} -sf liblinpack.so.1.0 ${PREFIX}/lib/liblinpack.so .endif You did remember to use tab instead of spaces after BROKEN= and TCL_LIB_FILE=, did you not? :-). Install additional documentation If your software has some documentation other than the standard man and info pages that you think is useful for the user, install it under PREFIX/share/doc. This can be done, like the previous item, in the post-install target. Create a new directory for your port. The directory name should reflect what the port is. This usually means PORTNAME. However, if you think the user might want different versions of the port to be installed at the same time, you can use the whole PKGNAME. Make the installation dependent on the variable NOPORTDOCS so that users can disable it in /etc/make.conf, like this: post-install: .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${DOCSDIR} .endif Here are some handy variables and how they are expanded by default when used in the Makefile: DATADIR gets expanded to PREFIX/share/PORTNAME. DOCSDIR gets expanded to PREFIX/share/doc/PORTNAME. EXAMPLESDIR gets expanded to PREFIX/share/examples/PORTNAME. These variables are exported to PLIST_SUB. Their values will appear there as pathnames relative to PREFIX if possible. That is, share/doc/PORTNAME will be substituted for %%DOCSDIR%% in the packing list by default, and so on. (See more on pkg-plist substitution here.) All documentation files and directories installed should be included in pkg-plist with the %%PORTDOCS%% prefix, for example: %%PORTDOCS%%%%DOCSDIR%%/AUTHORS %%PORTDOCS%%%%DOCSDIR%%/CONTACT %%PORTDOCS%%@dirrm %%DOCSDIR%% As an alternative to enumerating the documentation files in pkg-plist, a port can set the variable PORTDOCS to a list of file names and shell glob patterns to add to the final packing list. The names will be relative to DOCSDIR. Therefore, a port that utilizes PORTDOCS and uses a non-default location for its documentation should set DOCSDIR accordingly. If a directory is listed in PORTDOCS or matched by a glob pattern from this variable, the entire subtree of contained files and directories will be registered in the final packing list. If NOPORTDOCS is defined then files and directories listed in PORTDOCS would not be installed and neither would be added to port packing list. Installing the documentation at PORTDOCS as shown above remains up to the port itself. A typical example of utilizing PORTDOCS looks as follows: PORTDOCS= README.* ChangeLog docs/* You can also use the pkg-message file to display messages upon installation. See the section on using pkg-message for details. The pkg-message file does not need to be added to pkg-plist. Subdirectories Try to let the port put things in the right subdirectories of PREFIX. Some ports lump everything and put it in the subdirectory with the port's name, which is incorrect. Also, many ports put everything except binaries, header files and manual pages in the a subdirectory of lib, which does not work well with the BSD paradigm. Many of the files should be moved to one of the following: etc (setup/configuration files), libexec (executables started internally), sbin (executables for superusers/managers), info (documentation for info browser) or share (architecture independent files). See &man.hier.7; for details; the rules governing /usr pretty much apply to /usr/local too. The exception are ports dealing with USENET news. They may use PREFIX/news as a destination for their files. UIDs and GIDs If your port requires a certain user to be on the installed system, let the pkg-install script call pw to create it automatically. Look at net/cvsup-mirror for an example. If your port must use the same user/group ID number when it is installed as a binary package as when it was compiled, then you must choose a free UID from 50 to 999 and register it below. Look at japanese/Wnn6 for an example. Make sure you do not use a UID already used by the system or other ports. This is the current list of UIDs between 50 and 999. bind:*:53:53:Bind Sandbox:/:/sbin/nologin majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent rdfdb:*:55:55:rdfDB Daemon:/var/db/rdfdb:/bin/sh spamd:*:58:58:SpamAssassin user:/var/spool/spamd:/sbin/nologin cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent gnats:*:61:1:GNATS database owner:/usr/local/share/gnats/gnats-db:/bin/sh proxy:*:62:62:Packet Filter pseudo-user:/nonexistent:/nonexistent uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico xten:*:67:67:X-10 daemon:/usr/local/xten:/nonexistent pop:*:68:6:Post Office Owner (popper):/nonexistent:/sbin/nologin wnn:*:69:7:Wnn:/nonexistent:/nonexistent pgsql:*:70:70:PostgreSQL pseudo-user:/usr/local/pgsql:/bin/sh oracle:*:71:71::0:0:Oracle:/usr/local/oracle7:/sbin/nologin ircd:*:72:72:IRC daemon:/nonexistent:/nonexistent ircservices:*:73:73:IRC services:/nonexistent:/nonexistent simscan:*:74:74:Simscan User:/nonexistent:/sbin/nologin ifmail:*:75:66:Ifmail user:/nonexistent:/nonexistent www:*:80:80:World Wide Web Owner:/nonexistent:/sbin/nologin alias:*:81:81:QMail user:/var/qmail/alias:/nonexistent qmaild:*:82:81:QMail user:/var/qmail:/nonexistent qmaill:*:83:81:QMail user:/var/qmail:/nonexistent qmailp:*:84:81:QMail user:/var/qmail:/nonexistent qmailq:*:85:82:QMail user:/var/qmail:/nonexistent qmailr:*:86:82:QMail user:/var/qmail:/nonexistent qmails:*:87:82:QMail user:/var/qmail:/nonexistent mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin vpopmail:*:89:89:VPop Mail User:/usr/local/vpopmail:/nonexistent firebird:*:90:90:Firebird Database Administrator:/usr/local/firebird:/bin/sh mailman:*:91:91:Mailman User:/usr/local/mailman:/sbin/nologin gdm:*:92:92:GDM Sandbox:/:/sbin/nologin jabber:*:93:93:Jabber Daemon:/nonexistent:/nonexistent p4admin:*:94:94:Perforce admin:/usr/local/perforce:/sbin/nologin interch:*:95:95:Interchange user:/usr/local/interchange:/sbin/nologin squeuer:*:96:96:SQueuer Owner:/nonexistent:/bin/sh mud:*:97:97:MUD Owner:/nonexistent:/bin/sh msql:*:98:98:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh rscsi:*:99:99:Remote SCSI:/usr/local/rscsi:/usr/local/sbin/rscsi squid:*:100:100:squid caching-proxy pseudo user:/usr/local/squid:/sbin/nologin quagga:*:101:101:Quagga route daemon pseudo user:/usr/local/etc/quagga:/sbin/nologin ganglia:*:102:102:Ganglia User:/nonexistent:/sbin/nologin sgeadmin:*:103:103:Sun Grid Engine Admin:/nonexistent:/sbin/nologin slimserv:*:104:104:Slim Devices SlimServer pseudo-user:/nonexistent:/sbin/nologin dnetc:*:105:105:distributed.net client and proxy pseudo-user:/nonexistent:/sbin/nologin clamav:*:106:106:Clamav Antivirus:/nonexistent:/sbin/nologin cacti:*:107:107:Cacti Sandbox:/nonexistent:/sbin/nologin webkit:*:108:108:WebKit Default User:/usr/local/www/webkit:/bin/sh quickml:*:109:109:quickml Server:/nonexistent:/sbin/nologin vscan:*:110:110:Scanning Virus Account:/var/amavis:/bin/sh fido:*:111:111:Fido System:/usr/local/fido:/bin/sh dcc:*:112:112:Distributed Checksum Clearinghouse:/nonexistent:/sbin/nologin amavis:*:113:113:Amavis-stats Account:/nonexistent:/sbin/nologin dhis:*:114:114:DHIS Daemon:/nonexistent:/sbin/nologin _symon:*:115:115:Symon Account:/var/empty:/sbin/nologin postfix:*:125:125:Postfix Mail System:/var/spool/postfix:/sbin/nologin rbldns:*:153:153:rbldnsd pseudo-user:/nonexistent:/sbin/nologin sfs:*:171:171:Self-Certifying File System:/nonexistent:/sbin/nologin agk:*:172:172:AquaGateKeeper:/nonexistent:/nonexistent polipo:*:173:173:polipo web cache:/nonexistent:/sbin/nologin bogomilter:*:174:174:milter-bogom:/nonexistent:/sbin/nologin moinmoin:*:192:192:MoinMoin User:/nonexistent:/sbin/nologin sympa:*:200:200:Sympa Owner:/nonexistent:/sbin/nologin privoxy:*:201:201:Privoxy proxy user:/nonexistent:/sbin/nologin dspam:*:202:202:Dspam:/nonexistent:/sbin/nologin shoutcast:*:210:210:Shoutcast sandbox:/nonexistent:/bin/sh _tor:*:256:256:Tor anonymising router:/var/db/tor:/bin/sh smxs:*:260:260:Sendmail X SMTPS:/nonexistent:/sbin/nologin smxq:*:261:261:Sendmail X QMGR:/nonexistent:/sbin/nologin smxc:*:262:262:Sendmail X SMTPC:/nonexistent:/sbin/nologin smxm:*:263:263:Sendmail X misc:/nonexistent:/sbin/nologin smx:*:264:264:Sendmail X other:/nonexistent:/sbin/nologin ldap:*:389:389:OpenLDAP Server:/nonexistent:/sbin/nologin drweb:*:426:426:Dr.Web Mail Scanner:/nonexistent:/sbin/nologin courier:*:465:465:Courier Mail Server:/nonexistent:/sbin/nologin _bbstored:*:505:505::0:0:BoxBackup Store Daemon:/nonexistent:/bin/sh qtss:*:554:554:Darwin Streaming Server:/nonexistent:/sbin/nologin ircdru:*:555:555:Russian hybrid IRC server:/nonexistent:/bin/sh messagebus:*:556:556:D-BUS Daemon User:/nonexistent:/sbin/nologin avahi:*:558:558:Avahi Daemon User:/nonexistent:/sbin/nologin bnetd:*:700:700:Bnetd user:/nonexistent:/sbin/nologin bopm:*:717:717:Blitzed Open Proxy Monitor:/nonexistent:/bin/sh bacula:*:910:910:Bacula Daemon:/var/db/bacula:/sbin/nologin This is the current list of reserved GIDs. bind:*:53: rdfdb:*:55: spamd:*:58: cyrus:*:60: proxy:*:62: authpf:*:63: uucp:*:66: xten:*:67: dialer:*:68: network:*:69: pgsql:*:70: simscan:*:74: www:*:80: qnofiles:*:81: qmail:*:82: mysql:*:88: vpopmail:*:89: firebird:*:90: mailman:*:91: gdm:*:92: jabber:*:93: p4admin:*:94: interch:*:95: squeuer:*:96: mud:*:97: msql:*:98: rscsi:*:99: squid:*:100: quagga:*:101: ganglia:*:102: sgeadmin:*:103: slimserv:*:104: dnetc:*:105: clamav:*:106: cacti:*:107: webkit:*:108: quickml:*:109: vscan:*:110: fido:*:111: dcc:*:112: amavis:*:113: dhis:*:114: _symon:*:115: postfix:*:125: maildrop:*:126: rbldns:*:153: sfs:*:171: agk:*:172: polipo:*:173: moinmoin:*:192: sympa:*:200: dspam:*:202: _tor:*:256: smxs:*:260: smxq:*:261: smxc:*:262: smxm:*:263: smx:*:264: ldap:*:389: drweb:*:426: courier:*:465: _bbstored:*:505: qtss:*:554: ircdru:*:555: messagebus:*:556: realtime:*:557: avahi:*:558: bnetd:*:700: bopm:*:717: bacula:*:910: Please include a notice when you submit a port (or an upgrade) that reserves a new UID or GID in this range. This allows us to keep the list of reserved IDs up to date. Do things rationally The Makefile should do things simply and reasonably. If you can make it a couple of lines shorter or more readable, then do so. Examples include using a make .if construct instead of a shell if construct, not redefining do-extract if you can redefine EXTRACT* instead, and using GNU_CONFIGURE instead of CONFIGURE_ARGS += --prefix=${PREFIX}. If you find yourself having to write a lot of new code to try to do something, please go back and review bsd.port.mk to see if it contains an existing implementation of what you are trying to do. While hard to read, there are a great many seemingly-hard problems for which bsd.port.mk already provides a shorthand solution. Respect both <makevar>CC</makevar> and <makevar>CXX</makevar> The port should respect both CC and CXX variables. What we mean by this is that the port should not set the values of these variables absolutely, overriding existing values; instead, it should append whatever values it needs to the existing values. This is so that build options that affect all ports can be set globally. If the port does not respect these variables, please add NO_PACKAGE=ignores either cc or cxx to the Makefile. An example of a Makefile respecting both CC and CXX variables follows. Note the ?=: CC?= gcc CXX?= g++ Here is an example which respects neither CC nor CXX variables: CC= gcc CXX= g++ Both CC and CXX variables can be defined on FreeBSD systems in /etc/make.conf. The first example defines a value if it was not previously set in /etc/make.conf, preserving any system-wide definitions. The second example clobbers anything previously defined. Respect <makevar>CFLAGS</makevar> The port should respect the CFLAGS variable. What we mean by this is that the port should not set the value of this variable absolutely, overriding the existing value; instead, it should append whatever values it needs to the existing value. This is so that build options that affect all ports can be set globally. If it does not, please add NO_PACKAGE=ignores cflags to the Makefile. An example of a Makefile respecting the CFLAGS variable follows. Note the +=: CFLAGS+= -Wall -Werror Here is an example which does not respect the CFLAGS variable: CFLAGS= -Wall -Werror The CFLAGS variable is defined on FreeBSD systems in /etc/make.conf. The first example appends additional flags to the CFLAGS variable, preserving any system-wide definitions. The second example clobbers anything previously defined. You should remove optimization flags from the third party Makefiles. System CFLAGS contains system-wide optimization flags. An example from an unmodified Makefile: CFLAGS= -O3 -funroll-loops -DHAVE_SOUND Using system optimization flags, the Makefile would look similar to the following example: CFLAGS+= -DHAVE_SOUND + + Threading libraries + + The threading library must be linked to the binaries + using a special linker flag -pthread on + &os;. If a port insists on linking + -lpthread or -lc_r + directly, patch it to use PTHREAD_LIBS + variable provided by the ports framework. This variable + usually has the value of -pthread, but + on certain architectures and &os; versions it can have + different values, so do not just hardcode + -pthread into patches and always use + PTHREAD_LIBS. + + Feedback Do send applicable changes/patches to the original author/maintainer for inclusion in next release of the code. This will only make your job that much easier for the next release. <filename>README.html</filename> Do not include the README.html file. This file is not part of the cvs collection but is generated using the make readme command. Marking a port not installable with <makevar>BROKEN</makevar>, <makevar>FORBIDDEN</makevar>, or <makevar>IGNORE</makevar> In certain cases users should be prevented from installing a port. To tell a user that a port should not be installed, there are several make variables that can be used in a port's Makefile. The value of the following make variables will be the reason that is given back to users for why the port refuses to install itself. Please use the correct make variable as each make variable conveys radically different meanings to both users, and to automated systems that depend on the Makefiles, such as the ports build cluster, FreshPorts, and portsmon. Variables BROKEN is reserved for ports that currently do not compile, install, or deinstall correctly. It should be used for ports where the the problem is believed to be temporary. The build cluster will still attempt to try to build them to see if the underlying problem has been resolved. For instance, use BROKEN when a port: does not compile fails its configuration or installation process installs files outside of ${LOCALBASE} and ${X11BASE} does not remove all its files cleanly upon deinstall (however, it may be acceptable, and desirable, for the port to leave user-modified files behind) FORBIDDEN is used for ports that do contain a security vulnerability or induce grave concern regarding the security of a FreeBSD system with a given port installed (ex: a reputably insecure program or a program that provides easily exploitable services). Ports should be marked as FORBIDDEN as soon as a particular piece of software has a vulnerability and there is no released upgrade. Ideally ports should be upgraded as soon as possible when a security vulnerability is discovered so as to reduce the number of vulnerable FreeBSD hosts (we like being known for being secure), however sometimes there is a noticeable time gap between disclosure of a vulnerability and an updated release of the vulnerable software. Do not mark a port FORBIDDEN for any reason other than security. IGNORE is reserved for ports that should not be built for some other reason. It should be used for ports where the the problem is believed to be structural. The build cluster will not, under any circumstances, build ports marked as IGNORE. For instance, use IGNORE when a port: compiles but does not run properly does not work on the installed version of &os; requires &os; kernel sources to build, but the user does not have them installed has a distfile which may not be automatically fetched due to licensing restrictions does not work with some other currently installed port (for instance, the port depends on www/apache21 but www/apache13 is installed) If a port would conflict with a currently installed port (for example, if they install a file in the same place that perfoms a different function), use CONFLICTS instead. CONFLICTS will set IGNORE by itself. If a port sould be marked IGNORE only on certain architectures, there are two other convenience variables that will automatically set IGNORE for you: ONLY_FOR_ARCHS and NOT_FOR_ARCHS. Examples: ONLY_FOR_ARCHS= i386 amd64 NOT_FOR_ARCHS= alpha ia64 sparc64 Implementation Notes Due to vagaries in the usage of IGNORECMD in bsd.port.mk among other places, the value of BROKEN should be enclosed in quotes, and the value of IGNORE should not be enclosed in quotes. Also, the wording of the string should be somewhat different due to the way the information is shown to the user. Examples: BROKEN= "this port is unsupported on FreeBSD 5.x" IGNORE= is unsupported on FreeBSD 5.x resulting in the following output from make describe: - ===> foobar-0.1 is marked as broken: this port is unsupported on FreeBSD 5.x. + ===> foobar-0.1 is marked as broken: this port is unsupported on FreeBSD 5.x. - ===> foobar-0.1 is unsupported on FreeBSD 5.x. + ===> foobar-0.1 is unsupported on FreeBSD 5.x. Marking a port for removal with <makevar>DEPRECATED</makevar> or <makevar>EXPIRATION_DATE</makevar> Do remember that BROKEN and FORBIDDEN are to be used as a temporary resort if a port is not working. Permanently broken ports should be removed from the tree entirely. When it makes sense to do so, users can be warned about a pending port removal with DEPRECATED and EXPIRATION_DATE. The former is simply a string stating why the port is scheduled for removal; the latter is a string in ISO 8601 format (YYYY-MM-DD). Both will be shown to the user. It is possible to set DEPRECATED without an EXPIRATION_DATE (for instance, recommending a newer version of the port), but the converse does not make any sense. There is no set policy on how much notice to give. Current practice seems to be one month for security-related issues and two months for build issues. This also gives any interested committers a little time to fix the problems. Avoid use of the <literal>.error</literal> construct The correct way for a Makefile to signal that the port can not be installed due to some external factor (for instance, the user has specified an illegal combination of build options) is to set a nonblank value to IGNORE. This value will be formatted and shown to the user by make install. It is a common mistake to use .error for this purpose. The problem with this is that many automated tools that work with the ports tree will fail in this situation. The most common occurence of this is seen when trying to build /usr/ports/INDEX (see ). However, even more trivial commands such as make -V maintainer also fail in this scenario. This is not acceptable. How to avoid using <literal>.error</literal> Assume that someone has the line USE_POINTYHAT=yes in make.conf. The first of the next two Makefile snippets will cause make index to fail, while the second one will not: .if USE_POINTYHAT .error "POINTYHAT is not supported" .endif .if USE_POINTYHAT IGNORE=POINTYHAT is not supported .endif Necessary workarounds Sometimes it is necessary to work around bugs in software included with older versions of &os;. Some versions of &man.make.1; were broken on at least 4.8 and 5.0 with respect to handling comparisons based on OSVERSION. This would often lead to failures during make describe (and thus, the overall ports make index). The workaround is to enclose the conditional comparison in spaces, e.g.: - if ( ${OSVERSION} > 500023 ) + if ( ${OSVERSION} > 500023 ) Be aware that test-installing a port on 4.9 or 5.2 will not detect this problem. Miscellanea The files pkg-descr and pkg-plist should each be double-checked. If you are reviewing a port and feel they can be worded better, do so. Do not copy more copies of the GNU General Public License into our system, please. Please be careful to note any legal issues! Do not let us illegally distribute software!
A Sample <filename>Makefile</filename> Here is a sample Makefile that you can use to create a new port. Make sure you remove all the extra comments (ones between brackets)! It is recommended that you follow this format (ordering of variables, empty lines between sections, etc.). This format is designed so that the most important information is easy to locate. We recommend that you use portlint to check the Makefile. [the header...just to make it easier for us to identify the ports.] # New ports collection makefile for: xdvi [the "version required" line is only needed when the PORTVERSION variable is not specific enough to describe the port.] # Date created: 26 May 1995 [this is the person who did the original port to FreeBSD, in particular, the person who wrote the first version of this Makefile. Remember, this should not be changed when upgrading the port later.] # Whom: Satoshi Asami <asami@FreeBSD.org> # # $FreeBSD$ [ ^^^^^^^^^ This will be automatically replaced with RCS ID string by CVS when it is committed to our repository. If upgrading a port, do not alter this line back to "$FreeBSD$". CVS deals with it automatically.] # [section to describe the port itself and the master site - PORTNAME and PORTVERSION are always first, followed by CATEGORIES, and then MASTER_SITES, which can be followed by MASTER_SITE_SUBDIR. PKGNAMEPREFIX and PKGNAMESUFFIX, if needed, will be after that. Then comes DISTNAME, EXTRACT_SUFX and/or DISTFILES, and then EXTRACT_ONLY, as necessary.] PORTNAME= xdvi PORTVERSION= 18.2 CATEGORIES= print [do not forget the trailing slash ("/")! if you are not using MASTER_SITE_* macros] MASTER_SITES= ${MASTER_SITE_XCONTRIB} MASTER_SITE_SUBDIR= applications PKGNAMEPREFIX= ja- DISTNAME= xdvi-pl18 [set this if the source is not in the standard ".tar.gz" form] EXTRACT_SUFX= .tar.Z [section for distributed patches -- can be empty] PATCH_SITES= ftp://ftp.sra.co.jp/pub/X11/japanese/ PATCHFILES= xdvi-18.patch1.gz xdvi-18.patch2.gz [maintainer; *mandatory*! This is the person who is volunteering to handle port updates, build breakages, and to whom a users can direct questions and bug reports. To keep the quality of the Ports Collection as high as possible, we no longer accept new ports that are assigned to "ports@FreeBSD.org".] MAINTAINER= asami@FreeBSD.org COMMENT= A DVI Previewer for the X Window System [dependencies -- can be empty] RUN_DEPENDS= gs:${PORTSDIR}/print/ghostscript LIB_DEPENDS= Xpm.5:${PORTSDIR}/graphics/xpm [this section is for other standard bsd.port.mk variables that do not belong to any of the above] [If it asks questions during configure, build, install...] IS_INTERACTIVE= yes [If it extracts to a directory other than ${DISTNAME}...] WRKSRC= ${WRKDIR}/xdvi-new [If the distributed patches were not made relative to ${WRKSRC}, you may need to tweak this] PATCH_DIST_STRIP= -p1 [If it requires a "configure" script generated by GNU autoconf to be run] GNU_CONFIGURE= yes [If it requires GNU make, not /usr/bin/make, to build...] USE_GMAKE= yes [If it is an X application and requires "xmkmf -a" to be run...] USE_IMAKE= yes [et cetera.] [non-standard variables to be used in the rules below] MY_FAVORITE_RESPONSE= "yeah, right" [then the special rules, in the order they are called] pre-fetch: i go fetch something, yeah post-patch: i need to do something after patch, great pre-install: and then some more stuff before installing, wow [and then the epilogue] .include <bsd.port.mk> Keeping Up The &os; Ports Collection is constantly changing. Here is some information on how to keep up. FreshPorts One of the easiest ways to learn about updates that have already been committed is by subscribing to FreshPorts. You can select multiple ports to monitor. Maintainers are strongly encouraged to subscribe, because they will receive notification of not only their own changes, but also any changes that any other &os; committer has made. (These are often necessary to keep up with changes in the underlying ports framework—although it would be most polite to receive an advance heads-up from those committing such changes, sometimes this is overlooked or just simply impractical. Also, in some cases, the changes are very minor in nature. We expect everyone to use their best judgement in these cases.) If you wish to use FreshPorts, all you need is an account. If your registered email address is @FreeBSD.org, you will see the opt-in link on the right hand side of the webpages. For those of you who already have a FreshPorts account, but are not using your @FreeBSD.org email address, just change your email to @FreeBSD.org, subscribe, then change it back again. FreshPorts also has a sanity test feature which automatically tests each commit to the FreeBSD ports tree. If subscribed to this service, you will be notified of any errors which FreshPorts detects during sanity testing of your commits. The Web Interface to the Source Repository It is possible to browse the files in the source repository by using a web interface. Changes that affect the entire port system are now documented in the CHANGES file. Changes that affect individual ports are now documented in the UPDATING file. However, the definitive answer to any question is undoubtedly to read the source code of bsd.port.mk, and associated files. The &os; Ports Mailing List If you maintain ports, you should consider following the &a.ports;. Important changes to the way ports work will be announced there, and then committed to CHANGES. The &os; Port Building Cluster on <hostid role="hostname">pointyhat.FreeBSD.org</hostid> One of the least-publicized strengths of &os; is that an entire cluster of machines is dedicated to continually building the Ports Collection, for each of the major OS releases and for each Tier-1 architecture. You can find the results of these builds at package building logs and errors. Individual ports are built unless they are specifically marked with IGNORE. Ports that are marked with BROKEN will still be attempted, to see if the underlying problem has been resolved. (This is done by passing TRYBROKEN to the port's Makefile.) The &os; Port Distfile Survey The build cluster is dedicated to building the latest release of each port with distfiles that have already been fetched. However, as the Internet continually changes, distfiles can quickly go missing. The FreeBSD Ports distfiles survey attempts to query every download site for every port to find out if each distfile is still currently available. Maintainers are asked to check this report periodically, not only to speed up the building process for users, but to help avoid wasting bandwidth of the sites that volunteer to host all these distfiles. The &os; Ports Monitoring System Another handy resource is the FreeBSD Ports Monitoring System (also known as portsmon). This system comprises a database that processes information from several sources and allows its to be browsed via a web interface. Currently, the ports Problem Reports (PRs), the error logs from the build cluster, and individual files from the ports collection are used. In the future, this will be expanded to include the distfile survey, as well as other sources. To get started, you can view all information about a particular port by using the Overview of One Port. As of this writing, this is the only resource available that maps GNATS PR entries to portnames. (PR submitters do not always include the portname in their Synopsis, although we would prefer that they did.) So, portsmon is a good place to start if you want to find out whether an existing port has any PRs filed against it and/or any build errors; or, to find out if a new port that you may be thinking about creating has already been submitted.
diff --git a/zh_TW.Big5/share/sgml/glossary/freebsd-glossary.sgml b/zh_TW.Big5/share/sgml/glossary/freebsd-glossary.sgml index 95c9da32dc..785bb437c8 100644 --- a/zh_TW.Big5/share/sgml/glossary/freebsd-glossary.sgml +++ b/zh_TW.Big5/share/sgml/glossary/freebsd-glossary.sgml @@ -1,1926 +1,1920 @@ &os; Glossary This glossary contains terms and acronyms used within the &os; community and documentation. A ACL ACPI AMD AML API APIC APM APOP ASL ATA ATM ACPI Machine Language AML Pseudocode, interpreted by a virtual machine within an ACPI-compliant operating system, providing a layer between the underlying hardware and the documented interface presented to the OS. ACPI Source Language ASL The programming language AML is written in. Access Control List ACL Advanced Configuration and Power Interface ACPI A specification which provides an abstraction of the interface the hardware presents to the operating system, so that the operating system should need to know nothing about the underlying hardware to make the most of it. ACPI evolves and supercedes the functionality provided previously by APM, PNPBIOS and other technologies, and provides facilities for controlling power consumption, machine suspension, device enabling and disabling, etc. Application Programming Interface API A set of procedures, protocols and tools that specify the canonical interaction of one or more program parts; how, when and why they do work together, and what data they share or operate on. Advanced Power Management APM Advanced Programmable Interrupt Controller APIC Advanced Technology Attachment ATA Asynchronous Transfer Mode ATM Authenticated Post Office Protocol APOP Automatic Mount Daemon AMD A daemon that automatically mounts a filesystem when a file or directory within that filesystem is accessed. B BIND BIOS BSD Basic Input/Output System BIOS The definition of BIOS depends a bit on the context. Some people refer to it as the ROM chip with a basic set of routines to provide an interface between software and hardware. Others refer to it as the set of routines contained in the chip that help in bootstrapping the system. Some might also refer to it as the screen used to configure the boostrapping process. The BIOS is PC-specific but other systems have something similar. Berkeley Internet Name Domain BIND An implementation of the DNS protocols. Berkeley Software Distribution BSD - This is the name that the Computer Systems Research Group - (CSRG) at The University - of California at Berkeley - gave to their improvements and modifications to - AT&T's 32V &unix;. - &os; is a descendant of the CSRG work. + ³o¬O¥Ñ U.C. Berkeley ªº + Computer Systems Research Group(CSRG) ¿ï¨Ó·í§@¥L­Ì©Ò§ï¨}¡B­×§ï¹Lªº + AT&T's 32V &unix; ¦WºÙ¡C&os; «h¬O¥Ñ CSRG ªº³o­Ó¤ß¦å­l¥Í¥X¨Ó¡C Bikeshed Building A phenomenon whereby many people will give an opinion on an uncomplicated topic, whilst a complex topic receives little or no discussion. See the FAQ for the origin of the term. C CD CHAP CLIP COFF CPU CTS CVS Carrier Detect CD An RS232C signal indicating that a carrier has been detected. Central Processing Unit CPU Also known as the processor. This is the brain of the computer where all calculations take place. There are a number of different architectures with different instruction sets. Among the more well-known are the Intel-x86 and derivatives, Sun SPARC, PowerPC, and Alpha. Challenge Handshake Authentication Protocol CHAP Classical IP over ATM CLIP Clear To Send CTS An RS232C signal giving the remote system permission to send data. Common Object File Format COFF Concurrent Versions System CVS D DAC DDB DES DHCP DNS DSDT DSR DTR DVMRP Discretionary Access Control DAC Data Encryption Standard DES Data Set Ready DSR Data Terminal Ready DTR Debugger DDB Differentiated System Description Table DSDT Distance-Vector Multicast Routing Protocol DVMRP Domain Name System DNS The system that converts humanly readable hostnames (i.e., mail.example.net) to Internet addresses and vice versa. Dynamic Host Configuration Protocol DHCP A protocol that dynamically assigns IP addresses to a computer (host) when it requests one from the server. The address assignment is called a lease. E ECOFF ELF ESP Encapsulated Security Payload ESP Executable and Linking Format ELF Extended COFF ECOFF F FADT FAT FAT16 FTP File Allocation Table FAT File Allocation Table (16-bit) FAT16 File Transfer Protocol FTP A member of the family of high-level protocols implemented on top of TCP which can be used to transfer files over a TCP/IP network. Fixed ACPI Description Table FADT G GUI Giant The name of a mutual exclusion mechanism (a sleep mutex) that protects a large set of kernel resources. Although a simple locking mechanism was adequate in the days where a machine might have only a few dozen processes, one networking card, and certainly only one processor, in current times it is an unacceptable performance bottleneck. &os; developers are actively working to replace it with locks that protect individual resources, which will allow a much greater degree of parallelism for both single-processor and multi-processor machines. Graphical User Interface GUI A system where the user and computer interact with graphics. H HTML HUP HangUp HUP HyperText Markup Language HTML The markup language used to create web pages. I I/O IASL IMAP IP IPFW IPP IPv4 IPv6 ISP IP Firewall IPFW IP Version 4 IPv4 The IP protocol version 4, which uses 32 bits for addressing. This version is still the most widely used, but it is slowly being replaced with IPv6. IP Version 6 IPv6 The new IP protocol. Invented because the address space in IPv4 is running out. Uses 128 bits for addressing. Input/Output I/O Intel’s ASL compiler IASL Intel’s compiler for converting ASL into AML. Internet Message Access Protocol IMAP Internet Printing Protocol IPP Internet Protocol IP The packet transmitting protocol that is the basic protocol on the Internet. Originally developed at the U.S. Department of Defense and an extremly important part of the TCP/IP stack. Without the Internet Protocol, the Internet would not have become what it is today. For more information, see RFC 791. Internet Service Provider ISP A company that provides access to the Internet. K KAME Japanese for turtle, the term KAME is used in computing circles to refer to the KAME Project, who work on an implementation of IPv6. KDC KLD KSE KVA Kbps Kernel &man.ld.1; KLD Kernel Scheduler Entities KSE A kernel-supported threading system. See the project home page for further details. Kernel Virtual Address KVA Key Distribution Center KDC Kilo Bits Per Second Kbps Used to measure bandwith (how much data can pass a given point at a specified amount of time). Alternates to the Kilo prefix include Mega, Giga, Tera, and so forth. L LAN LOR LPD Line Printer Daemon LPD Local Area Network LAN A network used on a local area, e.g. office, home, or so forth. Lock Order Reversal LOR The &os; kernel uses a number of resource locks to arbitrate contention for those resources. A run-time lock diagnostic system found in &os.current; kernels (but removed for releases), called &man.witness.4;, detects the potential for deadlocks due to locking errors. (&man.witness.4; is actually slightly conservative, so it is possible to get false positives.) A true positive report indicates that if you were unlucky, a deadlock would have happened here. True positive LORs tend to get fixed quickly, so check &a.current.url; and the LORs Seen page before posting to the mailing lists. M MAC MADT MFC MFP4 MFS MIT MLS MOTD MTA MUA Mail Transfer Agent MTA An application used to transfer email. An MTA has traditionally been part of the BSD base system. Today Sendmail is included in the base system, but there are many other MTAs, such as postfix, qmail and Exim. Mail User Agent MUA An application used by users to display and write email. Mandatory Access Control MAC Massachusetts Institute of Technology MIT Merge From Current MFC - To merge functionality or a patch from the -CURRENT - branch to another, most often -STABLE. + MFC ¬O¤@­ÓÁY¼g¡A¥¦¥Nªí¤F Merged From -CURRENT + ¡A³o¦r²´·|¦b CVS logs ¤¤±`¨£¡A + ¥Hªí¥Ü³o¬O±q -CURRENT ¤¤¾ã¦X¶i¨ä¥L¤À¤ä(³q±`¬O -STABLE)ªº patch ©Î¥\¯à¡C Merge From Perforce MFP4 To merge functionality or a patch from the Perforce repository to the -CURRENT branch. Merge From Stable MFS In the normal course of FreeBSD development, a change will be committed to the -CURRENT branch for testing before being merged to -STABLE. On rare occasions, a change will go into -STABLE first and then be merged to -CURRENT. This term is also used when a patch is merged from -STABLE to a security branch. Message Of The Day MOTD A message, usually shown on login, often used to distribute information to users of the system. Multi-Level Security MLS Multiple APIC Description Table MADT N NAT NDISulator NFS NTFS NTP Network Address Translation NAT Network File System NFS New Technology File System NTFS A filesystem developed by Microsoft and available in its New Technology operating systems, such as &windows2k;, &windowsnt; and &windowsxp;. Network Time Protocol NTP O OBE ODMR OS On-Demand Mail Relay ODMR Operating System OS A set of programs, libraries and tools that provide access to the hardware resources of a computer. Operating systems range today from simplistic designs that support only one program running at a time, accessing only one device to fully multi-user, multi-tasking and multi-process systems that can serve thousands of users simultaneously, each of them running dozens of different applications. Overtaken By Events OBE Indicates a suggested change (such as a Problem Report or a feature request) which is no longer relevant or applicable due to such things as later changes to &os;, changes in networking standards, the affected hardware having since become obsolete, and so forth. P p4 PAE PAM PAP PC PCNSFD PDF PID POLA POP POP3 PPD PPP PPPoA PPPoE PPP over ATM PPPoA PPP over Ethernet PPPoE PR PXE Password Authentication Protocol PAP Perforce A source code control product made by Perforce Software which is more advanced than CVS. Although not open source, it use is free of charge to open-source projects such as &os;. Some &os; developers use a Perforce repository as a staging area for code that is considered too experimental for the -CURRENT branch. Personal Computer PC Personal Computer Network File System Daemon PCNFSD Physical Address Extensions PAE A method of enabling access to up to 64 GB of RAM on systems which only physically have a 32-bit wide address space (and would therefore be limited to 4 GB without PAE). Pluggable Authentication Modules PAM Point-to-Point Protocol PPP Pointy Hat A mythical piece of headgear, much like a dunce cap, awarded to any &os; committer who breaks the build, makes revision numbers go backwards, or creates any other kind of havoc in the source base. Any committer worth his or her salt will soon accumulate a large collection. The usage is (almost always?) humorous. Portable Document Format PDF Post Office Protocol POP Post Office Protocol Version 3 POP3 PostScript Printer Description PPD Preboot eXecution Environment PXE Principle Of Least Astonishment POLA - As &os; evolves, changes visible to the user should be - kept as unsurprising as possible. For example, arbitrarily - rearranging system startup variables in - /etc/defaults/rc.conf violates - POLA. Developers consider - POLA when contemplating user-visible - system changes. + ¦b &os; ªºµo®i¹Lµ{¤¤¡A¥ô¦óªº§ïÅÜ´T«×¡A³£¤£¸ÓÅý¨Ï¥ÎªÌ²ßºD·P¨ì¤£¾A¡C + Á|¨Ò¨Ó»¡¡G­Y¥ô·N½Õ°Ê /etc/defaults/rc.conf ¤¤ªº¨t²Î±Ò°Ê¶¶§Ç¡A + ´N¬O¹H­I POLA ­ì«hªººë¯«¡C¥ô¦ó¶}µo¤H­û¡A³£¸Ó¦b°µ¥X­«¤j§ïÅÜ«e¡A + ¥ý¤T«ä¬O§_·|»P POLA ­ì«h¦³©Ò¹H­I¡C Problem Report PR A description of some kind of problem that has been found in either the &os; source or documentation. See Writing &os; Problem Reports. Process ID PID A number, unique to a particular process on a system, which identifies it and allows actions to be taken against it. Project Evil The working title for the NDISulator, written by Bill Paul, who named it referring to how awful it is (from a philosophical standpoint) to need to have something like this in the first place. The NDISulator is a special compatibility module to allow Microsoft Windows™ NDIS miniport network drivers to be used with &os;/i386. This is usually the only way to use cards where the driver is closed-source. See src/sys/compat/ndis/subr_ndis.c. R RA RAID RAM RD RFC RISC RPC RS232C RTS Random Access Memory RAM Received Data RD Recommended Standard 232C RS232C A standard for communications between serial devices. Reduced Instruction Set Computer RISC Redundant Array of Inexpensive Disks RAID Remote Procedure Call RPC repocopy Repository Copy - A direct copying of files within the CVS repository. - - Without a repocopy, if a file needed to be copied or - moved to another place in the repository, the committer would - run cvs add to put the file in its new - location, and then cvs rm on the old file - if the old copy was being removed. - - The disadvantage of this method is that the history - (i.e. the entries in the CVS logs) of the file would not be - copied to the new location. As the &os; Project considers - this history very useful, a repository copy is often used - instead. This is a process where one of the repository meisters - will copy the files directly within the repository, rather than - using the &man.cvs.1; program. + repocopy(repository copy ªºÁY¼g) + ´N¬Oª½±µ±q CVS repository ¤¤½Æ»sÀɮסC + + ­Y¤£¥Î repocopy ªº¤è¦¡¡A¨º»ò­Y­n¦b repository ¤º½Æ»s¡B²¾°ÊÀɮתº¸Ü¡A + committer ´N¥²¶·°õ¦æ cvs add ¨Ó§âÀɮשñ¨ì·s¦ì¸m¡A + ¨Ã¥BÁÙ­n°õ¦æ cvs rm ¨Ó§R°£ÂÂÀÉ¡C + + ­è­èÁ¿ªº³oºØ¤è¦¡ªº¯ÊÂI¦b©ó¡A¸ÓÀɪº¤§«e¬ÛÃö¬ö¿ý + (¤ñ¦p¦b CVS logs ¤¤ªº¬ÛÃö¶µ¥Ø)¨Ã¤£·|ÀH¤§¦Ó½Æ»s¨ì·s¦a¤è¥h¡C + ¦Ó &os; ­p¹º¤¤»{¬°³o¨Ç¾ú¥v°O¿ý³£¬O¬Û·í¦³¥Îªº¡A + ©Ò¥H·|¸g±`±Ä¥Î repository copy ªº¤è¦¡¡C + ³o¤]´N¬O¬°¦ó repository ºÞ²z­û·|ª½±µ¦b repository ¤º½Æ»sÀɮתº¤è¦¡¡A + ¦Ó«D±Ä¨ú &man.cvs.1; µ{¦¡¨Ó¶i¦æ cvs add¡B + cvs rm¤§Ãþªº°Ê§@¡C Request For Comments RFC A set of documents defining Internet standards, protocols, and so forth. See www.rfc-editor.org. Also used as a general term when someone has a suggested change and wants feedback. Request To Send RTS Router Advertisement RA S SCI SCSI SG SMB SMP SMTP SMTP AUTH SSH STR SMTP Authentication SMTP AUTH Server Message Block SMB Signal Ground SG An RS232 pin or wire that is the ground reference for the signal. Simple Mail Transfer Protocol SMTP Secure Shell SSH Small Computer System Interface SCSI Suspend To RAM STR Symmetric MultiProcessor SMP System Control Interrupt SCI T TCP TCP/IP TD TFTP TGT TSC Ticket-Granting Ticket TGT Time Stamp Counter TSC A profiling counter internal to modern &pentium; processors that counts core frequency clock ticks. Transmission Control Protocol TCP A protocol that sits on top of (e.g.) the IP protocol and guarantees that packets are delivered in a reliable, ordered, fashion. Transmission Control Protocol/Internet Protocol TCP/IP The term for the combination of the TCP protocol running over the IP protocol. Much of the Internet runs over TCP/IP. Transmitted Data TD Trivial FTP TFTP U UDP UFS1 UFS2 UID URL USB Uniform Resource Locator URL Unix File System Version 1 UFS1 Unix File System Version 2 UFS2 Universal Serial Bus USB User ID UID A unique number assigned to each user of a computer, by which the resources and permissions assigned to that user can be identified. User Datagram Protocol UDP V VPN Virtual Private Network VPN