openSUSE
openSUSE_Leap_15.6-DVD-x86_64开机黑屏2分钟后才正常启动的探究解决
一、现象描述:linux开机黑屏2分钟后才正常启动
台式机如今是运行openSUSE_Leap_15.6-DVD-x86_64和fedora40的,都是开机黑屏2分钟后才正常启动,之前安装过fedora16、opensuse15.2、15.3、15.4、15.5也是这样的,还以为是开源显卡驱动程序对独立显卡支持兼容不足,但是使用dmesg命令查看错误信息也并没有指向开源显卡驱动程序amdgpu,而是其它内容(自己也不太了解硬件错误信息)
localhost:~ # vim /etc/default/grub
使用vim文本编辑器打开/etc/default/grub找到这行GRUB_CMDLINE_LINUX_DEFAULT=“splash=silent resume=/dev/disk/by-uuid/36c4e25f-a097-41b4-bd17-f48feecb71c2 preempt=full quiet security=apparmor mitigations=auto”
将splash=silent和quiet删除,开机就不显示动画图片,只显示大量英文信息,英文信息跳动是很快的,只看是否有红色信息出现就行了
localhost:~ # grub2-mkconfig -o /boot/grub2/grub.cfg
正常启动进入系统后,回看开机过程跳出的大量英文信息,使用命令dmesg -l err就是集中显示红色信息的内容
PC-20160104YPJX:~ # dmesg -l err
[ 38.934596] i2c i2c-4: sendbytes: NAK bailout.
[ 75.989341] usb usb3-port5: disabled by hub (EMI?), re-enabling…
[ 77.132391] usb usb3-port5: disabled by hub (EMI?), re-enabling…
[ 84.886714] usb usb3-port1: disabled by hub (EMI?), re-enabling…
[ 85.428710] usb 3-1: device descriptor read/64, error -62
localhost:~ # dmesg -l warn
[ 0.006867] ACPI BIOS Warning (bug): Optional FADT field Pm2ControlBlock has valid Length but zero Address: 0x0000000000000000/0x1 (20230628/tbfadt-624)
[ 0.269677] mtrr: your CPUs had inconsistent variable MTRR settings
[ 5.344017] sd 6:0:0:0: [sdb] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes)
[ 41.862339] process ‘/opt/wechat-beta/wechat’ started with executable stack
[ 47.282863] warning: `NetworkChangeNo’ uses wireless extensions which will stop working for Wi-Fi 7 hardware; use nl80211
[ 48.359649] exFAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 1146.080929] rtw_8822bu 1-2:1.0: firmware failed to leave lps state
[ 1464.064975] rtw_8822bu 1-2:1.0: firmware failed to leave lps state
[ 2288.064908] rtw_8822bu 1-2:1.0: firmware failed to leave lps state
二、解决i2c错误
在百度网站查"i2c-4: sendbytes: NAK bailout"得知:
I2C是一种双线双向通信方式,用于短距离通信,在Linux系统中通常表示为i2c-1, i2c-2等。NAK是I2C通信中的一种信号,表示“不应答”(Negative Acknowledge),用于告知通信过程中数据传输失败或者被终止。
"i2c-1: sendbytes: NAK bailout"这条错误信息意味着在使用i2c-1总线进行数据传输时,目标设备没有响应(即没有返回ACK信号),因此主机终止了数据的发送。
检查硬件连接:确保I2C总线的硬件连接正确,设备确实连接到了总线上。
软件调试:使用I2C工具如i2cdetect和i2cget进行检测,或者启用内核日志(dmesg)来获取更多信息。
localhost:~ # zypper search i2c
Loading repository data…
Reading installed packages…
S | Name | Summary | Type
–±-----------------------±--------------------------------------------------±-------
| ddcutil-i2c-udev-rules | Udev rules to grant logged in users DDC/CI access | package
| i2c-tools | A heterogeneous set of I2C tools for Linux | package
| libi2c0 | I2C/SMBus bus access library | package
| libi2c0-devel | I2C/SMBus bus access library | package
localhost:~ # zypper install i2c-tools
localhost:~ # modprobe i2c-dev
localhost:~ # i2cdetect -l
localhost:~ # i2cdetect -l | sort
i2c-0 i2c Radeon i2c bit bus 0x90 I2C adapter
i2c-1 i2c Radeon i2c bit bus 0x91 I2C adapter
i2c-10 smbus SMBus PIIX4 adapter port 3 at 0b00 SMBus adapter
i2c-11 smbus SMBus PIIX4 adapter port 4 at 0b00 SMBus adapter
i2c-12 smbus SMBus PIIX4 adapter port 1 at 0b20 SMBus adapter
i2c-2 i2c Radeon i2c bit bus 0x92 I2C adapter
i2c-3 i2c Radeon i2c bit bus 0x93 I2C adapter
i2c-4 i2c Radeon i2c bit bus 0x94 I2C adapter
i2c-5 i2c Radeon i2c bit bus 0x95 I2C adapter
i2c-6 i2c Radeon i2c bit bus 0x96 I2C adapter
i2c-7 i2c Radeon i2c bit bus 0x97 I2C adapter
i2c-8 smbus SMBus PIIX4 adapter port 0 at 0b00 SMBus adapter
i2c-9 smbus SMBus PIIX4 adapter port 2 at 0b00 SMBus adapter
localhost:~ # i2cdetect -y 1
localhost:~ # i2cdetect -y 2
localhost:~ # i2cdetect -y 3
localhost:~ # i2cdetect -y 4
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – 35 – – – – – – – – – –
40: – – – – – – – – – – 4a 4b – – – –
50: 50 – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –
localhost:~ # i2cdetect -y 5
localhost:~ # i2cdetect -y 6
localhost:~ # i2cdetect -y 7
localhost:~ # i2cdetect -y 8
localhost:~ # i2cdetect -y 9
localhost:~ # i2cdetect -y 10
localhost:~ # i2cdetect -y 12
localhost:~ # i2cdetect -y 12
逐个查看12条i2c总线,仅仅知道i2c总线4连接到着4个设备0x35 0x4a 0x4b 0x50,具体是什么硬件就无法得知
I2C总线是由Philips公司开发的一种简单、双向二线制同步串行总线。它只需要两根线即可在连接于总线上的器件之间传送信息。
I2C总线用于主设备(一个或多个)与单个或多个从设备之间的通信。多个不同的外围设备可以共享一组仅通过2根线连接到处理器的总线,允许多个集成电路之间进行数据交换,这种简单且可扩展性也是I2C总线与其他接口相比最大的优势之一。
I2C总线的一些特点:只需要两根总线线路;一个串行数据线(SDA)和一个串行时钟线(SCL)。
拆开台式机机箱,看到带有两根线的硬件就有机箱面板开关线缆、前置音频接口、前置USB接口,拔出这些电线接口,再按照原样插上接回去,当然也要拆出钮扣电池再装上,之后开机重设主板时间,进入opensuse15.6还是会出现报错"i2c-1: sendbytes: NAK bailout"。
要先确定是那个硬件出错,先拔掉前置USB接线,重启还出错;再拔掉前置音频接线,重启后没有出现报错"i2c-1: sendbytes: NAK bailout",屏幕只是断闪一下,而且在1分钟之内就进入图形界面,初步确实是前置音频接线产生错误
参考文章:《详解AC97和HD声卡前置音频接口的连接路线》
http://www.mianfeiwendang.com/doc/b234ff784e9deaff3456e433/2
上网一查,原来是电脑主板的F_AUDIO针脚是HD_AUDIO标准,而前置音频接线头是AC97_AUDIO标准的,AC97_AUDIO接头有两根电线将5和6短接,将9和10短接,拆出6和10的线针即可
三、解决usb错误
usb接口的硬件是我们经常接触的,有优盘,usb键盘,usb鼠标,usb无线网卡,usb小风扇,usb小灯等等。台式机机箱后面有四个usb硬件:usb键盘,usb鼠标,usb无线网卡,usb移动硬盘
localhost:~ # lsusb
Bus 003 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 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 006: ID 0bc2:ac30 Seagate RSS LLC BUP Slim