Add gk7205v300_ultimate_oko2 project

pull/2/head
Igor Zalatov (from Citadel PC) 2023-04-30 18:23:04 +03:00
parent 975158a408
commit 265107db13
290 changed files with 16943 additions and 0 deletions

View File

@ -0,0 +1,48 @@
source "$BR2_EXTERNAL_GOKE_PATH/linux/Config.ext.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/goke_patcher/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/aura-httpd/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/baresip-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/comgt/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/dropbear-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/df_sdwan_edge/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/fdk-aac-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/ffmpeg-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/fwprintenv-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/goke-osdrv-gk710x/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/goke-osdrv-gk7205v200/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/hisi-gpio/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/hisilicon-opensdk/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/i2c-telemetry/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/ipctool/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/json-c-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/jsonfilter/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/lame-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/libcurl-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/libevent-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/libhv-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/libogg-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/libre-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/librem-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/libsrt-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/libwebsockets-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/linux-firmware-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/majestic-fonts/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/majestic/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/mavfwd/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/mavlink-router/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/mbedtls-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/microbe-web/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/motors/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/mt7601u-ap-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/nabto/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/node-exporter/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/opus-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/quirc-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/rtl8188fu-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/rtl8812au-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/uacme-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/vtund-openipc/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/wifibroadcast/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/yaml-cli/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/xmdp/Config.in"
source "$BR2_EXTERNAL_GOKE_PATH/package/zerotier-one/Config.in"

View File

@ -0,0 +1,116 @@
# Architecture
BR2_arm=y
BR2_cortex_a7=y
BR2_ARM_EABI=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_ARM_INSTRUCTIONS_THUMB2=y
BR2_KERNEL_HEADERS_VERSION=y
BR2_DEFAULT_KERNEL_VERSION="4.9.37"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
# Toolchain
BR2_PER_PACKAGE_DIRECTORIES=y
BR2_GCC_VERSION_8_X=y
#BR2_TOOLCHAIN_USES_UCLIBC=y
#BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y
#BR2_TOOLCHAIN_BUILDROOT_LIBC="uclibc"
BR2_TOOLCHAIN_USES_MUSL=y
BR2_TOOLCHAIN_BUILDROOT_MUSL=y
BR2_TOOLCHAIN_BUILDROOT_LIBC="musl"
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_TOOLCHAIN_BUILDROOT_USE_SSP=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.37"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_GOKE_PATH)/board/gk7205v200/kernel/gk7205v300.generic.config"
BR2_LINUX_KERNEL_UIMAGE=y
BR2_LINUX_KERNEL_XZ=y
BR2_LINUX_KERNEL_EXT_GOKE_PATCHER=y
BR2_LINUX_KERNEL_EXT_GOKE_PATCHER_LIST="$(BR2_EXTERNAL_GOKE_PATH)/board/gk7205v200/kernel/patches/ $(BR2_EXTERNAL_GOKE_PATH)/board/gk7205v200/kernel/overlay"
# Filesystem
# BR2_TARGET_TZ_INFO is not set
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_ROOTFS_OVERLAY="$(TOPDIR)/../general/overlay"
BR2_ROOTFS_POST_BUILD_SCRIPT="$(TOPDIR)/../scripts/executing_commands_for_$(BR2_TOOLCHAIN_BUILDROOT_LIBC).sh"
# OpenIPC configuration
BR2_TOOLCHAIN_BUILDROOT_VENDOR="openipc"
BR2_TARGET_GENERIC_ISSUE="Welcome to OpenIPC v2.2"
BR2_TARGET_GENERIC_HOSTNAME="openipc-gk7205v300"
BR2_GLOBAL_PATCH_DIR="$(TOPDIR)/../general/package/all-patches"
# OpenIPC packages
BR2_PACKAGE_BUSYBOX_CONFIG="$(TOPDIR)/../general/package/busybox/busybox.config"
BR2_PACKAGE_DROPBEAR_OPENIPC=y
# BR2_PACKAGE_FDK_AAC_OPENIPC is not set
BR2_PACKAGE_FWPRINTENV_OPENIPC=y
BR2_PACKAGE_GOKE_OSDRV_GK7205V200=y
BR2_PACKAGE_HISILICON_OPENSDK=y
BR2_PACKAGE_HASERL=y
# BR2_PACKAGE_HISI_GPIO is not set
BR2_PACKAGE_IPCTOOL=y
BR2_PACKAGE_JSON_C=y
BR2_PACKAGE_LAME_OPENIPC=y
BR2_PACKAGE_LIBCURL_OPENIPC=y
BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y
# BR2_PACKAGE_LIBCURL_OPENIPC_VERBOSE is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set
BR2_PACKAGE_LIBCURL_OPENIPC_MBEDTLS=y
BR2_PACKAGE_LIBEVENT_OPENIPC=y
BR2_PACKAGE_LIBEVENT_OPENIPC_REMOVE_PYSCRIPT=y
BR2_PACKAGE_LIBOGG_OPENIPC=y
BR2_PACKAGE_LIBWEBSOCKETS_OPENIPC=y
BR2_PACKAGE_LIBYAML=y
BR2_PACKAGE_MAJESTIC_FONTS=y
BR2_PACKAGE_MAJESTIC=y
BR2_PACKAGE_MBEDTLS_OPENIPC=y
# BR2_PACKAGE_MBEDTLS_OPENIPC_PROGRAMS is not set
# BR2_PACKAGE_MBEDTLS_OPENIPC_COMPRESSION is not set
BR2_PACKAGE_MICROBE_WEB=y
# BR2_PACKAGE_MINI_SNMPD is not set
BR2_PACKAGE_MOTORS=y
BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
# BR2_PACKAGE_SSHPASS is not set
BR2_PACKAGE_UACME_OPENIPC=y
BR2_PACKAGE_VTUND_OPENIPC=y
BR2_PACKAGE_YAML_CLI=y
BR2_PACKAGE_QUIRC_OPENIPC=y
# WiFi
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC=y
BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_MT7601U=y
# BR2_PACKAGE_RTL8188EU is not set
# WIREGUARD
BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
# IPTABLES
BR2_PACKAGE_IPTABLES=y
# MQTT
BR2_PACKAGE_MOSQUITTO=y
# BR2_PACKAGE_MOSQUITTO_BROKER is not set
# ZEROTIER
BR2_PACKAGE_ZEROTIER_ONE=y
# DEBUG
BR2_PACKAGE_HOST_GDB=y
BR2_PACKAGE_GDB=y

View File

@ -0,0 +1 @@
gk7205v300_ultimate_defconfig

View File

@ -0,0 +1,2 @@
name: GOKE
desc: Buildroot external tree for Goke based IP cameras

View File

@ -0,0 +1,2 @@
include $(BR2_EXTERNAL_GOKE_PATH)/linux/linux-ext-goke_patcher.mk
include $(sort $(wildcard $(BR2_EXTERNAL_GOKE_PATH)/package/*/*.mk))

View File

@ -0,0 +1,15 @@
config BR2_LINUX_KERNEL_EXT_GOKE_PATCHER
bool "Goke kernel patches"
select BR2_PACKAGE_GOKE_PATCHER
help
Patch Kernel for Goke boards
if BR2_LINUX_KERNEL_EXT_GOKE_PATCHER
config BR2_LINUX_KERNEL_EXT_GOKE_PATCHER_LIST
string "Patch list"
help
Space-separated list of patches to be applied
endif # BR2_LINUX_KERNEL_EXT_GOKE_PATCHER

View File

@ -0,0 +1,11 @@
################################################################################
#
# linux_kernel_ext_goke_patcher
#
################################################################################
LINUX_EXTENSIONS += goke_patcher
define GOKE_PATCHER_PREPARE_KERNEL
$(GOKE_PATCHER_PKGDIR)/apply.sh $(@D) $(BR2_LINUX_KERNEL_EXT_GOKE_PATCHER_LIST)
endef

View File

@ -0,0 +1 @@
../../general/package/goke-osdrv-gk7205v200

View File

@ -0,0 +1,303 @@
#!/bin/bash
#
# OpenIPC.org (c)
#
#
# Constants
#
MAX_KERNEL_SIZE=0x200000 # 2MiB, 2097152
MAX_KERNEL_SIZE_ULTIMATE=0x300000 # 3MiB, 3145728
MAX_KERNEL_SIZE_EXPERIMENTAL=0x3E8480 # ~3.9MiB, 4097152
MAX_ROOTFS_SIZE=0x500000 # 5MiB, 5242880
MAX_ROOTFS_SIZE_ULTIMATE=0xA00000 # 10MiB, 10485760
_d=$(date +"%y.%m.%d")
OPENIPC_VER=$(echo OpenIPC v${_d:0:1}.${_d:1})
unset _d
SRC_CACHE_DIR="/tmp/buildroot_dl"
#
# Functions
#
echo_c() {
# 30 grey, 31 red, 32 green, 33 yellow, 34 blue, 35 magenta, 36 cyan,37 white
echo -e "\e[1;$1m$2\e[0m"
}
log_and_run() {
_command=$1
echo_c 35 "$_command"
$_command
unset _command
}
clone() {
sudo apt-get update -y
sudo apt-get install -y automake autotools-dev bc build-essential curl fzf git libtool rsync unzip
git clone --depth=1 https://github.com/OpenIPC/firmware.git
}
fresh() {
BR_VER=$1
if [ -d "$SRC_CACHE_DIR" ]; then
echo_c 36 "Found cache directory."
else
echo_c 31 "Cache directory not found."
echo_c 34 "Creating cache directory ..."
log_and_run "mkdir -p ${SRC_CACHE_DIR}"
echo_c 34 "Done.\n"
fi
if [ -d "buildroot-${BR_VER}" ]; then
echo_c 36 "Found existing Buildroot directory."
if [ -d "buildroot-${BR_VER}/dl" ]; then
echo_c 36 "Found existing Buildroot downloads directory."
echo_c 34 "Copying Buildroot downloads to cache directory ..."
log_and_run "cp -rvf buildroot-${BR_VER}/dl/* ${SRC_CACHE_DIR}"
echo_c 34 "Done.\n"
fi
echo_c 34 "Cleaning source directory."
echo_c 35 "make distclean"
make distclean
echo_c 34 "Done.\n"
else
echo_c 31 "Buildroot sources not found."
fi
echo_c 34 "Downloading Buildroot sources to cache directory ..."
log_and_run "curl --continue-at - --output ${SRC_CACHE_DIR}/buildroot-${BR_VER}.tar.gz https://buildroot.org/downloads/buildroot-${BR_VER}.tar.gz"
echo_c 34 "Done.\n"
echo_c 34 "Extracting a fresh copy of Buildroot from Buildroot sources ..."
log_and_run "tar xvf ${SRC_CACHE_DIR}/buildroot-${BR_VER}.tar.gz"
echo_c 34 "Done.\n"
echo_c 34 "Copying cached source files back to Buildroot ..."
log_and_run "mkdir -p buildroot-${BR_VER}/dl/"
log_and_run "cp -rvf ${SRC_CACHE_DIR}/* buildroot-${BR_VER}/dl/"
echo_c 34 "Done.\n"
# make prepare
echo_c 33 "Start building OpenIPC Firmware ${OPENIPC_VER} for ${SOC}."
echo "The start-stop times" >/tmp/openipc_buildtime.txt
date >>/tmp/openipc_buildtime.txt
}
should_fit() {
filename=$1
maxsize=$2
filesize=$(stat --printf="%s" ./output/images/$filename)
if [[ $filesize -gt $maxsize ]]; then
export TG_NOTIFY="Warning: $filename is too large: $filesize vs $maxsize"
echo_c 31 "Warning: $filename is too large: $filesize vs $maxsize"
exit 1
fi
}
rename() {
if grep -q ultimate_defconfig ./output/.config || grep -q ultimate_oko2_defconfig ./output/.config || grep -q fpv_defconfig ./output/.config; then
should_fit uImage $MAX_KERNEL_SIZE_ULTIMATE
should_fit rootfs.squashfs $MAX_ROOTFS_SIZE_ULTIMATE
else
should_fit uImage $MAX_KERNEL_SIZE
should_fit rootfs.squashfs $MAX_ROOTFS_SIZE
fi
mv -v ./output/images/uImage ./output/images/uImage.${SOC}
mv -v ./output/images/rootfs.squashfs ./output/images/rootfs.squashfs.${SOC}
mv -v ./output/images/rootfs.cpio ./output/images/rootfs.${SOC}.cpio
mv -v ./output/images/rootfs.tar ./output/images/rootfs.${SOC}.tar
date >>/tmp/openipc_buildtime.txt
echo_c 31 "\n\n$(cat /tmp/openipc_buildtime.txt)\n\n"
}
rename_initramfs() {
should_fit uImage $MAX_KERNEL_SIZE_EXPERIMENTAL
mv -v ./output/images/uImage ./output/images/uImage.initramfs.${SOC}
mv -v ./output/images/rootfs.cpio ./output/images/rootfs.${SOC}.cpio
mv -v ./output/images/rootfs.tar ./output/images/rootfs.${SOC}.tar
date >>/tmp/openipc_buildtime.txt
echo_c 31 "\n\n$(cat /tmp/openipc_buildtime.txt)\n\n"
}
autoup_rootfs() {
echo_c 34 "\nDownloading u-boot created by OpenIPC"
curl --location --output ./output/images/u-boot-${SOC}-universal.bin \
https://github.com/OpenIPC/firmware/releases/download/latest/u-boot-${SOC}-universal.bin
echo_c 34 "\nMaking autoupdate u-boot image"
./output/host/bin/mkimage -A arm -O linux -T firmware -n "$OPENIPC_VER" \
-a 0x0 -e 0x50000 -d ./output/images/u-boot-${SOC}-universal.bin \
./output/images/autoupdate-uboot.img
echo_c 34 "\nMaking autoupdate kernel image"
./output/host/bin/mkimage -A arm -O linux -T kernel -C none -n "$OPENIPC_VER" \
-a 0x50000 -e 0x250000 -d ./output/images/uImage.${SOC} \
./output/images/autoupdate-kernel.img
echo_c 34 "\nMaking autoupdate rootfs image"
./output/host/bin/mkimage -A arm -O linux -T filesystem -n "$OPENIPC_VER" \
-a 0x250000 -e 0x750000 -d ./output/images/rootfs.squashfs.${SOC} \
./output/images/autoupdate-rootfs.img
}
#################################################################################
FUNCS=(
ambarella-s3l
ak3916ev300
ak3918ev300
fh8833v100
fh8852v100
fh8852v200
fh8852v210
fh8856v100
fh8856v200
fh8856v210
fh8858v200
fh8858v210
gk7101
gk7101s
gk7102
gk7102s
gk7202v300
gk7205v200 gk7205v200_fpv gk7205v200_ultimate
gk7205v210
gk7205v300 gk7205v300_fpv gk7205v300_ultimate
gk7605v100
gm8135
gm8136
hi3516cv100
hi3518ev100
hi3516cv200
hi3518ev200 hi3518ev200_ultimate
hi3516cv300 hi3516cv300_ultimate
hi3516ev100
hi3516av100 hi3516av100_ultimate
hi3516dv100 hi3516dv100_ultimate
hi3519v101
hi3516av200 hi3516av200_ultimate
hi3516av300
hi3516cv500
hi3516dv300
hi3516dv200
hi3516ev200 hi3516ev200_fpv hi3516ev200_ultimate hi3516ev200_eltis
hi3516ev300 hi3516ev300_fpv hi3516ev300_ultimate hi3516ev300_dev hi3516ev300_glibc hi3516ev300_tehshield
hi3518ev300 hi3518ev300_ultimate
hi3536cv100
hi3536dv100 hi3536dv100_vixand
msc313e msc313e_baresip
msc316dc
msc316dm
nt98562
nt98566
rv1109
rv1126
ssc325
ssc333
ssc335 ssc335_blackbird ssc335_goodcam ssc335_initramfs ssc335_musl ssc335_portal ssc335_rotek ssc335_tiandy
ssc337 ssc337_kama
ssc335de
ssc337de
t10
t20
t30
t31 t31_ultimate
xm510
xm530
xm550
)
copy_function() {
test -n "$(declare -f "$1")" || return
eval "${_/$1/$2}"
}
uni_build() {
[ -z "$BOARD" ] && BOARD=$FUNCNAME
SOC=$(echo $BOARD | cut -d '_' -f 1)
set -e
if [ "$(echo $BOARD | cut -sd '_' -f 2)" == "" ]; then
BOARD="${BOARD}_lite"
fi
if [ "$BOARD" == "hi3518ev200_lite" ]; then
NEED_AUTOUP=1
fi
echo_c 33 "\n SoC: $SOC\nBoard: $BOARD\n"
if [ "all" = "${COMMAND}" ]; then
fresh $(make BOARD=${BOARD} buildroot-version)
fi
log_and_run "make BOARD=${BOARD} ${COMMAND}"
if [ "all" = "${COMMAND}" ]; then
if [ "$BOARD" == "ssc335_initramfs" ]; then
rename_initramfs
else
rename
fi
if [ ! -z "$NEED_AUTOUP" ]; then
autoup_rootfs
fi
fi
}
for i in "${FUNCS[@]}"; do
copy_function uni_build $i
done
#######
if [ $# -eq 0 ]; then
if ! command -v fzf >/dev/null 2>&1; then
echo -ne "Usage: $0 <variant>\nVariants:"
for i in "${FUNCS[@]}"; do echo -n " ${i}"; done
echo
exit 1
else
SELECTED=$(find . -path "*/br-ext-chip-*" -name "*_defconfig" | fzf)
[ -z "$SELECTED" ] && exit 1
BOARD=$(echo $SELECTED | cut -d / -f 4 | awk -F_ '{printf "%s_%s", $1, $2}')
fi
else
BOARD=$1
fi
COMMAND=$2
[ -z "$COMMAND" ] && COMMAND=all
echo_c 37 "Building OpenIPC for ${BOARD}"
uni_build $BOARD $COMMAND

View File

@ -0,0 +1 @@
<+03>-3

View File

@ -0,0 +1,8 @@
#!/bin/sh
at AT+CGDCONT=1,"IP","Internet"
at AT+CGACT=1,1
at AT+CGPADDR=1
at AT+QCFG="usbnet",1
at at+qnetdevctl=1,1,1

View File

@ -0,0 +1,2 @@
#
composer_message="This firmware was created with the Composer project."

View File

@ -0,0 +1 @@
gk300-0002-02

View File

@ -0,0 +1,11 @@
#
H:/var/www
A:127.0.0.1
A:*
D:8.8.8.8/32
E401:401.html
/cgi-bin:admin:123456
/cgi-bin:oper:88888888
#
P:/image.jpg:http://127.0.0.1:80/image.jpg
#

View File

@ -0,0 +1,23 @@
#!/bin/sh
case "$1" in
start)
hwclock -s
pwr 7 0
sleep 3 &&
modprobe mt7601u
modprobe usbserial vendor=0x28e9 product=0x018a;
#rmmod usbserial &&
##modprobe usbserial vendor=0x28e9 product=0x018a &&
sleep 3 &&
qw 0 AT+LDB+on
qw 0 AT+MDM+on
qw 0 AT+AP5+on
# morg &
;;
stop)
pwr 7 1
qw 0 AT+MDM+off
;;
esac

View File

@ -0,0 +1,66 @@
#!/bin/sh
DAEMON="httpd"
PIDFILE="/var/run/$DAEMON.pid"
CONFFILE="/etc/httpd.conf"
HTTPD_ARGS="httpd -p 8080 -f -c $CONFFILE -r Authentication"
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
if [ "$(fw_printenv -n debug)" ]; then
echo "Development mode. Disabling Basic Auth"
sed -i "/^\/cgi-bin:admin:/s/^/#/" $CONFFILE
else
echo "Production mode. Enabling Basic Auth"
sed -i "/^#\/cgi-bin:admin:/s/^#//" $CONFFILE
fi
# The httpd does not create a pidfile, so pass "-n" in the command line
# and use "-m" to instruct start-stop-daemon to create one.
start() {
printf 'Starting %s: ' "$DAEMON"
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
-- $HTTPD_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf 'Stopping %s: ' "$DAEMON"
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
start-stop-daemon -K -q -p "$PIDFILE"
status=$?
if [ "$status" -eq 0 ]; then
rm -f "$PIDFILE"
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
restart() {
stop
sleep 1
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

View File

@ -0,0 +1,134 @@
#!/bin/sh
readconfig() {
echo "=============------------ Read cofig --------------============"
rcfg
echo "================-------- Parse config -------------============"
ssid=`cat /tmp/config.txt | grep ssid | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d " " -f 2`
key=`cat /tmp/config.txt | grep ^key | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`
###########################
privkey=`cat /tmp/config.txt | grep PrivateKey | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`
addrcam=`cat /tmp/config.txt | grep Address | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;addrcam="${addrcam%/*}"
gateway=`cat /tmp/config.txt | grep Gateway | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;gateway="${gateway%<*}"
pubkey=`cat /tmp/config.txt | grep PublicKey | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`
allowips=`cat /tmp/config.txt | grep AllowedIPs | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;allowips="${allowips%<*}"
endpoint=`cat /tmp/config.txt | grep Endpoint | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;endpoint="${endpoint%<*}"
###########################
dumpconfig=`echo -n "$ssid$key"`
}
setconfig() {
echo "===========-------------- set wifi config ------------=========="
if [[ ! -z "$ssid" && ! -z "$key" ]]
then
cur=`sed -n '3p' /usr/bin/crCli`
new="wpa_passphrase $ssid $key >/tmp/wpa_supplicant.conf"
if [[ "$cur" == "$new" ]]
then
echo "Ok. ssid not replaced"
else
echo "Ok. Set new ssid, key"
sed -i '3d' /usr/bin/crCli
sed -i "3i \\$new" /usr/bin/crCli
fi
fi
if [[ ! -z "$privkey" && ! -z "$addrcam" && ! -z "$pubkey" && ! -z "$allowips" && ! -z "$endpoint" ]]
then
echo "=======---------- Not Null ------========"
corr=0
#########################################################################
addrcam="address ${addrcam%/*}"
gateway="gateway ${gateway%/*}"
privkey="PrivateKey = $privkey"
pubkey="PublicKey = $pubkey"
allowips="AllowedIPs = $allowips"
endpoint="Endpoint = $endpoint"
eaddrcam=`sed -n '48p' /etc/network/interfaces | sed 's/^ *//'`
egateway=`sed -n '50p' /etc/network/interfaces | sed 's/^ *//'`
eprivkey=`cat /etc/wireguard.conf | grep PrivateKey`
epubkey=`cat /etc/wireguard.conf | grep PublicKey`
eallowips=`cat /etc/wireguard.conf | grep AllowedIPs`
eendpoint=`cat /etc/wireguard.conf | grep Endpoint`
if [[ ! "$addrcam" == "$eaddrcam" ]]
then
sed -i '48d' /etc/network/interfaces
sed -i "48i \\$addrcam" /etc/network/interfaces
corr=1
echo "==========----------- correct addr in interfaces ---------========"
fi
if [[ ! "$gateway" == "$egateway" ]]
then
sed -i '50d' /etc/network/interfaces
sed -i "50i \\$gateway" /etc/network/interfaces
corr=1
echo "======------ correct gateway in interfaces -----====="
fi
if [[ ! "$privkey" == "$eprivkey" ]]
then
corr=1
fi
if [[ ! "$pubkey" == "$epubkey" ]]
then
corr=1
fi
if [[ ! "$allowips" == "$eallowips" ]]
then
corr=1
fi
if [[ ! "$endpoint" == "$eendpoint" ]]
then
corr=1
fi
if [[ $corr == 1 ]]
then
echo "===========--------------- Set WG ----------============"
echo "WG addr:: $addrcam"
if [[ ! "$addrcam" == "address xxx.xxx.xxx.xxx" ]]
then sed -i '46s/manual/auto/' /etc/network/interfaces
else sed -i '46s/auto/manual/' /etc/network/interfaces
fi
rm -f /etc/wireguard.conf
echo "[Interface]" >> /etc/wireguard.conf
echo "$privkey" >> /etc/wireguard.conf
echo "[Peer]" >> /etc/wireguard.conf
echo "$pubkey" >> /etc/wireguard.conf
echo "$allowips" >> /etc/wireguard.conf
echo "$endpoint" >> /etc/wireguard.conf
echo "PersistentKeepalive = 5" >> /etc/wireguard.conf
rm -f /sdcard/config.hex
rm -f /sdcard/config.txt
fi
fi
}
checkconfig() {
echo "check config"
if [ -f /sdcard/config.hex ]
then
echo "config exist"
readconfig
setconfig
else
echo "config not exist"
fi
if [ -f /sdcard/hardres ]
then
rm -f /sdcard/hardres
firstboot
fi
}
case "$1" in
start)
echo "read config on SDcard"
checkconfig
echo "set config done"
# commands to launch application
;;
esac

View File

@ -0,0 +1,60 @@
#!/bin/sh
hands() {
echo "0" > /tmp/maxf
echo "0" > /tmp/lst
echo "0" > /tmp/st
echo "0" > /tmp/zx
echo "0" > /tmp/ff
sleep 5;
if [[ "$(getenv apmode)" == "1" ]]
then
crAp
else
crCli
fi
if [[ "$(getenv focus-control)" == "2" ]]
then
i2c-init
fi
if [[ "$(getenv wifif)" == "1" ]]
then
modprobe rtl8821cu
sleep 2 &&
crCl
fi
light 1
sleep 0.5
light 0
#xm-light-fan 3 2 0 75 75
eaddrcam=`sed -n '56p' /etc/network/interfaces | sed 's/^ *//'`
caddr="address xxx.xxx.xxx.xxx"
sleep 25 &&
rmmod usbserial &&
modprobe usbserial vendor=0x28e9 product=0x018a &&
#sleep 15 && bt
light 0;
}
case "$1" in
start)
echo "hands WG"
hands
auto_f &
zx &
warmlight &
qw 0 "AT+ALL>0"
qw 0 "AT+ALL>0"
qw 0 "AT+ALL>0"
qw 0 AT+CU1+75
;;
stop)
killall uqmi
qw 0 AT+CU1+0
;;
esac

View File

@ -0,0 +1,11 @@
#!/bin/sh
case "$1" in
start)
sleep 120 && s_baf
;;
stop)
echo "By"
;;
esac

View File

@ -0,0 +1,40 @@
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id == tty to run on, or empty for /dev/console
# runlevels == ignored
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a
::sysinit:/bin/mkdir -p /run/lock/subsys
# ::sysinit:/sbin/swapon -a
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS
# Put a getty on the serial port
console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
# Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot
# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
# ::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -f

View File

@ -0,0 +1,79 @@
system:
buffer: 2048
image:
mirror: false
flip: false
rotate: none
contrast: 55
hue: 50
saturation: 65
luminance: 50
osd:
enabled: true
template: "%d/%m/%Y %T"
nightMode:
enabled: false
pinSwitchDelayUs: 150
irSensorPinInvert: false
records:
enabled: false
path: /mnt/mmc/records/%Y/%m/%d/%H.mp4
maxUsage: 95
video0:
enabled: true
codec: h264
size: 2560x1440
fps: 15
gopMode: normal
gopSize: 1
rcMode: avbr
bitrate: 2048
video1:
enabled: true
size: 1920x1080
fps: 15
bitrate: 1024
codec: h264
jpeg:
enabled: true
toProgressive: false
mjpeg:
size: 640x360
fps: 5
bitrate: 1024
audio:
enabled: false
volume: auto
srate: 8000
rtsp:
enabled: true
port: 554
hls:
enabled: true
youtube:
enabled: true
url: rtmp://a.rtmp.youtube.com/live2
key: qk5h-kxrg-dsfk-jduh-c0jg
motionDetect:
enabled: false
profile: outdoor
visualize: false
debug: false
ipeye:
enabled: false
onvif:
enabled: false
watchdog:
enabled: true
timeout: 10
netip:
enabled: false
user: admin
password: 6V0Y4HLF
port: 34567
snapshots: false
ignoreSetTime: false
cloud:
enabled: false
isp:
memMode: normal

View File

@ -0,0 +1,22 @@
# Provide user, group, and mode information for devices. If a regex matches
# the device name provided by sysfs, use the appropriate user:group and mode
# instead of the default 0:0 660.
#
# Syntax:
# [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
#
# [-]: do not stop on this match, continue reading mdev.conf
# =: move, >: move and create a symlink
# !: do not create device node
# @|$|*: run@cmd if $ACTION=add, $cmd if $ACTION=remove, *cmd in all cases
#
#
#
mmcblk[0-9] root:disk 660
mmcblk[0-9]p[0-9] root:disk 660 *(/lib/mdev/automount.sh)
#
sd[a-z] root:disk 660
sd[a-z][0-9] root:disk 660 *(/lib/mdev/automount.sh)
#

View File

@ -0,0 +1,6 @@
f2fs
vfat
usb-storage
sd_mod
camhi-motor.ko

View File

@ -0,0 +1,64 @@
# Interfaces
auto lo
iface lo inet loopback
manual usb0
iface usb0 inet dhcp
pre-up modprobe usbserial vendor=0x2c7c product=0x6026
pre-up modprobe rndis_host
pre-up sleep 10
pre-up /etc/chat
pre-up sleep 2
pre-up /etc/chat
pre-up sleep 1
pre-up /etc/chat
auto eth0
iface eth0 inet dhcp
hwaddress ether $(fw_printenv -n ethaddr || echo 00:24:B8:FF:FF:FF)
#pre-up echo -e "nameserver 77.88.8.8\nnameserver 8.8.4.4\n" >/tmp/resolv.conf
manual eth0:1
iface eth0:1 inet static
address $(fw_printenv -n ipaddr || echo 192.168.1.10)
netmask 255.255.255.0
auto wwan0
iface wwan0 inet dhcp
pre-up sleep 1
pre-up modprobe option
pre-up modprobe qmi_wwan
pre-up sleep 10
pre-up uqmi -s -d /dev/cdc-wdm0 --start-network internet --autoconnect &
pre-up echo 'Y' | tee /sys/class/net/wwan0/qmi/raw_ip
post-down uqmi -s -d /dev/cdc-wdm0 --stop-network --autoconnect
post-down sleep 2
post-down killall uqmi
post-down killall uqmi
manual eth2
iface eth2 inet dhcp
pre-up wifi xm711
auto wg0
iface wg0 inet static
address 192.168.77.14
netmask 255.255.255.0
gateway 192.168.77.1
pre-up modprobe wireguard
pre-up ip link add dev wg0 type wireguard
pre-up wg setconf wg0 /etc/wireguard.conf
post-down ip link del dev wg0
auto bbsw0
iface bbsw0 inet static
address 192.168.78.15
netmask 255.255.255.0
gateway 192.168.78.1
pre-up modprobe wireguard
pre-up ip link add dev bbsw0 type wireguard
pre-up wg setconf bbsw0 /etc/wg1.conf
post-down ip link del dev bbsw0

View File

@ -0,0 +1,14 @@
#!/bin/sh
echo "start connect";
sleep 5s;
uqmi -s -d /dev/cdc-wdm0 --start-network internet --autoconnect &
echo "connect";
echo "set wwan"
ip link set wwan0 down
echo 'Y' | tee /sys/class/net/wwan0/qmi/raw_ip
ip link set wwan0 up
echo "get ip"
udhcpc -i wwan0

View File

@ -0,0 +1,69 @@
# Sample udhcpd configuration file (/etc/udhcpd.conf)
start 192.168.2.20
end 192.168.2.254
# The interface that udhcpd will use
interface wlan0
# The maximum number of leases (includes addresses reserved
# by OFFER's, DECLINE's, and ARP conflicts). Will be corrected
# if it's bigger than IP lease block, but it ok to make it
# smaller than lease block.
max_leases 5
#pidfile /var/run/udhcpd.pid
# The location of the leases file
lease_file /tmp/udhcpd.leases
# The time period at which udhcpd will write out leases file.
#static_lease 00:60:08:11:CE:4E 192.168.0.54
#static_lease 00:60:08:11:CE:3E 192.168.0.44
#Examples:
#opt dns 192.168.10.2 192.168.10.10
#option subnet 255.255.255.0
#opt router 192.168.10.2
#opt wins 192.168.10.10
#option dns 129.219.13.81 # appended to above DNS servers for a total of 3
#option domain local
#option lease 864000 # default: 10 days
#option msstaticroutes 10.0.0.0/8 10.127.0.1 # single static route
#option staticroutes 10.0.0.0/8 10.127.0.1, 10.11.12.0/24 10.11.12.1
# Arbitrary option in hex form:
#option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
# Currently supported options (for more info, see options.c):
#opt lease NUM
#opt subnet IP
#opt broadcast IP
#opt router IP_LIST
#opt ipttl NUM
#opt mtu NUM
#opt hostname STRING # client's hostname
#opt domain STRING # client's domain suffix
#opt search STRING_LIST # search domains
#opt nisdomain STRING
#opt timezone NUM # (localtime - UTC_time) in seconds. signed
#opt tftp STRING # tftp server name
#opt bootfile STRING # tftp file to download (e.g. kernel image)
#opt bootsize NUM # size of that file
#opt rootpath STRING # (NFS) path to mount as root fs
#opt wpad STRING
#opt serverid IP # default: server's IP
#opt message STRING # error message (udhcpd sends it on success too)
#opt vlanid NUM # 802.1P VLAN ID
#opt vlanpriority NUM # 802.1Q VLAN priority
# Options specifying server(s)
#opt dns IP_LIST
#opt wins IP_LIST
#opt nissrv IP_LIST
#opt ntpsrv IP_LIST
#opt lprsrv IP_LIST
#opt swapsrv IP
# Options specifying routes
#opt routes IP_PAIR_LIST
#opt staticroutes STATIC_ROUTES # RFC 3442 classless static route option
#opt msstaticroutes STATIC_ROUTES # same, using MS option number
# Obsolete options, no longer supported
#opt logsrv IP_LIST # 704/UDP log server (not syslog!)
#opt namesrv IP_LIST # IEN 116 name server, obsolete (August 1979!!!)
#opt cookiesrv IP_LIST # RFC 865 "quote of the day" server, rarely (never?) used
#opt timesrv IP_LIST # RFC 868 time server, rarely (never?) used
# TODO: in development
#opt userclass STRING # RFC 3004. set of LASCII strings. "I am a printer" etc
#opt sipserv STRING LIST # RFC 3361. flag byte, then: 0: domain names, 1: IP addrs

View File

@ -0,0 +1,11 @@
#
[interface]
PrivateKey = *
#
[Peer]
PublicKey = *
AllowedIPs = *
Endpoint = *
PersistentKeepalive = 5
#

View File

@ -0,0 +1,8 @@
[Interface]
PrivateKey = *
[Peer]
PublicKey = *
AllowedIPs = *
Endpoint = *:*
PersistentKeepalive = 5

View File

@ -0,0 +1,9 @@
ctrl_interface=/var/run/wpa_supplicant
# -- SoftAP mode with encryption/password protected example:
network={
ssid="gk300-0003-03"
mode=2
key_mgmt=WPA-PSK
psk="10923874"
}

View File

@ -0,0 +1,83 @@
#!/bin/sh
destdir="/mnt"
my_umount()
{
if grep -qs "^/dev/$1 " /proc/mounts ; then
yaml-cli -s ".records.enabled" "false"
# sed -i '96s/true/false/' /etc/majestic.yaml
unlink "/sdcard";
unlink "/var/www/rec";
umount "${destdir}/mmc";
rmdir "${destdir}/mmc"
fi
[ -d "${destdir}/mmc" ] && rmdir "${destdir}/mmc"
}
my_mount()
{
mkdir -p "${destdir}/mmc" || exit 1
if ! mount -t vfat "/dev/$1" "${destdir}/mmc"; then
# failed to mount, clean up mountpoint
rmdir "${destdir}/mmc"
exit 1
fi
echo "SD Card mounted";
ln -s "${destdir}/mmc" "/sdcard"
ln -s "${destdir}/mmc/records" "/var/www/rec"
yaml-cli -s ".records.enabled" "true"
if [ -f /sdcard/autoexe ]
then
/sdcard/autoexe
fi
if [ -f /sdcard/hardres ]
then
rm -f /sdcard/hardres
flash_eraseall -j /dev/mtd4
firstboot
fi
}
case "${ACTION}" in
add|"")
majex=`ps aux | grep majestic | grep -v grep`
if [[ ! -z "$majex" ]]
then
echo "Stop majestic"
dumpconfig=`echo -n "Stop majestic"`
/etc/init.d/S95hisilicon stop
sleep 1
fi
my_umount ${MDEV}
my_mount ${MDEV}
if [[ ! -z "$majex" ]]
then
echo "Start majestic"
dumpconfig=`echo -n "Start majestic"`
/etc/init.d/S95hisilicon start
fi
;;
remove)
majex=`ps aux | grep majestic | grep -v grep`
if [[ ! -z "$majex" ]]
then
echo "Stop majestic"
dumpconfig=`echo -n "Stop majestic"`
/etc/init.d/S95hisilicon stop
sleep 1
fi
my_umount ${MDEV}
if [[ ! -z "$majex" ]]
then
echo "Start majestic"
dumpconfig=`echo -n "Start majestic"`
/etc/init.d/S95hisilicon start
fi
;;
esac

View File

@ -0,0 +1,76 @@
kernel/fs/configfs/configfs.ko:
kernel/fs/fat/fat.ko:
kernel/fs/fat/vfat.ko: kernel/fs/fat/fat.ko
kernel/fs/f2fs/f2fs.ko:
kernel/crypto/seqiv.ko:
kernel/crypto/echainiv.ko:
kernel/crypto/hmac.ko:
kernel/crypto/gf128mul.ko:
kernel/crypto/ctr.ko:
kernel/crypto/gcm.ko:
kernel/crypto/ccm.ko:
kernel/crypto/crc32_generic.ko:
kernel/crypto/drbg.ko:
kernel/crypto/jitterentropy_rng.ko:
kernel/crypto/ghash-generic.ko: kernel/crypto/gf128mul.ko
kernel/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko: kernel/net/mac80211/mac80211.ko kernel/net/wireless/cfg80211.ko
kernel/drivers/net/wireless/realtek/rtl8821cu/rtl8821cu.ko: kernel/net/mac80211/mac80211.ko kernel/net/wireless/cfg80211.ko
kernel/drivers/net/mii.ko:
kernel/drivers/net/tun.ko:
kernel/drivers/net/usb/cdc_ether.ko: kernel/drivers/net/usb/usbnet.ko kernel/drivers/net/mii.ko
kernel/drivers/net/usb/rndis_host.ko: kernel/drivers/net/usb/cdc_ether.ko kernel/drivers/net/usb/usbnet.ko kernel/drivers/net/mii.ko
kernel/drivers/net/usb/usbnet.ko: kernel/drivers/net/mii.ko
kernel/drivers/net/usb/qmi_wwan.ko: kernel/drivers/usb/class/cdc-wdm.ko kernel/drivers/net/usb/usbnet.ko kernel/drivers/net/mii.ko
kernel/drivers/usb/storage/usb-storage.ko: kernel/drivers/scsi/scsi_mod.ko
kernel/drivers/usb/gadget/function/usb_f_acm.ko: kernel/drivers/usb/gadget/libcomposite.ko kernel/fs/configfs/configfs.ko kernel/drivers/usb/gadget/function/u_serial.ko
kernel/drivers/usb/gadget/function/u_serial.ko:
kernel/drivers/usb/gadget/function/u_ether.ko:
kernel/drivers/usb/gadget/function/usb_f_ecm.ko: kernel/drivers/usb/gadget/function/u_ether.ko kernel/drivers/usb/gadget/libcomposite.ko kernel/fs/configfs/configfs.ko
kernel/drivers/usb/gadget/function/usb_f_rndis.ko: kernel/drivers/usb/gadget/function/u_ether.ko kernel/drivers/usb/gadget/libcomposite.ko kernel/fs/configfs/configfs.ko
kernel/drivers/usb/gadget/function/usb_f_mass_storage.ko: kernel/drivers/usb/gadget/libcomposite.ko kernel/fs/configfs/configfs.ko
kernel/drivers/usb/gadget/libcomposite.ko: kernel/fs/configfs/configfs.ko
kernel/drivers/usb/class/cdc-wdm.ko:
kernel/drivers/usb/serial/usbserial.ko:
kernel/drivers/usb/serial/option.ko: kernel/drivers/usb/serial/usb_wwan.ko kernel/drivers/usb/serial/usbserial.ko
kernel/drivers/usb/serial/usb-serial-simple.ko: kernel/drivers/usb/serial/usbserial.ko
kernel/drivers/usb/serial/usb_wwan.ko: kernel/drivers/usb/serial/usbserial.ko
kernel/drivers/i2c/busses/i2c-tiny-usb.ko:
kernel/drivers/scsi/scsi_mod.ko:
kernel/drivers/scsi/scsi_transport_fc.ko: kernel/drivers/scsi/scsi_mod.ko
kernel/drivers/scsi/sd_mod.ko: kernel/drivers/scsi/scsi_mod.ko
kernel/net/bridge/br_netfilter.ko:
kernel/net/wireless/cfg80211.ko:
kernel/net/mac80211/mac80211.ko: kernel/net/wireless/cfg80211.ko
extra/open_mipi_rx.ko: extra/open_sys_config.ko extra/open_osal.ko
extra/wireguard.ko:
goke/gk7205v200_aenc.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_rgn.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_acodec.ko: goke/gk7205v200_aio.ko goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_ao.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_jpege.ko: goke/gk7205v200_venc.ko goke/gk7205v200_base.ko extra/open_osal.ko
extra/open_sensor_i2c.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_base.ko: extra/open_osal.ko
goke/gk7205v200_vpss.ko: goke/gk7205v200_base.ko extra/open_osal.ko
extra/open_pwm.ko: extra/open_osal.ko
goke/gk7205v200_ai.ko: goke/gk7205v200_base.ko extra/open_osal.ko
extra/open_sys_config.ko:
extra/open_piris.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_h265e.ko: goke/gk7205v200_venc.ko goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_vgs.ko: goke/gk7205v200_base.ko extra/open_osal.ko
extra/open_isp.ko: goke/gk7205v200_base.ko extra/open_osal.ko
extra/open_wdt.ko: extra/open_osal.ko
extra/open_sensor_spi.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_h264e.ko: goke/gk7205v200_venc.ko goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_sys.ko: goke/gk7205v200_base.ko extra/open_sys_config.ko extra/open_osal.ko
extra/open_adc.ko: extra/open_osal.ko
extra/open_osal.ko:
goke/gk7205v200_ive.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_vi.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_vedu.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_adec.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_venc.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_rc.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_aio.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/gk7205v200_chnl.ko: goke/gk7205v200_base.ko extra/open_osal.ko
goke/camhi-motor.ko:
extra/hisi-hwrng.ko:

View File

@ -0,0 +1,25 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
curz
fi
baf
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
baf
fi

View File

@ -0,0 +1,8 @@
#!/bin/sh
AT="$1"
SLEEP=0.2
TTY=/dev/ttyUSB3
RESULT=$(cat $TTY & echo -ne "$AT\n" > $TTY; sleep $SLEEP; killall cat)
echo $RESULT

View File

@ -0,0 +1,44 @@
#!/bin/sh
fa=$(getenv auto-focus);
if [[ "$fa" == "1" ]]
then
if [[ "$(getenv focus-control)" == "1" ]]
then
sleep 35;
s_z_up &&
s_z_down
fi
fi
while true; do
ft=$(getenv focus-threshold);
fa=$(getenv auto-focus);
FF=$(gf);
st=$(getenv delay-tr);
#echo $FF;
if [[ "$fa" == "1" ]]
then
if [[ "$FF" -lt "$ft" ]]
then
cst=$(cat /tmp/st)
if [[ "$cst" == "$st" ]]
then
s_baf
sleep 3
fp=$(gf)
if [[ "$fp" -lt "$(expr $ft / 2)" ]]
then
curz
# s_baf;
fi
echo "0" > /tmp/st
else
echo "$(expr $cst + 1)" > /tmp/st
fi
else
echo "0" > /tmp/st
fi
fi
done

View File

@ -0,0 +1,146 @@
#!/bin/sh
echo "$(date +%Y-%m-%d-%H-%M-%S-%3N) : BAF" >> /tmp/l_focus
#get_focus() {
#iRES=$(sample_af 0 c & sleep 0.25; killall sample_af)
#RST=`echo ${RES} | awk '{print $2}'`
#if [[ ! -z "$RST" ]]
#then
#echo "1"
#else
#echo "$RST"
#fi
#}
step_r() {
echo "step r"
#sleep $SLEEP;
cur_fs=$(gf)
echo $cur_fs;
st=`expr $cur_fs + 8`
fs_in 10;
while [[ $st -gt $cur_fs ]]; do
# sleep $SLEEP;
cur_fs=$(gf)
#echo 'step r'
echo $cur_fs
fs_in 10;
# sleep $SLEEP;
st=$(gf)
echo $st;
done
fs_out 20;
}
step_l() {
echo 'step l'
#sleep $SLEEP;
cur_fs=$(gf)
echo $cur_fs;
st=`expr $cur_fs + 8`
fs_out 10
while [[ $st -gt $cur_fs ]]; do
# echo 'step l';
# sleep $SLEEP;
cur_fs=$(gf)
# echo $cur_fs;
fs_out 10
# sleep $SLEEP;
st=$(gf)
#echo $st;
done
fs_in 10
}
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
fs_in 60;
#echo $CC_F
st=$(gf)
kf=$DD
ct=`expr $st + 8`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
#i sleep 0.25
st=$(gf)
fs_out 2;
# sleep 0.25
ct=$(gf)
if [[ "$st" -eq "$ct" ]]
then
ct=`expr $ct + 8`
fi
if [[ "$ct" -lt 40 ]]
then
ct=`expr $ct + 230`
fi
# echo "$st $ct"
echo "ct: $ct st: $st kf:$kf";
done
fs_in 1;
#fi
#sleep $SLEEP;
#iCUR_F=$(get_focus)
#echo "cur $CUR_F";
#fs_in 25;
#STP_R=$(get_focus)
#echo "R $STP_R";
#fs_out 50;
#STP_L=$(get_focus)
#echo "L $STP_L";
#fs_in 25;
#tek=$(get_focus)
#echo "tek $tek";
#///////////////////////////////////////////////////////////////////////////////////////////////////////////
#if [[ $STP_R -gt $CUR_F ]]
#then
# echo "Go L"
# step_r
#else
# if [[ $STP_L -gt $CUR_F ]]
# then
# echo "Go R";
# step_l
# else
# curz;
# fi
#fi
#tek=$(get_focus)
#if [[ $tek -lt $CUR_F ]]
#then
#CUR_F=$(get_focus)
##echo "cur $CUR_F";
#fs_in 70;
#STP_R=$(get_focus)
#echo "R $STP_R";
#fs_out 140;
#STP_L=$(get_focus)
#echo "L $STP_L";
#fs_in 70;
#tek=$(get_focus)
#echo "tek $tek";
#///////////////////////////////////////////////////////////////////////////////////////////////////////////
#if [[ $STP_R -gt $CUR_F ]]
#then
# echo "Go L"
# step_r
#else
# if [[ $STP_L -gt $CUR_F ]]
# then
# echo "Go R";
# step_l
# else
# curz;
# fi
#fi
#fi

View File

@ -0,0 +1,34 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=100;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
#fs_out 180;
fs_in 140;
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
st=$(gf)
s_fs_out 1;
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
ct=`expr $(gf) + 1`;
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_in 13;
#fi

View File

@ -0,0 +1,34 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=100;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
#fs_out 180;
fs_out 140;
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
st=$(gf)
s_fs_in 1;
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
ct=`expr $(gf) + 1`;
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_out 21;
#fi

View File

@ -0,0 +1,13 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=100;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
fs_in 140;
fs_out 140;
it=`cat /tmp/iter`
fs_in $it;

View File

@ -0,0 +1,32 @@
#!/bin/sh
#i killall sample_af
# rm -f /tmp/saf_f
# sample_af 0 c >> /tmp/saf_f &
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
fs_out 120;
#echo $CC_F
st=$(gf)
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -le "$ct" ]]; do
st=$(gf)
zz=$(echo "scale=4; $st/1000" | bc);
sleep $zz;
s_fs_in 1;
ct=$(gf)
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_out 4;
#fi

View File

@ -0,0 +1,35 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
#fs_out 180;
fs_out 140;
#echo $CC_F
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
st=$(gf)
s_fs_in 1;
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
ct=`expr $(gf) + 8`;
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_out 21;
#fi

View File

@ -0,0 +1,37 @@
#!/bin/sh
#i killall sample_af
# rm -f /tmp/saf_f
# echo "0" > /tmp/maxf
# sample_af 0 c >> /tmp/saf_f &
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
fs_in 180;
fs_out 320;
#echo $CC_F
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$mx" ]]; do
s_fs_in 1;
st=$(gf)
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
st=$(gf)
ct=$(gf)
# if [[ "$ct" -lt $DD ]]
# then
# ct=`expr $ct + 230`
# fi
echo "ct: $mx st: $st kf:$kf zz:$zz";
done
s_fs_out 4;
#fi

View File

@ -0,0 +1,80 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d r -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d r -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d l -s 85
}
step_l() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d l -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d l -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d r -s 85
}
CUR_F=$(get_focus)
camhi-motor -d l -s 99
STP_R=$(get_focus)
camhi-motor -d r -s 99
sleep $SLEEP
camhi-motor -d r -s 99
STP_L=$(get_focus)
camhi-motor -d l -s 99
if [[ $STP_R -gt $CUR_F ]]
then
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
step_r
else
if [[ $CUR_F -lt 300 ]]
then
camhi-motor -d r -s 99
camhi-motor -d r -s 99
STP_R=$(get_focus)
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
STP_L=$(get_focus)
camhi-motor -d r -s 99
camhi-motor -d r -s 99
if [[ $STP_R -gt $STP_L ]]
then
camhi-motor -d r -s 99
step_r
else
camhi-motor -d l -s 99
step_l
fi
fi
fi
fi

View File

@ -0,0 +1,32 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
c_bbaf
fi
c_baf
c_saf
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
# echo "Zhopa"
c_bbaf
c_baf
c_saf
fi

View File

@ -0,0 +1,204 @@
#!/bin/sh
step_r() {
echo "r $1"
cur_fs=$(gf)
echo "r $1 $cur_fs"
camhi-motor -d r -s $1 && sleep 0.3 &&st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
sleep 0.2 && cur_fs=$(gf)
camhi-motor -d r -s $1 && sleep 0.3 && st=$(gf)
echo "r $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_l $(expr $1 / 2)
else
echo "r $1 $cur_fs"
camhi-motor -d r -s 2 && sleep 0.3 && st=$(gf)
fi
}
step_l() {
cur_fs=$(gf)
#echo "l $1 $cur_fs"
camhi-motor -d l -s $1 && sleep 0.3 && st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s $1 && sleep 0.3 && st=$(gf)
echo "l $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_r $(expr $1 / 2)
else
camhi-motor -d r -s 2 && sleep 0.3 && st=$(gf)
echo "r $1 $cur_fs"
fi
}
if [[ -z $1 ]]
then
ss=64
else
ss=$1
fi
if [[ "$(gf)" -lt "25" ]]
then
ss=99
fi
while [[ $ss -gt 2 ]]
do
CUR_F=$(gf)
if [[ $ss == 99 ]]
then
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
camhi-motor -d r -s 64 && sleep 0.4 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4 &&
camhi-motor -d l -s 64 && sleep 0.4
fi
fi
fi
fi
fi
fi
fi
fi
else
camhi-motor -d l -s $ss && sleep 0.4 &&
STP_R=$(gf)
camhi-motor -d r -s $ss && sleep 0.4 &&
camhi-motor -d r -s $ss && sleep 0.4 &&
STP_L=$(gf)
camhi-motor -d l -s $ss && sleep 0.4
fi
echo $CUR_F;
echo $STP_R;
echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
echo "Go L"
camhi-motor -d s
step_l $ss
# ss=1
else
if [[ $STP_L -gt $CUR_F ]]
then
echo "Go R";
camhi-motor -d s
step_r $ss
# ss=1
fi
fi
if [[ $ss == 99 ]]
then
ss=64
else
ss=$(expr $ss / 2)
fi
camhi-motor -d s
done

View File

@ -0,0 +1,64 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(gf)
camhi-motor -d r -s 32
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d r -s 32
st=$(gf)
done
camhi-motor -d l -s 32
}
step_l() {
cur_fs=$(gf)
camhi-motor -d l -s 32
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s 32
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d r -s 32
}
CUR_F=$(gf)
camhi-motor -d l -s 64
STP_R=$(gf)
camhi-motor -d r -s 64
sleep $SLEEP
camhi-motor -d r -s 64
STP_L=$(gf)
camhi-motor -d l -s 64
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
# else
# echo "Current"
fi
fi

View File

@ -0,0 +1,86 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d r -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d r -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d l -s 85
}
step_l() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d l -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d l -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d r -s 85
}
CUR_F=$(get_focus)
camhi-motor -d l -s 99
STP_R=$(get_focus)
camhi-motor -d r -s 99
sleep $SLEEP
camhi-motor -d r -s 99
STP_L=$(get_focus)
camhi-motor -d l -s 99
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
else
if [[ $CUR_F -lt 300 ]]
then
camhi-motor -d r -s 99
camhi-motor -d r -s 99
STP_R=$(get_focus)
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
STP_L=$(get_focus)
camhi-motor -d r -s 99
camhi-motor -d r -s 99
if [[ $STP_R -gt $STP_L ]]
then
camhi-motor -d r -s 99
step_r
else
camhi-motor -d l -s 99
step_l
# echo "Current"
fi
fi
fi
fi

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d l -s $1
#c_baf
#c_saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d r -s $1
#c_baf
#c_saf

View File

@ -0,0 +1,65 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(gf)
camhi-motor -d r -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d r -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d l -s 2
}
step_l() {
cur_fs=$(gf)
camhi-motor -d l -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d r -s 2
}
CUR_F=$(gf)
camhi-motor -d l -s 16
STP_R=$(gf)
camhi-motor -d r -s 16
sleep $SLEEP
camhi-motor -d r -s 16
STP_L=$(gf)
camhi-motor -d l -s 16
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
# else
# echo "Current"
fi
fi

View File

@ -0,0 +1,65 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(gf)
camhi-motor -d r -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d r -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d l -s 2
}
step_l() {
cur_fs=$(gf)
camhi-motor -d l -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d r -s 2
}
CUR_F=$(gf)
camhi-motor -d l -s 16
STP_R=$(gf)
camhi-motor -d r -s 16
sleep $SLEEP
camhi-motor -d r -s 16
STP_L=$(gf)
camhi-motor -d l -s 16
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
# else
# echo "Current"
fi
fi

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d d -s 25
#baf
#saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d u -s 25
#baf
#saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d d -s 25
c_baf
c_saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d u -s 25
c_baf
c_saf

View File

@ -0,0 +1,7 @@
#!/bin/sh
sleep 7;
wpa_supplicant -B -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf
touch /tmp/udhcpd.leases;
sleep 6;
ip addr add 192.168.2.1/24 dev wlan0
udhcpd -f "/etc/udhcpd.conf" &

View File

@ -0,0 +1,9 @@
#!/bin/sh
sleep 3
wpa_passphrase $(getenv cmidf) $(getenv cmkeyf) >/tmp/wpa_supplican.conf
sed -i '2i \\tscan_ssid=1' /tmp/wpa_supplican.conf
sleep 3
wpa_supplicant -B -Dnl80211 -iwlan1 -c/tmp/wpa_supplican.conf
sleep 6
udhcpc -i wlan1 &

View File

@ -0,0 +1,9 @@
#!/bin/sh
sleep 3
wpa_passphrase $(getenv cmid) $(getenv cmkey) >/tmp/wpa_supplicant.conf
sed -i '2i \\tscan_ssid=1' /tmp/wpa_supplicant.conf
sleep 3
wpa_supplicant -B -Dnl80211 -iwlan0 -c/tmp/wpa_supplicant.conf
sleep 6
udhcpc -i wlan0 &

View File

@ -0,0 +1,6 @@
#!/bin/sh
z_up
sleep 0.05;
z_down

View File

@ -0,0 +1,3 @@
#!/bin/sh
xm-uart-motors 0 x && sleep 0.2 && xm-uart-motors 0 s && xm-uart-motors 0 s
echo "$(date) : f_down" >> /tmp/l_focus

View File

@ -0,0 +1,3 @@
#!/bin/sh
xm-uart-motors 0 z && sleep 0.1 && xm-uart-motors 0 s && xm-uart-motors 0 s
echo "$(date) : f_up" >> /tmp/l_focus

View File

@ -0,0 +1,10 @@
#!/bin/sh
it=$1
i=0
while [ $i -lt $it ]
do
f_down;
i=`expr $i + 1`;
done
echo "$(date) : fs_in $it" >> /tmp/l_focus

View File

@ -0,0 +1,10 @@
#!/bin/sh
it=$1
i=0
while [ $i -lt $it ]
do
f_up;
i=`expr $i + 1`;
done
echo "$(date) : fs_out $it" >> /tmp/l_focus

View File

@ -0,0 +1,2 @@
#!/bin/sh
fw_printenv $1 -n

View File

@ -0,0 +1,12 @@
#!/bin/sh
tt="$(fw_printenv ethaddr -n | cut -c12- | tr -d :)";
cssid=`cat /etc/wpa_supplicant.conf | grep ssid | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d " " -f 2`
nssid="ssid=\"ev300-$tt\"";
echo "$cssid";
echo "$nssid";
#if [[ "$cssid" != "$nssid" ]]
# then
# echo "new_ssid"
# sed -i '5d' /etc/wpa_supplicant.conf
# sed -i "5i \\$nssid" /etc/wpa_supplicant.conf
#fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
get_exp() {
exp=1
exp=$(curl -s http://localhost/metrics | grep ^isp_exptime | cut -d' ' -f2)
bri=`expr $exp / 1000`
echo $bri
};
BRI=$(get_exp);
echo "$BRI";

View File

@ -0,0 +1,11 @@
#!/bin/sh
while [[ -z $r ]]
do
r=$(cat /tmp/zx);
done
echo $r

View File

@ -0,0 +1,10 @@
#!/bin/sh
while [[ -z "$rr" ]]
do
rr=$(echo $(sample_af 0 c & sleep 0.18 && killall sample_af) | awk '{print $2}');
done
echo $rr;

View File

@ -0,0 +1,2 @@
#!/bin/sh
cat /tmp/maxf

View File

@ -0,0 +1,13 @@
#!/bin/sh
tt="$(fw_printenv ethaddr -n | cut -c12- | tr -d :)";
cssid=`cat /etc/wpa_supplicant.conf | grep ssid | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d " " -f 2`
nssid="ssid=\"ev300-$tt\"";
#echo "$cssid";
#echo "$nssid";
echo $tt;
#if [[ "$cssid" != "$nssid" ]]
# then
# echo "new_ssid"
# sed -i '5d' /etc/wpa_supplicant.conf
# sed -i "5i \\$nssid" /etc/wpa_supplicant.conf
#fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
devmem 0x112C0058 32 0x1032
devmem 0x112C005C 32 0x1032
devmem 0x100C000C 32 0x1
devmem 0x120101BC 32 0x801282
i2c-motor -d i

View File

@ -0,0 +1,17 @@
#!/bin/sh
i2c-motor -d r -s 99 && sleep 0.4 && i2c-motor -d s && sleep 0.1 &&
i2c-motor -d l -s 2 && sleep 0.17 && i2c-motor -d s && sleep 0.17 && cur_fs=`expr $(gf)`
i2c-motor -d l -s 1 && sleep 0.17 && i2c-motor -d s && sleep 0.17 && cur_fs=`expr $(gf)`
i2c-motor -d l -s 4 && sleep 0.17 && i2c-motor -d s && sleep 0.17 && st=`expr $(gf) + 5`
while [[ $st -gt $cur_fs ]]; do
sleep 0.17 && cur_fs=$(gf)
i2c-motor -d l -s 2 && sleep 0.17 && i2c-motor -d s && sleep 0.17 && st=`expr $(gf) + 5`
echo "r $st"
done
i2c-motor -d r -s 2 && sleep 0.17 && i2c-motor -d s && sleep 0.17 && st=`expr $(gf) + 2`
i2c-motor -d r -s 1 && sleep 0.17 && i2c-motor -d s && sleep 0.17 && st=`expr $(gf) + 2`
i2c-motor -d r -s 1 && sleep 0.17 && i2c-motor -d s && sleep 0.17 && st=`expr $(gf) + 2`
echo "r $st"

View File

@ -0,0 +1,3 @@
#!/bin/sh
i2c-motor -d l -s $1 && sleep 0.3 && i2c-motor -d s

View File

@ -0,0 +1,3 @@
#!/bin/sh
i2c-motor -d r -s $1 && sleep 0.3 && i2c-motor -d s

View File

@ -0,0 +1,3 @@
#!/bin/sh
i2c-motor -d d -s 5 && sleep 0.3 && i2c-motor -d s

View File

@ -0,0 +1,3 @@
#!/bin/sh
i2c-motor -d u -s 5 && sleep 0.3 && i2c-motor -d s

View File

@ -0,0 +1,62 @@
#!/bin/sh
light_enable() {
echo "1" > /tmp/lt
if [[ "$ir_inv" == "0" ]]
then
ircut_demo gk7205v300 0
else
ircut_demo gk7205v300 1
fi
if [[ "$lt_t" == "1" ]]
then
qw 0 AT+BLH+75
else
if [[ "$lt_p" -gt "0" ]]
then
devmem 0x100C0080 32 0x530
echo "$lt_p" >/sys/class/gpio/unexport
echo "$lt_p" >/sys/class/gpio/export
echo "out" >/sys/class/gpio/gpio$lt_p/direction
echo "1" >/sys/class/gpio/gpio$lt_p/value
fi
fi
}
light_disable() {
echo "0" > /tmp/lt
if [[ "$ir_inv" == "0" ]]
then
ircut_demo gk7205v300 1
else
ircut_demo gk7205v300 0
fi
if [[ "$lt_t" == "1" ]]
then
qw 0 AT+BLH+0
else
if [[ "$lt_p" -gt "0" ]]
then
devmem 0x100C0080 32 0x530
echo "$lt_p" >/sys/class/gpio/unexport
echo "$lt_p" >/sys/class/gpio/export
echo "out" >/sys/class/gpio/gpio$lt_p/direction
echo "0" >/sys/class/gpio/gpio$lt_p/value
fi
fi
}
ir_inv=$(getenv ircut-inv);
lt_t=$(getenv light-control);
lt_p=$(getenv light-port);
echo "0" > /tmp/lst
if [ $1 -eq 1 ]; then
light_enable
elif [ $1 -eq 0 ]; then
light_disable
fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
devmem 0x100C0080 32 0x530
echo 0 > /tmp/lt
echo 4 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio4/direction
echo 0 > /sys/class/gpio/gpio4/value

View File

@ -0,0 +1,7 @@
#!/bin/sh
devmem 0x100C0080 32 0x530
echo 1 > /tmp/lt
echo 4 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio4/direction
echo 1 > /sys/class/gpio/gpio4/value

View File

@ -0,0 +1,76 @@
#!/bin/sh
step_r() {
echo "r $1"
cur_fs=$(gf)
echo "r $1 $cur_fs"
camhi-motor -d r -s $1 && st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
sleep 0.2 && cur_fs=$(gf)
camhi-motor -d r -s $1 && st=$(gf)
echo "r $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_l $(expr $1 / 2)
else
echo "r $1 $cur_fs"
camhi-motor -d r -s 2 && st=$(gf)
fi
}
step_l() {
cur_fs=$(gf)
#echo "l $1 $cur_fs"
camhi-motor -d l -s $1 && st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s $1 && st=$(gf)
echo "l $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_r $(expr $1 / 2)
else
camhi-motor -d r -s 2 && st=$(gf)
echo "r $1 $cur_fs"
fi
}
if [[ -z $1 ]]
then
ss=64
else
ss=$1
fi
while [[ $ss -gt 2 ]]
do
CUR_F=$(gf)
camhi-motor -d l -s $ss && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s $ss && sleep 0.1 &&
camhi-motor -d r -s $ss && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s $ss && sleep 0.1 &&
echo $CUR_F;
echo $STP_R;
echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
echo "Go L"
step_l $ss
# ss=1
else
if [[ $STP_L -gt $CUR_F ]]
then
echo "Go R";
step_r $ss
# ss=1
fi
fi
ss=$(expr $ss / 2)
done

View File

@ -0,0 +1,11 @@
#!/bin/sh
while (true)
do
sleep 1.7 && qw 0 "AT+ALL>1" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>2" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>3" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>4" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>0" && sleep 0.1 && qw 0 "AT+ALL>0" && qw 0 "AT+ALL>0";
done

View File

@ -0,0 +1,9 @@
#!/bin/sh
f="{$1}"
maj=`ps aux | grep $f | grep -v grep`
if [[ ! -z "$maj" ]]
then
echo "1";
else
echo "0"
fi

View File

@ -0,0 +1,22 @@
#!/bin/sh
AT="AT+BTV"
SLEEP=0;
TTY=/dev/ttyUSB0
RESULT="";
while [[ -z "$RESULT" ]]
do
RESULT=$(cat $TTY & echo -ne "$AT\n" > $TTY; sleep $SLEEP; killall cat)
if [[ "$RESULT" == *"ommand"* ]]; then
RESULT="";
sleep 1;
fi
if [[ -z "$RESULT" ]]; then
sleep 0.1;
fi
done
r=${RESULT:4}
#echo $r;
r=${r::-2}
echo $r;

View File

@ -0,0 +1,21 @@
#!/bin/sh
AT="AT+BTR>0x0A"
SLEEP=0;
TTY=/dev/ttyUSB0
RESULT="";
while [[ -z "$RESULT" ]]
do
RESULT=$(cat $TTY & echo -ne "$AT\n" > $TTY; sleep $SLEEP; killall cat)
if [[ "$RESULT" == *"ommand"* ]]; then
RESULT="";
sleep 1;
fi
if [[ -z "$RESULT" ]]; then
sleep 0.1;
fi
done
r=${RESULT:4}
r=${r::-2}
echo $r;

View File

@ -0,0 +1,6 @@
#!/bin/sh
devmem 0x100C0080 32 0x530
echo $1 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$1/direction
echo $2 > /sys/class/gpio/gpio$1/value

View File

@ -0,0 +1,10 @@
#!/bin/sh
AT="$2"
TTY=/dev/ttyUSB$1
echo -ne "$AT\n" > $TTY;
echo -ne "$AT\n" > $TTY;
echo -ne "$AT\n" > $TTY;
echo -ne "$AT\n" > $TTY;

View File

@ -0,0 +1,5 @@
#!/bin/sh
qw 0 AT+MDM+off
sleep 1;
qw 0 AT+MDM+on
reboot;

Some files were not shown because too many files have changed in this diff Show More