增加ota文件系统编译方法;(注意每次swupdate_make_recovery_img需要删除根目录和./lichee/linux下的.config和.config.old)
This commit is contained in:
@@ -0,0 +1,414 @@
|
||||
|
||||
hook_args.HookArgsDefault [
|
||||
{
|
||||
name "LINEOUT Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "SPK Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "LINEOUT Output Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ" #value=1, "single" value=0
|
||||
}
|
||||
# {
|
||||
# name "LINEOUT volume"
|
||||
# preserve true
|
||||
# optional true
|
||||
# value 31
|
||||
# }
|
||||
{
|
||||
name "MIC1 Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "MIC1 Input Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ" #value=0, "single" value=1
|
||||
}
|
||||
# {
|
||||
# name "MIC1 gain volume"
|
||||
# preserve true
|
||||
# optional true
|
||||
# value 31
|
||||
# }
|
||||
]
|
||||
|
||||
hook_args.HookArgsPlayback [
|
||||
{
|
||||
name "LINEOUT Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "SPK Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "LINEOUT Output Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ"
|
||||
}
|
||||
# {
|
||||
# name "LINEOUT volume"
|
||||
# preserve true
|
||||
# optional true
|
||||
# value 31
|
||||
# }
|
||||
]
|
||||
|
||||
hook_args.HookArgsCapture [
|
||||
{
|
||||
name "MIC1 Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "MIC1 Input Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ"
|
||||
}
|
||||
# {
|
||||
# name "MIC1 gain volume"
|
||||
# preserve true
|
||||
# optional true
|
||||
# value 31
|
||||
# }
|
||||
]
|
||||
pcm.!default {
|
||||
type hooks
|
||||
slave {
|
||||
pcm {
|
||||
type asym
|
||||
playback.pcm "hw:{CARD=audiocodec, DEV=0}"
|
||||
capture.pcm "hw:0,0"
|
||||
}
|
||||
}
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args HookArgsDefault
|
||||
}
|
||||
}
|
||||
|
||||
pcm.PlaybackRateDmix {
|
||||
@args [ SAMPLERATE CHNNUM PERIODSIZE ]
|
||||
@args.SAMPLERATE {
|
||||
type integer
|
||||
default 16000
|
||||
}
|
||||
@args.CHNNUM {
|
||||
type integer
|
||||
default 1
|
||||
}
|
||||
@args.PERIODSIZE {
|
||||
type integer
|
||||
default 960 #1024
|
||||
}
|
||||
type plug
|
||||
slave.pcm {
|
||||
type softvol
|
||||
slave.pcm {
|
||||
type hooks
|
||||
slave.pcm {
|
||||
type dmix
|
||||
ipc_key 1111
|
||||
ipc_perm 0666
|
||||
slave {
|
||||
pcm "hw:0,0"
|
||||
format S16_LE
|
||||
rate $SAMPLERATE
|
||||
channels $CHNNUM
|
||||
period_size $PERIODSIZE
|
||||
periods 8
|
||||
}
|
||||
}
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args HookArgsPlayback
|
||||
}
|
||||
}
|
||||
control {
|
||||
name "Soft Volume Master"
|
||||
card audiocodec
|
||||
count 1
|
||||
}
|
||||
min_dB -26.0
|
||||
max_dB 25.0
|
||||
resolution 256
|
||||
}
|
||||
rate_converter "linear" #"speexrate"
|
||||
}
|
||||
|
||||
#pcm.resample rely on alsa-plugin and libspeexdsp. Select them in menuconfig if we want to use plugin pcm.resample.
|
||||
pcm.resample {
|
||||
type plug
|
||||
slave {
|
||||
pcm "hw:0,0"
|
||||
format S16_LE
|
||||
rate 16000
|
||||
channels 1
|
||||
}
|
||||
rate_converter "speexrate"
|
||||
}
|
||||
|
||||
pcm.CaptureMic Capture1MicHard
|
||||
|
||||
# I2SRTX's I2S_SAMPLERATE and I2S_CHNNUM must be same to PlaybackRateDmix's SAMPLERATE and CHNNUM!
|
||||
pcm.I2SRTX {
|
||||
@args [ I2S_SAMPLERATE I2S_CHNNUM ]
|
||||
@args.I2S_SAMPLERATE {
|
||||
type integer
|
||||
default 16000
|
||||
}
|
||||
@args.I2S_CHNNUM {
|
||||
type integer
|
||||
default 1
|
||||
}
|
||||
type hooks
|
||||
slave.pcm {
|
||||
type plug
|
||||
slave {
|
||||
pcm "hw:snddaudio0,0"
|
||||
channels $I2S_CHNNUM
|
||||
rate $I2S_SAMPLERATE
|
||||
}
|
||||
}
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args [
|
||||
{
|
||||
name "loopback debug"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
#pcm.CaptureI2SRX {
|
||||
# type hooks
|
||||
# slave.pcm "hw:snddaudio0,0"
|
||||
# hooks.0 {
|
||||
# type ctl_elems
|
||||
# hook_args [
|
||||
# {
|
||||
# name "loopback debug"
|
||||
# preserve true
|
||||
# optional true
|
||||
# value 1
|
||||
# }
|
||||
# ]
|
||||
# }
|
||||
#}
|
||||
|
||||
#pcm_slave.slaveCap {
|
||||
# @args [ PCMID CHNNUM ]
|
||||
# @args.PCMID {
|
||||
# type string
|
||||
# }
|
||||
# @args.CHNNUM {
|
||||
# type integer
|
||||
# }
|
||||
# pcm $PCMID
|
||||
# channels $CHNNUM
|
||||
#}
|
||||
|
||||
#pcm_slave.slaveMultiCapture {
|
||||
# pcm {
|
||||
# type multi
|
||||
# slaves {
|
||||
# a "slaveCap:CaptureMic,1"
|
||||
# b "slaveCap:CaptureI2SRX,1"
|
||||
# }
|
||||
# bindings {
|
||||
# 0 {slave a channel 0}
|
||||
# 1 {slave b channel 0}
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
|
||||
#pcm.CaptureDouble {
|
||||
# type plug
|
||||
# slave slaveMultiCapture
|
||||
# ttable.0.0 1
|
||||
# ttable.1.1 1
|
||||
#}
|
||||
|
||||
#we define pcm capture plugin naming convention:
|
||||
#pcm.Capture<n>Mic:<SampleRate>, <n>: the number of MIC. It can auto convert to indicated channels. <SampleRate>: set sample rate to Hardware PCM.
|
||||
#pcm.Capture<n>MicPlusAec, if enable aec, add PlusAec. It forbids to auto convert to multi channels because of aec.
|
||||
# ref to GenerateCaptureIdentifier() in [audio_hw.c]
|
||||
#e.g.:
|
||||
#pcm.Capture1Mic:16000
|
||||
#pcm.Capture1MicPlusAec
|
||||
#pcm.Capture2Mic:16000
|
||||
#pcm.Capture2MicPlusAec
|
||||
pcm.Capture1Mic {
|
||||
@args [ SAMPLERATE ]
|
||||
@args.SAMPLERATE {
|
||||
type integer
|
||||
default 16000
|
||||
}
|
||||
type hooks
|
||||
slave.pcm {
|
||||
type plug
|
||||
slave {
|
||||
pcm "hw:0,0"
|
||||
channels 1
|
||||
rate $SAMPLERATE
|
||||
}
|
||||
}
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args HookArgsCapture
|
||||
}
|
||||
}
|
||||
|
||||
pcm.Capture1MicHard {
|
||||
type hooks
|
||||
slave.pcm "hw:0,0"
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args HookArgsCapture
|
||||
}
|
||||
}
|
||||
pcm.Capture1MicPlusAec {
|
||||
type route
|
||||
slave.pcm {
|
||||
type multi
|
||||
slaves {
|
||||
a {pcm Capture1MicHard channels 1}
|
||||
b {pcm I2SRTX channels 1}
|
||||
}
|
||||
bindings {
|
||||
0 {slave a channel 0}
|
||||
1 {slave b channel 0}
|
||||
}
|
||||
}
|
||||
ttable.0.0 1
|
||||
ttable.1.1 1
|
||||
}
|
||||
|
||||
pcm.Capture2Mic {
|
||||
@args [ SAMPLERATE ]
|
||||
@args.SAMPLERATE {
|
||||
type integer
|
||||
default 16000
|
||||
}
|
||||
type hooks
|
||||
slave.pcm {
|
||||
type plug
|
||||
slave {
|
||||
pcm "hw:0,0"
|
||||
channels 2
|
||||
rate $SAMPLERATE
|
||||
}
|
||||
}
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args [
|
||||
{
|
||||
name "MIC1 Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "MIC1 Input Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ"
|
||||
}
|
||||
{
|
||||
name "MIC2 Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "MIC2 Input Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
pcm.Capture2MicHard {
|
||||
type hooks
|
||||
slave.pcm "hw:0,0"
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args [
|
||||
{
|
||||
name "MIC1 Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "MIC1 Input Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ"
|
||||
}
|
||||
{
|
||||
name "MIC2 Switch"
|
||||
preserve true
|
||||
optional true
|
||||
value 1
|
||||
}
|
||||
{
|
||||
name "MIC2 Input Select"
|
||||
preserve true
|
||||
optional true
|
||||
value "differ"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
pcm.Capture2MicPlusAec {
|
||||
type route
|
||||
slave.pcm {
|
||||
type multi
|
||||
slaves {
|
||||
a {pcm Capture2MicHard channels 2}
|
||||
b {pcm I2SRTX channels 1}
|
||||
}
|
||||
bindings {
|
||||
0 {slave a channel 0}
|
||||
1 {slave a channel 1}
|
||||
2 {slave b channel 0}
|
||||
}
|
||||
}
|
||||
ttable.0.0 1
|
||||
ttable.1.1 1
|
||||
ttable.2.2 1
|
||||
}
|
||||
|
||||
pcm.eq {
|
||||
type awequal
|
||||
slave.pcm "hw:0,0"
|
||||
config_file "/etc/awequal.conf"
|
||||
tuning_support true
|
||||
verbose true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Configuration file for fw_(printenv/setenv) utility.
|
||||
# Up to two entries are valid, in this case the redundant
|
||||
# environment sector is assumed present.
|
||||
# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash.
|
||||
# Futhermore, if the Flash sector size is omitted, this value is assumed to
|
||||
# be the same as the Environment size, which is valid for NOR and SPI-dataflash
|
||||
# Device offset must be prefixed with 0x to be parsed as a hexadecimal value.
|
||||
|
||||
# NOR example
|
||||
# MTD device name Device offset Env. size Flash sector size Number of sectors
|
||||
# /dev/mtd1 0x0000 0x4000 0x4000
|
||||
# /dev/mtd2 0x0000 0x4000 0x4000
|
||||
|
||||
# MTD SPI-dataflash example
|
||||
# MTD device name Device offset Env. size Flash sector size Number of sectors
|
||||
#/dev/mtd5 0x4200 0x4200
|
||||
#/dev/mtd6 0x4200 0x4200
|
||||
|
||||
# NAND example
|
||||
#/dev/mtd0 0x4000 0x4000 0x20000 2
|
||||
|
||||
# On a block device a negative offset is treated as a backwards offset from the
|
||||
# end of the device/partition, rather than a forwards offset from the start.
|
||||
|
||||
# Block device example
|
||||
#/dev/mmcblk0 0xc0000 0x20000
|
||||
#/dev/mmcblk0 -0x20000 0x20000
|
||||
|
||||
# VFAT example
|
||||
#/boot/uboot.env 0x0000 0x4000
|
||||
|
||||
# UBI volume
|
||||
#/dev/ubi0_0 0x0 0x1f000 0x1f000
|
||||
#/dev/ubi0_1 0x0 0x1f000 0x1f000
|
||||
|
||||
# UBI volume by name
|
||||
#/dev/ubi0:env 0x0 0x1f000 0x1f000
|
||||
#/dev/ubi0:env-redund 0x0 0x1f000 0x1f000
|
||||
|
||||
# Allwinner Tina
|
||||
/dev/by-name/env 0x0000 0x1000
|
||||
/dev/by-name/env-redund 0x0000 0x1000
|
||||
|
||||
# Allwinner Tina UBI volume
|
||||
# /dev/ubi0:env 0x0 0x20000 0x20000
|
||||
# /dev/ubi0:env-redund 0x0 0x20000 0x20000
|
||||
@@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# load modules....
|
||||
#
|
||||
|
||||
MODULES_DIR="/lib/modules/`uname -r`"
|
||||
|
||||
start() {
|
||||
printf "load modules\n"
|
||||
|
||||
echo "load sample_virvi2vo ---- "
|
||||
#/usr/bin/sample_virvi2vo -path /usr/bin/sample_virvi2vo_v851s_sc1721v.conf &
|
||||
|
||||
#echo "------ insmod scsi modules start --------"
|
||||
#insmod $MODULES_DIR/scsi_mod.ko
|
||||
#insmod $MODULES_DIR/sd_mod.ko
|
||||
|
||||
#wifi
|
||||
echo "------ insmod xr806 modules start --------"
|
||||
insmod $MODULES_DIR/xr806.ko
|
||||
#insmod $MODULES_DIR/vipcore.ko
|
||||
#input
|
||||
#insmod $MODULES_DIR/input-core.ko
|
||||
insmod $MODULES_DIR/evdev.ko
|
||||
|
||||
echo "------insmod audio modules start-----"
|
||||
#audio
|
||||
insmod $MODULES_DIR/soundcore.ko
|
||||
insmod $MODULES_DIR/snd.ko
|
||||
insmod $MODULES_DIR/snd-timer.ko
|
||||
insmod $MODULES_DIR/snd-pcm.ko
|
||||
insmod $MODULES_DIR/snd-pcm-dmaengine.ko
|
||||
insmod $MODULES_DIR/snd-soc-core.ko
|
||||
insmod $MODULES_DIR/snd_soc_sunxi_pcm.ko
|
||||
insmod $MODULES_DIR/snd_soc_sunxi_component_rxsync.ko
|
||||
insmod $MODULES_DIR/snd_soc_sunxi_aaudio.ko
|
||||
insmod $MODULES_DIR/snd_soc_sunxi_daudio.ko
|
||||
insmod $MODULES_DIR/snd_soc_sunxi_internal_codec.ko
|
||||
insmod $MODULES_DIR/snd_soc_sunxi_machine.ko
|
||||
|
||||
echo "------insmod audio modules end-----"
|
||||
|
||||
#insmod $MODULES_DIR/rt-media.ko
|
||||
|
||||
echo "------ insmod gpio_keys modules start --------"
|
||||
#gpio key
|
||||
insmod $MODULES_DIR/gpio_keys.ko
|
||||
|
||||
echo "------ insmod sunxi_gpadc modules start --------"
|
||||
#l-sen
|
||||
insmod $MODULES_DIR/sunxi_gpadc.ko
|
||||
|
||||
echo "------ insmod cst9220 modules start --------"
|
||||
#ctp
|
||||
#insmod $MODULES_DIR/gslX680new.ko
|
||||
insmod $MODULES_DIR/cst9220.ko
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "unload modules\n"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# udev This is a minimal non-LSB version of a UDEV startup script. It
|
||||
# was derived by stripping down the udev-058 LSB version for use
|
||||
# with buildroot on embedded hardware using Linux 2.6.34+ kernels.
|
||||
#
|
||||
# You may need to customize this for your system's resource limits
|
||||
# (including startup time!) and administration. For example, if
|
||||
# your early userspace has a custom initramfs or initrd you might
|
||||
# need /dev much earlier; or without hotpluggable busses (like USB,
|
||||
# PCMCIA, MMC/SD, and so on) your /dev might be static after boot.
|
||||
#
|
||||
# This script assumes your system boots right into the eventual root
|
||||
# filesystem, and that init runs this udev script before any programs
|
||||
# needing more device nodes than the bare-bones set -- /dev/console,
|
||||
# /dev/zero, /dev/null -- that's needed to boot and run this script.
|
||||
#
|
||||
|
||||
# Check for missing binaries
|
||||
UDEV_BIN=/sbin/udevd
|
||||
test -x $UDEV_BIN || exit 5
|
||||
|
||||
# Check for config file and read it
|
||||
UDEV_CONFIG=/etc/udev/udev.conf
|
||||
test -r $UDEV_CONFIG || exit 6
|
||||
. $UDEV_CONFIG
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Populating ${udev_root:-/dev} using udev: "
|
||||
printf '\000\000\000\000' > /proc/sys/kernel/hotplug
|
||||
$UDEV_BIN -d || (echo "FAIL" && exit 1)
|
||||
udevadm trigger --type=subsystems --action=add
|
||||
udevadm trigger --type=devices --action=add
|
||||
udevadm settle --timeout=30 || echo "udevadm settle failed"
|
||||
echo "done"
|
||||
;;
|
||||
stop)
|
||||
# Stop execution of events
|
||||
udevadm control --stop-exec-queue
|
||||
killall udevd
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start wifi_deamon....
|
||||
#
|
||||
|
||||
start() {
|
||||
printf "Starting wifi_deamon....: "
|
||||
wifi_daemon
|
||||
sleep 0.2
|
||||
wifi -o sta
|
||||
#wifi -a enable
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping wifi_deamon: "
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Load fat modules....
|
||||
#
|
||||
|
||||
MODULES_DIR="/lib/modules/`uname -r`"
|
||||
|
||||
start() {
|
||||
printf "Load fat modules\n"
|
||||
insmod $MODULES_DIR/fat.ko
|
||||
insmod $MODULES_DIR/vfat.ko
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Unload fat modules\n"
|
||||
rmmod $MODULES_DIR/fat.ko
|
||||
rmmod $MODULES_DIR/vfat.ko
|
||||
}
|
||||
|
||||
#case "$1" in
|
||||
# start)
|
||||
# start
|
||||
# ;;
|
||||
# stop)
|
||||
# stop
|
||||
# ;;
|
||||
# restart|reload)
|
||||
# stop
|
||||
# start
|
||||
# ;;
|
||||
# *)
|
||||
# echo "Usage: $0 {start|stop|restart}"
|
||||
# exit 1
|
||||
#esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Load mmc modules....
|
||||
#
|
||||
|
||||
MODULES_DIR="/lib/modules/`uname -r`"
|
||||
|
||||
start() {
|
||||
printf "Load mmc modules\n"
|
||||
insmod $MODULES_DIR/mmc_core.ko
|
||||
insmod $MODULES_DIR/mmc_block.ko
|
||||
insmod $MODULES_DIR/sunxi_mmc_host.ko
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Unload mmc modules\n"
|
||||
rmmod $MODULES_DIR/mmc_core.ko
|
||||
rmmod $MODULES_DIR/block.ko
|
||||
rmmod $MODULES_DIR/sunxi_mmc_host.ko
|
||||
}
|
||||
|
||||
#case "$1" in
|
||||
# start)
|
||||
# start
|
||||
# ;;
|
||||
# stop)
|
||||
# stop
|
||||
# ;;
|
||||
# restart|reload)
|
||||
# stop
|
||||
# start
|
||||
# ;;
|
||||
# *)
|
||||
# echo "Usage: $0 {start|stop|restart}"
|
||||
# exit 1
|
||||
#esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,71 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# pcba test
|
||||
#
|
||||
start() {
|
||||
printf "load pcba test\n"
|
||||
|
||||
LOOP_CNT=0
|
||||
SD_DEV=
|
||||
while [ 1 ];do
|
||||
if [ $LOOP_CNT -eq 3 ];then
|
||||
echo wait SD Card ready timeout
|
||||
break;
|
||||
fi
|
||||
if [ -b /dev/mmcblk1p1 ];then
|
||||
SD_DEV=/dev/mmcblk1p1
|
||||
break;
|
||||
elif [ -b /dev/mmcblk1 ];then
|
||||
SD_DEV=/dev/mmcblk1
|
||||
break;
|
||||
elif [ -b /dev/mmcblk0p1 ];then
|
||||
SD_DEV=/dev/mmcblk0p1
|
||||
break;
|
||||
elif [ -b /dev/mmcblk0 ];then
|
||||
SD_DEV=/dev/mmcblk0
|
||||
break;
|
||||
else
|
||||
echo SD Card not ready, wait
|
||||
fi
|
||||
LOOP_CNT=$(($LOOP_CNT+1))
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if [ -n "$(grep '/mnt/SDCARD' /proc/mounts)" ]; then
|
||||
echo "start mv stream..."
|
||||
ls /tmp/
|
||||
rm -rf /mnt/extsd/stream*.h264
|
||||
rm -rf /mnt/extsd/data*.jpg
|
||||
mv /tmp/stream*.h264 /mnt/SDCARD/
|
||||
mv /tmp/data*.jpg /mnt/SDCARD/
|
||||
echo "---/mnt/SDCARD/---"
|
||||
ls /mnt/SDCARD/
|
||||
fi
|
||||
|
||||
if [ -d /mnt/SDCARD/pcba_test ]; then
|
||||
/usr/bin/pcba_test.sh
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "nnload pcba test\n"
|
||||
|
||||
}
|
||||
|
||||
#case "$1" in
|
||||
# start)
|
||||
# start
|
||||
# ;;
|
||||
# stop)
|
||||
# stop
|
||||
# ;;
|
||||
# restart|reload)
|
||||
# stop
|
||||
# start
|
||||
# ;;
|
||||
# *)
|
||||
# echo "Usage: $0 {start|stop|restart}"
|
||||
# exit 1
|
||||
#esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "------run rc.final file-----"
|
||||
#echo "insmod wifi modules"
|
||||
#insmod /lib/modules/3.4.39/8723ds.ko
|
||||
#insmod /lib/modules/3.4.39/bcmdhd.ko
|
||||
#insmod /lib/modules/3.4.39/xradio_mac.ko
|
||||
#insmod /lib/modules/3.4.39/xradio_core.ko
|
||||
#insmod /lib/modules/3.4.39/xradio_wlan.ko
|
||||
|
||||
export LD_LIBRARY_PATH=/usr/lib/eyesee-mpp:${LD_LIBRARY_PATH}
|
||||
ulimit -c unlimited
|
||||
echo /mnt/extsd/coredump-%e-%p-%s-%t > /proc/sys/kernel/core_pattern
|
||||
|
||||
for i in /etc/init.d/S??* ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set start
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i start
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
#LOOP_CNT=0
|
||||
#SD_DEV=
|
||||
#while [ 1 ];do
|
||||
# if [ $LOOP_CNT -eq 3 ];then
|
||||
# echo wait SD Card ready timeout
|
||||
# break;
|
||||
# fi
|
||||
# if [ -b /dev/mmcblk1p1 ];then
|
||||
# SD_DEV=/dev/mmcblk1p1
|
||||
# break;
|
||||
# elif [ -b /dev/mmcblk1 ];then
|
||||
# SD_DEV=/dev/mmcblk1
|
||||
# break;
|
||||
# elif [ -b /dev/mmcblk0p1 ];then
|
||||
# SD_DEV=/dev/mmcblk0p1
|
||||
# break;
|
||||
# elif [ -b /dev/mmcblk0 ];then
|
||||
# SD_DEV=/dev/mmcblk0
|
||||
# break;
|
||||
# else
|
||||
# echo SD Card not ready, wait
|
||||
# fi
|
||||
# LOOP_CNT=$(($LOOP_CNT+1))
|
||||
# sleep 1
|
||||
#done
|
||||
#
|
||||
## repair sd card file
|
||||
#if [ "x$SD_DEV" != "x" ]; then
|
||||
# echo SD Card is ready
|
||||
#
|
||||
# if [ -f /usr/bin/fsck_msdos ]; then
|
||||
# /usr/bin/fsck_msdos -pfS $SD_DEV
|
||||
# fi
|
||||
#fi
|
||||
|
||||
#if [ -z "$(grep '\<vfat\>' /proc/mounts)" ]; then
|
||||
# ! /bin/mount -t vfat /dev/mmcblk0 /mnt/extsd 2>/dev/null &&
|
||||
# /bin/mount -t vfat /dev/mmcblk0p1 /mnt/extsd
|
||||
#fi
|
||||
|
||||
#sleep 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#/usr/bin/sample_virvi2vo -path /usr/bin/sample_virvi2vo_v851s_sc1721v.conf &
|
||||
|
||||
|
||||
run_usb_adb
|
||||
|
||||
#l-sen
|
||||
echo "show ls value"
|
||||
cat /sys/class/gpadc/data
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "------run rc.modules file-----"
|
||||
MODULES_DIR="/lib/modules/`uname -r`"
|
||||
|
||||
#disp
|
||||
echo "------ insmod display modules start --------"
|
||||
#insmod $MODULES_DIR/fb.ko
|
||||
insmod $MODULES_DIR/disp.ko
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "------run rc.preboot file-----"
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# Stop all init scripts in /etc/init.d
|
||||
# executing them in reversed numerical order.
|
||||
#
|
||||
|
||||
for i in $(ls -r /etc/init.d/S??*) ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set stop
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i stop
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# /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:/etc/preinit
|
||||
::sysinit:/bin/mount -t proc proc /proc
|
||||
::sysinit:/bin/mount -t tmpfs tmpfs /run
|
||||
::sysinit:/bin/mount -o remount,rw /
|
||||
::sysinit:/bin/mkdir -p /dev/pts
|
||||
::sysinit:/bin/mkdir -p /dev/shm
|
||||
::sysinit:/bin/mount -a
|
||||
::sysinit:/bin/hostname -F /etc/hostname
|
||||
# now run any rc scripts
|
||||
#::sysinit:/etc/init.d/rcS
|
||||
::sysinit:/etc/init.d/rcS boot
|
||||
|
||||
# Put a getty on the serial port
|
||||
/dev/console::respawn:-/bin/sh
|
||||
#ttyS0::respawn:/sbin/getty -n -L ttyS0 115200 vt100 -n -l /bin/sh # 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 -r
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
echo "------run profile file-----"
|
||||
[ -f /etc/banner ] && cat /etc/banner
|
||||
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
|
||||
fgrep -sq '/ overlay ro,' /proc/mounts && {
|
||||
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
|
||||
echo 'Please try to remove files from /overlay/upper/... and reboot!'
|
||||
}
|
||||
|
||||
export PATH="%PATH%"
|
||||
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
|
||||
export HOME=${HOME:-/root}
|
||||
export PS1='\u@\h:\w\$ '
|
||||
export LD_LIBRARY_PATH=/usr/lib/eyesee-mpp:${LD_LIBRARY_PATH}
|
||||
ulimit -c unlimited
|
||||
mount -t debugfs none /sys/kernel/debug
|
||||
|
||||
[ -x /bin/more ] || alias more=less
|
||||
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
||||
|
||||
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
|
||||
|
||||
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
|
||||
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
||||
|
||||
[ -n "$FAILSAFE" ] || {
|
||||
for FILE in /etc/profile.d/*.sh; do
|
||||
[ -e "$FILE" ] && . "$FILE"
|
||||
done
|
||||
unset FILE
|
||||
}
|
||||
[ -x /bin/ll ] || alias ll='ls -al'
|
||||
|
||||
#export TSLIB_ROOT=/usr/local/tslib
|
||||
export TSLIB_TSDEVICE=/dev/input/event2
|
||||
export TSLIB_TSEVENTTYPE=input
|
||||
export TSLIB_CONFFILE=/mnt/ts.conf
|
||||
#export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
|
||||
#export TSLIB_CALIBFILE=/etc/pointercal
|
||||
export TSLIB_CALIBFILE=/mnt/pointercal
|
||||
|
||||
export TSLIB_PLUGINDIR=/usr/lib/ts
|
||||
export TSLIB_CONSOLEDEVICE=none
|
||||
export TSLIB_FBDEVICE=/dev/fb0
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/etc/udev/hotplug-tf.sh %k $env{ACTION}"
|
||||
ACTION=="add", KERNEL=="mmc0:*", RUN+="/etc/udev/hotplug-tf.sh %k $env{ACTION}"
|
||||
ACTION=="remove", KERNEL=="mmc0:*", RUN+="/etc/udev/hotplug-tf.sh %k $env{ACTION}"
|
||||
@@ -0,0 +1,3 @@
|
||||
KERNEL=="sda[0-9]", SUBSYSTEM=="block", SUBSYSTEM=="usb", RUN+="/etc/udev/usb_handle %k $env{ACTION}"
|
||||
ACTION=="add|change", KERNEL=="sd*", RUN+="/etc/udev/usb_handle %k $env{ACTION}"
|
||||
ACTION=="remove", KERNEL=="sd*", RUN+="/etc/udev/usb_handle %k $env{ACTION}"
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "hotplug usb $(date)"#>>/run/udev.log
|
||||
echo "[$#] $0, $1, $2"#>>/run/udev.log
|
||||
if [ "$#" != "2" ];then
|
||||
echo " !! param err." #>> /run/udev.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$2" == "remove" ];then
|
||||
echo " <==umount"#>> /run/udev.log
|
||||
umount /mnt/exUDISK
|
||||
fi
|
||||
|
||||
if [ "$2" == "add" ];then
|
||||
echo " <==mount"#>> /run/udev.log
|
||||
mount -t vfat /dev/sda1 /mnt/exUDISK
|
||||
fi
|
||||
@@ -0,0 +1,104 @@
|
||||
# Sample udhcpd configuration file (/etc/udhcpd.conf)
|
||||
# Values shown are defaults
|
||||
|
||||
# The start and end of the IP lease block
|
||||
start 192.168.10.100
|
||||
end 192.168.10.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 254
|
||||
|
||||
# The time period at which udhcpd will write out a dhcpd.leases
|
||||
# file. If this is 0, udhcpd will never automatically write a
|
||||
# lease file. Specified in seconds.
|
||||
#auto_time 7200
|
||||
|
||||
# The amount of time that an IP will be reserved (leased to nobody)
|
||||
# if a DHCP decline message is received (seconds)
|
||||
#decline_time 3600
|
||||
|
||||
# The amount of time that an IP will be reserved
|
||||
# if an ARP conflict occurs (seconds)
|
||||
#conflict_time 3600
|
||||
|
||||
# How long an offered address is reserved (seconds)
|
||||
#offer_time 60
|
||||
|
||||
# If client asks for lease below this value, it will be rounded up
|
||||
# to this value (seconds)
|
||||
#min_lease 60
|
||||
|
||||
# The location of the leases file
|
||||
#lease_file /var/lib/misc/udhcpd.leases
|
||||
|
||||
# The location of the pid file
|
||||
#pidfile /var/run/udhcpd.pid
|
||||
|
||||
# Every time udhcpd writes a leases file, the below script will be called
|
||||
#notify_file # default: no script
|
||||
#notify_file dumpleases # useful for debugging
|
||||
|
||||
# The following are bootp specific options
|
||||
# next server to use in bootstrap
|
||||
#siaddr 192.168.0.22 # default: 0.0.0.0 (none)
|
||||
# tftp server name
|
||||
#sname zorak # default: none
|
||||
# tftp file to download (e.g. kernel image)
|
||||
#boot_file /var/nfs_root # default: none
|
||||
|
||||
# Static leases map
|
||||
#static_lease 00:60:08:11:CE:4E 192.168.0.54
|
||||
#static_lease 00:60:08:11:CE:3E 192.168.0.44
|
||||
|
||||
# The remainder of options are DHCP options and can be specified with the
|
||||
# keyword 'opt' or 'option'. If an option can take multiple items, such
|
||||
# as the dns option, they can be listed on the same line, or multiple
|
||||
# lines.
|
||||
# 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
|
||||
# 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)
|
||||
# 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
|
||||
# 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
|
||||
@@ -0,0 +1,7 @@
|
||||
ctrl_interface=/var/log/wpa_supplicant
|
||||
update_config=1
|
||||
|
||||
network={
|
||||
ssid="AWTest"
|
||||
psk="1qaz@WSX"
|
||||
}
|
||||
@@ -0,0 +1,525 @@
|
||||
#!/bin/sh
|
||||
|
||||
MOUNT_ETC=0
|
||||
MOUNT_OVERLAY=1
|
||||
|
||||
################################## functions ##################################
|
||||
|
||||
#mkfs_jffs2() <device in /dev/by-name>
|
||||
mkfs_jffs2() {
|
||||
! [ -x /usr/sbin/mkfs.jffs2 ] \
|
||||
&& ! [ -x /sbin/mkfs.jffs2 ] \
|
||||
&& echo "Not Found /usr/sbin/mkfs.jffs2 or /sbin/mkfs.jffs2" \
|
||||
&& return 1
|
||||
|
||||
# format to jffs2
|
||||
local erase_block=$(/bin/cat /proc/mtd \
|
||||
| /bin/grep "$(basename $1)" \
|
||||
| /usr/bin/awk '{print $3}')
|
||||
/bin/mkdir -p /tmp/jffs2.dir/tmp
|
||||
mkfs.jffs2 -p -e 0x${erase_block} -d /tmp/jffs2.dir \
|
||||
-o /tmp/jffs2.img >/dev/null || return 1
|
||||
/bin/dd if=/tmp/jffs2.img of=$1 || return 1
|
||||
/bin/rm -rf /tmp/jffs2.img /tmp/jffs2.dir
|
||||
return 0
|
||||
}
|
||||
|
||||
mkfs_ubifs() {
|
||||
mkfs.ubifs -x lzo -y "$1"
|
||||
}
|
||||
|
||||
mount_etc() {
|
||||
local etc_update=0
|
||||
# if enable ota, do update
|
||||
[ -f /etc/init.d/rc.ota-upgrade ] \
|
||||
&& source /etc/init.d/ota-upgrade
|
||||
|
||||
local root_dev="$(readlink /dev/by-name/rootfs)"
|
||||
|
||||
# if mount failed, format.
|
||||
case "${root_dev}" in
|
||||
/dev/mtdblock*)
|
||||
/bin/mount -t jffs2 /dev/by-name/rootfs_data /etc \
|
||||
&& [ -e /etc/etc_complete -a ! -e /etc/etc_need_update ] \
|
||||
&& return
|
||||
# /etc/etc_complete and /etc/etc_need_update both exist, that means we just need to update
|
||||
[ -e /etc/etc_complete -a -e /etc/etc_need_update ] && /bin/echo "do etc update" && etc_update=1
|
||||
/bin/umount /etc
|
||||
|
||||
[ x$etc_update = x"1" ] || {
|
||||
# not update, format first
|
||||
/bin/echo "Mount Failed: formating /dev/by-name/rootfs_data to jffs2 ..."
|
||||
mkfs_jffs2 "/dev/by-name/rootfs_data" || return 1
|
||||
}
|
||||
mount -t jffs2 /dev/by-name/rootfs_data /mnt
|
||||
;;
|
||||
/dev/ubi*)
|
||||
/bin/mount -t ubifs /dev/by-name/rootfs_data /etc \
|
||||
&& [ -e /etc/etc_complete -a ! -e /etc/etc_need_update ] \
|
||||
&& return
|
||||
# /etc/etc_complete and /etc/etc_need_update both exist, that means we just need to update
|
||||
[ -e /etc/etc_complete -a -e /etc/etc_need_update ] && /bin/echo "do etc update" && etc_update=1
|
||||
|
||||
/bin/umount /etc
|
||||
[ x$etc_update = x"1" ] || {
|
||||
# not update, format first
|
||||
/bin/echo "Mount Failed: formating /dev/by-name/rootfs_data to ubifs ..."
|
||||
mkfs_ubifs "/dev/by-name/rootfs_data" || return 1
|
||||
}
|
||||
/bin/mount -t ubifs /dev/by-name/rootfs_data /mnt
|
||||
;;
|
||||
*)
|
||||
/usr/sbin/fsck.ext4 -y /dev/by-name/rootfs_data &>/dev/null
|
||||
/bin/mount -t ext4 -o sync,data=journal /dev/by-name/rootfs_data /etc \
|
||||
&& [ -e /etc/etc_complete -a ! -e /etc/etc_need_update ] \
|
||||
&& return
|
||||
# /etc/etc_complete and /etc/etc_need_update both exist, that means we just need to update
|
||||
[ -e /etc/etc_complete -a -e /etc/etc_need_update ] && /bin/echo "do etc update" && etc_update=1
|
||||
|
||||
/bin/umount /etc
|
||||
[ x$etc_update = x"1" ] || {
|
||||
# not update, format first
|
||||
/bin/echo "Mount Failed: formating /dev/by-name/rootfs_data to ext4 ..."
|
||||
mkfs.ext4 -m 0 /dev/by-name/rootfs_data >/dev/null || return 1
|
||||
}
|
||||
/bin/mount -t ext4 -o sync,data=journal /dev/by-name/rootfs_data /mnt
|
||||
;;
|
||||
esac
|
||||
mkdir -p /tmp/etc
|
||||
/bin/cp -af /etc/* /tmp/etc/
|
||||
# keep the wifi config
|
||||
[ -e /mnt/wifi/wpa_supplicant.conf ] && {
|
||||
/bin/echo "keep the wifi config"
|
||||
/bin/cp /mnt/wifi/wpa_supplicant.conf /tmp/etc/wifi/
|
||||
}
|
||||
/bin/cp -af /tmp/etc/* /mnt/
|
||||
rm -rf /tmp/etc
|
||||
sync
|
||||
[ ! -e /mnt/etc_complete ] && touch /mnt/etc_complete
|
||||
[ -e /mnt/etc_need_update ] && /bin/echo "etc update done" && rm -f /mnt/etc_need_update
|
||||
sync
|
||||
/bin/mount -o move /mnt /etc
|
||||
|
||||
}
|
||||
|
||||
mount_usr(){
|
||||
|
||||
local extend_name=$(fw_printenv -n extend_partition)
|
||||
if [ $extend_name == extendB ]; then
|
||||
extend_name="extend_backup"
|
||||
else
|
||||
extend_name="extend"
|
||||
fi
|
||||
local extend_partition="/dev/by-name/${extend_name}"
|
||||
|
||||
[ -L ${extend_partition} ] ||
|
||||
if [ ${extend_partition} == "/dev/by-name/extend" ]; then
|
||||
[ -L /dev/by-name/extend_backup ] || return
|
||||
else
|
||||
[ -L /dev/by-name/extend ] || return
|
||||
fi
|
||||
|
||||
/bin/mkdir -p /tmp/usr
|
||||
/bin/mount ${extend_partition} /tmp/usr >/dev/null || {
|
||||
if [ ${extend_partition} == "/dev/by-name/extend" ]; then
|
||||
echo "****** 111 mount /dev/by-name/extend_backup /usr *******"
|
||||
/bin/mount /dev/by-name/extend_backup /tmp/usr > /dev/null
|
||||
return
|
||||
else
|
||||
echo "********** 222 mount /dev/by-name/extend /usr ********"
|
||||
/bin/mount /dev/by-name/extend /tmp/usr > /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
echo "*******333 mount ${extend_partition} /usr ******"
|
||||
! [ -d /tmp/usr/bin ] \
|
||||
&& umount /tmp/usr \
|
||||
&& rm -rf /tmp/usr \
|
||||
&& return
|
||||
|
||||
/bin/mount -o move /tmp/usr /usr \
|
||||
&& rm -rf /tmp/usr
|
||||
|
||||
}
|
||||
|
||||
mount_sec_storage(){
|
||||
[ -e /dev/by-name/sec_storage ] || return
|
||||
|
||||
local root_dev="$(readlink /dev/by-name/rootfs)"
|
||||
|
||||
# mount sec_storage
|
||||
if [ -h /dev/by-name/sec_storage -a -d /data/tee ]; then
|
||||
case "${root_dev}" in
|
||||
/dev/mtdblock*)
|
||||
/bin/busybox mount -t jffs2 /dev/by-name/sec_storage /data/tee 2>/dev/null
|
||||
if [ "$?" -ne "0" ]; then
|
||||
mkfs_jffs2 "/dev/by-name/sec_storage"
|
||||
/bin/busybox mount -t jffs2 /dev/by-name/sec_storage /data/tee 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
/dev/ubi*)
|
||||
/bin/busybox mount -t ubifs /dev/by-name/sec_storage /data/tee 2>/dev/null
|
||||
if [ "$?" -ne "0" ]; then
|
||||
mkfs_ubifs "/dev/by-name/sec_storage"
|
||||
/bin/busybox mount -t ubifs /dev/by-name/sec_storage /data/tee 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
/usr/sbin/fsck.ext4 -y /dev/by-name/sec_storage &>/dev/null
|
||||
/bin/busybox mount -t ext4 /dev/by-name/sec_storage /data/tee 2>/dev/null
|
||||
if [ "$?" -ne "0" ]; then
|
||||
mkfs.ext4 /dev/by-name/sec_storage >/dev/null
|
||||
/bin/busybox mount -t ext4 /dev/by-name/sec_storage /data/tee 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
mount_single_app(){
|
||||
/usr/sbin/fsck.ext4 -y /dev/by-name/app &>/dev/null
|
||||
/bin/mount /dev/by-name/app /mnt/app
|
||||
}
|
||||
|
||||
mount_dual_app(){
|
||||
local appAB=$(fw_printenv -n appAB)
|
||||
local first_app=app
|
||||
local second_app=app_sub
|
||||
local applimit=$(fw_printenv -n applimit)
|
||||
[ x"$applimit" != x"" -a "$applimit" -ne 0 ] && {
|
||||
local appcount=$(fw_printenv -n appcount)
|
||||
let appcount+=1
|
||||
[ "$appcount" -gt "$applimit" ] && {
|
||||
echo "Warning: applimit ($applimit) exceeded. Switch app partition."
|
||||
if [ x"$appAB" = x"A" ]; then
|
||||
appAB=B
|
||||
elif [ x"$appAB" = x"B" ]; then
|
||||
appAB=A
|
||||
else
|
||||
echo "check appAB error: appAB=$appAB"
|
||||
appAB=A
|
||||
fi
|
||||
fw_setenv appAB $appAB
|
||||
echo "Switch appAB to $appAB"
|
||||
appcount=1
|
||||
}
|
||||
fw_setenv appcount $appcount
|
||||
}
|
||||
echo "appAB=$appAB"
|
||||
if [ x"$appAB" = x"A" ]; then
|
||||
first_app=app
|
||||
second_app=app_sub
|
||||
elif [ x"$appAB" = x"B" ]; then
|
||||
first_app=app_sub
|
||||
second_app=app
|
||||
else
|
||||
echo "check appAB error: appAB=$appAB"
|
||||
fi
|
||||
|
||||
/usr/sbin/fsck.ext4 -y /dev/by-name/$first_app &> /dev/null
|
||||
/bin/mount -t ext4 /dev/by-name/$first_app /mnt/app \
|
||||
&& echo "mount $first_app success" \
|
||||
&& return
|
||||
|
||||
echo "mount $first_app fail, now try mount $second_app"
|
||||
|
||||
#mount first_app fail, try second_app
|
||||
/usr/sbin/fsck.ext4 -y /dev/by-name/$second_app &> /dev/null
|
||||
/bin/mount -t ext4 /dev/by-name/$second_app /mnt/app \
|
||||
&& echo "mount $second_app success" \
|
||||
&& return
|
||||
|
||||
echo "mount app fail"
|
||||
}
|
||||
|
||||
mount_app() {
|
||||
[ -L /dev/by-name/app ] || return
|
||||
|
||||
if [ -L /dev/by-name/app_sub ]; then
|
||||
mount_dual_app
|
||||
else
|
||||
mount_single_app
|
||||
fi
|
||||
}
|
||||
|
||||
mount_overlay() {
|
||||
|
||||
local root_dev="$(readlink /dev/by-name/rootfs)"
|
||||
local mount_partition_dir
|
||||
case "$1" in
|
||||
UDISK)
|
||||
mount_partition_dir="/mnt/UDISK"
|
||||
;;
|
||||
rootfs_data)
|
||||
mount_partition_dir="/overlay"
|
||||
;;
|
||||
*)
|
||||
echo "error: please choose rootfs_data or UDISK"
|
||||
return 1
|
||||
esac
|
||||
|
||||
case "${root_dev}" in
|
||||
/dev/mtdblock*)
|
||||
/bin/mount -t jffs2 /dev/by-name/$1 ${mount_partition_dir} || {
|
||||
/bin/echo "Mount Failed: formating /dev/by-name/$1 to jffs2 ..."
|
||||
mkfs_jffs2 "/dev/by-name/$1" || return 1
|
||||
mount -t jffs2 /dev/by-name/$1 ${mount_partition_dir}
|
||||
}
|
||||
;;
|
||||
/dev/ubi*)
|
||||
/bin/mount -t ubifs /dev/by-name/$1 ${mount_partition_dir} || {
|
||||
/bin/echo "Mount Failed: formating /dev/by-name/$1 to ubifs ..."
|
||||
mkfs_ubifs "/dev/by-name/$1" || return 1
|
||||
/bin/mount -t ubifs /dev/by-name/$1 ${mount_partition_dir}
|
||||
}
|
||||
;;
|
||||
*)
|
||||
/usr/sbin/fsck.ext4 -y /dev/by-name/$1 &>/dev/null
|
||||
/bin/mount -t ext4 -o sync,data=journal /dev/by-name/$1 ${mount_partition_dir} || {
|
||||
/bin/echo "Mount Failed: formating /dev/by-name/$1 to ext4 ..."
|
||||
mkfs.ext4 -m 0 /dev/by-name/$1 >/dev/null || return 1
|
||||
/bin/mount -t ext4 -o sync,data=journal /dev/by-name/$1 ${mount_partition_dir}
|
||||
}
|
||||
;;
|
||||
esac
|
||||
|
||||
fgrep -sq overlay /proc/filesystems || {
|
||||
/bin/echo "skip mount overlayfs as kernel not support"
|
||||
return
|
||||
}
|
||||
# only for recovery,copy boot_partition(boot) wifi information to boot_partition(recovery)
|
||||
local system=$(fw_printenv -n boot_partition)
|
||||
|
||||
if [ x"$system" = x"recovery" ]; then
|
||||
[ -e /overlay/upper/etc/wifi/wpa_supplicant ] && {
|
||||
cp -fpr /overlay/upper/etc/wifi/* /etc/wifi/
|
||||
}
|
||||
fi
|
||||
|
||||
#When /dev/root is readonly, such as squashfs or ext4 ro, we try to mount overlayfs.Otherwise, don't mount overlayfs
|
||||
fgrep -sq '/dev/root / squashfs ro' /proc/mounts || fgrep -sq '/dev/root / ext4 ro' /proc/mounts || {
|
||||
/bin/echo "skip mount overlayfs as now rootfs not squashfs or readonly ext4"
|
||||
return
|
||||
}
|
||||
# First, try to mount without a workdir, for overlayfs v22 and before.
|
||||
# If it fails, it means that we are probably using a v23 and
|
||||
# later versions that require a workdir
|
||||
# mount -n -t overlay overlayfs:/overlay -o rw,noatime,lowerdir=/,upperdir=/overlay /mnt || {
|
||||
# mkdir -p /overlay/upper /overlay/workdir
|
||||
# mount -n -t overlay overlayfs:/overlay -o rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/workdir /mnt
|
||||
# }
|
||||
|
||||
local overlay_need_workdir=1
|
||||
# overlayfs in linux-3.4 and linux-3.10 is v22 and before, should mount without a workdir
|
||||
fgrep -sq 'Linux version 3' /proc/version && overlay_need_workdir=0
|
||||
|
||||
local mount_overlay_dir="/overlay"
|
||||
[ x"${mount_partition_dir}" = x"/mnt/UDISK" ] && {
|
||||
mkdir -p /mnt/UDISK/overlay
|
||||
mount_overlay_dir="/mnt/UDISK/overlay"
|
||||
}
|
||||
|
||||
if [ x"$overlay_need_workdir" = x"0" ]; then
|
||||
mount -n -t overlayfs overlayfs:${mount_overlay_dir} -o rw,noatime,lowerdir=/,upperdir=${mount_overlay_dir} /mnt
|
||||
else
|
||||
mkdir -p ${mount_overlay_dir}/upper ${mount_overlay_dir}/workdir
|
||||
mount -n -t overlay overlayfs:${mount_overlay_dir} -o rw,noatime,lowerdir=/,upperdir=${mount_overlay_dir}/upper,workdir=${mount_overlay_dir}/workdir /mnt
|
||||
fi
|
||||
|
||||
mount -n /proc -o noatime,move /mnt/proc
|
||||
pivot_root /mnt /mnt/rom
|
||||
mount -n /rom/dev -o noatime,move /dev
|
||||
mount -n /rom/tmp -o noatime,move /tmp
|
||||
mount -n /rom/sys -o noatime,move /sys
|
||||
mount -n /rom$mount_partition_dir -o noatime,move $mount_partition_dir
|
||||
fgrep -sq '/rom/usr' /proc/mounts && {
|
||||
mount -n /rom/usr -o noatime,move /usr
|
||||
if [ x"$overlay_need_workdir" = x"0" ]; then
|
||||
mkdir -p $mount_overlay_dir/usr
|
||||
mount -n -t overlayfs overlayfs:${mount_overlay_dir} -o rw,noatime,lowerdir=/usr,upperdir=${mount_overlay_dir}/usr /usr
|
||||
else
|
||||
mkdir -p ${mount_overlay_dir}/upper/usr ${mount_overlay_dir}/workdir/usr
|
||||
mount -n -t overlay overlayfs:${mount_overlay_dir} -o rw,noatime,lowerdir=/usr,upperdir=${mount_overlay_dir}/upper/usr,workdir=${mount_overlay_dir}/workdir/usr /usr
|
||||
fi
|
||||
}
|
||||
|
||||
[ x"$1" = x"UDISK" ] && rm -rf /overlay
|
||||
}
|
||||
|
||||
set_parts_by_name() {
|
||||
# create by-name
|
||||
local parts part
|
||||
/bin/mkdir -p /dev/by-name
|
||||
parts=$partitions
|
||||
for part in $(/bin/echo ${parts} | /bin/sed 's/:/ /g')
|
||||
do
|
||||
[ ! -e /dev/${part#*@} ] && [ -x /sbin/mdev ] && mdev -s #for initramfs
|
||||
/bin/ln -fs "/dev/${part#*@}" "/dev/by-name/${part%@*}"
|
||||
done
|
||||
}
|
||||
|
||||
etc_part=/dev/nande
|
||||
|
||||
#hardcode rootfs_data partition as nande
|
||||
mount_etc_hardcode() {
|
||||
|
||||
# fix fs
|
||||
/usr/sbin/fsck.ext4 -y $etc_part &>/dev/null
|
||||
|
||||
/bin/mount -t ext4 $etc_part /etc \
|
||||
&& [ -e /etc/etc_complete ] \
|
||||
&& return
|
||||
|
||||
/bin/echo "mount Failed or etc_complete not exist"
|
||||
/bin/echo "now format $etc_part to ext4 ..."
|
||||
/bin/umount /etc
|
||||
mkfs.ext4 -m 0 $etc_part >/dev/null || return 1
|
||||
/bin/mount -t ext4 -o sync,data=journal $etc_part /mnt
|
||||
|
||||
/bin/cp -af /etc/* /mnt/
|
||||
sync
|
||||
/bin/mount -o move /mnt /etc
|
||||
|
||||
#prepare by-name in /etc for next boot
|
||||
set_parts_by_name
|
||||
cp -fpr /dev/by-name /etc
|
||||
sync
|
||||
#now rootfs_data is ready, next boot can mount it as etc
|
||||
touch /etc/etc_complete
|
||||
sync # this sync not necessary, but sync after modify something is good
|
||||
}
|
||||
|
||||
set_parts_by_name_hardcode() {
|
||||
|
||||
#UDISK is the last partition, when UDISK is there, the /etc/by-name is ready
|
||||
[ -e /etc/by-name/UDISK ] && {
|
||||
#set_part_by_name may cost more than 100ms, now just copy it from /etc
|
||||
cp -fpr /etc/by-name /dev/
|
||||
return
|
||||
}
|
||||
|
||||
#should not go here. now just show warning and do set_parts_by_name
|
||||
echo "warning: no /etc/by-name/UDISK, please check it"
|
||||
set_parts_by_name
|
||||
}
|
||||
|
||||
check_update_system_state() {
|
||||
swu_mode=`fw_printenv | grep swu_mode | awk -F '=' '{print $2}'`
|
||||
echo "swu_mode:$swu_mode"
|
||||
if [ $swu_mode == ]; then
|
||||
echo "Not thing todo"
|
||||
else
|
||||
# update_flash_flag && boot_partition_flag
|
||||
# bit3~7: reserve
|
||||
# bit2 : extend(/usr) 1:extend 0:extend_back
|
||||
# bit1 : rootfs 1:rootfs 0:rootfs_backup
|
||||
# bit0 : kernel 1:kernel 0:kernel_back
|
||||
|
||||
dd if=/dev/mtdblock0 of=/tmp/boot0_flag skip=61439 ibs=1 bs=1 count=1 1>/dev/null 2>&1
|
||||
boot_flash_flag=0x`xxd /tmp/boot0_flag | awk -F ' ' '{print $2}'`
|
||||
boot_partition_flag=0x`fw_printenv | grep update_partition_flag | awk 'BEGIN{FS="="} {print $2}'`
|
||||
echo "boot_flash_flag:$boot_flash_flag, boot_partition_flag:$boot_partition_flag"
|
||||
if [ $boot_flash_flag == $boot_partition_flag ]; then
|
||||
|
||||
boot_flash_flag_tmp=$((boot_flash_flag&0x7))
|
||||
echo "boot_flash_flag_tmp:$boot_flash_flag_tmp"
|
||||
# The system has been updated, but env has not been updated
|
||||
case $boot_flash_flag_tmp in
|
||||
0)
|
||||
fw_setenv boot_partition bootB
|
||||
fw_setenv root_partition rootfsB
|
||||
fw_setenv extend_parttion extendB
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
|
||||
1)
|
||||
fw_setenv boot_partition bootA
|
||||
fw_setenv root_partition rootfsB
|
||||
fw_setenv extend_parttion extendB
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
2)
|
||||
fw_setenv boot_partition bootB
|
||||
fw_setenv root_partition rootfsA
|
||||
fw_setenv extend_parttion extendB
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
3)
|
||||
|
||||
fw_setenv boot_partition bootB
|
||||
fw_setenv root_partition rootfsB
|
||||
fw_setenv extend_parttion extendA
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
4)
|
||||
|
||||
fw_setenv boot_partition bootA
|
||||
fw_setenv root_partition rootfsA
|
||||
fw_setenv extend_parttion extendB
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
5)
|
||||
fw_setenv boot_partition bootA
|
||||
fw_setenv root_partition rootfsB
|
||||
fw_setenv extend_parttion extendA
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
6)
|
||||
fw_setenv boot_partition bootB
|
||||
fw_setenv root_partition rootfsA
|
||||
fw_setenv extend_parttion extendA
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
7)
|
||||
fw_setenv boot_partition bootA
|
||||
fw_setenv root_partition rootfsA
|
||||
fw_setenv extend_parttion extendA
|
||||
fw_setenv swu_mode
|
||||
;;
|
||||
*)
|
||||
echo "not match boot_flash_flag_tmp"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
else
|
||||
echo "update system fail, not clean swu_mode"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------------
|
||||
|
||||
/bin/mount -t proc /proc /proc
|
||||
/bin/mount -t tmpfs tmpfs /tmp
|
||||
/bin/mount -t sysfs sys /sys
|
||||
# /bin/mount -t devtmpfs none /dev
|
||||
#demo_video_in -n 40 -s0 1920x1088 -f0 0 -pf 12 -trd 1 -pf2 0
|
||||
fgrep -sq pstore /proc/filesystems && {
|
||||
/bin/mount -t pstore pstore /sys/fs/pstore
|
||||
}
|
||||
|
||||
#fw_setenv, fw_printenv need /var/lock
|
||||
mkdir -p /var/lock
|
||||
|
||||
#common but slow
|
||||
set_parts_by_name
|
||||
|
||||
mount_sec_storage
|
||||
|
||||
# OTA's configuration is not turned on by default exit returns,
|
||||
# which does not affect the startup speed
|
||||
check_update_system_state
|
||||
|
||||
mount_usr
|
||||
[ x"$MOUNT_ETC" = x"1" ] && mount_etc
|
||||
[ x"$MOUNT_OVERLAY" = x"1" ] && mount_overlay rootfs_data #choose rootfs_data or UDISK
|
||||
mount_app
|
||||
|
||||
#hardcode but fast
|
||||
#mount_etc_hardcode
|
||||
#set_parts_by_name_hardcode
|
||||
#mount_usr
|
||||
|
||||
exec /sbin/init
|
||||
@@ -0,0 +1,29 @@
|
||||
# Uncomment if you wish to use the one-wire linux input layer S70/A70...
|
||||
# module_raw one_wire_ts_input
|
||||
|
||||
# Uncomment if you wish to use the linux input layer event interface
|
||||
module_raw input
|
||||
|
||||
# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
|
||||
# module_raw collie
|
||||
|
||||
# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
|
||||
# module_raw corgi
|
||||
|
||||
# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
|
||||
# module_raw ucb1x00
|
||||
|
||||
# Uncomment if you're using an HP iPaq h3600 or similar
|
||||
# module_raw h3600
|
||||
|
||||
# Uncomment if you're using a Hitachi Webpad
|
||||
# module_raw mk712
|
||||
|
||||
# Uncomment if you're using an IBM Arctic II
|
||||
# module_raw arctic2
|
||||
|
||||
module pthres pmin=1
|
||||
module variance delta=30
|
||||
module dejitter delta=100
|
||||
module linear
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
# remove
|
||||
if [ "${ACTION}" == "remove" ]; then
|
||||
MOUNTPOINT="$(grep -w "^/dev/${MDEV}" /proc/mounts | awk '{print $2}')"
|
||||
[ -n "${MOUNTPOINT}" ] \
|
||||
&& /bin/umount -l ${MOUNTPOINT} 2>/dev/null 1>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# add
|
||||
if [ "${ACTION}" == "add" ]; then
|
||||
case ${MDEV} in
|
||||
mmcblk[0-9])
|
||||
[ -d "/sys/block/${MDEV}/${MDEV}p1" ] && exit 0
|
||||
MOUNTPOINT=/mnt/SDCARD
|
||||
;;
|
||||
mmcblk[0-9]p[0-9])
|
||||
MOUNTPOINT=/mnt/SDCARD
|
||||
;;
|
||||
sd[a-z])
|
||||
[ -d "/sys/block/${MDEV}/${MDEV}1" ] && exit 0
|
||||
MOUNTPOINT=/mnt/exUDISK
|
||||
;;
|
||||
sd[a-z][0-9])
|
||||
MOUNTPOINT=/mnt/exUDISK
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
for fstype in vfat ext4
|
||||
do
|
||||
[ "${fstype}" = "ext4" -a -x "/usr/sbin/e2fsck" ] \
|
||||
&& e2fsck -p /dev/${MDEV} >/dev/null
|
||||
/bin/mount -t ${fstype} -o utf8 /dev/${MDEV} ${MOUNTPOINT} && exit 0
|
||||
done
|
||||
[ ! -b "/dev/${MDEV}" -a -f "/sys/block/${MDEV%p*}/${MDEV}/uevent" ] \
|
||||
&& echo add > /sys/block/${MDEV%p*}/${MDEV}/uevent
|
||||
fi
|
||||
exit 0
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# pcba test
|
||||
#
|
||||
|
||||
echo "start PCBA Test\n"
|
||||
|
||||
echo "============ pcba test ================"
|
||||
|
||||
export SCREEN_INFO='1280x800-32bpp'
|
||||
export TSLIB_TSEVENTTYPE=H3600
|
||||
export TSLIB_CONSOLEDEVICE=none
|
||||
export TSLIB_FBDEVICE=/dev/fb0
|
||||
export TSLIB_TSDEVICE=/dev/input/event2
|
||||
export TSLIB_CALIBFILE=/etc/pointercal
|
||||
export TSLIB_CONFFILE=/etc/ts.conf
|
||||
export TSLIB_PLUGINDIR=/usr/lib/ts
|
||||
|
||||
|
||||
/usr/bin/sample_ao -path /usr/bin/sample_ao_startup.conf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#/usr/bin/sample_ai -path /usr/bin/sample_ai_v851s_sc1721v.conf
|
||||
|
||||
#/usr/bin/sample_ao -path /usr/bin/sample_ao_v851s_sc1721v.conf
|
||||
|
||||
|
||||
ifconfig wlan0 up
|
||||
ifconfig wlan0 192.168.51.1
|
||||
udhcpd /etc/udhcpd.conf &
|
||||
|
||||
wifi -o ap
|
||||
|
||||
/usr/bin/sample_rtsp -path /usr/bin/sample_rtsp_v851s_sc1721v.conf &
|
||||
|
||||
ts_test &
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
MODULES_DIR="/lib/modules/`uname -r`"
|
||||
|
||||
insmod $MODULES_DIR/configfs.ko
|
||||
#insmod $MODULES_DIR/usb-common.ko
|
||||
#insmod $MODULES_DIR/usbcore.ko
|
||||
insmod $MODULES_DIR/sunxi_hci.ko
|
||||
insmod $MODULES_DIR/ehci-hcd.ko
|
||||
insmod $MODULES_DIR/ohci-hcd.ko
|
||||
insmod $MODULES_DIR/udc-core.ko
|
||||
insmod $MODULES_DIR/libcomposite.ko
|
||||
insmod $MODULES_DIR/sunxi_usb_udc.ko
|
||||
insmod $MODULES_DIR/usb_f_fs.ko
|
||||
insmod $MODULES_DIR/usb_f_mass_storage.ko
|
||||
insmod $MODULES_DIR/usb_f_hid.ko
|
||||
insmod $MODULES_DIR/sunxi_usbc.ko
|
||||
|
||||
if [ -f /lib/modules/4.9.191/videobuf2-vmalloc.ko ];then
|
||||
insmod $MODULES_DIR/videobuf2-vmalloc.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/usb_f_uvc.ko ];then
|
||||
insmod $MODULES_DIR/usb_f_uvc.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/u_audio.ko ];then
|
||||
insmod $MODULES_DIR/u_audio.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/usb_f_uac1.ko ];then
|
||||
insmod $MODULES_DIR/usb_f_uac1.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/uvcvideo.ko ];then
|
||||
insmod $MODULES_DIR/uvcvideo.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/snd-hwdep.ko ];then
|
||||
insmod $MODULES_DIR/snd-hwdep.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/snd-rawmidi.ko ];then
|
||||
insmod $MODULES_DIR/snd-rawmidi.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/snd-usbmidi-lib.ko ];then
|
||||
insmod $MODULES_DIR/snd-usbmidi-lib.ko
|
||||
fi
|
||||
if [ -f /lib/modules/4.9.191/snd-usb-audio.ko ];then
|
||||
insmod $MODULES_DIR/snd-usb-audio.ko
|
||||
fi
|
||||
|
||||
cat /sys/devices/platform/soc/usbc0/usb_device
|
||||
setusbconfig adb
|
||||
adbd > /dev/null &
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
MODULES_DIR="/lib/modules/`uname -r`"
|
||||
|
||||
insmod $MODULES_DIR/configfs.ko
|
||||
#insmod $MODULES_DIR/usb-common.ko
|
||||
#insmod $MODULES_DIR/usbcore.ko
|
||||
insmod $MODULES_DIR/sunxi_hci.ko
|
||||
insmod $MODULES_DIR/ehci-hcd.ko
|
||||
insmod $MODULES_DIR/ohci-hcd.ko
|
||||
insmod $MODULES_DIR/udc-core.ko
|
||||
insmod $MODULES_DIR/libcomposite.ko
|
||||
insmod $MODULES_DIR/sunxi_usb_udc.ko
|
||||
insmod $MODULES_DIR/usb_f_fs.ko
|
||||
insmod $MODULES_DIR/usb_f_mass_storage.ko
|
||||
insmod $MODULES_DIR/usb_f_hid.ko
|
||||
insmod $MODULES_DIR/sunxi_usbc.ko
|
||||
|
||||
insmod $MODULES_DIR/scsi_mod.ko
|
||||
insmod $MODULES_DIR/sd_mod.ko
|
||||
insmod $MODULES_DIR/usb-storage.ko
|
||||
insmod $MODULES_DIR/uas.ko
|
||||
insmod $MODULES_DIR/ums-realtek.ko
|
||||
insmod $MODULES_DIR/ums-datafab.ko
|
||||
insmod $MODULES_DIR/ums-freecom.ko
|
||||
insmod $MODULES_DIR/ums-isd200.ko
|
||||
insmod $MODULES_DIR/ums-usbat.ko
|
||||
insmod $MODULES_DIR/ums-sddr09.ko
|
||||
insmod $MODULES_DIR/ums-sddr55.ko
|
||||
insmod $MODULES_DIR/ums-jumpshot.ko
|
||||
insmod $MODULES_DIR/ums-alauda.ko
|
||||
insmod $MODULES_DIR/ums-karma.ko
|
||||
insmod $MODULES_DIR/ums-cypress.ko
|
||||
insmod $MODULES_DIR/ums-eneub6250.ko
|
||||
|
||||
cat /sys/devices/platform/soc/usbc0/usb_host
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
########### paramter (ref to tulip_cedarx.conf)############
|
||||
[parameter]
|
||||
pcm_file_path = "/mnt/SDCARD/sample_ai_pcm.wav"
|
||||
pcm_sample_rate = 44100
|
||||
mic_num = 1 #1 or 2
|
||||
pcm_channel_cnt = 2
|
||||
pcm_bit_width = 16
|
||||
pcm_frame_size = 1024
|
||||
pcm_cap_duration = 30
|
||||
pcm_ai_gain = 100
|
||||
ans_en = 0
|
||||
ans_mode = 3
|
||||
agc_en = 0
|
||||
agc_target_db = 0
|
||||
agc_max_gain_db = 30
|
||||
@@ -0,0 +1,10 @@
|
||||
########### paramter (ref to tulip_cedarx.conf)############
|
||||
[parameter]
|
||||
pcm_file_path = "/usr/share/startup.wav"
|
||||
pcm_sample_rate = 44100
|
||||
pcm_channel_cnt = 2
|
||||
pcm_bit_width = 16
|
||||
pcm_frame_size = 1024
|
||||
ao_volume = 60
|
||||
log_level = 0
|
||||
ao_softvolume = 0 #[0,100]
|
||||
@@ -0,0 +1,10 @@
|
||||
########### paramter (ref to tulip_cedarx.conf)############
|
||||
[parameter]
|
||||
pcm_file_path = "/mnt/SDCARD/sample_ai_pcm.wav"
|
||||
pcm_sample_rate = 44100
|
||||
pcm_channel_cnt = 2
|
||||
pcm_bit_width = 16
|
||||
pcm_frame_size = 1024
|
||||
ao_volume = 100
|
||||
log_level = 0
|
||||
ao_softvolume = 0 #[0,100]
|
||||
@@ -0,0 +1,73 @@
|
||||
########### paramter (ref to tulip_cedarx.conf)############
|
||||
[parameter]
|
||||
|
||||
main_isp = 0
|
||||
main_vipp = 4
|
||||
main_src_width = 1280
|
||||
main_src_height = 720
|
||||
main_pixel_format = "aw_lbc_2_0x" #nv21,nv12,yu12,yv12;aw_lbc_2_5x,aw_lbc_2_0x,aw_lbc_1_5x,aw_lbc_1_0x
|
||||
main_wdr_enable = 0
|
||||
main_vi_buf_num = 3
|
||||
main_src_frame_rate = 20 #fps
|
||||
main_viChn = 0 #-1:disale main stream
|
||||
main_venc_chn = 0 #-1:disale main stream
|
||||
main_encode_type = "H.265"
|
||||
main_encode_width = 1280 #1280x720->720p, 1920x1080->1080p, 2304x1296->3M, 2560×1440->2k, 3840x2160->4k, 7680x4320->8k
|
||||
main_encode_height = 720
|
||||
main_encode_frame_rate = 20 #fps
|
||||
main_encode_bitrate = 1572864 #5M:5242880, 2M:2097152, 1.5M:1572864, 1M:1048576
|
||||
main_file_path = #"/mnt/extsd/mainStream.raw" #if no path is specified, it will not be saved.
|
||||
main_online_en = 0
|
||||
main_online_share_buf_num = 2
|
||||
main_encpp_enable = 1
|
||||
|
||||
sub_isp = 0
|
||||
sub_vipp = 4
|
||||
sub_src_width = 640
|
||||
sub_src_height = 360
|
||||
sub_pixel_format = "aw_lbc_2_0x" #nv21,nv12,yu12,yv12;aw_lbc_2_5x,aw_lbc_2_0x,aw_lbc_1_5x,aw_lbc_1_0x
|
||||
sub_wdr_enable = 0
|
||||
sub_vi_buf_num = 3
|
||||
sub_src_frame_rate = 20 #fps
|
||||
|
||||
sub_vipp_crop_en = 1
|
||||
sub_vipp_crop_rect_x = 0
|
||||
sub_vipp_crop_rect_y = 0
|
||||
sub_vipp_crop_rect_w = 1888
|
||||
sub_vipp_crop_rect_h = 1072
|
||||
|
||||
sub_viChn = -1 #-1:disale sub stream
|
||||
sub_venc_chn = -1 #-1:disale sub stream
|
||||
sub_encode_type = "H.264"
|
||||
sub_encode_width = 640 #1280x720->720p, 1920x1080->1080p, 2560×1440->2k, 3840x2160->4k, 7680x4320->8k
|
||||
sub_encode_height = 360
|
||||
sub_encode_frame_rate = 20 #fps
|
||||
sub_encode_bitrate = 256000 #5M:5242880, 2M:2097152, 1M:1048576, 0.5M:512000
|
||||
sub_file_path = #"/mnt/extsd/subStream.raw" #if no path is specified, it will not be saved.
|
||||
sub_encpp_enable = 1
|
||||
|
||||
sub_lapse_viChn = -1 #-1:disale sub lapse stream
|
||||
sub_lapse_venc_chn = -1 #-1:disale sub lapse stream
|
||||
sub_lapse_encode_type = "H.264"
|
||||
sub_lapse_encode_width = 640 #1280x720->720p, 1920x1080->1080p, 2560×1440->2k, 3840x2160->4k, 7680x4320->8k
|
||||
sub_lapse_encode_height = 360
|
||||
sub_lapse_encode_frame_rate = 20 #fps
|
||||
sub_lapse_encode_bitrate = 256000 #5M:5242880, 2M:2097152, 1M:1048576, 0.5M:512000
|
||||
sub_lapse_file_path = #"/mnt/extsd/subLapseStream.raw" #if no path is specified, it will not be saved.
|
||||
sub_lapse_time = 1000000 #unit:us
|
||||
sub_lapse_encpp_enable = 1
|
||||
|
||||
isp_ve_linkage_enable = 1
|
||||
isp_ve_linkage_stream_channel = 0 #0:main stream, 1:sub stream, 2:sub lapse stream
|
||||
|
||||
wb_yuv_enable = 0
|
||||
wb_yuv_buf_num = 20
|
||||
wb_yuv_start_index = 0
|
||||
wb_yuv_total_cnt = 100
|
||||
wb_yuv_stream_channel = 0 #0:main stream, 1:sub stream, 2:sub lapse stream
|
||||
wb_yuv_file_path = "/mnt/extsd/wb_yuv.yuv"
|
||||
|
||||
rtsp_net_type = 3 #RTSP Network type, 0: "lo", 1: "eth0", 2: "br0", 3: "wlan0"
|
||||
|
||||
test_duration = 0 #unit:s, 0:Infinite duration.
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
########### paramter (ref to tulip_cedarx.conf)############
|
||||
[parameter]
|
||||
capture_width = 1920
|
||||
capture_height = 1080
|
||||
display_x = 0
|
||||
display_y = 0
|
||||
display_width = 1280
|
||||
display_height = 800
|
||||
layer_num = 0
|
||||
isp_dev = 0
|
||||
vipp_dev = 0
|
||||
|
||||
capture_width2 = 0
|
||||
capture_height2 = 640
|
||||
display_x2 = 0
|
||||
display_y2 = 0
|
||||
display_width2 = 0
|
||||
display_height2 = 640
|
||||
layer_num2 = 4
|
||||
isp_dev2 = 0
|
||||
vipp_dev2 = 4
|
||||
|
||||
capture_width3 = 0
|
||||
capture_height3 = 360
|
||||
display_x3 = 240
|
||||
display_y3 = 320
|
||||
display_width3 = 0
|
||||
display_height3 = 320
|
||||
layer_num3 = 5
|
||||
isp_dev3 = 0
|
||||
vipp_dev3 = 0
|
||||
|
||||
add_ui_layer = 0
|
||||
ui_test_layer = 9
|
||||
ui_display_width = 480
|
||||
ui_display_height = 640
|
||||
|
||||
# disp_type is lcd, hdmi, cvbs
|
||||
disp_type = "lcd"
|
||||
|
||||
# pic_format is yu12, yv12, nv21, nv12, nv21s
|
||||
pic_format = nv21
|
||||
frame_rate = 20
|
||||
test_duration = 0 #unit:s
|
||||
@@ -0,0 +1,344 @@
|
||||
#!/bin/sh
|
||||
|
||||
name=`basename $0`
|
||||
|
||||
usage() {
|
||||
echo "$name Usage:"
|
||||
echo ""
|
||||
echo "$name [function]"
|
||||
echo "function: mtp, support MTP function"
|
||||
echo " adb, support adb function"
|
||||
echo " uvc, support uvc function"
|
||||
echo " uvc,uac1 support uvc and uac1 function"
|
||||
echo "example:"
|
||||
echo "$name uvc"
|
||||
echo ""
|
||||
}
|
||||
|
||||
enable_adb() {
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/ffs.adb ] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/ffs.adb
|
||||
}
|
||||
echo "Tina ADB" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/ffs.adb/ /sys/kernel/config/usb_gadget/g1/configs/c.1/ffs.adb
|
||||
|
||||
[ -d /dev/usb-ffs/adb ] || {
|
||||
mkdir -p /dev/usb-ffs
|
||||
mkdir /dev/usb-ffs/adb
|
||||
mount -o uid=2000,gid=2000 -t functionfs adb /dev/usb-ffs/adb/
|
||||
}
|
||||
}
|
||||
|
||||
enable_mtp() {
|
||||
mtp_name=mtp.gs0
|
||||
mtp_ffs=false
|
||||
kv=`uname -r`
|
||||
kv=${kv:0:1}
|
||||
if [ "x$kv" = "x5" ]; then
|
||||
mtp_ffs=true
|
||||
mtp_name=ffs.mtp
|
||||
fi
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/$mtp_name ] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/$mtp_name
|
||||
}
|
||||
if [ "x$mtp_ffs" = "xtrue" ]; then
|
||||
[ -d /dev/usb-ffs/mtp ] || {
|
||||
mkdir -p /dev/usb-ffs
|
||||
mkdir /dev/usb-ffs/mtp
|
||||
mount -o rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 -t functionfs mtp /dev/usb-ffs/mtp/
|
||||
}
|
||||
fi
|
||||
echo "Tina MTP" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
echo 1 > /sys/kernel/config/usb_gadget/g1/os_desc/use
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/$mtp_name/ /sys/kernel/config/usb_gadget/g1/configs/c.1/$mtp_name
|
||||
if [ "x$mtp_ffs" = "xtrue" ]; then
|
||||
MtpTools -f connect
|
||||
sleep .500
|
||||
fi
|
||||
}
|
||||
|
||||
uvc_create_frame()
|
||||
{
|
||||
format=$1
|
||||
name=$2
|
||||
width=$3
|
||||
height=$4
|
||||
frameindex=$5
|
||||
|
||||
dir=streaming/$format/$name/${height}p
|
||||
mkdir -p $dir
|
||||
echo $width > $dir/wWidth
|
||||
echo $height > $dir/wHeight
|
||||
echo $(($width * $height * 2 )) > $dir/dwMaxVideoFrameBufferSize
|
||||
#20,30fps
|
||||
#cat <<EOF > $dir/dwFrameInterval
|
||||
#500000
|
||||
#333333
|
||||
#EOF
|
||||
|
||||
#30fps
|
||||
echo 333333 > $dir/dwFrameInterval
|
||||
echo 333333 > $dir/dwDefaultFrameInterval
|
||||
echo $(($width * $height * 2 * 30 * 8)) > $dir/dwMinBitRate
|
||||
echo $(($width * $height * 2 * 30 * 8)) > $dir/dwMaxBitRate
|
||||
echo $frameindex > $dir/bFrameIndex
|
||||
}
|
||||
|
||||
enable_uvc()
|
||||
{
|
||||
cd /sys/kernel/config/usb_gadget/g1/functions
|
||||
mkdir uvc.usb0
|
||||
cd uvc.usb0
|
||||
|
||||
uvc_create_frame mjpeg m 1920 1080 1
|
||||
uvc_create_frame mjpeg m 1280 720 2
|
||||
uvc_create_frame mjpeg m 640 480 3
|
||||
uvc_create_frame uncompressed u 320 240 1
|
||||
uvc_create_frame h264 h 1920 1080 1
|
||||
uvc_create_frame h264 h 1280 720 2
|
||||
|
||||
mkdir -p streaming/header/h
|
||||
|
||||
ln -s streaming/mjpeg/m/ streaming/header/h/
|
||||
ln -s streaming/uncompressed/u/ streaming/header/h/
|
||||
ln -s streaming/h264/h/ streaming/header/h/
|
||||
|
||||
ln -s streaming/header/h/ streaming/class/fs
|
||||
ln -s streaming/header/h/ streaming/class/hs
|
||||
|
||||
mkdir -p control/header/h
|
||||
|
||||
ln -s control/header/h/ control/class/fs/
|
||||
ln -s control/header/h/ control/class/ss/
|
||||
|
||||
#echo 3072 > streaming_maxpacket
|
||||
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/
|
||||
}
|
||||
|
||||
udc_controller=`ls /sys/class/udc`
|
||||
|
||||
set_usb_function() {
|
||||
# 1:function
|
||||
# 2:idVendor
|
||||
# 3:idProduct
|
||||
#
|
||||
|
||||
[ -d /sys/kernel/config/usb_gadget ] || {
|
||||
mount -t configfs none /sys/kernel/config
|
||||
mkdir /sys/kernel/config/usb_gadget/g1
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/strings/0x409
|
||||
echo "Allwinner Technology Inc." > /sys/kernel/config/usb_gadget/g1/strings/0x409/manufacturer
|
||||
echo "Tina" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
}
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/configs/c.1 ] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1
|
||||
echo 0xc0 > /sys/kernel/config/usb_gadget/g1/configs/c.1/bmAttributes
|
||||
echo 500 > /sys/kernel/config/usb_gadget/g1/configs/c.1/MaxPower
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409
|
||||
}
|
||||
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/ffs.adb
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/ffs.mtp
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/mtp.gs0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/f1
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/rndis.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/uac1.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/accessory.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/hid.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/hid.usb1
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/loopback.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/gser.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/printer.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/uvc.usb0
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/mass_storage.usb0
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/fs
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/hs
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/fs/
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/ss/
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/
|
||||
rm -rf /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/uncompressed/
|
||||
|
||||
echo $2 > /sys/kernel/config/usb_gadget/g1/idVendor
|
||||
echo $3 > /sys/kernel/config/usb_gadget/g1/idProduct
|
||||
|
||||
if [ $1 == "none" ]; then
|
||||
return
|
||||
elif [ $1 == "mtp" ]; then
|
||||
enable_mtp
|
||||
elif [ $1 == "adb" ]; then
|
||||
enable_adb
|
||||
elif [ $1 == "mass_storage" ]; then
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/mass_storage.usb0 ] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/mass_storage.usb0
|
||||
echo Tina > /sys/kernel/config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/inquiry_string
|
||||
}
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/mass_storage.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/f1
|
||||
|
||||
#echo "/dev/by-name/UDISK" > /sys/kernel/config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/file
|
||||
elif [ $1 == "uac1" ]; then
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0 ] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0
|
||||
echo 0x1 > /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/p_chmask
|
||||
echo 0 > /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/c_chmask
|
||||
echo 16000 > /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/p_srate
|
||||
}
|
||||
echo "Tina UAC1" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/uac1.usb0
|
||||
elif [ $1 == "uvc" ]; then
|
||||
[ $4 == "bulk" ] && {
|
||||
echo Y > /sys/module/usb_f_uvc/parameters/bulk_streaming_ep
|
||||
}
|
||||
echo 0xef > /sys/kernel/config/usb_gadget/g1/bDeviceClass
|
||||
echo 0x02 > /sys/kernel/config/usb_gadget/g1/bDeviceSubClass
|
||||
echo 0x01 > /sys/kernel/config/usb_gadget/g1/bDeviceProtocol
|
||||
echo "Tina UVC" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
|
||||
#echo 0x150 > /sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/header/h/bcdUVC
|
||||
|
||||
enable_uvc
|
||||
elif [ $1 == "uvc,uac1" ]; then
|
||||
echo Y > /sys/module/usb_f_uvc/parameters/bulk_streaming_ep
|
||||
echo 0xef > /sys/kernel/config/usb_gadget/g1/bDeviceClass
|
||||
echo 0x02 > /sys/kernel/config/usb_gadget/g1/bDeviceSubClass
|
||||
echo 0x01 > /sys/kernel/config/usb_gadget/g1/bDeviceProtocol
|
||||
echo "Tina UVC" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
|
||||
enable_uvc
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0 ] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0
|
||||
# enable PC capture only ISOC(IN)
|
||||
echo 0x1 > /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/p_chmask
|
||||
echo 0 > /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/c_chmask
|
||||
echo 16000 > /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/p_srate
|
||||
}
|
||||
echo "Tina UVC UAC1" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/uac1.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/uac1.usb0
|
||||
elif [ $1 == "rndis" ]; then
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/rndis.usb0
|
||||
echo "Tina RNDIS" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/rndis.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/rndis.usb0
|
||||
elif [ $1 == "adb,rndis" ]; then
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/rndis.usb0] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/rndis.usb0
|
||||
}
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/rndis.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/rndis.usb0
|
||||
enable_adb
|
||||
echo 0xef > /sys/kernel/config/usb_gadget/g1/bDeviceClass
|
||||
echo 0x02 > /sys/kernel/config/usb_gadget/g1/bDeviceSubClass
|
||||
echo 0x01 > /sys/kernel/config/usb_gadget/g1/bDeviceProtocol
|
||||
echo "Tina ADB,RNDIS" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
elif [ $1 == "hid" ]; then
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/hid.usb0 ] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/hid.usb0
|
||||
}
|
||||
echo 1 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/protocol
|
||||
echo 8 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/report_desc
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/hid.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/hid.usb0
|
||||
echo "Tina HID" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
elif [ $1 == "ecm" ]; then
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/ecm.usb0
|
||||
echo "Tina ECM" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/ecm.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/ecm.usb0
|
||||
elif [ $1 == "adb,ecm" ]; then
|
||||
[ -d /sys/kernel/config/usb_gadget/g1/functions/ecm.usb0] || {
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/ecm.usb0
|
||||
}
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/ecm.usb0/ /sys/kernel/config/usb_gadget/g1/configs/c.1/ecm.usb0
|
||||
enable_adb
|
||||
echo 0xef > /sys/kernel/config/usb_gadget/g1/bDeviceClass
|
||||
echo 0x02 > /sys/kernel/config/usb_gadget/g1/bDeviceSubClass
|
||||
echo 0x01 > /sys/kernel/config/usb_gadget/g1/bDeviceProtocol
|
||||
echo "Tina ADB,ECM" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
fi
|
||||
|
||||
echo $udc_controller > /sys/kernel/config/usb_gadget/g1/UDC
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Lack of arg!"
|
||||
usage
|
||||
exit
|
||||
fi
|
||||
|
||||
# idVendor, idProduct only for test
|
||||
if [ $1 == "none" ]; then
|
||||
set_usb_function none 0x1f3a 0x1001
|
||||
return
|
||||
fi
|
||||
if [ $1 == "adb" ]; then
|
||||
set_usb_function adb 0x18d1 0xD002
|
||||
return
|
||||
fi
|
||||
if [ $1 == "mtp" ]; then
|
||||
set_usb_function mtp 0x045E 0x00C9
|
||||
return
|
||||
fi
|
||||
if [ $1 == "uac1" ]; then
|
||||
if [ $# == 3 ]; then
|
||||
set_usb_function uac1 $2 $3
|
||||
else
|
||||
set_usb_function uac1 0x1d61 0x0101
|
||||
fi
|
||||
return
|
||||
fi
|
||||
if [ $1 == "mass_storage" ]; then
|
||||
set_usb_function mass_storage 0x1f3a 0x1000
|
||||
return
|
||||
fi
|
||||
if [ $1 == "uvc" ]; then
|
||||
if [ $2 == "bulk" ]; then
|
||||
set_usb_function uvc 0x09a1 0x0026 bulk
|
||||
else
|
||||
set_usb_function uvc 0x09a1 0x0026
|
||||
fi
|
||||
return
|
||||
fi
|
||||
if [ $1 == "uac1,uvc" -o $1 == "uvc,uac1" ]; then
|
||||
#set_usb_function uvc,uac1 0x1943 0x2263
|
||||
#set_usb_function uvc,uac1 0x09a1 0x0026
|
||||
if [ $# == 3 ]; then
|
||||
set_usb_function uvc,uac1 $2 $3
|
||||
else
|
||||
set_usb_function uvc,uac1 0x09a1 0x002A
|
||||
fi
|
||||
return
|
||||
fi
|
||||
if [ $1 == "rndis" ]; then
|
||||
if [ $# == 3 ]; then
|
||||
set_usb_function rndis $2 $3
|
||||
else
|
||||
set_usb_function rndis 0x0525 0xa4a2
|
||||
fi
|
||||
fi
|
||||
if [ $1 == "adb,rndis" ]; then
|
||||
if [ $# == 3 ]; then
|
||||
set_usb_function adb,rndis $2 $3
|
||||
else
|
||||
set_usb_function adb,rndis 0x0525 0xa4a2
|
||||
fi
|
||||
fi
|
||||
if [ $1 == "hid" ]; then
|
||||
if [ $# == 3 ]; then
|
||||
set_usb_function hid $2 $3
|
||||
else
|
||||
set_usb_function hid 0x0525 0xa4ac
|
||||
fi
|
||||
fi
|
||||
if [ $1 == "ecm" ]; then
|
||||
if [ $# == 3 ]; then
|
||||
set_usb_function ecm $2 $3
|
||||
else
|
||||
set_usb_function ecm 0x0525 0xa4a2
|
||||
fi
|
||||
fi
|
||||
if [ $1 == "adb,ecm" ]; then
|
||||
if [ $# == 3 ]; then
|
||||
set_usb_function adb,ecm $2 $3
|
||||
else
|
||||
set_usb_function adb,ecm 0x18d1 0xD002
|
||||
fi
|
||||
fi
|
||||
Binary file not shown.
@@ -4,7 +4,6 @@
|
||||
#
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_HAVE_DOT_CONFIG=y
|
||||
# CONFIG_TARGET_v837s_fastboot is not set
|
||||
CONFIG_TARGET_v851s_fastboot_sl100_back=y
|
||||
# CONFIG_TARGET_v851s3_fastboot_sl100_front is not set
|
||||
CONFIG_TARGET_v851s_fastboot_sl100_back_=y
|
||||
@@ -83,7 +82,6 @@ CONFIG_SUNXI_SD_BOOT_KERNEL_FORMAT_BOOTIMG=y
|
||||
# CONFIG_SUNXI_MKBOOTIMG_ADD_DTB is not set
|
||||
CONFIG_SUNXI_SMALL_STORAGE_OTA=y
|
||||
CONFIG_SUNXI_MOVE_KO_TO_USR=y
|
||||
CONFIG_SUNXI_MOVE_UDEV_TO_USR=y
|
||||
# CONFIG_SUNXI_RECOVERY_INITRAMFS_PART is not set
|
||||
# CONFIG_SUNXI_RECOVERY_INITRAMFS_KERNEL_FORMAT_UIMAGE is not set
|
||||
CONFIG_SUNXI_RECOVERY_INITRAMFS_KERNEL_FORMAT_BOOTIMG=y
|
||||
@@ -96,7 +94,10 @@ CONFIG_SUNXI_BOOT_IMAGE_NAME_SUFFIX_RECOVERY=y
|
||||
# CONFIG_SUNXI_ROOTFS_IMAGE_NAME_SUFFIX_NONE is not set
|
||||
CONFIG_SUNXI_ROOTFS_IMAGE_NAME_SUFFIX_RECOVERY=y
|
||||
# CONFIG_SUNXI_ROOTFS_IMAGE_NAME_SUFFIX_RAMFS is not set
|
||||
# CONFIG_CUSTOMIZE_CONFIG_FILE is not set
|
||||
CONFIG_CUSTOMIZE_CONFIG_FILE=y
|
||||
# CONFIG_KERNEL_CONFIG_FILE_SUFFIX_NONE is not set
|
||||
CONFIG_KERNEL_CONFIG_FILE_SUFFIX_RECOVERY=y
|
||||
# CONFIG_KERNEL_CONFIG_FILE_SUFFIX_RAMFS is not set
|
||||
# CONFIG_SUPPORT_PACK_OUT_OF_TINA is not set
|
||||
CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE=y
|
||||
CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE=y
|
||||
@@ -1479,7 +1480,7 @@ CONFIG_BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FACTOR is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FALSE is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FOLD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FSYNC is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FSYNC=y
|
||||
# CONFIG_BUSYBOX_CONFIG_HEAD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_HOSTID is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_ID is not set
|
||||
@@ -1752,7 +1753,7 @@ CONFIG_BUSYBOX_CONFIG_FLOCK=y
|
||||
CONFIG_BUSYBOX_CONFIG_HEXDUMP=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_HD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_XXD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_XXD=y
|
||||
CONFIG_BUSYBOX_CONFIG_HWCLOCK=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
|
||||
@@ -1762,7 +1763,12 @@ CONFIG_BUSYBOX_CONFIG_HWCLOCK=y
|
||||
CONFIG_BUSYBOX_CONFIG_LOSETUP=y
|
||||
# CONFIG_BUSYBOX_CONFIG_LSPCI is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_LSUSB is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MDEV is not set
|
||||
CONFIG_BUSYBOX_CONFIG_MDEV=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MDEV_CONF=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MDEV_RENAME=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MDEV_EXEC=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MESG is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MKE2FS is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MKFS_EXT2 is not set
|
||||
@@ -2080,7 +2086,7 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_KMSG_SYSLOG=y
|
||||
# CONFIG_BUSYBOX_SYSLOG_STAMP_KERNEL_FORMAT is not set
|
||||
CONFIG_PACKAGE_busybox-init-base-files=y
|
||||
CONFIG_BUSYBOX_INIT_BASE_FILES_OPTIONS=y
|
||||
CONFIG_BUSYBOX_INIT_BASE_FILES_PATH="busybox-init-base-files"
|
||||
CONFIG_BUSYBOX_INIT_BASE_FILES_PATH="busybox-init-base-ota-files"
|
||||
# CONFIG_BUSYBOX_INIT_BASE_FILES_RC_LOG is not set
|
||||
# CONFIG_BUSYBOX_INIT_BASE_FILES_RC_LOAD_SCRIPT is not set
|
||||
# CONFIG_BUSYBOX_INIT_BASE_FILES_RC_MODULES is not set
|
||||
@@ -2144,28 +2150,7 @@ CONFIG_LIBSTDCPP_FILE_SPEC="./lib/libstdc++.so.*"
|
||||
# CONFIG_PACKAGE_ubus is not set
|
||||
# CONFIG_PACKAGE_ubusd is not set
|
||||
# CONFIG_PACKAGE_uci is not set
|
||||
CONFIG_PACKAGE_udev=y
|
||||
|
||||
#
|
||||
# Configuration
|
||||
#
|
||||
# CONFIG_UDEV_DISABLE_LOGGING is not set
|
||||
# CONFIG_UDEV_ENABLE_DEBUG is not set
|
||||
CONFIG_UDEV_EXTRA_accelerometer=y
|
||||
CONFIG_UDEV_EXTRA_ata_id=y
|
||||
CONFIG_UDEV_EXTRA_cdrom_id=y
|
||||
# CONFIG_UDEV_EXTRA_collect is not set
|
||||
# CONFIG_UDEV_EXTRA_edd_id is not set
|
||||
# CONFIG_UDEV_EXTRA_firmware is not set
|
||||
# CONFIG_UDEV_EXTRA_floppy is not set
|
||||
CONFIG_UDEV_EXTRA_input_id=y
|
||||
CONFIG_UDEV_EXTRA_mtd_probe=y
|
||||
CONFIG_UDEV_EXTRA_path_id=y
|
||||
CONFIG_UDEV_EXTRA_qemu=y
|
||||
CONFIG_UDEV_EXTRA_rule_generator=y
|
||||
CONFIG_UDEV_EXTRA_scsi_id=y
|
||||
CONFIG_UDEV_EXTRA_usb_id=y
|
||||
CONFIG_UDEV_EXTRA_v4l_id=y
|
||||
# CONFIG_PACKAGE_udev is not set
|
||||
# CONFIG_PACKAGE_usign is not set
|
||||
# CONFIG_PACKAGE_wireless-tools is not set
|
||||
|
||||
|
||||
Reference in New Issue
Block a user