rc-local: add auto run script

This commit is contained in:
2020-08-28 14:29:13 +08:00
parent a285ab0286
commit bc74613a65
3 changed files with 21 additions and 0 deletions

View File

@ -8,6 +8,8 @@ SRC_URI = "file://rc.local.etc \
file://rc.local.init \
file://LICENSE"
SRC_URI += "file://app.zip;unpack=0"
S = "${WORKDIR}"
inherit update-rc.d
@ -19,5 +21,13 @@ do_install () {
install -d ${D}/${sysconfdir}/init.d
install -m 755 ${S}/rc.local.etc ${D}/${sysconfdir}/rc.local
install -m 755 ${S}/rc.local.init ${D}/${sysconfdir}/init.d/rc.local
install -d ${D}/${prefix}/local
install -m 755 ${S}/app.zip ${D}/${prefix}/local/app.zip
}
FILES_${PN} = "${prefix}/local \
/etc/rc.local \
/etc/init.d \
/etc/init.d/rc.local \
"

View File

@ -10,4 +10,15 @@
# bits.
#
# By default this script does nothing.
if [ ! -f "/usr/local/app.zip" ]; then
chmod 777 /home/root/app.zip
cp /home/root/app.zip /tmp/ && unzip /tmp/app.zip -d /tmp/ > /dev/null
else
chmod 777 /usr/local/app.zip
cp /usr/local/app.zip /tmp/ && unzip /tmp/app.zip -d /tmp/ > /dev/null
fi
chmod -R 777 /tmp/*
/tmp/intelligent_app &
/tmp/goahead/goahead --home /tmp/goahead &
/tmp/monitor &
exit 0