IMX6ULL-开机启动ssh卡顿

1. 问题现象

i.MX6ULL平台,在调试过程中出现sshd在开机自启动的过程中卡顿现象(等待时间较久),观察打印信息发现,sshd一定等待直到以下代码出现才能正常启动。

random:nonblocking pool is initialized

在此过程中,nonblocking pool 的初始化要 2 分钟。而启动sshd并不需要等待nonblockingpool 初始化。

2. 问题解决

可以通过加速nonblockingpool的初始化速度从而解决sshd启动过慢的问题,具体做法修改内核代码。

在kernel_code/drivers/char/random.c 约 900 行处的voidadd_interrupt_randomness(int irq, int irq_flags) 中有一处判断。

if((fast_pool->count < 64) &&

!time_after(now, fast_pool->last + HZ))

return;

在此基础上加上nonblocking_pool.initialized判断。

if((fast_pool->count < 64) &&

!time_after(now, fast_pool->last + HZ)&&

nonblocking_pool.initialized)

return;

内核加上以上修改后重新编译内核并烧写,开机时sshd就可以正常启动了。

另外,记得在/etc/ssh/sshd_config 下打开PermitRootLogin yes 释放 root 权限登录。

相关推荐
chlk12310 小时前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑11 小时前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件11 小时前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
深紫色的三北六号21 小时前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash1 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI1 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行2 天前
Linux和window共享文件夹
linux
Sinclair2 天前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
木心月转码ing2 天前
WSL+Cpp开发环境配置
linux
Rockbean3 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek