PC-UNIXに関する記事など

csupを使った kernel ソースツリーの更新

csup とは?

csup はFreeBSDにおける cvsup プロトコルの実装です。cvsup 互換プログラムなため同じ supfile を利用できるのが特徴です。
最近のFreeBSDでは標準で組み込まれており最初から利用する事が可能です。
以前からある csvup と比較するとプログラムサイズ的に1/10程度の非常にコンパクトで依存の少ないプログラムとなっている。
昔の古いFreeBSDではカーネルソースツリーは cvsup を使って更新されてきましたが最近ではこの csup で更新するのが主流となっております。
勿論古い今までの cvsup を使ってカーネルソースツリーを更新することも可能です。

更新準備

設定ファイルを用意します

# cp /usr/share/examples/cvsup/stable-supfile /usr/local/etc/stable-supfile

設定ファイルの書き換え

*default host=cvsup.jp.FreeBSD.org
*default release=cvs tag=RELENG_8_2

/etc/make.conf に追加

# csup ---
SUP_UPDATE=    YES
SUP=           /usr/bin/csup
SUPFLAGS=      -L 2 -r 0 -l /var/run/csup.pid -Z
SUPHOST=       cvsup.jp.FreeBSD.org
SUPFILE=       /usr/local/etc/stable-supfile

更新実行

最初1回目の更新

ソースツリーを取得していない場合最初の1回目 csup を単独で実行してソースツリーを取得する

# csup -L 2 -r 0 -l /var/run/csup.pid -Z /usr/local/etc/stable-supfile

二度目以降の更新

# cd /usr/src
# make update

csupオプション

Usage: csup [options] supfile
  Options:
    -1           Don't retry automatically on failure (same as "-r 0")
    -4           Force usage of IPv4 addresses
    -6           Force usage of IPv6 addresses
    -A addr      Bind local socket to a specific address
    -b base      Override supfile's "base" directory
    -c collDir   Subdirectory of "base" for collections (default "sup")
    -d delLimit  Allow at most "delLimit" file deletions (default unlimited)
    -h host      Override supfile's "host" name
    -i pattern   Include only files/directories matching pattern.
                   May be repeated for an OR operation.  Default is
                   to include each entire collection.
    -k           Keep bad temporary files when fixups are required
    -l lockfile  Lock file during update; fail if already locked
    -L n         Verbosity level (0..2, default 1)
    -p port      Alternate server port (default 5999)
    -r n         Maximum retries on transient errors (default unlimited)
    -s           Don't stat client files; trust the checkouts file
    -v           Print version and exit
    -z           Enable compression for all collections
    -Z           Disable compression for all collections

stable-supfile

$ cat /usr/local/etc/stable-supfile
# $FreeBSD: src/share/examples/cvsup/stable-supfile,v 1.33.2.3.6.1 2010/12/21 17:09:25 kensmith Exp $
#
# This file contains all of the "CVSup collections" that make up the
# FreeBSD-stable 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 stable-supfile
#
# If not running X, or invoking cvsup from a non-interactive script, then
# run it as follows:
#
#       cvsup -g -L 2 stable-supfile
#
# You may wish to change some of the settings in this file to better
# suit your system:
#
# host=CHANGE_THIS.FreeBSD.org
#               This specifies the server host which will supply the
#               file updates.  You must change it to one of the CVSup
#               mirror sites listed in the FreeBSD Handbook at
#               http://www.freebsd.org/doc/handbook/mirrors.html.
#               You can override this setting on the command line
#               with cvsup's "-h host" option.
#
# base=/var/db
#               This specifies the root where CVSup will store information
#               about the collections you have transferred to your system.
#               A setting of "/var/db" will generate this information in
#               /var/db/sup.  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.
#
###############################################################################
#
# DANGER!  WARNING!  LOOK OUT!  VORSICHT!
#
# If you add any of the ports or doc collections to this file, be sure to
# specify them with a "tag" value set to ".", like this:
#
#   ports-all tag=.
#   doc-all tag=.
#
# If you leave out the "tag=." portion, CVSup will delete all of
# the files in your ports or doc tree.  That is because the ports and doc
# collections do not use the same tags as the main part of the FreeBSD
# source tree.
#
###############################################################################

# Defaults that apply to all the collections
#
# IMPORTANT: Change the next line to use one of the CVSup mirror sites
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
*default host=cvsup.jp.FreeBSD.org
*default base=/var/db
*default prefix=/usr
# The following line is for 8-stable.  If you want 7-stable, 6-stable,
# 5-stable, 4-stable, 3-stable, or 2.2-stable, change to "RELENG_7",
# "RELENG_6", "RELENG_5", "RELENG_4", "RELENG_3", or "RELENG_2_2"
# respectively.
*default release=cvs tag=RELENG_8_2
*default delete use-rel-suffix

# If you seem to be limited by CPU rather than network or disk bandwidth, try
# commenting out the following line.  (Normally, today's CPUs are fast enough
# that you want to run compression.)
*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.
# Please note:  If you want to track -STABLE, leave this uncommented.
src-all

# These are the individual collections that make up "src-all".  If you
# use these, be sure to comment out "src-all" above.
#src-base
#src-bin
#src-cddl
#src-contrib
#src-etc
#src-games
#src-gnu
#src-include
#src-kerberos5
#src-kerberosIV
#src-lib
#src-libexec
#src-release
#src-rescue
#src-sbin
#src-share
#src-sys
#src-tools
#src-usrbin
#src-usrsbin
# These are the individual collections that make up FreeBSD's crypto
# collection. They are no longer export-restricted and are a part of
# src-all
#src-crypto
#src-eBones
#src-secure
#src-sys-crypto

このエントリーをはてなブックマークに追加

トップ  »  FreeBSD  »  csupを使った kernel ソースツリーの更新

トラックバック(0)

トラックバックURL: http://www.omakase.org/mt/mt-tb.cgi/71

コメントする

カテゴリFreeBSDの記事一覧