#!/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. c++ 常用数据接口 set

    #include <set> #include <iostream> #include <string> int main(void) { std::set< ...

  2. PAT-乙级-1051. 复数乘法 (15)

    1051. 复数乘法 (15) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 复数可以写成(A + Bi)的常规 ...

  3. java基础知识回顾之java Thread类学习(七)--java多线程通信等待唤醒机制(wait和notify,notifyAll)

    1.wait和notify,notifyAll: wait和notify,notifyAll是Object类方法,因为等待和唤醒必须是同一个锁,不可以对不同锁中的线程进行唤醒,而锁可以是任意对象,所以 ...

  4. IOS:利用dispatch_once创建单例

    在之前有一篇学习笔记中,记载了一篇如何在OC中实现单例的文章:<IOS学习笔记4—Objective C—创建单例>自苹果引入了Grand Central Dispatch (GCD)(M ...

  5. 毕向东JAVA视频讲解笔记(前三课)

    1,定义一个类,因为java程序都定义类中,java程序都是以类的形式存在的,类的形式其实就是一个字节码文件最终体现. 2,定义一个主函数.为了让该类可以独立运行. 3,因为演示hello world ...

  6. C++ Primer笔记整理

    1. 迭代器:迭代器是一种对象,它可以看做是游标,用来遍历标准模板库中的部分或者全部元素. 每个迭代器指向容器中确定的地址,此外,迭代器还提供一些基本操作符:*.++.==.!=.=. 2. 模板:是 ...

  7. 【memcache缓存专题(1)】memcache的介绍与应用场景

    简介 Memcached是一个高性能的分布式的内存对象缓存系统,目前全世界不少人使用这个缓存项目来构建自己大负载的网站,来分担数据库的压力,通过在内存里维护一个统一的巨大的hash表,它能够用来存储各 ...

  8. json的数据格式(仔细查看)

    1.json对象就是jsonObject,jsonobject里可以放入很多键值对,并以逗号为分隔符. jsonObject里还可以嵌套JsonObject对象,或者数组信息作为value,数组作为k ...

  9. ReadDirectoryChangesW 监控文件夹 (一个简单的监控示例程序)(文件被修改了,也可以探测到)

    // .h文件 #pragma once typedef void (*PFN_NotifyAction)(DWORD dwAction, LPWSTR szFile, DWORD dwLength) ...

  10. C++Builder和VC的比较

    C++Builder和VC的比较 其实很久以前我就想写这篇文章,其原因一方面是因为笔者深深感觉到C++ Builder的确是一个先进与强大的程式开发工具,但更最重要的一点是,我深信C++ Builde ...