本次經(jīng)驗基于創(chuàng )龍TL437x-IDK開(kāi)發(fā)板,對上電動(dòng)運行程序進(jìn)行步驟分析,希望能幫助大家~ 創(chuàng )龍TL437x-IDK開(kāi)發(fā)板基于TI AM4379 ARM Cortex-A9 CPU,主頻高達1GHz,低功耗DDR3L,這里就不細說(shuō),可自百度搜索,圖片如下:
進(jìn)入主題,步驟如下: 將可執行文件helloworld復制到開(kāi)發(fā)板文件系統"/home/root/"目錄下。
進(jìn)入開(kāi)發(fā)板系統,在"/lib/systemd/system/"目錄下新建和可執行文件名對應的service文件,比如helloworld.service。 Target# cd /lib/systemd/system/ Target# vi helloworld.service
service文件添加如下代碼: [Unit] Description=helloworld //可執行文件名稱(chēng),請根據實(shí)際情況修改 After=basic.service X.service thermal-zone-init.service [Service] Environment=DISPLAY=0:0 ExecStartPre=/bin/echo "****Start to run myscript.service****" ExecStart=/home/root/helloworld //可執行文件路徑,請根據實(shí)際情況修改 StandardOutput=tty KillMode=process KillSignal=SIGKILL SendSIGKILL=yes [Install] WantedBy=multi-user.target
輸入以下命令使能該服務(wù): Target# systemctl -f enable /lib/systemd/system/helloworld.service
重啟開(kāi)發(fā)板后可看到helloworld程序已經(jīng)自動(dòng)啟動(dòng)
|