【发布时间】:2018-05-17 23:53:51
【问题描述】:
我编写了一个简单的脚本,以便在我的主板上使用 3G UMTS 加密狗。
bash 脚本如下:
#!/bin/bash
sleep 1;
/usr/bin/tmux new-session -d -s Cloud
/usr/bin/tmux set-option set-remain-on-exit on
/usr/bin/tmux new-window -d -n 'usb_modeswitch' -t Cloud:2 '/usr/sbin/usb_modeswitch --default-vendor 12d1 --default-product 1446 -J';
/usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 10; /usr/bin/wvdialconf; /usr/bin/wvdial';
及其对应的systemd脚本如下:
[Unit]
Description=Enable UMTS Dongle for Cloud Connectivity
[Service]
Type=oneshot
ExecStart=/usr/umts.sh
RemainAfterExit=true
[Install]
WantedBy=default.target
我还有其他类似的 systemd 文件用于某些应用程序文件,我目前直接写在板上,但希望它们可用于我为新板制作的每张图像。
就食谱而言,我应该如何解决这个问题?
我想创建自己的 Yocto 层:
meta-custom
------ recipes-custom/
------------- files / all such scripts here
------------ custom_1.0.bb
我应该只执行do_install() custom_1.0.bb 配方中的 bash 脚本吗?因为脚本不需要编译?
【问题讨论】:
标签: bash embedded-linux yocto