winlin

update package for pi, check the lsb_release.

@@ -79,6 +79,15 @@ package_dir=${build_objs}/package @@ -79,6 +79,15 @@ package_dir=${build_objs}/package
79 log="${build_objs}/logs/package.`date +%s`.log" && . ${product_dir}/scripts/_log.sh && check_log 79 log="${build_objs}/logs/package.`date +%s`.log" && . ${product_dir}/scripts/_log.sh && check_log
80 ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi 80 ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi
81 81
  82 +# check lsb_release
  83 +lsb_release -a >/dev/null 2>&1
  84 +ret=$?; if [[ $ret -ne 0 ]]; then
  85 + failed_msg "lsb_release not found. to install on centos/debian(ubuntu/respberry-pi):";
  86 + failed_msg " sudo yum install -y lsb-release";
  87 + failed_msg " sudo aptitude install -y lsb-release";
  88 + exit $ret;
  89 +fi
  90 +
82 # check os version 91 # check os version
83 os_name=`lsb_release --id|awk '{print $3}'` && 92 os_name=`lsb_release --id|awk '{print $3}'` &&
84 os_release=`lsb_release --release|awk '{print $2}'` && 93 os_release=`lsb_release --release|awk '{print $2}'` &&
@@ -89,10 +98,13 @@ ok_msg "target os is ${os_name}-${os_major_version} ${os_release} ${os_machine}" @@ -89,10 +98,13 @@ ok_msg "target os is ${os_name}-${os_major_version} ${os_release} ${os_machine}"
89 98
90 # for raspberry-pi 99 # for raspberry-pi
91 # use rasberry-pi instead all release 100 # use rasberry-pi instead all release
92 -uname -a|grep "raspberrypi"; if [[ 0 -eq $? ]]; then os_name="RaspberryPi"; fi  
93 -if [[ "Raspbian" == $os_name ]]; then os_name="RaspberryPi"; fi  
94 -# check the cpu machine  
95 -if [[ "unknown" == $os_machine ]]; then os_machine=`uname -m`; fi 101 +if [ $PI = YES ]; then
  102 + uname -a|grep "raspberrypi"; if [[ 0 -eq $? ]]; then os_name="RaspberryPi"; fi
  103 + if [[ "Raspbian" == $os_name ]]; then os_name="RaspberryPi"; fi
  104 + # check the cpu machine
  105 + if [[ "unknown" == $os_machine ]]; then os_machine=`uname -m`; fi
  106 +fi
  107 +ok_msg "real os is ${os_name}-${os_major_version} ${os_release} ${os_machine}"
96 108
97 # build srs 109 # build srs
98 # @see https://github.com/winlinvip/simple-rtmp-server/wiki/Build 110 # @see https://github.com/winlinvip/simple-rtmp-server/wiki/Build