많은 사람들과 마찬가지로, BeagleBone Black boot가 실행될 때 직접 실행되는 Qt 애플리케이션을 갖고 싶습니다. 다음과 같은 다른 주제의 답변을 사용하십시오 : Beaglebone Boot to Qt App; Start QT Application on bootup on an Embedded Linux Device (Beaglebone Black)터치 스크린이있는 Qt 앱으로 BeagleBone 부팅
저는 Angstrom 2012-09-12와 함께 BeagleBone Black revC를 보유하고 있습니다.
나는 다음과 같은 서비스 설치를 부팅 시작하는 내 응용 프로그램을 얻을 달성 :"autoShow.service"
[Unit]
Description=Autorun Qt app
ConditionFileIsExecutable=/home/root/ShowcaseNice
[Service]
Type=simple
TimeoutStartSec=120
WorkingDirectory=/home/root
ExecStart=/bin/sh -c 'source /etc/profile ; /home/root/ShowcaseNice -qws'
Restart=always
[Install]
WantedBy=multi-user.target
하지만 내 응용 프로그램은 터치 스크린 (4DCAPE-43T)를 통해 터치 인터페이스를 사용하고 작동하지 않습니다 모든. 시스템 응용 프로그램을 실행할 때 tslib 라이브러리가로드되지 않은 것 같습니다.
ConditionPathExists=/dev/input/touchscreen0
그런 다음 서비스가 응용 프로그램을로드하지 않고 경로가 존재하지 않기 때문에 오류 메시지가 표시됩니다 : 나는 서비스에 [단위]이 줄을 추가 할 때 때문에 추론.
또한 단순한 유휴 상태에서 유형을 바꾸면 BeagleBone이 유휴 모드 일 때만 응용 프로그램을로드하므로 모든 부팅 프로세스가 끝날 때 대부분의 경우 응용 프로그램이로드되기 때문에 때때로 작동합니다.
tslib로드가 끝난 후 응용 프로그램 실행을 보장하는 방법을 찾으려고했지만 서비스가 아닌 tslib를로드하는 것을 찾을 수 없었습니다. 그렇다면 어떻게 실행하기 전에 "/ dev/input/touchscreen0"파일이 이미 존재하는지 어떻게 확인할 수 있습니까?
감사합니다.
PS : 내 프로필 파일이 때문에 환경 변수의 정의로 내 서비스에서 언급 된 바와 같이, 여기있다 :
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
PATH="/usr/local/bin:/usr/bin:/bin"
EDITOR="/bin/vi" # needed for packages like cron
test -z "$TERM" && TERM="vt100" # Basic terminal capab. For screen etc.
if [ ! -e /etc/localtime ]; then
TZ="UTC" # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html
# for an explanation of how to set this to your local timezone.
export TZ
fi
if [ "$HOME" = "/home/root" ]; then
PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
fi
if [ "$PS1" ]; then
# works for bash and ash (no other shells known to be in use here)
PS1='\[email protected]\h:\w\$ '
fi
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/* ; do
. $i
done
unset i
fi
PATH=$PATH:/opt/qt/lib
QWS_MOUSE_PROTO="LinuxInput:/dev/input/touchscreen0 MouseMan:/dev/input/mouse2"
SLOTS=/sys/devices/bone_capemgr.8/slots
PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins
export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM QWS_MOUSE_PROTO SLOTS PINS
echo DM-GPIO-Test > $SLOTS
umask 022
EDIT1 :
"autoShow.service"
[Unit]
Description=Autorun Qt app
ConditionFileIsExecutable=/home/root/ShowcaseNice
After=systemd-modules-load.service
[Service]
Type=oneshot
WorkingDirectory=/home/root
ExecStart=/bin/sh -c 'source /etc/profile ; /home/root/ShowcaseNice -qws'
Restart=always
RemainAfterExit=1;
[Install]
WantedBy=multi-user.target
그리고 : 서비스 파일에 수정 응용 프로그램이 실행 중일 때 (터치 기능이 작동하지 않는 상태) 상태를 확인한 후 다음 결과를 얻습니다.
[email protected]:~# systemctl status systemd-modules-load.service
systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static)
Active: active (exited) since Sat 2000-01-01 01:16:39 CET; 29s ago
Docs: man:systemd-modules-load.service(8)
man:modules-load.d(5)
Process: 89 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/systemd-modules-load.service
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[email protected]:~# systemctl status autoShow.service
autoShow.service - Autorun Qt app
Loaded: loaded (/lib/systemd/system/autoShow.service; enabled)
Active: activating (start) since Sat 2000-01-01 01:16:39 CET; 32s ago
Main PID: 140 (sh)
CGroup: name=systemd:/system/autoShow.service
|-140 /bin/sh -c source /etc/profile ; /home/root/ShowcaseNice -qws
`-195 /home/root/ShowcaseNice -qws
Jan 01 01:16:39 beaglebone systemd[1]: Starting Autorun Qt app...
Jan 01 01:16:45 beaglebone sh[140]: Cannot open mouse input device '/dev/input/touchscreen0': No such file or directory
[email protected]:~# systemctl status rc-local.service
rc-local.service
Loaded: error (Reason: No such file or directory)
Active: inactive (dead)
EDIT2 : 명제를 결합한 여러 가지 테스트를 수행 한 후에 대부분의 시간 동안 작동하는 것으로 보이는 중간 솔루션을 발견했습니다. 그러나 때로는 터치 기능이 여전히 작동하지 않습니다. systemd (see this post)와 함께 다른 문제를 겪고 있기 때문에 나는 그것을 옆에 두었다.
"autoShow.service"
[Unit]
Description=Autorun Qt app
ConditionFileIsExecutable=/home/root/ShowcaseNice
[Service]
[email protected] or getty.target
Requires=systemd-modules-load.service
WorkingDirectory=/home/root
ExecStart=/bin/sh -c 'source /etc/profile ; /home/root/ShowcaseNice -qws'
Restart=always
sysVStartPriority=99
Type=idle
[Install]
WantedBy=multi-user.target
시도해 봤나 = getty @ .service 또는 getty.target –
예, 전에 이미 시도한 및 (심지어 Erik 주어진 낮은 우선 순위 트릭 함께) 다시 시도했지만 작동하지 않습니다. – Puck