#!/bin/sh

#
# ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking
# 说明:
# 本文主要对TI的sdk中的setup-package-install.sh脚本进行解读,是为了了解
# 其工作机制。
#
# -- 深圳 南山平山村 曾剑锋 # This distribution contains contributions or derivatives under copyright
# as follows:
#
# Copyright (c) , Texas Instruments Incorporated
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - Neither the name of Texas Instruments nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cwd=`dirname $`
. $cwd/common.sh entry_header() {
cat << EOF
-------------------------------------------------------------------------------
setup package script
This script will make sure you have the proper host support packages installed
This script requires administrator priviliges (sudo access) if packages are to be installed.
-------------------------------------------------------------------------------
EOF
} exit_footer() {
cat << EOF
--------------------------------------------------------------------------------
Package verification and installation successfully completed
--------------------------------------------------------------------------------
EOF
} cwd=`dirname $`
. $cwd/common.sh entry_header packages_to_install="xinetd tftpd nfs-kernel-server minicom build-essential libncurses5-dev autoconf automake" get_host_type host # Starting with Ubuntu 14.04 the package name for uboot-mkimage has changed
# to u-boot-tools if [ "$host" = "trusty" ]; then
packages_to_install="$packages_to_install u-boot-tools"
else
packages_to_install="$packages_to_install uboot-mkimage" fi cmd="sudo apt-get install " # 合成需要安装的工具包
# Check and only install the missing packages
for i in $packages_to_install; do
is_it_installed=`dpkg-query -l $i >/dev/null`
if [ "$?" -ne "" ]; then
needs_installation=`echo $needs_installation`" "$i
new_cmd=`echo $cmd`" "$i # 每次将需要安装的包加载当前的cmd字符串后面
cmd=$new_cmd
fi
done if [ "$needs_installation" = "" ]; then
echo "System has required packages!"
else
echo "System requires packages $needs_installation to be installed" echo "Installation requires you to have administrator priviliges (sudo access) "
echo "on your host. Do you have administrator privilieges?" # Force the user to answer. Maybe the user does not want to continue
while true;
do
read -p "Type 'y' to continue or 'n' to exit the installation: " REPLY
if [ "$REPLY" = 'y' -o "$REPLY" = 'n' ]; then
break;
fi
done if [ "$REPLY" = 'n' ]; then
echo "Installation is aborted by user"
exit
fi # 执行并安装程序
echo "Performing $cmd"
$cmd
check_status
fi
# Print the exit statement to the console
exit_footer

ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking的更多相关文章

  1. ti processor sdk linux am335x evm /bin/setup-uboot-env.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-uboot-env.sh hacking # 说明: # 本文主要对TI的sdk中 ...

  2. ti processor sdk linux am335x evm /bin/setup-minicom.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-minicom.sh hacking # 说明: # 本文主要对TI的sdk中的s ...

  3. ti processor sdk linux am335x evm /bin/setup-targetfs-nfs.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-targetfs-nfs.sh hacking # 说明: # 本文主要对TI的s ...

  4. ti processor sdk linux am335x evm /bin/commom.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm /bin/commom.sh hacking # 说明: # 本文主要对TI的sdk中的common.s ...

  5. ti processor sdk linux am335x evm /bin/setup-host-check.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-host-check.sh hacking # 说明: # 本文主要对TI的sdk ...

  6. ti processor sdk linux am335x evm /bin/create-sdcard.sh hacking

    #!/bin/bash # # ti processor sdk linux am335x evm /bin/create-sdcard.sh hacking # 说明: # 本文主要对TI的sdk中 ...

  7. ti processor sdk linux am335x evm /bin/unshallow-repositories.sh hacking

    #!/bin/bash # # ti processor sdk linux am335x evm /bin/unshallow-repositories.sh hacking # 说明: # 本文主 ...

  8. ti processor sdk linux am335x evm /bin/setup-tftp.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-tftp.sh hacking # 说明: # 本文主要对TI的sdk中的setu ...

  9. ti processor sdk linux am335x evm setup.sh hacking

    #!/bin/sh # # ti processor sdk linux am335x evm setup.sh hacking # 说明: # 本文主要对TI的sdk中的setup.sh脚本进行解读 ...

随机推荐

  1. switch..case函数的基础使用一

    基本作用:switch中的参数与case的值进行比对,相等则进入case. JDK1.7 switch支持int.Integer.String类型 package com.my.test; impor ...

  2. 使用Forms进行身份验证(Asp.net)

    1.背景      以往项目登陆后的用户信息都是存放在session中,但session有一个问题就是读取的时候需要先实例化所在类,在调用对象()如果用static修饰,则可能到时多次登陆sessio ...

  3. CF Gym100548 K Last Defence 解题报告

    先特判掉特殊情况: $a=b,Ans=2$ $ab=0,a+b>0,Ans=2$ $a=b=0,Ans=1$ 考虑剩下的非特殊情况.记$Solve(a,b)$为数列中除了$a,b$外的不同的数的 ...

  4. Asp.net 程序部署问题——在应用程序级别之外使用注册为 allowDefinition='MachineToApplicati错误信息

    [转]在应用程序级别之外使用注册为 allowDefinition='MachineToApplicati 错误信息: ======================================== ...

  5. PHP对XML文件操作类讲解

    <?phpclass XML{    private $dom;        function __construct ()    {        $this->dom = new D ...

  6. VisionTimer BUG && Start

    void Start() { vp_Timer.In(0.0f, delegate() { Debug.Log("Start"); }, 10, 1.0f); } Version ...

  7. Redis学习笔记(十)——过期时间、访问限制与缓存

    http://irfen.me/redis-learn-10-time-expire-limit-cache/ 过期时间 之前应该提到过 redis 的特性之一是可以设置键的超时时间.命令是expir ...

  8. java基础知识回顾之java Thread类学习(八)--java.util.concurrent.locks(JDK1.5)与synchronized异同讲解

    看API文档介绍几个方法:  JDK1.5中提供了多线程的升级解决方案: 特点: 1.将同步synchronized显示的替换成Lock                    2.接口Conditio ...

  9. Android ActionBar与ViewPager合用

    内容可以左右滑动,因为使用了ViewPager(我这里用了V4包) view_pager_main.xml <?xml version="1.0" encoding=&quo ...

  10. 【转】Windows平台SSH登录Linux并使用图形化界面

    备注:经验证本文提供的方法可行且比使用VNC简洁一些.略有修改.   [日期:2011-09-06] 来源:Linux社区  作者:tianhuadihuo   http://www.linuxidc ...