Skip to content

Commit

Permalink
preload libimp_control on ingenic devices (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
themactep authored Jan 7, 2024
1 parent bef0eab commit d01a2c2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions general/package/majestic/files/S95majestic
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ load_majestic() {
[ "$(cli -g .watchdog.timeout)" -lt "30" ] && cli -s .watchdog.timeout 30
ulimit -c unlimited && echo "|/usr/sbin/sendcoredump.sh" >/proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" -- $DAEMON_ARGS

if [ "ingenic" = "$(ipcinfo -v)" ]; then
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
sleep 2
if [ -f "/tmp/imp.conf" ]; then
while read -r line; do imp-control.sh $line; done < /tmp/imp.conf
fi
else
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" -- $DAEMON_ARGS
fi

status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
Expand Down Expand Up @@ -49,7 +60,7 @@ stop() {
}

restart() {
stop
stop || true
sleep 1
reload
}
Expand All @@ -60,7 +71,8 @@ reload() {

case "$1" in
start|stop|restart|reload)
"$1";;
"$1"
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
Expand Down

0 comments on commit d01a2c2

Please sign in to comment.