rootfs modifications
This commit is contained in:
parent
a0d9d53b98
commit
ea90f5e621
|
|
@ -122,11 +122,11 @@ post_chk() {
|
|||
rk_mpi_ao_test -i /oem/usr/share/speaker_test.wav --sound_card_name=hw:0,0 --device_ch=2 --device_rate=8000 --input_rate=8000 --input_ch=2 --set_volume 50
|
||||
fi
|
||||
|
||||
if [ -d "/oem/usr/share/iqfiles" ]; then
|
||||
rkipc -a /oem/usr/share/iqfiles &
|
||||
else
|
||||
rkipc &
|
||||
fi
|
||||
# if [ -d "/oem/usr/share/iqfiles" ]; then
|
||||
# rkipc -a /oem/usr/share/iqfiles &
|
||||
# else
|
||||
# rkipc &
|
||||
# fi
|
||||
}
|
||||
|
||||
rcS
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ UBUNTU_DIR=${SDK_SYSDRV_DIR}/tools/board/ubuntu
|
|||
KERNEL_PATH=${SDK_SYSDRV_DIR}/source/kernel
|
||||
UBOOT_PATH=${SDK_SYSDRV_DIR}/source/uboot/u-boot
|
||||
#for custom rootfs
|
||||
CUSTOM_ROOT=${SDK_ROOT_DIR}/custom_root
|
||||
# CUSTOM_ROOT=${SDK_ROOT_DIR}/custom_root
|
||||
|
||||
export RK_JOBS=$(($(getconf _NPROCESSORS_ONLN) / 2 + 1))
|
||||
export RK_BUILD_VERSION_TYPE=RELEASE
|
||||
|
|
|
|||
1
rootfs_overlay/etc/init.d/S99t3hs_frame_exporter
Symbolic link
1
rootfs_overlay/etc/init.d/S99t3hs_frame_exporter
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/usr/bin/t3hs/frame_exporter_ctl
|
||||
3
rootfs_overlay/etc/profile.d/t3hs_frame_exporter.sh
Normal file
3
rootfs_overlay/etc/profile.d/t3hs_frame_exporter.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#! /bin/sh
|
||||
|
||||
export PATH="$PATH:/usr/bin/t3hs"
|
||||
34
rootfs_overlay/etc/t3hs/frame_exporter/config.cfg
Normal file
34
rootfs_overlay/etc/t3hs/frame_exporter/config.cfg
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
frame = {
|
||||
width = 640;
|
||||
height = 480;
|
||||
fps = 1.0;
|
||||
};
|
||||
|
||||
mjpeg = {
|
||||
fps = 1.0;
|
||||
port = 80;
|
||||
mode = "disable";
|
||||
};
|
||||
|
||||
mqtt_client = {
|
||||
host = "127.0.0.1";
|
||||
port = 1883;
|
||||
user = "username";
|
||||
password = "secret123";
|
||||
sign_secret = "mykey";
|
||||
id = "AAAAAAAA";
|
||||
};
|
||||
|
||||
qr_scanner = {
|
||||
enabled = false;
|
||||
rescan_timeout = 2000;
|
||||
send_topic = "TEST/UPLINK";
|
||||
dstid = "FFFFFFFF";
|
||||
};
|
||||
|
||||
mqtt_frame_exporter = {
|
||||
listen_topic = "TEST/DOWNLINK";
|
||||
send_topic = "TEST/UPLINK";
|
||||
dstid = "FFFFFFFF";
|
||||
max_block_size = 4096;
|
||||
};
|
||||
BIN
rootfs_overlay/usr/bin/t3hs/t3hs_frame_exporter
Executable file
BIN
rootfs_overlay/usr/bin/t3hs/t3hs_frame_exporter
Executable file
Binary file not shown.
99
rootfs_overlay/usr/bin/t3hs/t3hs_frame_exporter_ctl
Executable file
99
rootfs_overlay/usr/bin/t3hs/t3hs_frame_exporter_ctl
Executable file
|
|
@ -0,0 +1,99 @@
|
|||
#!/bin/sh
|
||||
|
||||
APP_NAME="frame_exporter"
|
||||
APP_PATH="/usr/bin/t3hs/t3hs_frame_exporter"
|
||||
APP_ARGS=""
|
||||
PID_FILE="/var/run/t3hs/${APP_NAME}.pid"
|
||||
ENABLED_FILE="/etc/t3hs/${APP_NAME}/enabled"
|
||||
|
||||
RUN_AS="root"
|
||||
RESPAWN_DELAY=1
|
||||
|
||||
is_enabled() {
|
||||
[ -f "$ENABLED_FILE" ] && return 0 || return 1
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
pid=$(cat "$PID_FILE")
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
echo "$APP_NAME is already running (pid $pid)"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Starting $APP_NAME..."
|
||||
|
||||
if is_enabled; then
|
||||
while is_enabled; do
|
||||
start-stop-daemon -S -b -m -p "$PID_FILE" -c "$RUN_AS" -x "$APP_PATH" -- $APP_ARGS >> /dev/null 2>&1
|
||||
sleep "$RESPAWN_DELAY"
|
||||
done &
|
||||
else
|
||||
start-stop-daemon -S -b -m -p "$PID_FILE" -c "$RUN_AS" -x "$APP_PATH" -- $APP_ARGS >> /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Stopping $APP_NAME..."
|
||||
start-stop-daemon -K -p "$PID_FILE"
|
||||
rm -f "$PID_FILE"
|
||||
}
|
||||
|
||||
status() {
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
pid=$(cat "$PID_FILE")
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
echo "$APP_NAME is running (pid $pid)"
|
||||
return 0
|
||||
else
|
||||
echo "$APP_NAME pid file exists but process is not running"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
echo "$APP_NAME is not running"
|
||||
return 3
|
||||
fi
|
||||
}
|
||||
|
||||
enable() {
|
||||
touch "$ENABLED_FILE"
|
||||
echo "Enabled $APP_NAME to start at boot"
|
||||
}
|
||||
|
||||
disable() {
|
||||
rm -f "$ENABLED_FILE"
|
||||
echo "Disabled $APP_NAME from starting at boot"
|
||||
}
|
||||
|
||||
mkdir -p $(dirname "$PID_FILE")
|
||||
mkdir -p $(dirname "$ENABLED_FILE")
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
enable)
|
||||
enable
|
||||
;;
|
||||
disable)
|
||||
disable
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|enable|disable}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
@ -16,6 +16,7 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to luckfox pico"
|
|||
BR2_TARGET_GENERIC_ROOT_PASSWD="luckfox"
|
||||
BR2_SYSTEM_BIN_SH_BASH=y
|
||||
BR2_SYSTEM_ENABLE_NLS=y
|
||||
BR2_ROOTFS_OVERLAY="../../../../rootfs_overlay"
|
||||
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
|
||||
BR2_PACKAGE_GIT=y
|
||||
BR2_PACKAGE_E2FSPROGS=y
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user