wiki:gpxe-sis900

瞭解 Etherboot 如何加入新的網路卡驅動程式

目標: 加入以下網路卡的支援

STEP 1: 從 Etherboot 原始碼開始

  • 源起:
    • 目前有很多新的網路卡雖然有支援 PXE 但是卻沒有正式被 PXELinux 支援. 所以必須要找到可以自行加入新網路卡的方法.
  • 作法:
    • 測試環境: Debian Etch 4.0r1
    • 下載 git 版本控制軟體
      # apt-get install git cogito git-core
      
      • 註:Ubuntu 只要安裝 git-core 即可。
        # apt-get install git-core
        
    • 修改 git 預設對應
      # update-alternative --config git
      There are 2 alternatives which provide `git'.
      
        Selection    Alternative
      -----------------------------------------------
       +        1    /usr/bin/git.transition
      *         2    /usr/bin/git-scm
      
      Press enter to keep the default[*], or type selection number: 2
      
      • 如果不修改預設 git 對應為 git-scm 會出現以下錯誤訊息
        # git clone git://git.etherboot.org/scm/gpxe.git
        
        git, the filemanager with GNU Interactive Tools, is now called gitfm.
        
        If you are looking for git, Linus Torvald's content tracker, install
        the cogito and git-core packages and see README.Debian and git(7).
        
        This transition script will be removed in the debian stable
        release after etch.
        
        If you wish to complete the transition early, install git-core
        and use (as root):
         update-alternatives --config git
        
        Press RETURN to run gitfm
        
        
        GNU Interactive Tools 4.3.20 (i586-pc-linux-gnu), 10:15:20 Aug 21 2006
        GIT is free software; you can redistribute it and/or modify it under the
        terms of the GNU General Public License as published by the Free Software
        Foundation; either version 2, or (at your option) any later version.
        Copyright (C) 1993-1999 Free Software Foundation, Inc.
        Written by Tudor Hulubei and Andrei Pitis, Bucharest, Romania
        
        /usr/bin/gitfm: fatal error: `chdir' failed: permission denied.
        
      • 註: Ubuntu 不用做更新
        # update-alternatives --config git
        
        There is only 1 program which provides git
        (/usr/bin/git-scm). Nothing to configure.
        
    • 下載 Etherboot 最新版原始碼
      # git clone git://git.etherboot.org/scm/gpxe.git
      
    • 從 Etherboot 原始碼中的 src/drivers/net/sis900.c 開始看
      # cd gpxe
      ~/gpxe# cd src/drivers/net/
      ~/gpxe/src/drivers/net/# ls sis900*
      sis900.c   sis900.h
      

STEP 2: 比較與 Linux Kernel 原始碼的差異

  • 下載 Linux Kernel 原始碼
    • 首先請確定 /etc/apt/source.list 裡有 deb src 的來源
      # apt-get source linux-image-`uname -r`
      
  • 找尋 sis900.c 跟 sis900.h 的檔案位置
    # find . -name "sis900*"
    ### 以下是使用 Ubuntu 的結果 ###
    ./gpxe/src/drivers/net/sis900.c
    ./gpxe/src/drivers/net/sis900.h
    ./linux-source-2.6.20-2.6.20/drivers/net/sis900.c
    ./linux-source-2.6.20-2.6.20/drivers/net/sis900.h
    
  • [結果] 請 checkout svn 進行後續比較工作。
    ## for Developer
    # svn co http://trac.nchc.org.tw/svn/grid
    ## for Anonymous User
    # svn co http://trac.nchc.org.tw/svnroot/grid
    
Last modified 17 years ago Last modified on Feb 5, 2008, 2:04:40 PM

Attachments (3)

Download all attachments as: .zip