December 17, 2006


延續著在 Redhat AS 4下安裝systemtap之後,當然是要為我最愛的Debian寫一篇說明了!

apt-get install systemtap linux-source-2.6.18

安裝好之後,開始重編Kernel。由於使用systemtap需要vmlinux檔,所以做好的kernel deb要內附vmlinux的話請修改"/etc/kernel-pkg.conf"並加入
install_vmlinux := YES

接下來到kernel source的top dir,進行make menuconfig,記得Kernel要加入"CONFIG_KPROBES", "CONFIG_DEBUG_INFO"這兩個選項喔!建立核心請執行
make-kpkg --revision 2.6.18 --append-to-version -systemtap --initrd binary-arch

經過一段時間後,馬上把編譯好的deb裝上(如果要刪除舊的source,請記得裝上剛編譯的kernel header deb),並以這個新的kernel重新開機,這樣systemtap的環境就配置好了。

Posted by asho at 10:45 AM | Comments (0)

在 Redhat AS 4 下安裝 systemtap

Systemtap是一套dynamic kernel probing system. 動態修改變數、更換function、找出function flow...這一套系統在kernel-2.6.11之後皆可以使用,只要Kernel config設定了"CONFIG_KPROBES","CONFIG_DEBUG_INFO"和相關套件就可以使用了。
因為弟的產品開發是Redhat AS4 base,而該dist所包kernel為2.6.9,雖然舊,但redhat持續有上patch,官方release note指出有支援systemtap,卻沒有詳細的安裝步驟,其實內建的套件都已經支援了,只是缺乏kernel-debuginfo套件而已。所以本節只是講解產生kernel-debuginfo,礙於腦筋不夠靈光,特寫此篇來記錄。以下是安裝順序:

  • 先安裝好Redhat AS U4,弟安裝的套件有開發用的套件

  • rpmfind找到Redhat ASU4的kernel-src.rpm

  • 安裝kernel-2.6.9-42.EL.src.rpm:rpm -ivh kernel-2.6.9-42.EL.src.rpm

  • 編輯kernel的spec檔案:vim /usr/src/redhat/SPECS/kernel-2.6.spec,指定要編譯的kernel設成1,其餘為0。以筆者來說,只需要%define buildup 1,其餘就填0

  • 執行 rpmbuiild --target i686 -ba kernel-2.6.spec

  • 安裝編譯好的kernel-debuginfo rpm:rpm -ivh /usr/src/redhat/RPMS/i686/kernel-debuginfo-2.6.9-42.EL.i686.rpm,這個rpm內附kernel的symbol檔,拿來debug用的

  • 安裝光碟所附的systemtap或是到rpmfind.net找

  • 經過以上的動作就完成了systemtap的環境的設置,馬上拿systemtap script來測試吧!

    Posted by asho at 12:43 AM | Comments (0)

    December 16, 2006

    cycle: calendar program for women

    Description: calendar program for women
    Cycle is a calendar for women. Given a cycle length or statistics for
    several periods, it can calculate the days until menstruation, the days
    of "safe" sex, the fertile period, and the days to ovulations, and
    define the d.o.b. of a child. It allows the user to write notes and
    helps to supervise the administration of hormonal contraceptive tablets.
    Possibilities of the program:
    - Calculate days of menstruation, based on the length of the cycle or
    on statistics of previous periods.
    - Calculate days of "safe" sex, fertile period and day to ovulations.
    - Definition of D.O.B. (Date Of Birth) of a child
    - Allows to write notes.
    - Helps to supervise reception of hormonal contraceptive tablets.
    - Multiple users allowed. Data is protected by a password for every
    NOTE: This program is not a reliable contraceptive method. It does
    neither help to prevent sexual transmision diseases like AIDS. It is
    just an electronic means of keeping track of some of your medical data
    and extract some statistical conclusions from them. You cannot consider
    this program as a substitute for your gynecologist in any way.
    Tag: special::not-yet-tagged, special::not-yet-tagged::c

    Posted by asho at 07:11 PM | Comments (0)

    scsi hot-plug add/remove

    SCSIADD(8) root tools SCSIADD(8)

    scsiadd - Add and remove SCSI devices

    scsiadd [-a|-r]

    scsiadd [-a|-r]

    scsiadd [-a|-r]

    scsiadd [-a|-r]

    scsiadd [-s]

    scsiadd [-s]

    scsiadd [-p]

    scsiadd [-i]

    Scsiadd adds and removes devices, scans for new devices, or prints the
    status of the SCSI bus. The options are:

    -a add device

    -r remove device

    -s scan for new devices

    -p print SCSI status

    -i set maximum SCSI ID which is scanned

    scsiadd 3
    add SCSI device with ID 3 on primary host

    scsiadd -r 1
    remove SCSI device with ID 1 from primary host

    scsiadd -s
    scan for new devices on primary device

    scsiadd -a 1 2 13 4
    add SCSI device with ID 13 and LUN 4 on host 1 channel 2

    Posted by asho at 06:39 PM | Comments (0)

    December 01, 2006

    DVD Authoring

    mkisofs -dvd-video -udf -o dvd.iso dvd/
    dvd+rw-format -f /dev/srcd0
    growisofs -Z /dev/srcd0=dvd.iso
    dvdrecord -dao speed=2 dev=0,0,0 dvd.iso
    growisofs -Z /dev/scd0 -dvd-video -udf dvd_dir/

    Posted by asho at 10:15 PM | Comments (0)