1.在packages/rfs/ls1028_ubuntu_main_overlay文件中添加以下内容:
(1)创建可执行脚本:
vi forlinx/.forlinx.sh
#!/bin/bash
echo "forlinx init test" >> /root/forlinx_init
(2)创建system服务:
vi etc/systemd/system/forlinx.service
[Unit]
Description = ls1028 forlinx
[Service]
ExecStart = /forlinx/.forlinx.sh
Type = oneshot
[Install]
WantedBy = multi-user.target
(3)修改编译脚本
vi tools/flex-builder
build_distro_rfs_ubuntu() {
...
...
...
sudo chroot $RFSDIR systemctl enable /etc/systemd/system/forlinx.service //添加此内容
#sudo chroot $RFSDIR systemctl disable wpa_supplicant.service
...
...
...
最后就可以使用全编译命令进行编译,生成的ubuntu.img烧写进去即可实现
forlinx.service服务自启。