简体   繁体   English

当 psplash 从初始化脚本 (PID=1) 启动时,psplash-write 不起作用

[英]psplash-write does not work when psplash is started from the init script (PID=1)

I have integrated psplash to a custom Yocto layer for NVIDIA Jetson Nano.我已将 psplash 集成到 NVIDIA Jetson Nano 的自定义 Yocto 层。 I want to run psplash from the very first init script (PID=1).我想从第一个初始化脚本 (PID=1) 运行 psplash。 The reason is to cover the time spent by systemd to load unit and service files.原因是为了覆盖 systemd 加载单元和服务文件所花费的时间。 I have added init=/bin/newinit.sh to the Linux kernel parameters.我已将init=/bin/newinit.sh到 Linux kernel 参数中。 Here is the content of the /bin/newinit.sh that replaces my /sbin/init .这是替换我的/bin/newinit.sh的内容/sbin/init

#!/bin/sh
/usr/bin/psplash &
/bin/psplashanimator.sh &
exec /sbin/init

Here is the content of the /bin/psplashanimator.sh这是/bin/psplashanimator.sh的内容

#!/bin/sh
/bin/sleep 0.1 && /usr/bin/psplash-write "PROGRESS 50"

I made sure that psplash-write is not called by any other process by disabling the systemd daemons (psplash-start, psplash-systemd).我通过禁用 systemd 守护进程(psplash-start、psplash-systemd)确保psplash-write不会被任何其他进程调用。 Yet, I can't update the progress bar by using these scripts.但是,我无法使用这些脚本更新进度条。 Psplash is displayed nicely, but nothing on the progress bar. Psplash 显示很好,但进度条上没有任何内容。 If I move /bin/sleep 0.1 && /usr/bin/psplash-write "PROGRESS 50" into the /bin/newinit.sh before exec , it works fine;如果我将/bin/sleep 0.1 && /usr/bin/psplash-write "PROGRESS 50"移动到/bin/newinit.sh之前exec ,它工作正常; but it blocks the main execution of the init script.但它阻止了 init 脚本的主要执行。

All in all, if I start the psplash in a custom init script, psplash-write only works before the exec is called.总而言之,如果我在自定义初始化脚本中启动 psplash,则 psplash-write 仅在调用 exec 之前起作用。 I can't figure out why that is and how to fix that.我不知道为什么会这样以及如何解决。

If there is a simple solution or rationale as to why this wouldn't work, I would kindly appreciate your guidance.如果有一个简单的解决方案或理由说明为什么这不起作用,我将非常感谢您的指导。

NOTE1: Note that conventional way of updating psplash with systemd services ( psplash-systemd.service ) work fine when psplash is started using psplash-start.service , I get progress bar updates.注意1:请注意,当使用psplash-start.service启动 psplash 时,使用 systemd 服务 ( psplash-systemd.service ) 更新 psplash 的传统方法工作正常,我得到进度条更新。

NOTE2: Psplash uses framebuffer driver and FIFO.注 2: Psplash 使用帧缓冲驱动程序和 FIFO。

NOTE3: Related source files: psplash.c psplash-write.c注3 相关源文件: psplash.c psplash-write.c

NOTE4: Current systemd execution (to let you see if I am missing something that must be ready before running psplash)注 4:当前的 systemd 执行(让你看看我是否遗漏了一些在运行 psplash 之前必须准备好的东西)

系统执行

I'm not 100% sure about psplash and systemd, but it might be the case you need to have something like this in your environment to control psplash:我对 psplash 和 systemd 不是 100% 确定,但在您的环境中可能需要这样的东西来控制 psplash:

export TMPDIR=/mnt/.psplash导出 TMPDIR=/mnt/.psplash

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM