mirror of https://github.com/OpenIPC/firmware.git
[no ci] rubyfpv: formatting and restore local tweaksys
parent
c32402293d
commit
7ea9b831bc
|
@ -1,7 +1,6 @@
|
|||
config BR2_PACKAGE_RUBYFPV
|
||||
bool "rubyfpv"
|
||||
select BR2_PACKAGE_IW
|
||||
default n
|
||||
select BR2_PACKAGE_IW
|
||||
help
|
||||
Ruby package
|
||||
|
||||
|
|
|
@ -6,24 +6,27 @@
|
|||
chip=$(ipcinfo -c)
|
||||
fw=$(grep "BUILD_OPTION" "/etc/os-release" | cut -d= -f2)
|
||||
echo "Chip: " > /tmp/ruby_boot.log
|
||||
echo ${chip} >> /tmp/ruby_boot.log
|
||||
echo "$chip" >> /tmp/ruby_boot.log
|
||||
echo "Firmware: " >> /tmp/ruby_boot.log
|
||||
echo ${fw} >> /tmp/ruby_boot.log
|
||||
echo "$fw" >> /tmp/ruby_boot.log
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if ! [ -f /etc/system.ok ]; then
|
||||
tweaksys ${chip}
|
||||
fi
|
||||
start)
|
||||
if [ ! -f /etc/system.ok ]; then
|
||||
tweaksys "$chip"
|
||||
exit 0
|
||||
fi
|
||||
echo "Starting Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_start &
|
||||
;;
|
||||
|
||||
echo "Starting Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_start &
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_stop.sh
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
stop)
|
||||
echo "Stopping Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_stop.sh
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -0,0 +1,187 @@
|
|||
#!/bin/sh
|
||||
chip=$(ipcinfo -c)
|
||||
family=$(ipcinfo -f)
|
||||
vendor=$(ipcinfo -v)
|
||||
|
||||
if [ ! "$chip" = "hi3536dv100" ]; then
|
||||
sensor=$(ipcinfo -s)
|
||||
fi
|
||||
|
||||
basic() {
|
||||
# set boot delay
|
||||
fw_setenv bootdelay 0
|
||||
|
||||
# free uart for telemetry
|
||||
sed -i "s!console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL!#console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL!g" /etc/inittab
|
||||
|
||||
# tune socket buffer
|
||||
echo "net.core.rmem_default=512000" >> /etc/sysctl.conf
|
||||
}
|
||||
|
||||
prefix=${family}
|
||||
|
||||
hisi_goke() {
|
||||
if [ "$vendor" = "hisilicon" ]; then
|
||||
prefix="open"
|
||||
fi
|
||||
|
||||
# remove unneeded modules
|
||||
sed -i "s!insmod ${prefix}_rgn.ko!#insmod ${prefix}_rgn.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_jpege.ko!#insmod ${prefix}_jpege.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_ive.ko save_power=0!#insmod ${prefix}_ive.ko save_power=0!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_aio.ko!#insmod ${prefix}_aio.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_ai.ko!#insmod ${prefix}_ai.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_ao.ko!#insmod ${prefix}_ao.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_aenc.ko!#insmod ${prefix}_aenc.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_adec.ko!#insmod ${prefix}_adec.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_acodec.ko!#insmod ${prefix}_acodec.ko!g" "/usr/bin/load_${vendor}"
|
||||
|
||||
# change fps 25 -> 30
|
||||
sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/imx307_i2c_2l_1080p.ini
|
||||
sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/smtsec_imx307_i2c_4l_1080p.ini
|
||||
sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/imx335_i2c_4M.ini
|
||||
}
|
||||
|
||||
sigmastar() {
|
||||
sed -i "s!serial=/dev/ttyAMA0!serial=/dev/ttyS0!g" /etc/telemetry.conf
|
||||
sed -i "s!Device = /dev/ttyAMA0!Device = /dev/ttyS0!g" /etc/mavlink.conf
|
||||
}
|
||||
|
||||
majestic_generic() {
|
||||
# digital image stabilization
|
||||
#cli -s .isp.dis true
|
||||
|
||||
cli -s .isp.slowShutter disabled
|
||||
cli -s .image.contrast 50
|
||||
cli -s .image.luminance 50
|
||||
cli -s .video0.size 1920x1080
|
||||
cli -s .video0.fps 30
|
||||
cli -s .video0.bitrate 5120
|
||||
cli -s .video0.codec h264
|
||||
cli -s .video0.rcMode cbr
|
||||
cli -s .video0.gopSize 1.5
|
||||
|
||||
# lowdelay support only imx307 sensor
|
||||
if [ "$sensor" = "imx307" ]; then
|
||||
cli -s .isp.lowDelay true
|
||||
#cli -s .video0.sliceUnits 4
|
||||
fi
|
||||
|
||||
if [ "$sensor" = "imx335" ]; then
|
||||
cli -s .isp.drc 350
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx335_i2c_4M.ini
|
||||
fi
|
||||
|
||||
cli -s .hls.enabled false
|
||||
cli -s .netip.enabled false
|
||||
cli -s .jpeg.enabled false
|
||||
}
|
||||
|
||||
majestic_sigmastar() {
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx415_fpv.bin
|
||||
cli -s .isp.exposure 10
|
||||
cli -s .video0.codec h265
|
||||
cli -s .video0.size 1920x1080
|
||||
cli -s .video0.fps 60
|
||||
cli -s .video0.rcMode cbr
|
||||
cli -s .jpeg.enabled false
|
||||
}
|
||||
|
||||
streamer() {
|
||||
if [ -f /usr/bin/majestic ]; then
|
||||
if [ "$vendor" = "sigmastar" ]; then
|
||||
majestic_sigmastar
|
||||
else
|
||||
majestic_generic
|
||||
fi
|
||||
|
||||
# outgoing rtp stream
|
||||
cli -s .outgoing.enabled true
|
||||
cli -s .outgoing.server udp://127.0.0.1:5600
|
||||
fi
|
||||
|
||||
if [ -f /usr/bin/venc ]; then
|
||||
if [ "$sensor" = "imx335" ]; then
|
||||
sed -i "s!version=200_imx307B!version=300_imx335B!g" /etc/venc.conf
|
||||
sed -i "s!size=720p!size=1292x972!g" /etc/venc.conf
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
finish() {
|
||||
# complete tweaks and add flag
|
||||
fw_setenv wlandev
|
||||
touch /etc/system.ok
|
||||
echo "Restart system to apply fpv changes..."
|
||||
reboot
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
gk7205v200 | gk7205v210 | hi3516ev200)
|
||||
echo "Preparing system tweaks for ${chip}..."
|
||||
|
||||
# set custom config
|
||||
if [ "$chip" = "gk7205v200" ] && [ "$sensor" = "imx307" ]; then
|
||||
echo "switch to custom sensor config"
|
||||
#cli -s .isp.sensorConfig /etc/sensors/60fps/720p_imx307_i2c_2l.ini
|
||||
fi
|
||||
|
||||
# fix osmem in bootargs
|
||||
bootargs=$(fw_printenv -n bootargs)
|
||||
if echo "$bootargs" | grep -q "32M"; then
|
||||
newbootargs="mem=\${osmem} "$(echo "$bootargs" | cut -d " " -f2-)
|
||||
fw_setenv bootargs "$newbootargs"
|
||||
fw_setenv osmem 40M
|
||||
fi
|
||||
|
||||
# remove unneeded scripts
|
||||
rm -f /etc/init.d/S60crond /etc/init.d/S49ntpd /etc/init.d/S02klogd
|
||||
|
||||
basic
|
||||
hisi_goke
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
gk7205v300 | hi3516ev300)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
|
||||
# increase osmem
|
||||
mem=$(fw_printenv -n osmem) && [ "$mem" = "32M" ] && fw_setenv osmem 64M && set_allocator cma || echo "Memory allocated for the system:" "$mem"
|
||||
|
||||
# set sensor config for smtsec board
|
||||
if [ "$chip" = "gk7205v300" ] && [ "$sensor" = "imx307" ]; then
|
||||
cli -s .isp.sensorConfig /etc/sensors/smtsec_imx307_i2c_4l_1080p.ini
|
||||
fi
|
||||
|
||||
basic
|
||||
hisi_goke
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
t31l | t31n | t31x | t31zx)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
basic
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
hi3536dv100)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
finish
|
||||
;;
|
||||
|
||||
ssc33x)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
basic
|
||||
sigmastar
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {gk7205v200|gk7205v210|gk7205v300|hi3516ev200|hi3516ev300|t31l|t31n|t31x|t31zx|hi3536dv100|ssc33x}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
|
@ -1,3 +1,9 @@
|
|||
################################################################################
|
||||
#
|
||||
# rubyfpv
|
||||
#
|
||||
################################################################################
|
||||
|
||||
RUBYFPV_SITE_METHOD = git
|
||||
RUBYFPV_SITE = https://github.com/PetruSoroaga/RubyFPV
|
||||
RUBYFPV_VERSION = 5ec137401ec338c9273e48a7cb9402d96010b9dd
|
||||
|
@ -5,8 +11,8 @@ RUBYFPV_VERSION = 5ec137401ec338c9273e48a7cb9402d96010b9dd
|
|||
RUBYFPV_DEPENDENCIES += libpcap iw
|
||||
|
||||
RUBYFPV_MAKE_OPTS = \
|
||||
CC="$(TARGET_CC)" \
|
||||
CXX="$(TARGET_CXX)"
|
||||
CC="$(TARGET_CC)" \
|
||||
CXX="$(TARGET_CXX)"
|
||||
|
||||
define RUBYFPV_BUILD_CMDS
|
||||
$(MAKE) $(RUBYFPV_MAKE_OPTS) -C $(@D) vehicle RUBY_BUILD_ENV=openipc
|
||||
|
@ -16,6 +22,15 @@ define RUBYFPV_INSTALL_TARGET_CMDS
|
|||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(RUBYFPV_PKGDIR)/files/S73ruby
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/root/ruby/licenses
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/root/ruby/licenses $(@D)/licenses/*
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/firmware/ath9k_htc
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/firmware/ath9k_htc $(RUBYFPV_PKGDIR)/files/htc_9271.fw.3
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(RUBYFPV_PKGDIR)/files/tweaksys
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/ruby_start
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/ruby_logger
|
||||
|
@ -23,14 +38,6 @@ define RUBYFPV_INSTALL_TARGET_CMDS
|
|||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/ruby_tx_telemetry
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(RUBYFPV_PKGDIR)/files/ruby_stop.sh
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/sbin $(RUBYFPV_PKGDIR)/files/version_ruby_base.txt
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(DATALINK_PKGDIR)/files/tweaksys
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/root/ruby/licenses
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/root/ruby/licenses $(@D)/licenses/*
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/firmware/ath9k_htc
|
||||
cp $(RUBYFPV_PKGDIR)/files/htc_9271.fw.3 $(TARGET_DIR)/lib/firmware/ath9k_htc
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
|
Loading…
Reference in New Issue