mirror of https://github.com/OpenIPC/firmware.git
load imp-config preset settings using init script (#1254)
parent
1cbfe74443
commit
38a1f5750c
|
@ -111,7 +111,6 @@ BR2_PACKAGE_INGENIC_PWM=y
|
||||||
BR2_PACKAGE_LOGCAT_OPENIPC=y
|
BR2_PACKAGE_LOGCAT_OPENIPC=y
|
||||||
# BR2_PACKAGE_HOST_GDB is not set
|
# BR2_PACKAGE_HOST_GDB is not set
|
||||||
# BR2_PACKAGE_GDB is not set
|
# BR2_PACKAGE_GDB is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# CCACHE
|
# CCACHE
|
||||||
BR2_CCACHE=y
|
BR2_CCACHE=y
|
||||||
|
|
|
@ -91,7 +91,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -93,7 +93,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -91,7 +91,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -92,7 +92,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -91,7 +91,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -91,7 +91,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -93,7 +93,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -91,7 +91,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -92,7 +92,6 @@ BR2_PACKAGE_VTUND_OPENIPC=y
|
||||||
BR2_PACKAGE_YAML_CLI=y
|
BR2_PACKAGE_YAML_CLI=y
|
||||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||||
# BR2_PACKAGE_AUTONIGHT is not set
|
# BR2_PACKAGE_AUTONIGHT is not set
|
||||||
BR2_PACKAGE_INGENIC_LIBIMP_CONTROL=y
|
|
||||||
|
|
||||||
# WiFi
|
# WiFi
|
||||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||||
|
|
|
@ -20,6 +20,8 @@ endef
|
||||||
define INGENIC_LIBIMP_CONTROL_INSTALL_TARGET_CMDS
|
define INGENIC_LIBIMP_CONTROL_INSTALL_TARGET_CMDS
|
||||||
$(INSTALL) -D -m 0755 $(@D)/libimp_control.so $(TARGET_DIR)/usr/lib
|
$(INSTALL) -D -m 0755 $(@D)/libimp_control.so $(TARGET_DIR)/usr/lib
|
||||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(INGENIC_LIBIMP_CONTROL_PKGDIR)/src/imp-control.sh
|
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(INGENIC_LIBIMP_CONTROL_PKGDIR)/src/imp-control.sh
|
||||||
|
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||||
|
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(INGENIC_LIBIMP_CONTROL_PKGDIR)/src/S96impconfig
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(generic-package))
|
$(eval $(generic-package))
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
start() {
|
||||||
|
[ ! -f "/etc/imp.conf" ] && return
|
||||||
|
|
||||||
|
echo -n "Restoring IMP Configuration: "
|
||||||
|
while read -r line; do
|
||||||
|
imp-control.sh $line
|
||||||
|
done < /etc/imp.conf
|
||||||
|
echo "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|restart|reload}"
|
||||||
|
exit 1
|
||||||
|
esac
|
|
@ -1,5 +1,6 @@
|
||||||
config BR2_PACKAGE_MAJESTIC
|
config BR2_PACKAGE_MAJESTIC
|
||||||
bool "Majestic streamer"
|
bool "Majestic streamer"
|
||||||
|
select BR2_PACKAGE_INGENIC_LIBIMP_CONTROL if BR2_OPENIPC_SOC_VENDOR="ingenic"
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Tiny but powerful IPC streaming software
|
Tiny but powerful IPC streaming software
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
DAEMON="majestic"
|
DAEMON="majestic"
|
||||||
|
DAEMON_PATH="/usr/bin"
|
||||||
PIDFILE="/var/run/$DAEMON.pid"
|
PIDFILE="/var/run/$DAEMON.pid"
|
||||||
|
|
||||||
DAEMON_ARGS="-s"
|
DAEMON_ARGS="-s"
|
||||||
|
@ -10,7 +11,7 @@ DAEMON_ARGS="-s"
|
||||||
|
|
||||||
load_majestic() {
|
load_majestic() {
|
||||||
printf 'Starting %s: ' "$DAEMON"
|
printf 'Starting %s: ' "$DAEMON"
|
||||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
[ -f $DAEMON_PATH/$DAEMON ] || echo -en "DISABLED, "
|
||||||
# shellcheck disable=SC2086 # we need the word splitting
|
# shellcheck disable=SC2086 # we need the word splitting
|
||||||
[ -f /etc/coredump.conf ] && . /etc/coredump.conf
|
[ -f /etc/coredump.conf ] && . /etc/coredump.conf
|
||||||
if [ "$coredump_enabled" ]; then
|
if [ "$coredump_enabled" ]; then
|
||||||
|
@ -20,13 +21,9 @@ load_majestic() {
|
||||||
|
|
||||||
if [ "ingenic" = "$(ipcinfo -v)" ]; then
|
if [ "ingenic" = "$(ipcinfo -v)" ]; then
|
||||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x /usr/bin/env -- \
|
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x /usr/bin/env -- \
|
||||||
LD_PRELOAD=/usr/lib/libimp_control.so /usr/bin/$DAEMON $DAEMON_ARGS
|
LD_PRELOAD=/usr/lib/libimp_control.so $DAEMON_PATH/$DAEMON $DAEMON_ARGS
|
||||||
sleep 2
|
|
||||||
if [ -f "/tmp/imp.conf" ]; then
|
|
||||||
while read -r line; do imp-control.sh $line; done < /tmp/imp.conf
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" -- $DAEMON_ARGS
|
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON_PATH/$DAEMON" -- $DAEMON_ARGS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
status=$?
|
status=$?
|
||||||
|
@ -47,7 +44,7 @@ start() {
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
printf 'Stopping %s: ' "$DAEMON"
|
printf 'Stopping %s: ' "$DAEMON"
|
||||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
[ -f $DAEMON_PATH/$DAEMON ] || echo -en "DISABLED, "
|
||||||
start-stop-daemon -K -q -p "$PIDFILE"
|
start-stop-daemon -K -q -p "$PIDFILE"
|
||||||
status=$?
|
status=$?
|
||||||
if [ "$status" -eq 0 ]; then
|
if [ "$status" -eq 0 ]; then
|
||||||
|
|
Loading…
Reference in New Issue