⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install_elphel

📁 基于FPGA的IP camera的开源系统
💻
字号:
#!/bin/sh## install_elphel -- install, customize and build elphel camera software #       This is an interactive "wizard" that asks questions as it goes.## Overview of installation process:#       The file elphel_$REVNUM.tar.gz is made available to you.#       You cd to a suitable directory.#       I reccomend putting both the elphel_$REVNUM.tar.gz file in this#       directory as well as the needed linux and axis files.#       Unpack using:#               gtar xzvf elphel_$REVNUM.tar.gz#       which will create a directory elphel_$REVNUM.#       You cd into that directory, where you will find this script along#       with a README file and a file named elphelcamera.tar .#       Run this script:  ./install_elphel#       You will be prompted for the camera model (313 or 323).#       You will be prompted for the locations of axis and linux sources#       (unless they can be found in "..")#       along with information of where to get them;#       use a separate window (or...) to get them and then enter where#       you put them.#       You will be asked where you want to put the output;#       the default is to put in ./elphel$MODEL which is usually adequate.#       You will be asked if you want to build the software now or later;#       if now, it will be built for you.#       The README, install_elphel and elphelcamera.tar files will remain#       and can be used, for example, to do a separate installation for #       another camera model.#       (Only one camera model can be supported per installed directory).## Credits:# This script is based upon "install" included with devboard_82 software by #       Axis Communications ABMODEL="$1"      # optional, can be passed in...?LINUXFILE="linux-2.4.22.tar.gz"LINUXFILEROOT="linux-2.4.22"AXISFILE="devboard_82-R1_91.tar.gz"LINUXURL="http://developer.axis.com/download/linux/linux-2.4.22.tar.gz"AXISURL="http://developer.axis.com/download/devboard_82/R1_91/devboard_82-R1_91.tar.gz"LINUXFILEDIRDFLT=".."AXISFILEDIRDFLT=".."ELPHELFILE="elphelcamera.tar"AXISACTUAL0="axis"AXISACTUAL="$AXISACTUAL0/devboard_82"STARTDIR=`pwd`PRODDIR=$PRODDIRDFLTLINUXFILEDIR=$LINUXFILEDIRDFLTAXISFILEDIR=$AXISFILEDIRDFLT# It is important that any relative paths from user appear AFTER#   all standard places where we might find things like "install"...#   otherwise, we'll use local scripts named "install" when we don't#   want to!#   Thus we form PATH as $CRISPATH:$NEWPATHPARTS:$OLDPATHCRISPATH=/usr/local/crisNEWPATHPARTS=/bin:/usr/binOLDPATH="$PATH"# If there is a ../cris directory, use it as default compiler tools#       directory instead of /usr/local/crisif [ -d ../cris ] ; then CRISPATH=../cris ; fiif [ ! -f elphelcamera.tar ]then    echo Not found: elphelcamera.tar    echo This script must be run only from the directory where you untarred    echo the elphel camera distribution software.    exit 1fiechoechoecho  echo "This script will install files needed for the development of Elphel cameras"  echo "It needs CRIS compiler to be installed, and both"  echo "$LINUXFILE and $AXISFILE be available"	if [[ $MODEL != 3[12]3 ]];  then		echo '*** Please enter the model number of the product you want to install'		echo -n '***     software for (313,323) ? '		read MODEL	fi	case "$MODEL" in		313|323)      PRODNAME="Elphel Model $MODEL Camera"      PRODDIRDFLT="./elphel$MODEL"      echo       echo "Selected product: $PRODNAME"			;;		*)			echo "*** Unknown model - $MODEL"			exit 1			;;	esac  echo  while truedo    echo "Please enter directory for cris compilation tools [$CRISPATH] :"    read newpath    case "$newpath" in        '') :        ;;        /*) CRISPATH="$newpath"         ;;        *) CRISPATH=`pwd`/"$newpath"         ;;    esac    case "$CRISPATH" in        /*) :        ;;        *) CRISPATH=`pwd`/"$CRISPATH"        ;;    esac    echo Trying $CRISPATH...    # It is important that any relative paths from user appear AFTER    #   all standard places where we might find things like "install"...    #   otherwise, we'll find local scripts named "install" when we don't    #   want to!    PATH="$CRISPATH:$NEWPATHPARTS:$OLDPATH"    export PATH    echo Using PATH = $PATH    if gcc-cris --version > /dev/null 2>&1; then break; fi    echo "*** Cannot not find gcc-cris in your PATH!"    echo "*** If you haven't got it you can download it from"    echo "    ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/"doneecho Using target compiler tools from $CRISPATHechoGCC_CRIS_RELEASE=`gcc-cris -E -v -xc /dev/null 2>&1 | grep Axis | grep CRIS \		  | sed -e 's/.* R\(.*\)\].*/\1/g'`if [ -z "$GCC_CRIS_RELEASE" ] || [ "$GCC_CRIS_RELEASE" -lt 54 ]; \   then	echo "*** Your gcc-cris is too old! Upgrade to at least cris-dist-1.54"	echo "*** You can download it from"	echo "    ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/"	exit 1fi if [ ! -f $LINUXFILEDIR/$LINUXFILE ]; then	echo "*** You need to have the source code for Linux 2.4.22 to continue."	echo "    If you haven't got it you can find it at http://www.kernel.org"	echo "    It was also mirrored at $LINUXURL"	echo -n "Enter directory of $LINUXFILE file" \		"[$LINUXFILEDIRDFLT]: "	read LINUXFILEDIR	[ -z "$LINUXFILEDIR" ] && LINUXFILEDIR=$LINUXFILEDIRDFLT	if [ ! -e "$LINUXFILEDIR" ]; then		echo "*** $LINUXFILEDIR does not exist!"		exit 1	fi	if [ ! -f $LINUXFILEDIR/$LINUXFILE ]; then		echo "*** $LINUXFILEDIR/$LINUXFILE does not exist!"		exit 1	fifiecho Using Linux distribution file $LINUXFILEDIR/$LINUXFILEechoif [ ! -f $AXISFILEDIR/$AXISFILE ]; then	echo "*** You need to have $AXISFILE to continue."	echo "    It has both patches over the $LINUXFILE and many applications"	echo "    used in $PRODNAME"	echo "    If you haven't got it you can find it the software section"	echo "    of the Axis Communications developer site at http://developer.axis.com"	echo "    Probable location - $AXISURL"	echo -n "Enter directory of $AXISFILE file" \		"[$AXISFILEDIRDFLT]: "	read AXISFILEDIR	[ -z "$AXISFILEDIR" ] && AXISFILEDIR=$AXISFILEDIRDFLT	if [ ! -e "$AXISFILEDIR" ]; then		echo "*** $AXISFILEDIR does not exist!"		exit 1	fi	if [ ! -f $AXISFILEDIR/$AXISFILE ]; then		echo "*** $AXISFILEDIR/$AXISFILE does not exist!"		exit 1	fifiecho Using Axis distribution file $AXISFILEDIR/$AXISFILEecho#create directory for the productecho -n "Enter directory for the installation of $PRODNAME" \	"[$PRODDIRDFLT]: "read PRODDIR[ -z "$PRODDIR" ] && PRODDIR=$PRODDIRDFLTif [ -e "$PRODDIR" ]; then	echo -n "*** $PRODDIR already exists. Do you whant to overwrite it [N]? "	read ANSWER	[ -z "$ANSWER" ] && ANSWER=n	case "$ANSWER" in		[yY])#			rm -dvf $PRODDIR			if ! rm -rf $PRODDIR ; then				echo "rm failed"				exit 1			fi			;;		*)			exit 1			;;	esacfiif ! mkdir $PRODDIR ; then  echo "makedir $PRODDIR failed"  exit 1fi# untar the whole tree from Axis tarball into product directory, then move everything up# two levels (get rid of axis/devboard_82 prefix)echo "---processing $AXISFILEDIR/$AXISFILE"tar xzf $AXISFILEDIR/$AXISFILE --directory=$PRODDIRmv $PRODDIR/$AXISACTUAL/* $PRODDIRrm -rf $PRODDIR/$AXISACTUAL0mv $PRODDIR/README $PRODDIR/README_AXISmv $PRODDIR/kernelconfig $PRODDIR/kernelconfig_axis#cp README $PRODDIR/README# Now install linux, but always actually, no links (as in Axis install) so kernel modifications# will not influence other installations#LINUXFILE="linux-2.4.22.tar.gz"#LINUXFILEROOT="linux-2.4.22"if ! mkdir $PRODDIR/os ; then  echo "makedir $PRODDIR/os failed"  exit 1fiecho "---processing $LINUXFILEDIR/$LINUXFILE"tar xzf $LINUXFILEDIR/$LINUXFILE --directory=$PRODDIR/osif ! mv $PRODDIR/os/$LINUXFILEROOT $PRODDIR/os/linux ; then  echo "mv $PRODDIR/os/$LINUXFILEROOT $PRODDIR/os/linux failed"  exit 1fi#Apply Axis patch (it should be in $PRODDIRecho "---entering $PRODDIR"cd $PRODDIRecho "*** Patching kernel"if [ ! -f linux-2_4_22.diff ]; then	echo "*** Cannot find patch file linux-2_4_22.diff!"	exit 1ficat linux-2_4_22.diff | patch -d os/linux -Np1case $? in	0)		echo "*** Patch complete"		;;	1)		echo "*** Conflicts during patch. Not fatal, you may proceed."		;;	*)		echo "*** Patch failed!"		exit 1		;;esac#echo "---entering $STARTDIR"#cd $STARTDIRecho "*** Copying Elphel files from $STARTDIR/$ELPHELFILE over the Axis installation"tar xvf $STARTDIR/$ELPHELFILEecho "*** Removing unwanted files"# The axis install script is unwanted and causes complications should#       your PATH variable begin with "." since it will be executed#       instead of the standard unix/linux install program.rm -f install# create build script for full buildcp build.template builded build <<END1,\$s/MODELNUM/$MODEL/g/^FULLBUILD=/s/.*/FULLBUILD=y//^PATH=/s;.*;PATH="$CRISPATH:$NEWPATHPARTS:\$PATH";wqENDchmod +x build# create rebuild script for fast rebuildcp build.template rebuilded rebuild <<END1,\$s/MODELNUM/$MODEL/g/^FULLBUILD=/s/.*/FULLBUILD=n//^PATH=/s;.*;PATH="$CRISPATH:$NEWPATHPARTS:\$PATH";wqENDchmod +x rebuildecho "*** The software can be built now or you can build it manually later."echo -n "Do you want to build the software now (default y)? "read ANSWER[ -z "$ANSWER" ] && ANSWER=ycase "$ANSWER" in	[yY])		;;	*)		echo "*** Installation complete"		echo "*** Run \"make help\" for info about how to build."                echo "*** Or just run \"./build\" and later \"./rebuild\"  . "		exit 0		;;esacecho "*** Building software"# Use build script we made to do full build./build || exit 1echo "*** Build complete"echoecho "To download the images to the camera you need:"echo "cd $PRODDIR"echo ". ./init_env"echo "set camera to download mode (pressing and holding pushbutton during powering up)"echo "./flashit"echoecho Or see beneath the flashstation subdirectoryechoecho "Have fun!"exit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -