我正在构建一个基于 buildroot (2024-02)、init (busybox) 和 Raspberry-pi CM4 的系统。 “自制”应用程序不会给出任何登录提示,所以我自动启动我的 来自 inittab 的应用程序(就在“getty”启动之前):
inittab 的最后一部分:
::sysinit:/bin/hostname -F /etc/hostname
::sysinit:/etc/init.d/rcS
#Start my "home-made" application
/root/appl
#Put a getty on the serial port
console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
tty1::respawn:/sbin/getty -L tty1 0 vt100 # HDMI console
#Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot
#Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
我可以退出应用程序并返回 inittab 以输入 getty(登录提示符)。
应用程序负责:
问题是我必须退出回到 inittab(登录)并重新启动应用程序才能使 cifs 工作。
我尝试同时使用“mount.cifs”和“mount -t cifs”,但问题仍然存在。
有什么建议吗?
解决方案是使用 shell 和脚本启动应用程序:
::sysinit:/bin/hostname -F /etc/hostname
::sysinit:/etc/init.d/rcS
#Start my "home-made" application
::sysinit:/bin/sh -c /root/StartAppl.sh
#Put a getty on the serial port
console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
tty1::respawn:/sbin/getty -L tty1 0 vt100 # HDMI console
StartAppl.sh 是一个调用“appl”的脚本。不知道为什么我必须添加一个调用“appl”的脚本,而不是直接调用“appl”......