Year: 2009

Как установить сетевой драйвер в системе Linux

Как установить сетевой драйвер в системе Linux

Введение —

“Сетевые Технологии Corp. Attansic L1 Gigabit Ethernet Адаптер” (NIC) карты или адаптера не было обнаружено RHEL4 (RedHat) системы. Я попытался Бег Кудзу и другие команды, чтобы обнаружить устройство, но бесполезно. Итак, наконец, мне нужно установить драйверы для сетевой карты …

Шаг 1] Состояние устройства (сетевые карты) —

* См. ниже состояния устройства с аппаратной Conf файле ~ “/ ETC / sysconfig / hwconf”
* Технология Corp. Attansic L1 Gigabit Ethernet адаптер не обнаружил – Неизвестное устройство 8226

03:00.0 Ethernet контроллер: Attansic технологии Corp. L1 Gigabit Ethernet Adapter (Rev B0)
Subsystem: ASUSTeK Computer SRL: Неизвестное устройство 8226
Управление: I/O- Mem + + BusMaster SpecCycle-MemWINV-VGASnoop-ParErr-Stepping-SERR + FastB2B –
Status: Cap + 66MHz-UDF-FastB2B-ParErr-DEVSEL = быстрая> TAbort-<TAbort-<MAbort-> SERR + <PERR –
Задержка: 0, Cache Line Размер 10
Прерывание: PIN направляется IRQ 201

…..

[Root @ Desktop ~] # lspci вначале

03:00.0 Ethernet контроллер: Attansic технологии Corp. L1 Gigabit Ethernet Adapter (Rev B0)

…..
[Root @ Desktop ~] # lspci вначале-N

03:00.0 Класс 0200: 1969:1048 (Rev B0)

…..
[Root @ Desktop ~] #

* Убедитесь в том, чтобы скачать драйверы для выше venderID & DeviceID “1969:1048 “….

Шаг 2] Скачать и извлеките источник —

Во-первых, поставщик * скачать драйвера отсюда

ftp://ftp.hogchain.net/pub/linux/attansic/vendor_driver/l1-linux-v1.2.40.3.tar.gz

ИЛИ
с открытым исходным кодом (http://atl1.sourceforge.net/)

[Root @ Desktop ~] # TAR xvfz L1-Linux-v1.2.40.3.tar.gz

[Root @ Desktop ~] # CD L1-Linux-v1.2.40.3

[Root @ Desktop SRC] # Ls
at_ethtool.c at.h at_hw.c at_hw.h at_main.c at_osdep.h at_param.c kcompat.c kcompat_ethtool.c kcompat.h Makefile
[Root @ Desktop SRC] #

* Скомпилировать и установить драйверы

[Root @ Desktop SRC] # делать
Make-C / lib/modules/2.6.9-78.ELsmp/build SUBDIRS = / root/l1-linux-v1.2.40.3/src модули
Сделать [1]: Вход в каталог `/ usr/src/kernels/2.6.9-78.EL-smp-i686 ‘

…..
Сделать [1]: Выход из каталога `/ usr/src/kernels/2.6.9-78.EL-smp-i686 ‘
[Root @ Desktop SRC] # Эхо $?
0

[Root @ Desktop SRC] # сделать установку
Make-C / lib/modules/2.6.9-78.ELsmp/build SUBDIRS = / root/l1-linux-v1.2.40.3/src модули

…..
Человек-C-CAT P ‘> / Dev / NULL’ atl1 | | истинный
[Root @ Desktop SRC] # Эхо $?
0

* Теперь загрузка модуля ядра ….

[Root @ Desktop SRC] # Modprobe atl1

Шаг 3] Теперь проверить, является ли драйвер работает или нет —

[Root @ Desktop SRC] # modinfo atl1
Имя файла: / lib/modules/2.6.9-78.ELsmp/kernel/drivers/net/atl1/atl1.ko
Автор: Atheros Corporation, <xiong.huang@atheros.com>
Описание: Atheros 1000M Ethernet Network Driver
Лицензия: GPL
Версия: 1.2.40.3 1FC4E58EBDF31F49BFD33E8
Parm: TxDescriptors: Количество передать дескрипторы
Parm: RxDescriptors: Количество получают дескрипторы
Parm: MediaType: Выберите MediaType
Parm: IntModTimer: Прерывание Модератор Таймер
Parm: FlashVendor: SPI флэш-продавца
vermagic: 2.6.9-78.ELsmp СМП 686 REGPARM 4KSTACKS GCC-3.4
Зависит:
псевдоним: PCI: v00001969d00001048sv * SD * БК * SC * I *
[Root @ Desktop SRC] #

[Root @ Desktop SRC] # netconfig
[Root @ Desktop SRC] # Ifconfig
eth0 Link ENCAP: Ethernet HWaddr 00: AD: 54:0: XX: WW
INET Почтовый адрес: 192.168.0.2 Bcast: 192.168.0.255 Маска: 255.255.255.0
inet6 Почтовый адрес: fe80:: 223:54 FF: fe0a: 616b/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
RX Packets: 0 ошибок: 0 Dropped: 0 перерасход: 0 Frame: 0
TX пакетов: 7 ошибок: 0 Dropped: 0 перерасход: 0 перевозчика: 0
коллизии: 0 txqueuelen: 1000
RX байта: 0 (0.0 B) TX байта: 498 (498,0 б)
Память: feac0000-feb00000

…..

[Root @ Desktop SRC] #

[Root @ Desktop ~] # VI / ETC / sysconfig / hwconf

Класс: СЕТЬ
Шина: PCI
отдельностоящий: 0
Устройство: eth0
Водитель: atl1
Описание: “Технология Corp. Attansic L1 Gigabit Ethernet Adapter”
network.hwaddr: 00: AD: 54:0: XX: WW
VendorId: 1969
DeviceID: 1048
subVendorId: 1043
subDeviceId: 8226
pciType: 1
pcidom: 0
pcibus: 3
pcidev: 0
pcifn: 0
[Root @ Desktop ~] #

Получать удовольствие,
Arun Bagul

どのようにLinuxでシステムのネットワークドライバをインストールする

どのようにLinuxでシステムのネットワークドライバをインストールする

はじめに –

“AttansicルネサステクノロジのL1ギガビットイーサネットAdapte”ネットワーク(NIC)のカードまたはアダプタのRHEL4のが(RedHatの)システムが検出されませんでした。私はデバイスを検出するために葛などのコマンドを実行しているが、それを使用してみました。だから最終的に私は自分のネットワークカードのドライバをインストールする必要があります…

ステップ1] [デバイスの状態(ネットワークカード) –

ハードウェアのconfファイルからデバイスのステータスは以下の参照してください*〜”は/ etc / sysconfig / hwconf”
* AttansicルネサステクノロジのL1 Gigabit Ethernetアダプタは検出 – 不明なデバイス8226

03:00.0 Ethernetコントローラ:AttansicルネサステクノロジのL1 Gigabit Ethernetアダプタ(回転B0を)
サブシステム:マザーボードのunity:不明なデバイス8226
コントロール:I/O- Mem +バスマスタ+ SpecCycle – MemWINV – VGASnoop – ParErr -ステッピング- SERR + FastB2B –
状況:キャップ+ 66MHzのはUDF – FastB2B – ParErr – DEVSEL = fastを”TAbort -“TAbort – <MAbort-“SERR +”PERR –
待ち時間:0、キャッシュラインサイズ10
割り込み:IRQを201にルーティングされるピン

…..

[デスクトップ@ルート〜]#lspciを

03:00.0 Ethernetコントローラ:AttansicルネサステクノロジのL1 Gigabit Ethernetアダプタ(回転B0を)

…..
[デスクトップ@ルート〜]#lspciを-ム

03:00.0クラス0200:1969:1048(回転B0を)

…..
[デスクトップ@ルート〜]#

* venderID&DeviceIDを”1969:1048 “….上記のドライバをダウンロードしてください

ステップ2]をダウンロードしてソースを展開する –

ここからまず、ダウンロードベンダー*ドライバ

ftp://ftp.hogchain.net/pub/linux/attansic/vendor_driver/l1-linux-v1.2.40.3.tar.gz

または
オープンソース(http://atl1.sourceforge.net/)

[デスクトップ@ルート〜]#のtar xvfzのL1 – linuxの- v1.2.40.3.tar.gz

[デスクトップ@ルート〜]#のCDのL1 -のlinux – v1.2.40.3

[デスクトップの鉄骨@ルート]#1!
at_ethtool.c at.h at_hw.c at_hw.h at_main.c at_osdep.h at_param.c kcompat.c kcompat_ethtool.c kcompat.hのMakefile
[デスクトップの鉄骨@ルート]#

*ここでコンパイルしてドライバをインストールする

[デスクトップの鉄骨@ルート]を#
メイクĈ / lib/modules/2.6.9-78.ELsmp/buildはSUBDIRS = / root/l1-linux-v1.2.40.3/srcモジュール
する[1]:入りますディレクトリ`/ usr/src/kernels/2.6.9-78.EL-smp-i686′

…..
する[1]:出ますディレクトリ`/ usr/src/kernels/2.6.9-78.EL-smp-i686′
[デスクトップの鉄骨@ルート]#$エコー?
0

[デスクトップの鉄骨@ルート]をインストールする#
メイクĈ / lib/modules/2.6.9-78.ELsmp/buildはSUBDIRS = / root/l1-linux-v1.2.40.3/srcモジュール

…..
男- Ç – P’を猫”/ dev / nullを’atl1 | |真の
[デスクトップの鉄骨@ルート]#$エコー?
0

*ここでモジュール….カーネルをロードする

[デスクトップの鉄骨@ルート]#modprobeをatl1

ステップ3]今すぐかどうかをカーネルドライバまたは機能していることを確認します –

[デスクトップの鉄骨@ルート]#modinfoのatl1
ファイル名:/ lib/modules/2.6.9-78.ELsmp/kernel/drivers/net/atl1/atl1.ko
著者:Atherosの株式会社<xiong.huang@atheros.com>
説明:Atherosの1000Mのイーサネットネットワークドライバ
ライセンス:GPLの
バージョン:1.2.40.3 1FC4E58EBDF31F49BFD33E8
parm:TxDescriptors:ディスクリプタの送信数
parm:RxDescriptors:記述子の受信数
parm:MediaTypeを:MediaTypeを選択
parm:IntModTimer:モデレータタイマ割り込み
parm:FlashVendor:SPIフラッシュメーカー
vermagic:2.6.9 – 78.ELsmp SMPの686 REGPARM 4KSTACKS gcc – 3.4の
依存します:
エイリアス:のPCI:v00001969d00001048sv *のSD * bcの*理学* iの*
[デスクトップの鉄骨@ルート]#

[デスクトップの鉄骨@ルート] netconfigに#
[デスクトップの鉄骨@ルート] ifconfigコマンド#
eth0リンク方法:イーサネットハードウェアアドレス00:西暦:54:0:XXの:wwは
inetアドレス:192.168.0.2ブロードキャスト:192.168.0.255マスク:255.255.255.0
inet6アドレス:fe80::223:54ファカルティフェロー:fe0a:616b/64範囲:リンク
のBROADCASTがRUNNING MULTICASTのMTUをアップ:1500メトリック:1
RXパケット:0エラー:0損失:0オーバラン:0フレーム:0
TXパケット:7エラー:0損失:0オーバラン:0キャリア:0
衝突:0 TXキュー長:1000
RXバイト:0(0.0 2)テキサスバイト:498(498.0イ)
メモリ:feac0000 – feb00000

…..

[デスクトップの鉄骨@ルート]#

[デスクトップ@ルート〜]#viのは/ etc / sysconfig / hwconf

クラス:Network
バス:PCI
切り離された数:0
デバイス:eth0の
ドライバ:atl1
降順:”AttansicルネサステクノロジのL1 Gigabit Ethernetアダプタ”
network.hwaddr:00:西暦:54:0:XXの:wwは
のVendorID:1969
のDeviceID:1048
subVendorId:1043
subDeviceId:8226
pciType:1
pcidom:0
pcibus:3
pcidev:0
pcifn:0
[デスクトップ@ルート〜]#

楽しむ、
Arun Bagul

如何安装网络驱动程序在Linux系统

如何安装网络驱动程序在Linux系统

简介 –

“钰硕科技股份有限公司一楼千兆以太网Adapte”网络(NIC)的卡或适配器未发现RHEL4(红帽)系统。我试图运行葛根和其他命令,以检测设备,但没有用。因此,最后我要为我安装网卡驱动程序…

步骤1]设备状态(网卡) –

*见以下的设备,从硬件conf文件中的地位〜“的/ etc / sysconfig / hwconf”
*钰硕科技股份有限公司一楼千兆以太网适配器没有发现 – 未知设备8226

03:00.0以太网控制器:钰硕科技股份有限公司一楼千兆以太网适配器(恢复买0)
子系统:华硕电脑公司:未知设备8226
控制:I/O-号负责+总线主+ SpecCycle – MemWINV – VGASnoop – ParErr步进- SERR + FastB2B,
状态:第+ 66兆赫-的UDF – FastB2B – ParErr – DEVSEL =快“TAbort -”TAbort – <MAbort-“SERR +”剑麻,
延迟:0,缓存行大小10
中断:针路由为IRQ 201

…..

[@桌面根〜]#lspci的

03:00.0以太网控制器:钰硕科技股份有限公司一楼千兆以太网适配器(恢复买0)

…..
[@桌面根〜]#lspci的氮

03:00.0类0200:1969:1048(恢复买0)

…..
[@桌面根〜]#

*请务必venderID及以上的DeviceID“1969:1048 “….下载驱动程序

第2步]下载并解压缩源 –

首先,下载驱动程序供应商*从这里

ftp://ftp.hogchain.net/pub/linux/attansic/vendor_driver/l1-linux-v1.2.40.3.tar.gz


开源(http://atl1.sourceforge.net/)

[@桌面根〜]#焦油xvfz一楼- Linux的v1.2.40.3.tar.gz

[@桌面根〜]#光盘一楼- Linux的v1.2.40.3

[@桌面钢骨混凝土根]#储蓄
at_ethtool.c at.h at_hw.c at_hw.h at_main.c at_osdep.h at_param.c kcompat.c kcompat_ethtool.c kcompat.h的Makefile
[@桌面钢骨混凝土根]#

*现在编译并安装驱动程序

[@桌面钢骨混凝土根]#使
化妆荤/ = / root/l1-linux-v1.2.40.3/src模块lib/modules/2.6.9-78.ELsmp/build子目录
使[1]:进入目录`/ usr/src/kernels/2.6.9-78.EL-smp-i686′

…..
使[1]:离开目录`/ usr/src/kernels/2.6.9-78.EL-smp-i686′
[@桌面钢骨混凝土根]#回声$?
0

[@桌面钢骨混凝土根]#将安装
化妆荤/ = / root/l1-linux-v1.2.40.3/src模块lib/modules/2.6.9-78.ELsmp/build子目录

…..
男子- C肽’猫“/开发/空’atl1 | |真
[@桌面钢骨混凝土根]#回声$?
0

*现在加载内核模块….

[@桌面钢骨混凝土根]#modprobe atl1

第三步]现在验证内核驱动程序是否是工作或不 –

[@桌面钢骨混凝土根]#modinfo atl1
文件名:/ lib/modules/2.6.9-78.ELsmp/kernel/drivers/net/atl1/atl1.ko
作者:Atheros的公司,<xiong.huang@atheros.com>
描述:Atheros的千兆以太网网络驱动程序
许可:GPL
版本:1.2.40.3 1FC4E58EBDF31F49BFD33E8
磁滞剩磁:TxDescriptors:描述的传输数
磁滞剩磁:RxDescriptors:描述的接收数量
磁滞剩磁:介质类型:介质类型选择
磁滞剩磁:IntModTimer:主持人定时器中断
磁滞剩磁:FlashVendor:SPI闪存供应商
vermagic:2.6.9 – 78.ELsmp SMP的686 REGPARM 4KSTACKS gcc – 3.4的
取决于:
别名:的PCI:v00001969d00001048sv *湾*年* 5024 *我*
[@桌面钢骨混凝土根]#

[@桌面钢骨混凝土根]#netconfig
[@桌面钢骨混凝土根]#使用ifconfig
eth0的链接encap:以太网HWaddr 00:广告:54:0答:某某:湿重
iNet的地址:192.168.0.2 Bcast:192.168.0.255掩码:255.255.255.0
inet6地址:fe80::223:54法郎:fe0a:616b/64范围:链接
广播组播向上运行的MTU:1500跃点数:1
收发数据包:0错误:0下跌:0超支:0框架:0
得克萨斯州的数据包:7错误:0下跌:0超支:0载波:0
碰撞:0 txqueuelen:1000
收发字节:0(0.0二)德克萨斯州字节:498(498.0二)
内存:feac0000 – feb00000

…..

[@桌面钢骨混凝土根]#

[@桌面根〜]#编辑/ etc / sysconfig / hwconf

类别:网络
巴士:的PCI
超然:0
设备设置:eth0
司机:atl1
名称:“钰硕科技股份有限公司一楼千兆以太网适配器”
network.hwaddr:00:广告:54:0答:某某:湿重
vendorId:1969
的DeviceID:1048
subVendorId:1043
subDeviceId:8226
pciType:1
pcidom:0
PCI总线:3
pcidev:0
pcifn:0
[@桌面根〜]#

享受,
Arun Bagul

How to configure TATA Indicom/BSNL/Reliance Broadband+ Netconnect ( EDVO usb modem ) on Ubuntu Linux

How to configure TATA Indicom/BSNL/Reliance Broadband+ Netconnect ( EDVO usb modem ) on Ubuntu Linux

Introduction ~

This article is about how to configure TATA Indicom,BSNL and Reliance Broadband+ Netconnect ( EDVO usb modem ) on Ubuntu Linux.

To configure Reliance,BSNL and Tataindicom epi valley usb modem please refer the following article ~

http://www.indiangnu.org/2008/tata-indicom-usb-modem-epi-valley-on-ubuntu-linux/

To configure Tataindicom,Reliance Huawei datacard refer the following article ~

http://www.indiangnu.org/2008/tata-indicom-datacard-huawei-cdma-on-linuxubuntu/

** EVDO ?

EVolution-Data Optimized (EVDO) is a telecommunications standard for the wireless transmission of data through radio signals, typically for broadband Internet access. It uses multiplexing techniques including code division multiple access (CDMA) as well as time division multiple access (TDMA)
to maximize both individual user’s throughput and the overall system throughput. It is standardized by (3G) 3rd Generation Partnership Project 2 (3GPP2) as part of the CDMA2000 family of standards and has been adopted by many mobile phone service providers around the world – particularly those previously employing CDMA networks.

How to configure Reliance Broadband+ Netconnect –

Step 1] Mount USB file system to “/proc/bus/usb” –

root@laptop:~# ls  /proc/bus/usb/
root@laptop:~#

* It shows that usbfs is not mounted on “/proc/bus/usb”. To mount run following command….

root@laptop:/var/src/usb_modeswitch-1.0.5# mount -t usbfs  none /proc/bus/usb
root@laptop:/var/src/usb_modeswitch-1.0.5# ls /proc/bus/usb/
001  002  003  004  005  006  007  devices
root@laptop:/var/src/usb_modeswitch-1.0.5#

Step 2] Get the status of Reliance Broadband+ USB device ~

* lsusb list USB devices connected to PC as well as information about USB buses in the system and the devices connected to them.

* Output before connecting Reliance Broadband+ Netconnect usb modem –

root@laptop:~# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
…..
root@laptop:~#

* Let’s connect Reliance Broadband+ Netconnect! usb modem –

root@laptop:~# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 004: ID 19d2:fff5
Bus 005 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
…..
root@laptop:~#

* Bus 005 Device 004: ID 19d2:fff5  – This shows that the Reliance (EVDO) usb device is detected with Vendor_id  19d2  and product_id fff5

root@laptop:~# cat /proc/bus/usb/devices

T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 23 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=fff5 Rev= 0.00
S:  Manufacturer=ZTE, Incorporated
S:  Product=USB Storage
S:  SerialNumber=000000000002
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbserial_generic
E:  Ad=89(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=0a(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

root@laptop:~# dmesg | tail
[15035.656075] usb 7-2: new full speed USB device using uhci_hcd and address 24
[15035.814188] usb 7-2: configuration #1 chosen from 1 choice
[15035.827708] scsi10 : SCSI emulation for USB Mass Storage devices
[15035.828851] usb-storage: device found at 24
[15035.828856] usb-storage: waiting for device to settle before scanning
[15040.831095] usb-storage: device scan complete
[15040.834105] scsi 10:0:0:0: Direct-Access     ZTE      USB Storage FFF1 2.31 PQ: 0 ANSI: 2
[15040.839233] sd 10:0:0:0: [sdb] Attached SCSI removable disk
[15040.839378] sd 10:0:0:0: Attached scsi generic sg2 type 0
root@laptop:~#

*** Reliance Broadband+ EVDO USB is detected as “USB storage device” as shown above…

Step 3] How to use Reliance Broadband+ Netconnect as USB Modem –

To use Reliance Broadband+ usb as USB Modem. We need to switch the usb mode of this device with the help of “usb_modeswitch” tool.

Download ~ http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-1.0.5.tar.bz2

Help – http://www.draisberghof.de/usb_modeswitch/

* Download and extract the “usb_modeswitch” –

root@laptop:/var/src# wget -c  http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-1.0.5.tar.bz2

root@laptop:/var/src# tar xvfj usb_modeswitch-1.0.5.tar.bz2

* Now compile and install –

root@laptop:/var/src/usb_modeswitch-1.0.5# gcc -l usb -o usb_modeswitch usb_modeswitch.c
root@laptop:/var/src/usb_modeswitch-1.0.5# make install
mkdir -p /usr/sbin
install ./usb_modeswitch /usr/sbin
mkdir -p /etc
install –mode=644 ./usb_modeswitch.conf /etc
root@laptop:/var/src/usb_modeswitch-1.0.5#

**** Now configure USB mode switching –

a) Edit configuration file “/etc/usb_modeswitch.conf” –

Just search for vendor and product id eg (19d2 and fff5) in config “/etc/usb_modeswitch.conf” file….
This file contains most of the details. I choose following setting and that work’s for me

root@laptop:~# cat  /etc/usb_modeswitch.conf

###################
# ZTE AC8710
#

DefaultVendor=  0x19d2
DefaultProduct= 0xfff5

TargetVendor=   0x19d2
TargetProduct=  0xfff1

MessageContent=”5553424312345678c00000008000069f030000000000000000000000000000″

root@laptop:~#

b) Now run “usb_modeswitch” command to switch the mode of USB device

root@laptop:~# usb_modeswitch -c /etc/usb_modeswitch.conf

Step 4] Load “usbserial” module

* Remember in Ubuntu 09.04 the “usbserial” is buildin kernel. To load that module we need to modify “grub.conf” or “menu.lst” GRUB config file

root@laptop:~# cat /boot/grub/menu.lst

title        Ubuntu 9.04, kernel 2.6.28-11-generic
uuid        c98db8a7-0a2e-4cea-b9d5-43a30c892fb0
kernel        /vmlinuz-2.6.28-11-generic root=/dev/sda5  ro quiet splash  usbserial.vendor=0x19d2  usbserial.product=0xfff1
initrd        /initrd.img-2.6.28-11-generic
quiet
….
……
root@laptop:~#

**** Reboot the machine and run the following command

* Output before switch….

root@laptop:~# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 023: ID 19d2:fff5
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
…..
root@laptop:~#

root@laptop:~# usb_modeswitch -c /etc/usb_modeswitch.conf

* Output after switch….

root@laptop:~# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 024: ID 19d2:fff1
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
…..
root@laptop:~#

root@laptop:~# usb_modeswitch  -v 19d2 -p fff1

Looking for default devices …
Found default devices (1)
Accessing device 004 on bus 005 …
Using endpoints 0x02 (out) and 0x82 (in)
Not a storage device, skipping SCSI inquiry

Device description data (identification)
————————-
Manufacturer: ZTE, Incorporated
Product: ZTE CDMA Tech
Serial No.: not provided
————————-
Warning: no switching method given.
-> Run lsusb to note any changes. Bye.

root@laptop:~#

root@laptop:~# cat /proc/bus/usb/devices

T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 24 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=fff1 Rev= 0.00
S:  Manufacturer=ZTE, Incorporated
S:  Product=ZTE CDMA Tech

C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=128ms

root@laptop:~# dmesg  | tail
[   70.985075] usbserial_generic 5-1:1.1: generic converter detected
[   70.985109] usb 5-1: generic converter now attached to ttyUSB1
[   70.987028] usbserial_generic 5-1:1.2: generic converter detected
[   70.987064] usb 5-1: generic converter now attached to ttyUSB2
[   70.989589] usbserial_generic 5-1:1.3: generic converter detected
[   70.989623] usb 5-1: generic converter now attached to ttyUSB3
[   70.991023] usbserial_generic 5-1:1.4: generic converter detected
[   70.991061] usb 5-1: generic converter now attached to ttyUSB4
[   70.993066] usbserial_generic 5-1:1.5: generic converter detected
[   70.993109] usb 5-1: generic converter now attached to ttyUSB5
root@laptop:~#

*** It shows that Reliance Broadband+ EVDO usb  is detected as CDMA modem

Step 5] Configure wvdail –

* Run “wvdialconf” to detect and edit “/etc/wvdial.conf” confile

root@laptop:~# wvdialconf
Editing `/etc/wvdial.conf’.
Scanning your serial ports for a modem.
Modem Port Scan<*1>: S0   S1

root@laptop:~# cat /etc/wvdial.conf

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Password = your_mobile_no
Username = your_mobile_no
Phone = #777
PPPP Path = /usr/sbin/pppd
Modem Type = Analog Modem
Stupid Mode = 1
Tonline = 0
Baud = 9600
New PPPD = 1
Modem = /dev/ttyUSB0
ISDN = 0
root@laptop:~#

* Now it’s time to start surfing…..

root@laptop:~# wvdial &
[1] 21710
root@laptop:~#

root@laptop:~# ifconfig

ppp0 Link encap:Point-to-Point Protocol
inet addr:115.184.XX.BB  P-t-P:220.224.CC.DD  Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
RX packets:4310 errors:0 dropped:0 overruns:0 frame:0
TX packets:4347 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:2268618 (2.2 MB)  TX bytes:445276 (445.2 KB)

Enjoy,
Arun Bagul

How to build RPM of PHP for apache with mpm-worker

How to build RPM of PHP for apache with mpm-worker

In my last post, we have seen how we build rpm package for apache with default mpm-worker now it this tutorial we will see how we build rpm of php that can work with apache with mpm-worker.

Download php source rpm from mirror.centos.org

http://mirror.centos.org/centos-5/5.2/os/SRPMS/php-5.1.6-20.el5.src.rpm

To resolve the dependancies to build RPM package for PHP installing the require some lib packages

[root@testbed2:/tmp]# yum install bzip2-devel curl-devel gmp-devel aspell-devel libjpeg-devel libpng-devel pam-devel openssl-devel sqlite-devel pcre-devel krb5-devel libc-client-devel mysql-devel postgresql-devel unixODBC-devel libxml2-devel net-snmp-devel libxslt-devel libxml2-devel ncurses-devel gd-devel freetype-devel

install source rpm using
[root@testbed2:/tmp]# rpm -i php-5.1.6-20.el5.src.rpm

[root@testbed2:/tmp]# cd /usr/src/redhat/SPECS

vi php.spec and find “%configure” (without quote) where you can put the “–enable-maintainer-zts \” (without quote)

then rebuild rpm using below command

[root@testbed2:/usr/src/redhat/SPECS]# rpmbuild -bb php.spec

after creating rpm you will find all rpm in /usr/src/redhat/RPMS/{your arch folder} folder
in my condition the rpm’s in /usr/src/redhat/RPMS/x86_64

now change the httpd mpm to worker

[root@testbed2:/usr/src/redhat/X86_64]# /etc/init.d/httpd stop

edit file /etc/sysconfig/httpd

just uncomment the HTTPD=/usr/sbin/httpd.worker line

save and exit then start the httpd service

Now install php rpms from /usr/src/redhat/RPMS/{your arch folder}

[root@testbed2:/tmp]# /etc/init.d/httpd start
[root@testbed2:/tmp]# httpd -V
[root@testbed2:/tmp]# php -v

This is the way that I have done this. I know people are many way and good idea’s to do this.

So keep commenting that update that the things.

How to build rpm for http with mpm worker (on x86_64)

How to build rpm for http with mpm worker (on x86_64)

Guy’s since I started working on apache, I found that apache is most use ful web technology over network.
Everyone knows that (multi-processing module) MPM Prefork is default included in apache rather than MPM Worker.

MPM Prefork = This Multi-Processing Module (MPM) implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries. It is also the best MPM for isolating each request, so that a problem with a single request will not affect any other.
MPM Worker = This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with fewer system resources than a process-based server. However, it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.

More information is available on apache.org manuals

http://vr-zone.com/manual/en/mod/prefork.html
http://vr-zone.com/manual/en/mod/worker.html

On RPM based OS’s, apache is default with MPM-Prefork so we will build apache RPM (with default MPM-worker) for our own, don’t know this will be useful or now but will have know everyone with this 🙂

Download the source rpm packages from http://mirror.centos.org

[root@testbed2:/tmp]# wget http://mirror.centos.org/centos-5/5.3/os/SRPMS/httpd-2.2.3-22.el5.centos.src.rpm

install http source rpm

[root@testbed2:/tmp]# rpm -ivh httpd-2.2.3-22.el5.centos.src.rpm

[root@testbed2:/tmp]# cd /usr/src/redhat/SPECS

edit httpd.spec with vi editor

[root@testbed2:/usr/src/redhat/SPECS]# vi httpd.spec

find the –with-mpm and enter below config parameter under the –with-mpm

–enable-headers –enable-uniqueid \
–enable-deflate \
–enable-mime-magic \
–enable-so –enable-rewrite \
–enable-http \
–enable-log-config \
–with-libexpat=built-in \

Now find the “mpmbuild prefork”  and replace with “mpmbuild worker”

Now find the “mpmbuild worker” and replace with “mpmbuild prefork”
(you may find this, just few line below)

and most important thing is that you have to comment some lines i.e. (./prefork/httpd -l | grep -v prefork > prefork.mods to done)

find and comment from “./prefork/httpd -l | grep -v prefork > prefork.mods” to “Done” (i.e. just total 8 lines)

Now time to build http with mpmworker for that some dependancies are comes that we will resolve using yum

yum install xmlto db4-devel expat-devel libselinux-devel  apr-devel apr-util-devel pcre-devel openssl-devel distcache-devel

[root@testbed2:/usr/src/redhat/SPECS]# rpmbuild -bb httpd.spec

you have wait for few min and watch whats going on screen ……

your rpm build is created and placed into /usr/src/redhat/RPMS/x86_64

Now install the packages and check with ‘httpd -V’

N’joy

HAProxy Load Balancer

HAProxy Load Balancer

IT infra going day to day very critical and costly, So for that we need simple IP based load balancing solution that handles ssl traffic. Basically it’s very easy and secure way to manage your server load balancing.
This example will shows you how we use this with easy steps

The Configuration =
* Load Balancer:  <10.0.0.77>  // will be our haproxy server # This will listen on many ports that we will bind as per requirement
* Web Server 1: <10.0.1.209>  // web application server 1    #This will listen on tcp mode
* Web Server 2: <10.0.1.210>  // web application server 2   #This will listen on tcp mode
* Web Server 3: <10.0.1.227>  // web application server 3   #This will listen on http mode
* Admin Panel Port 8088: <10.0.0.77>  // Statistics Panel on port 8080  #This will listen on http mode

Get and Install haproxy
We’ll be using the 1.3.17 src files to install haproxy. You can get them from http://haproxy.1wt.eu/

wget http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.19.tar.gz

tar xvzf haproxy-1.3.19.tar.gz

cd haproxy-1.3.19

make TARGET=linux26 ARCH=x86_64

make install

Now add user haproxy or what ever need to run config

[root@ravi.com ~]# useradd haproxy

cp /path/to/haproxy-1.3.19/examples/haproxy.init /etc/init.d/haproxy

chmod +x /etc/init.d/haproxy

create the /etc/haproxy folder and create haproxy.cfg config file in it.

mkdir /etc/haproxy

Now Please add your config file haproxy.cfg in /etc/haproxy

Configure /etc/haproxy/haproxy.cfg

#[root@app71 haproxy]# more haproxy.cfg
global
log 127.0.0.1   local0
log 127.0.0.1   local1 notice
#log loghost    local0 info
maxconn 25000    # count about 1 GB per 25000 connections
#debug
#quiet
user ravi
group ravi

defaults
log         global
mode        tcp
option      dontlognull
retries 3
option         redispatch
maxconn     20000
contimeout      5000
clitimeout      50000
srvtimeout      50000

#Configuration for www.ravi.com
listen VIP:www.ravi.com:10.0.0.77:80
bind            10.0.0.77:80    # or any other IP:port combination we listen to.
bind            10.0.0.77:443    # or any other IP:port combination we listen to.
mode            tcp
option          ssl-hello-chk
option          forwardfor    # set the client’s IP in X-Forwarded-For.
balance         roundrobin
# set the maxconn parameter below to match Apache’s MaxClients minus
# one or two connections so that you can still directly connect to it.
# you have to set server health check it it’s down it showing you on stat
# Set server weights normally it should be 1 for all
server          app139:10.0.1.209:80 10.0.1.209 weight 1 maxconn 5000 check
server          app140:10.0.1.210:80 10.0.1.210 weight 1 maxconn 5000 check

listen VIP:www.ravi.com:10.0.0.77:8080
bind            10.0.0.77:8080    # or any other IP:port combination we listen to.
mode            http
option          forwardfor    # set the client’s IP in X-Forwarded-For.
balance         roundrobin
# set the maxconn parameter below to match Apache’s MaxClients minus
# one or two connections so that you can still directly connect to it.
# you have to set server health check it it’s down it showing you on stat
# Set server weights normally it should be 1 for all
server          app127:10.0.1.227:8080 10.0.1.227 weight 1 maxconn 5000 check

# Enable the stats page on a dedicated port (8088). Monitoring request errors
# on the frontend will tell us how many potential attacks were blocked.
listen  ha_stats 10.0.0.77:8088
mode            http
stats enable
stats auth user:password ##Auth user pass

edit the /etc/sysctl.conf and add the end of file then run sysctl -p to load the setting

net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 1024 65023
net.ipv4.tcp_max_syn_backlog = 10240
net.ipv4.tcp_max_tw_buckets = 400000
net.core.somaxconn = 10000

start haproxy using (/etc/init.d/haproxy start or /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid)

Configuring logging

Edit /etc/sysconfig/syslog

1.SYSLOGD_OPTIONS=”-m 0 -r”

Edit /etc/syslog.conf. Add the following:

1.local0.* /var/log/haproxy/haproxy.log
2.local1.* /var/log/haproxy/haproxy-1.log

Restart Syslog

service syslog restart

Now check with

ps auxwww | grep haproxy

Thanks

Ravi

How to disable core(s) of CPU

How to disable core(s) of CPU

Introduction ~

The question is why we  need to disable few core of CPU? Sometime it is necessary to run certain applications, which are not compatible with multi core processing.  Disabling core will not affect physically your hardware. Linux OS will simply ignore the core(s) you selected to disable.

Steps 1] How to do it?

Debian/Ubuntu ~

root@laptop:/home/arunsb# cat /boot/grub/menu.lst

title        Ubuntu 9.04, kernel 2.6.28-11-generic
kernel        /vmlinuz-2.6.28-11-generic root=UUID=55d33e45-75c7-54sc-b204-97b44e1d6a39 ro quiet splash maxcpus=1
initrd        /initrd.img-2.6.28-11-generic

Redhat/Fedora based system ~

root@laptop:/home/arunsb# cat /boot/grub/grub.conf

title Red Hat Enterprise Linux ES (2.6.9-78.ELsmp)
root (hd0,4)
kernel /boot/vmlinuz-2.6.9-78.ELsmp ro root=LABEL=/    maxcpus=1
initrd /boot/initrd-2.6.9-78.ELsmp.img

Note ~ after changing grub config file please reboot the system to apply changes!

As shown above “maxcpus=1” indicates that Linux will use only one CPU core. you can change this value as per your requirement and hardware available.

You can  also change this value during  starting of system from GRUB menu but it is temporary setting. To make it permanent you need to modify the  grub.conf (Redhat/Fedora) or menu.lst (debian/Ubuntu) GRUB config file.

Step 2] How to verify ~

I have dual core CPU as shown below and I have disable 1 core so After reboot I should get only one CPU core active

** Before above setting!

root@laptop:/home/arunsb# cat /proc/cpuinfo   | grep processor
processor    : 0
processor    : 1
root@laptop:/home/arunsb#

* Verify after above setting ~

root@laptop:/home/arunsb# cat /proc/cpuinfo   | grep processor
processor       : 0

root@laptop:/home/arunsb#

* How to Disable CPU without Reboot?
root@arunb:~# echo 0 > /sys/devices/system/cpu/cpu1/online

* Confirm ?
root@arunb:~# cat /proc/cpuinfo | grep -i ‘Processor’
processor : 0
root@arunb:~#

Thank you,
Arun Bagul

How to create edit/extract initrd in Ubuntu/Debian and Redhat/Fedora Linux ?

How to create edit/extract initrd in Ubuntu/Debian and Redhat/Fedora Linux ?

Introduction ~

Long back I edited initrd as  old linux (Ubuntu 6.06) box was not able to boot with SCSI hard disk? One of my friend wanted to do the same for other purpose. So got a chance to write article on the same? Let’s start with what is initrd?

What is initrd ?

initrd (Initial Ram Disk) is a temporary file system ( used as /) commonly used in the boot process of the Linux kernel. It is typically used for making preparations before the real root file system can be mounted.

Why someone want to edit/modify initrd ?

I assume that you all are familier with Linux booting process? Once Linux kernel loaded in to memory (RAM) it start init (father/mother of all  process) process. is that true? Let me ask you one question. Before loading actual physical root file system (/) how kernel access /sbin/init script? what is the use by specifying “initrd” file in GRUB ?  hold on!!

Suppose your root partion resides on some SCSI device and driver for this SCSI devices is compiled as a kernel module. Of course this module is required at boot time to have access to the root partion — but it is not in the kernel. Thus the need for an initrd image. Additionally after udev subsystem become common, somebody has to start udev to create device nodes. This is initrd’s duty too.

See the GRUB menu as shown below ~

title        Ubuntu 9.04, kernel 2.6.28-11-generic
kernel        /vmlinuz-2.6.28-11-generic root=/dev/sda3  ro quiet splash
initrd        /initrd.img-2.6.28-11-generic

GRUB loads  kernel and initrd image in to memory(RAM). When kernel boots  it checks for initrd image, and if it exists starts init script that resides on this image. init script is usually written in bash. When init script on initrd image is finished, kernel usually start standard init process ie /sbin/init

Step 1] Copy original initrd image file to temp location  ~

** Create temporary directory and copy initrd file in that temp directory

arunsb@laptop:~$ cp /boot/initrd.img-2.6.28-11-generic  /tmp/

arunsb@laptop:~$ mkdir /tmp/initrd-src

** Now extract “initrd” image –

arunsb@laptop:~$ cd /tmp/initrd-src

arunsb@laptop:/tmp/initrd-src$ gzip -dc  /tmp/initrd.img-2.6.28-11-generic  | cpio -id
38791 blocks
arunsb@laptop:/tmp/initrd-src$ ls -l
total 36
drwxr-xr-x 2 arunsb arunsb 4096 2009-07-12 16:32 bin
drwxr-xr-x 3 arunsb arunsb 4096 2009-07-12 16:32 conf
drwxr-xr-x 6 arunsb arunsb 4096 2009-07-12 16:32 etc
-rwxr-xr-x 1 arunsb arunsb 4825 2009-07-12 16:32 init
drwxr-xr-x 5 arunsb arunsb 4096 2009-07-12 16:32 lib
drwxr-xr-x 2 arunsb arunsb 4096 2009-07-12 16:32 sbin
drwxr-xr-x 8 arunsb arunsb 4096 2009-07-12 16:32 scripts
drwxr-xr-x 3 arunsb arunsb 4096 2009-07-12 16:32 usr
arunsb@laptop:/tmp/initrd-src$

** Check how “init” looks like ~

arunsb@laptop:/tmp/initrd-src$ head init
#!/bin/sh

echo “Loading, please wait…”

[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir -m 0700 /root
[ -d /sys ] || mkdir /sys
[ -d /proc ] || mkdir /proc
[ -d /tmp ] || mkdir /tmp
mkdir -p /var/lock
arunsb@laptop:/tmp/initrd-src$

Step 2] Edit/Modify as per your requirement

Step 3] How to create initrd image  ~

Create initrd image from scratch –

root@laptop:/home/arunsb# mkinitramfs  -v -o  /tmp/initrd-arun-$(uname -r)

root@laptop:/home/arunsb# ls -l /tmp/initrd-arun-2.6.28-11-generic
-rw-r–r– 1 root root 7536506 2009-07-12 17:11 /tmp/initrd-arun-2.6.28-11-generic

root@laptop:/home/arunsb# du -sh /tmp/initrd-arun-2.6.28-11-generic
7.2M    /tmp/initrd-arun-2.6.28-11-generic
root@laptop:/home/arunsb#

mkinitramfs ~ is the tool used to create initrd image. “initrd” image is a gzipped cpio archive.

** After all modifcation create initrd image as shown below…

arunsb@laptop:/tmp/initrd-src$ find . | cpio –quiet –dereference -o -H newc | gzip -9 > /tmp/initrd.img-2.6.28-11-arun
arunsb@laptop:/tmp/initrd-src$ ls -l /tmp/initrd.img-2.6.28-11-arun
-rw-r–r– 1 arunsb arunsb 7505955 2009-07-12 16:56 /tmp/initrd.img-2.6.28-11-arun
arunsb@laptop:/tmp/initrd-src$

* Enjoy !!

Regards,
Arun Bagul