怎么查看linux usb设备驱动

怎么查看linux usb设备驱动,第1张

下面的信息都是在VMware中运行Ubuntu12-04系统上执行的。同样该命令也支持在嵌入式系统中进行USB调试。

一、cat设备节点获取信息

在一些嵌入式开发中需要调试USB功能,经常会cat /sys 下的相关设备节点来查看某些信息,比如说我们可以看到 /sys/bus/usb/devices 目录有多个子目录。进入到某个子目录可以看到usb设备更加详细的信息(可以理解为设备描述符)。

1、usb设备在总线上的信息

// usb设备在总线上的信息

root@ubuntu:/sys/kernel/debug# cd /sys/bus/usb/devices

root@ubuntu:/sys/bus/usb/devices# ll

total 0

drwxr-xr-x 2 root root 0 Nov 26 21:21 ./

drwxr-xr-x 4 root root 0 Nov 26 21:21 ../

lrwxrwxrwx 1 root root 0 Nov 26 21:21 1-0:1.0 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-0:1.0/

lrwxrwxrwx 1 root root 0 Dec 15 23:10 1-1 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/

lrwxrwxrwx 1 root root 0 Dec 15 23:18 1-1:1.0 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.0/

lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-0:1.0 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-0:1.0/

lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-1 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/

lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-1:1.0 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/2-1:1.0/

lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-2 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/

lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-2:1.0 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2:1.0/

lrwxrwxrwx 1 root root 0 Nov 26 21:21 usb1 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/

lrwxrwxrwx 1 root root 0 Nov 26 21:21 usb2 ->../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/

其中 usbx/第x个总线,x-y:a.b/的目录格式,x表示总线号,y表示端口,a表示配置,b表示接口。

具体解释可以参照如下:

The names that begin with "usb" refer to USB controllers. More accurately, they refer to the "root hub" associated with each controller. The number is the USB bus number. In the example there is only one controller, so its bus is number 1. Hence the name "usb1".

"1-0:1.0" is a special case. It refers to the root hub's interface. This acts just like the interface in an actual hub an almost every respectsee below.

All the other entries refer to genuine USB devices and their interfaces. The devices are named by a scheme like this:

bus-port.port.port ...

In other words, the name starts with the bus number followed by a '-'. Then comes the sequence of port numbers for each of the intermediate hubs along the path to the device.

For example, "1-1" is a device plugged into bus 1, port 1. It happens to be a hub, and "1-1.3" is the device plugged into port 3 of that hub. That device is another hub, and "1-1.3.1" is the device plugged into its port 1.

The interfaces are indicated by suffixes having this form:

:config.interface

That is, a ':' followed by the configuration number followed by '.' followed by the interface number. In the above example, each of the devices is using configuration 1 and this configuration has only a single interface, number 0. So the interfaces show up as

1-1:1.0 1-1.3:1.0 1-1.3.1:1.0

A hub will never have more than a single interfacethat's part of the USB spec. But other devices can and do have multiple interfaces (and sometimes multiple configurations). Each interface gets its own entry in sysfs and can have its own driver.

2、特定设备的详细信息

进入到某个目录中去,可以看到该设备的详细信息,可用cat命令获取信息。

// usb设备的详细信息

root@ubuntu:/sys/bus/usb/devices/usb1# ll

total 0

drwxr-xr-x 6 root root 0 Nov 26 21:21 ./

drwxr-xr-x 4 root root 0 Nov 26 21:21 ../

drwxr-xr-x 10 root root 0 Nov 26 21:21 1-0:1.0/

drwxr-xr-x 5 root root 0 Dec 15 23:10 1-1/

-rw-r--r-- 1 root root 4096 Dec 15 23:40 authorized

-rw-r--r-- 1 root root 4096 Dec 15 23:40 authorized_default

-rw-r--r-- 1 root root 4096 Dec 15 23:40 avoid_reset_quirk

-r--r--r-- 1 root root 4096 Nov 26 21:21 bcdDevice

-rw-r--r-- 1 root root 4096 Nov 26 21:21 bConfigurationValue

-r--r--r-- 1 root root 4096 Nov 26 21:21 bDeviceClass

-r--r--r-- 1 root root 4096 Nov 26 21:21 bDeviceProtocol

-r--r--r-- 1 root root 4096 Nov 26 21:21 bDeviceSubClass

-r--r--r-- 1 root root 4096 Dec 15 23:40 bmAttributes

-r--r--r-- 1 root root 4096 Dec 15 23:40 bMaxPacketSize0

-r--r--r-- 1 root root 4096 Dec 15 23:40 bMaxPower

-r--r--r-- 1 root root 4096 Dec 15 23:40 bNumConfigurations

-r--r--r-- 1 root root 4096 Dec 15 23:40 bNumInterfaces

-r--r--r-- 1 root root 4096 Nov 26 21:21 busnum

-r--r--r-- 1 root root 4096 Dec 15 23:40 configuration

-r--r--r-- 1 root root 65553 Nov 26 21:21 descriptors

-r--r--r-- 1 root root 4096 Dec 15 23:40 dev

-r--r--r-- 1 root root 4096 Nov 26 21:21 devnum

-r--r--r-- 1 root root 4096 Dec 15 23:40 devpath

lrwxrwxrwx 1 root root 0 Nov 27 20:06 driver ->../../../../../bus/usb/drivers/usb/

drwxr-xr-x 3 root root 0 Dec 15 23:40 ep_00/

-r--r--r-- 1 root root 4096 Nov 26 21:21 idProduct

-r--r--r-- 1 root root 4096 Nov 26 21:21 idVendor

-r--r--r-- 1 root root 4096 Dec 15 23:40 ltm_capable

-r--r--r-- 1 root root 4096 Nov 26 21:21 manufacturer

-r--r--r-- 1 root root 4096 Dec 15 23:40 maxchild

drwxr-xr-x 2 root root 0 Nov 26 21:21 power/

-r--r--r-- 1 root root 4096 Nov 26 21:21 product

-r--r--r-- 1 root root 4096 Dec 15 23:40 quirks

-r--r--r-- 1 root root 4096 Nov 26 21:21 removable

--w------- 1 root root 4096 Dec 15 23:40 remove

-r--r--r-- 1 root root 4096 Nov 26 21:21 serial

-r--r--r-- 1 root root 4096 Nov 26 21:21 speed

lrwxrwxrwx 1 root root 0 Nov 26 21:21 subsystem ->../../../../../bus/usb/

-rw-r--r-- 1 root root 4096 Nov 26 21:21 uevent

-r--r--r-- 1 root root 4096 Dec 15 23:40 urbnum

-r--r--r-- 1 root root 4096 Dec 15 23:40 version

二、使用debugfs

1、挂载 debugfs 到 /sys/kernel/debug 路径下

root@ubuntu:mount -t debugfs none /sys/kernel/debug

2、执行上述步骤之后,在 /sys/kernel/debug 就会生成如下的文件

root@ubuntu:/sys/bus/usb/devices# cd /sys/kernel/debug/

root@ubuntu:/sys/kernel/debug# ll

total 0

drwx------ 22 root root 0 Nov 26 21:21 ./

drwxr-xr-x 7 root root 0 Nov 26 21:21 ../

drwxr-xr-x 2 root root 0 Nov 26 21:21 acpi/

drwxr-xr-x 32 root root 0 Dec 4 16:30 bdi/

drwxr-xr-x 2 root root 0 Nov 26 21:21 bluetooth/

drwxr-xr-x 2 root root 0 Nov 26 21:21 cleancache/

drwxr-xr-x 2 root root 0 Nov 26 21:21 dma_buf/

drwxr-xr-x 4 root root 0 Nov 26 21:21 dri/

drwxr-xr-x 2 root root 0 Nov 26 21:21 dynamic_debug/

drwxr-xr-x 2 root root 0 Nov 26 21:21 extfrag/

drwxr-xr-x 2 root root 0 Nov 26 21:21 frontswap/

-r--r--r-- 1 root root 0 Nov 26 21:21 gpio

drwxr-xr-x 3 root root 0 Nov 26 21:21 hid/

drwxr-xr-x 2 root root 0 Nov 26 21:21 kprobes/

drwxr-xr-x 3 root root 0 Nov 26 21:21 kvm-guest/

drwxr-xr-x 2 root root 0 Nov 26 21:21 mce/

drwxr-xr-x 2 root root 0 Nov 26 21:21 pinctrl/

-r--r--r-- 1 root root 0 Nov 26 21:21 pwm

drwxr-xr-x 2 root root 0 Nov 26 21:21 regmap/

drwxr-xr-x 3 root root 0 Nov 26 21:21 regulator/

-rw-r--r-- 1 root root 0 Nov 26 21:21 sched_features

-r--r--r-- 1 root root 0 Nov 26 21:21 sleep_time

-r--r--r-- 1 root root 0 Nov 26 21:21 suspend_stats

drwxr-xr-x 7 root root 0 Nov 26 21:21 tracing/

drwxr-xr-x 3 root root 0 Nov 26 21:21 usb/

drwxr-xr-x 2 root root 0 Nov 26 21:21 virtio-ports/

-r--r--r-- 1 root root 0 Nov 26 21:21 vmmemctl

-r--r--r-- 1 root root 0 Nov 26 21:21 wakeup_sources

drwxr-xr-x 2 root root 0 Nov 26 21:21 x86/

3、cat 设备节点

执行下述命令之后会以特定格式打印目前USB总线上所有USB设备的信息如下:

root@ubuntu:/sys/kernel/debug# cat usb/devices

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2

B: Alloc= 17/900 us ( 2%), #Int= 1, #Iso= 0

D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1

P: Vendor=1d6b ProdID=0001 Rev= 3.13

S: Manufacturer=Linux 3.13.0-32-generic uhci_hcd

S: Product=UHCI Host Controller

S: SerialNumber=0000:02:00.0

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0

D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1

P: Vendor=0e0f ProdID=0003 Rev= 1.03

S: Manufacturer=VMware

S: Product=VMware Virtual USB Mouse

C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid

E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=1ms

T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 3 Spd=12 MxCh= 7

D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1

P: Vendor=0e0f ProdID=0002 Rev= 1.00

S: Product=VMware Virtual USB Hub

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms

T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6

B: Alloc= 0/800 us ( 0%), #Int= 1, #Iso= 0

D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1

P: Vendor=1d6b ProdID=0002 Rev= 3.13

S: Manufacturer=Linux 3.13.0-32-generic ehci_hcd

S: Product=EHCI Host Controller

S: SerialNumber=0000:02:03.0

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub

E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=480 MxCh= 0

D: Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs= 1

P: Vendor=0bda ProdID=0129 Rev=39.60

S: Manufacturer=Generic

S: Product=USB2.0-CRW

S: SerialNumber=20100201396000000

C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA

I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=50 Driver=rts5139

E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E: Ad=83(I) Atr=03(Int.) MxPS= 3 Ivl=64ms

至于信息的详细解析可以参照 Linux源代码中 Documentation/usb/proc_usb_info.txt 文件。现摘录其中对该格式的详细解释:

| | |__Product ID code

| |__Vendor ID code

|__Device info tag #2

String descriptor info:

S: Manufacturer=ssss

| |__Manufacturer of this device as read from the device.

| For USB host controller drivers (virtual root hubs) this may

| be omitted, or (for newer drivers) will identify the kernel

| version and the driver which provi

使用下面这条命令可以查看系统内核tpm驱动情况:

$ ls -la /lib/modules/`uname -r`/kernel/drivers/char/tpm

总计 100

drwxr-xr-x 2 root root 4096 02-03 21:47 .

drwxr-xr-x 7 root root 4096 02-03 21:47 ..

-rwxr--r-- 1 root root 9812 01-21 15:27 tpm_atmel.ko

-rwxr--r-- 1 root root 11128 01-21 15:27 tpm_bios.ko

-rwxr--r-- 1 root root 15860 01-21 15:27 tpm_infineon.ko

-rwxr--r-- 1 root root 19184 01-21 15:27 tpm.ko

-rwxr--r-- 1 root root 10796 01-21 15:27 tpm_nsc.ko

-rwxr--r-- 1 root root 16516 01-21 15:27 tpm_tis.ko

tpm_tis模块可以完全使用TPM1.2。需要这个模块,没的话可能需要重新编译新的内核。

接下来可以这几条命令加载TPM驱动:

$ sudo modprobe tpm_bios

$ sudo modprobe tpm

$ sudo modprobe tpm_tis force=1 interrupts=0

$ dmesg

...

[xxx.yyy] tpm_tis tpm_tis: 1.2 TPM (device-id 0x4A10, rev-id 78)

如果显示有类似以上信息,说明设置成功。

需要安装TrouSerst和tpm-tools来管理TPM。

$ sudo /etc/init.d/tcsd start

用上面这条命令来起动这个管理工具

然后检查下tpm是不是可用了。

$ sudo tpm_version

TPM Version: 01010000

Manufacturer Info: 53544d20

分类: 电脑/网络 >> *** 作系统/系统故障

问题描述:

我有一个U盘,256M的,如和制作一个LINUX启动U盘??

解析:

U盘做Linux的启动盘

摘要

本文描述了如何在USB存储设备上建立Linux启动系统的过程。

首先让我们先了解一下LINUX下USB设备, Linux USB 驱动程序有三种不同的 USB 主控制器选项,这是因为在主板和 PCI 卡上有三种不同类型的 USB 芯片。"EHCI"驱动程序设计成为实现新的高速 USB 2.0 协议的芯片提供支持。"OHCI"驱动程序用来为非 PC 系统上的(以及带有 SiS 和 ALi 芯片组的 PC 主板上的)USB 芯片提供支持。"UHCI"驱动程序用来为大多数其它 PC 主板(包括 Intel 和 Via)上的 USB 实现提供支持。只需选择与希望启用的 USB 支持的类型对应的"?HCI"驱动程序即可。

启用了"USB support"和适当的"?HCI"USB 主控制器驱动程序后,使 USB 启动并运行只需再进行几个步骤。应该启用"Preliminary USB device filesystem",SCSI计算机标准接口,因为通常我们的USB存储设备,模拟为SCSI硬盘而进行访问

一、关于内核

u *** -storage模块包括在内核但是由于U盘的初始化过程比执行/ *** in/init慢,导致内核已经启动完成了,优盘还没有完成初始化工作,因此根文件系统没有加载,这时执行/ *** in/init命令肯定不成功。所以要对系统内核初始化代码作修改如下:

/init/do_mounts.c

……

* Allow the user to distinguish beeen failed open

* and bad superblock on root device.

*/

- printk ("VFS: Cannot open root device "%s" or %s",

+ printk ("VFS: Cannot open root device "%s" or %s,

retrying in 1 second.", root_device_name, kdevname (ROOT_DEV))

- printk ("Please append a correct "root=" boot option")

- panic("VFS: Unable to mount root fs on %s",

- kdevname(ROOT_DEV))

+ printk ("You may need to append a correct "root=" boot option")

+ printk ("or wait for the root device to bee ready.")

+

+ /* wait 1 second and try again,

+ * allowing time for hubs/devices to bee ready */

+ set_current_state(TASK_INTERRUPTIBLE)

+ schedule_timeout(HZ)

+ goto retry

}

panic("VFS: Unable to mount root fs on %s", kdevname(ROOT_DEV))

out:

……

按照需要重新编译内核。

您也可以在启动内核时加载initrd.img文件到内存中,等待3秒使优盘完成初始化工作,再执行/ *** in/init指令。

1、建立initrd.img文件

# mkdir -p /mnt/initrd

# cd /tmp

# mkinitrd /tmp/initrd.gz 2.4.20-u ***

2、解压initrd.img文件,修改启动脚本linuxrc

# gunzip initrd.gz

# mount -o loop /tmp/initrd /mnt/initrd

# cp / *** in/busybox /mnt/initrd/bin

# cd /mnt/initrd/bin

# ln -s busybox sleep

# vi /mnt/initrd/linuxrc

加入如下内容:

echo wait 3 seconds.....

/bin/sleep 3

3、重新生成initrd.img文件

由于缺省建立的initrd文件比较大(为4MB),为了加快优盘的启动,必须减小它。具体 *** 作如下:

# mkdir -p /mnt/initrdu ***

# cd /tmp

# dd if =/dev/zero of= /tmp/initrdu *** bs=1M count=1

# mke2fs -m 0 initrdu ***

# mount -o loop /tmp/initrdu *** /mnt/initrdu ***

# cp -a /mnt/initrd/* /mnt/initrdu ***

# umount /mnt/initrd

# umount /mnt/initrdu ***

# cd /tmp

# gzip -9 initrdu ***

# cp initrdu *** .gz /boot/initrd-2.4.20-u *** .img

二、建立优盘启动配置与目录结构

(/dev, /proc, /bin, /etc, /lib, /usr, /tmp, /var)

1、将优盘分成两个分区

留给Linux分区容量大小完全取决于安装哪些系统维护工具,结果如下:

# fdisk -l /dev/sda

Disk /dev/sda: 16 heads, 63 sectors, 126 cylinders

Units = cylinders of 1008 * 512 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 102 51376+ 6 FAT16

/dev/sda2 103 126 12096 83 Linux

注意:如果需要使用优盘引导Windows 98,扇区大小必须设置为63个扇区,可以通过fdisk的x命令扩展修改heads、sectors和cylinders参数。最好还是利用U盘相应工具建立.

2、建立与生成ext2分区

# mke2fs -m 0 /dev/sda2

# mkdir -p /mnt/sda2

# mount /dev/sda2 /mnt/sda2

# cd /mnt/sda2

3、建立boot目录

将编译好的内核与initrd.img文件拷贝到boot目录、编译好的模块拷贝到lib/modules目录,以及将/boot/grub的文件拷贝到boot目录,编辑boot/grub/menu.lst文件,内容如下:

timeout 10

color 0x17 0x70

default 0

title Windows 98

rootnoverify (hd0,0)

makeactive

chainloader +1

title GNU/Linux Redhat 8.0 (2.4.20-u *** )

root (hd0,1)

kernel /boot/bzImage ro root=/dev/sda2

initrd /boot/ initrd.img 如果没有initrd.img,这句就不要了

安装grub,具体 *** 作如下:

grub>root (hd1,1)

grub>setup (hd1)

4、建立bin目录

根据自工作的需要拷贝系统维护工具,如in *** od、fsck和mkdosfs等实用程序。

对于常用的工具,建议使用tinylogin tinylogin.busybox 或者busybox busybox,它们可以认您节约不省的空间.

另外,如果使用bash,还必须编辑与裁减/etc/termcap及如下文件:

/bin/bash

/etc/termcap

/usr/share/terminfo/l/linux

/usr/share/terminfo/k/klone+acs

/usr/share/terminfo/k/klone+color

/usr/share/terminfo/k/klone+sgr

5、建立dev proc usr *** in目录

使用cp -a命令拷贝常用的设备文件,包括console、tty1、tty2、tty3sda、sda1、sda2、hda、hdb和hda1等设备文件。如果您的内核使用Devfs, 只要建立这个目录即可.

建立proc usr *** in目录,你了可以ln –s bin *** in建立 *** in的连接.

6、建立lib目录

一定要注意使用ldd命令检查那些共享库文件,这些文件需要按照原来的路径拷贝到lib目录。

一般应有如下文件:

/lib:

–rwxr–xr–x 1 root root 45415 Nov 1 15:39 ld–2.0.7.so

lrwxrwxrwx 1 root root 11 Nov 1 15:39 ld–linux.so.2 –>

ld–2.0.7.so

–rwxr–xr–x 1 root root 731548 Nov 1 15:39 libc–2.0.7.so

lrwxrwxrwx 1 root root 13 Nov 1 15:39 libc.so.6 –>

libc–2.0.7.so

lrwxrwxrwx 1 root root 17 Nov 1 15:39 lib_err.so.2 –>

lib_err.so.2.0

–rwxr–xr–x 1 root root 6209 Nov 1 15:39 lib_err.so.2.0

–rwxr–xr–x 1 root root 153881 Nov 1 15:39 libcrypt–2.0.7.so

lrwxrwxrwx 1 root root 17 Nov 1 15:39 libcrypt.so.1 –>

libcrypt–2.0.7.so

–rwxr–xr–x 1 root root 12962 Nov 1 15:39 libdl–2.0.7.so

lrwxrwxrwx 1 root root 14 Nov 1 15:39 libdl.so.2 –>

libdl–2.0.7.so

lrwxrwxrwx 1 root root 14 Nov 1 15:39 libpam.so.0 –>

libpam.so.0.64

–rwxr–xr–x 1 root root 26906 Nov 1 15:39 libpam.so.0.64

lrwxrwxrwx 1 root root 19 Nov 1 15:39 libpam_misc.so.0 –>

libpam_misc.so.0.64

–rwxr–xr–x 1 root root 7086 Nov 1 15:39 libpam_misc.so.0.64

–r–xr–xr–x 1 root root 35615 Nov 1 15:39 libproc.so.1.2.6

lrwxrwxrwx 1 root root 19 Nov 1 15:39 libtermcap.so.2 –>

libtermcap.so.2.0.8

–rwxr–xr–x 1 root root 12041 Nov 1 15:39 libtermcap.so.2.0.8

–rwxr–xr–x 1 root root 12874 Nov 1 15:39 libutil–2.0.7.so

lrwxrwxrwx 1 root root 16 Nov 1 15:39 libutil.so.1 –>

libutil–2.0.7.so

drwx––x––x 3 root root 1024 Nov 1 15:39 modules

drwx––x––x 2 root root 1024 Nov 1 15:39 security

/lib/modules:

drwx––x––x 4 root root 1024 Nov 1 15:39 2.0.35

/lib/modules/2.0.35:

drwx––x––x 2 root root 1024 Nov 1 15:39 block

drwx––x––x 2 root root 1024 Nov 1 15:39 cdrom

/lib/modules/2.0.35/block:

drwx–––––– 1 root root 7156 Nov 1 15:39 loop.o

/lib/modules/2.0.35/cdrom:

drwx–––––– 1 root root 24108 Nov 1 15:39 cdu31a.o

/lib/security:

–rwx––x––x 1 root root 8771 Nov 1 15:39 pam_permit.so

三、建立配置文件

1、编辑etc/init.d/rcS ?文件名决定于etc/inittab

内容如下:

#!/bin/sh

PATH=/ *** in:/bin

export PATH

mount -n -t proc none /proc

umount /initrd

mount -n -o remount,rw /

mount -n -o remount,rw -t proc none /proc

ifconfig lo 127.0.0.1

hostname U *** Boot

2、编辑etc/fstab文件

内容如下:

/dev/sda2 / ext2 defaults 1 1

none /proc proc defaults 0 0

3、建立etc/inittab文件,如果用busybox生成的init这个文件可以不要。

id:2:initdefault:

si::sysinit:/etc/rcS

1:2345:respawn:/ *** in/getty 9600 tty1

2:23:respawn:/ *** in/getty 9600 tty2

4、建立nsswitch.conf文件

passwd: files

shadow: files

group: files

hosts: files

services: files

neorks: files

protocols: files

rpc: files

ethers: files

masks: files

bootparams: files

automount: files

aliases: files

group: files

publickey: files

5、建立/etc/pam.conf文件

OTHER auth optional /lib/security/pam_permit.so

OTHER account optional /lib/security/pam_permit.so

OTHER password optional /lib/security/pam_permit.so

OTHER session optional /lib/security/pam_permit.so


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8466230.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-16
下一篇 2023-04-16

发表评论

登录后才能评论

评论列表(0条)

保存