FC卡驱动源码编译基本流程

FC卡驱动源码编译基本流程

redhat6.x
4.2 Building the Driver for RHEL 6.x Linux
编译前先确认kernel-devel、gcc*是否安装好

  1. In the directory that contains the source driver file,
    qla2xxx-src-vx.xx.xx.xx.06.x-k.tar.gz, issue the following commands:

    tar -xzvf qla2xxx-src-vx.xx.xx.xx.06.x-k.tar.gz

    cd qla2xxx-src-vx.xx.xx.xx.06.x-k

  2. Build and install the driver modules from the source code by
    executing the build.sh script as follows:

    ./extras/build.sh install

    The build.sh script does the following:

    • Builds the driver .ko files.
    • Copies the .ko files to the appropriate
      /lib/modules/2.6…/extra/qlgc-qla2xxx directory.
    • Adds the appropriate directive in the modprobe.conf (if
      applicable).
  3. Manually load the driver for Linux Using insmod or modprobe.

    • To directly load the driver from the local build directory,
      issue the following insmod commands in order:

      insmod /lib/modules/2.6…/kernel/drivers/scsi/scsi_tgt.ko

      (if not already loaded)

      insmod /lib/modules/2.6…/kernel/drivers/scsi/

      scsi_transport_fc.ko

      insmod qla2xxx.ko

    • To load the driver using modprobe, issue the following command:

modprobe -v qla2xxx

* To unload the driver using modprobe, issue the following
  command:

   # modprobe -r qla2xxx
  1. Automatically load the driver by rebuilding the RAM disk to
    include the driver as follows:

    a. Edit the /etc/modprobe.d/modprobe.conf file and add the following
    entry. (Create a modprobe.conf file if it does not exist):

    alias scsi_hostadapterX qla2xxx
    

    where, X is based on the order of the SCSI modules being
    loaded.

    b. Create a backup copy of the RAMDISK image by issuing the
    following commands:

    # cd /boot
    
    # cp initrd-[kernel version].img initrd-[kernel version].img.bak
    
    # mkinitrd -f initrd-[kernel version].img `uname -r`
    

    NOTE: Depending on the server hardware, the RAMDISK file name
    may be different.

    c. To load the driver, reboot the host.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

京天不下雨

thanks

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值