廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 5039 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
月光 手機
個人頭像
個人文章 個人相簿 個人日記 個人地圖
社區建設獎
頭銜:看我代替月亮懲罰你!看我代替月亮懲罰你!
版主
級別: 版主 該用戶目前不上站
版區: Unix-like, 網站架設
推文 x42 鮮花 x565
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[FreeBSD][轉載] 利用CVSUP更新 Security Patch
#cd /usr/ports/net/cvsup-without-gui/

#make install clean //安裝套件

#cd /usr/share/examples/cvsup/ //切換到更新範例檔路徑

#cp ports-supfile /root/ //複製到root目錄底下

#cd /root/ //切換路徑

#ee ports-supfile //編輯設定檔

*default host=CHANGE_THIS.FreeBSD.org //官方站台(預設值)

*default host=cvsup.tw.freebsd.org //改為國內站台交大資工如此下載速度較快(還有cvsup1~13都可使用)

*default release=cvs tag=RELENG_6 //預設值

*default release=cvs tag=RELENG_6_3 //更改後只有安全更新會進入這個 branch的 source code

#rehash

#cvsup g -L 2 stablesupfile //開始更新
Shutting down connection to server

Finished successfully
//看到上面代表更新source code成功
更新完source code後在執行更新版本,編譯核心和安裝核心動作
#cd /usr/src/

#make -j4 buildworld //更新版本,可改用4個process來加速

#cd /usr/src/sys/i386/conf/ //進入編譯核心設定檔路徑

#cp GENERIC MYKERNEL //複製一份名為MYKERNEL設定檔

#ee MYKERNEL //修改設定檔
—————————-省略——————————————

#cd /usr/src //進入編譯核心的目錄

#make buildkernel KERNCONF=MYKERNEL //編譯核心

#make installkernel KERNCONF=MYKERNEL //安裝核心

#reboot //完成後重新開機進入單機模式
重開機後進入倒數開機選單按6進入OK提示模式輸入boot -s
接著螢幕會出現
Enter full pathname of shell of RETURN for /bin/sh:
(直接按 enter即可以 B shell進入單人模式)

#mount -u /    //重新載入 / (-u 代表改變為可讀可寫狀態)

#mount -a -t ufs //載入所有/etc/fstab有紀錄,型態為ufs的檔案系統

#cd /usr/src

#mergemaster -p //利用mergemaster來檢查設定檔

#make installworld

#mergemaster //進行/etc目路下設定檔文件的修改或更新

#reboot //重新開機

#uname -rs //檢查核心版本
FreeBSD 6.3-RELEASE-p2 //可知patch已經上去(-pX)

——————————————-

關於”mergemaster -p”的說明

“mergemaster”是一個用於安装系统配置文件的設定工具,”mergemaster -p”的作用是建立一個臨時的設定環境,把新的配置文件映射到這個環境。然後和系统的配置文件進行比較和處理,目的是保證系统配置文件的更新,這一點很重要!在執行”mergemaster -p”的過程中,主要是進行以下處理:

檢測系统是否存在臨時的設定檔環境,如果存在,讓管理者選擇是利用現有的設定還是刪除他,在新建一個新環境!

*** The directory specified for the temporary root environment,
/var/tmp/temproot, exists. This can be a security risk if untrusted
users have access to the system.

Use ‘d’ to delete the old /var/tmp/temproot and continue //按 “d” ,删除
Use ‘t’ to select a new temporary root directory //按 “t” ,選擇新的目錄
Use ‘e’ to exit mergemaster //按 “e” ,退出

Default is to use /var/tmp/temproot as is

How should I deal with this? [Use the existing /var/tmp/temproot]

一般的處理是先選 “d” ,删除原有的目錄,系统再重新建立一個臨時的根設定檔。

關於”mergemaster”的說明

執行完”make installworld”之後,需要對系统的”/etc”目錄下的文件進行更新,在更新過程中,需要管理者和系统進行互動,以卻定需要對系统的配置文件進行怎樣的更新。
每個配置文件的更新操作都有4個選項:

Use ‘d’ to delete the temporary ;不更新相對應的系统配置文件
Use ‘i’ to install the temporary ;用新的配置文件覆蓋原來的系统配置文件
Use ‘m’ to merge the temporary and installed versions ;根據新的配置文件,對系統的配置文件進行合並處理
Use ‘v’ to view the diff results again ;察看新的配置文件和系统原有的配置文件的不同

更新操作時,要根據管理者自己的想法進行相對應的操作,如果是新安装的系统進行更新的话,或者不需要保留原有的配置的話,一般選擇第二項操作。



月光論壇
http://bbs.dj...com/


===================================
贊助本站 -- 刊登廣告 -- 物超所值虛擬主機租用
獻花 x0 回到頂端 [樓 主] From:臺灣中華電信HINET | Posted:2008-06-04 08:41 |
aa 手機 會員卡 葫蘆墩家族
個人文章 個人相簿 個人日記 個人地圖 個人商品
特殊貢獻獎 社區建設獎
頭銜:            
站長
級別: 站長 該用戶目前不上站
推文 x1964 鮮花 x5260
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

我用的步驟差不多..

一般我安裝好 FreeBSD ,都會先安裝 cvsup,再來就是更新整個系統了

動作前請先安裝一些好用的工具

1. SSHSecureShellClient-3.2.9.exe 安裝在 windows
2. TotalCommander

我建的 cvsupfile-6_3

複製程式
# $Id: standard-supfile,v 1.4.2.3 1996/12/27 04:09:59 jdp Exp $
#
# This file contains all of the "CVSup collections" that make up the
# FreeBSD-current source tree.
#
# CVSup (CVS Update Protocol) allows you to download the latest CVS
# tree (or any branch of development therefrom) to your system easily
# and efficiently (far more so than with sup, which CVSup is aimed
# at replacing).  If you're running CVSup interactively, and are
# currently using an X display server, you should run CVSup as follows
# to keep your CVS tree up-to-date:
#
#       cvsup standard-supfile
#
# If not running X, or invoking cvsup from a non-interactive script, then
# run it as follows:
#
#       cvsup -g -L 2 standard-supfile
#
# You may wish to change some of the settings in this file to better
# suit your system:
#
# host=cvsup.FreeBSD.org
#              This specifies the server host which will supply the
#              file updates.  Please change this to one of the mirror
#              sites if possible.  (See the "README" file.)  You can
#              override this setting on the command line with cvsup's
#              "-h host" option.
#
# base=/usr
#              This specifies the root where CVSup will store information
#              about the collections you have transferred to your system.
#              A setting of "/usr" will generate this information in
#              /usr/sup.  Even if you are CVSupping a large number of
#              collections, you will be hard pressed to generate more than
#              ~1MB of data in this directory.  You can override the
#              "base" setting on the command line with cvsup's "-b base"
#              option.  This directory must exist in order to run CVSup.
#
# prefix=/usr
#              This specifies where to place the requested files.  A
#              setting of "/usr" will place all of the files requested
#              in "/usr/src" (e.g., "/usr/src/bin", "/usr/src/lib").
#              The prefix directory must exist in order to run CVSup.

# Defaults that apply to all the collections
*default host=cvsup.tw.freebsd.org.
*default base=/usr
*default prefix=/usr
*default release=cvs tag=RELENG_6_3
*default delete use-rel-suffix

# If your network link is a T1 or faster, comment out the following line.
*default compress

## Main Source Tree.
#
# The easiest way to get the main source tree is to use the "src-all"
# mega-collection.  It includes all of the individual "src-*" collections,
#

src-all

我建的 cvsupfile-ports

複製程式
# $Id: standard-supfile,v 1.4.2.3 1996/12/27 04:09:59 jdp Exp $
#
# This file contains all of the "CVSup collections" that make up the
# FreeBSD-current source tree.
#
# CVSup (CVS Update Protocol) allows you to download the latest CVS
# tree (or any branch of development therefrom) to your system easily
# and efficiently (far more so than with sup, which CVSup is aimed
# at replacing).  If you're running CVSup interactively, and are
# currently using an X display server, you should run CVSup as follows
# to keep your CVS tree up-to-date:
#
#       cvsup standard-supfile
#
# If not running X, or invoking cvsup from a non-interactive script, then
# run it as follows:
#
#       cvsup -g -L 2 standard-supfile
#
# You may wish to change some of the settings in this file to better
# suit your system:
#
# host=cvsup.FreeBSD.org
#              This specifies the server host which will supply the
#              file updates.  Please change this to one of the mirror
#              sites if possible.  (See the "README" file.)  You can
#              override this setting on the command line with cvsup's
#              "-h host" option.
#
# base=/usr
#              This specifies the root where CVSup will store information
#              about the collections you have transferred to your system.
#              A setting of "/usr" will generate this information in
#              /usr/sup.  Even if you are CVSupping a large number of
#              collections, you will be hard pressed to generate more than
#              ~1MB of data in this directory.  You can override the
#              "base" setting on the command line with cvsup's "-b base"
#              option.  This directory must exist in order to run CVSup.
#
# prefix=/usr
#              This specifies where to place the requested files.  A
#              setting of "/usr" will place all of the files requested
#              in "/usr/src" (e.g., "/usr/src/bin", "/usr/src/lib").
#              The prefix directory must exist in order to run CVSup.

# Defaults that apply to all the collections
*default host=cvsup.tw.freebsd.org.
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix

# If your network link is a T1 or faster, comment out the following line.
*default compress

## Main Source Tree.
#
# The easiest way to get the main source tree is to use the "src-all"
# mega-collection.  It includes all of the individual "src-*" collections,
#

ports-all

複製程式
# cvsup cvsupfile-6_3
# cvsup cvsupfile-ports

參考 http://www.freebsd.org/doc/en_US.ISO88...ok/makeworld.html

複製程式
# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# reboot

開機好

複製程式
# mergemaster -p
# make installworld
# mergemaster
# reboot

不過如果要改 kernel 的設定,其中一些步驟會有些不同


獻花 x0 回到頂端 [1 樓] From:臺灣新世紀資通股份有限公司 | Posted:2008-06-12 10:07 |
mnbmnb5266
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x5 鮮花 x46
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

兩位大大真是讓我受益良多啊,什麼時候我也能明白這麼多的電腦知識啊,繼續學習吧


我的收藏
https://pan.baidu.com/s/1QUJ9lr_VzxXKRJAlBJgUQA
提取码:am2c
獻花 x0 回到頂端 [2 樓] From:加拿大Rogers | Posted:2010-08-19 21:19 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.056588 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言