openlibs/alsa/build.sh
@@ -1,44 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile alsa-lib and alsa-utils for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: ftp://ftp.alsa-project.org/pub/lib/ LIB_NAME=alsa-lib-1.1.9 PACK_SUFIX=tar.bz2 PRJ_PATH=`pwd` PREFIX_PATH=`pwd`/../install # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/aplay # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -47,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -55,81 +131,78 @@ export CFLAGS= } function compile_alsa_lib() function do_fetch() { SRC_NAME=alsa-lib-1.1.9 PACK_SUFIX=tar.bz2 IMG_NAME=libasound.so.2.0.0 if [ -f ${PREFIX_PATH}/lib/${IMG_NAME} ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget ftp://ftp.alsa-project.org/pub/lib/${SRC_NAME}.${PACK_SUFIX} wget $LYFTP_SRC/$SRC_NAME.$PACK_SUFIX check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xjf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --datarootdir=/apps/etc/share do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build_alsa_lib() { if [ -e ${LIB_PATH}/libasound.so ] ; then return ; fi cd $LIB_NAME ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} check_result "ERROR: configure ${SRC_NAME} failure" make && make install make -j ${JOBS} && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - } function compile_alsa_utils() function do_build_alsa_utils() { SRC_NAME=alsa-utils-1.1.9 PACK_SUFIX=tar.bz2 IMG_NAME=aplay cd $LIB_NAME if [ -f ${PREFIX_PATH}/bin/${IMG_NAME} ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; fi export DESTDIR=${PREFIX_PATH} msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget ftp://ftp.alsa-project.org/pub/utils/$SRC_NAME.$PACK_SUFIX wget $LYFTP_SRC/$SRC_NAME.$PACK_SUFIX check_result "ERROR: download ${SRC_NAME} failure" fi tar -xjf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --datarootdir=/apps/etc/share \ ./configure ${CONFIG_CROSS} \ --disable-largefile --disable-nls --disable-alsamixer --without-curses \ --with-alsa-prefix=${PREFIX_PATH}/lib --with-alsa-inc-prefix=${PREFIX_PATH}/include --with-alsa-prefix=${PREFIX_PATH}/lib --with-alsa-inc-prefix=${PREFIX_PATH}/include check_result "ERROR: configure ${SRC_NAME} failure" make make -j ${JOBS} && make install check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} aplay/aplay cp aplay/aplay ${PREFIX_PATH}/bin/ cd - } function do_clean() { rm -rf *alsa* } export_cross if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi compile_alsa_lib do_export compile_alsa_utils export LIB_NAME=alsa-lib-1.1.9 do_fetch do_build_alsa_lib export LIB_NAME=alsa-utils-1.1.9 do_fetch do_build_alsa_utils openlibs/appweb/build.sh
@@ -53,7 +53,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -93,15 +93,15 @@ --enable-sockets --enable-track-vars --enable-trans-sid -enable-wddx --sysconfdir=/apps/appWeb/etc --with-pic \ --with-db --with-regex=system --with-pear --without-zlib --without-iconv --disable-dom --disable-libxml \ --disable-simplexml --disable-xml --disable-wddx --disable-xmlreader --without-xmlrpc --disable-xmlwriter \ --with-config-file-path=/apps/appweb --with-config-file-path=/apps/appweb check_result "ERROR: configure ${SRC_NAME} failure" export LDFLAGS+="-lpthread -ldl" export LDFLAGS+="-lpthread -ldl" make && make install check_result "ERROR: compile ${SRC_NAME} failure" # install and clear PHP ${STRIP} ${PREFIX_PATH}/lib/libphp5.so ${STRIP} ${PREFIX_PATH}/lib/libphp5.so cp -rf $PREFIX_PATH/lib/libphp5.so $PREFIX_PATH/modules rm -rf ${PREFIX_PATH}/bin/* rm -rf $PREFIX_PATH/include @@ -139,7 +139,7 @@ --enable-test --enable-send --enable-upload --enable-file --enable-regex --with-php=${PRJ_PATH}/${PHP_SRC_NAME} check_result "ERROR: configure ${SRC_NAME} failure" make TRACE=1 make TRACE=1 check_result "ERROR: compile ${SRC_NAME} failure" @@ -180,7 +180,7 @@ ./bin/appweb --config appweb.conf & EOF chmod 755 run.sh chmod 755 run.sh mv run.sh $PREFIX_PATH/ tar -cjf ${TARBALL} `basename $PREFIX_PATH` @@ -190,6 +190,18 @@ fi } function do_clean() { rm -rf appweb* php* } if [[ $# == 1 && $1 == -c ]] ;then echo "start clean ${LIB_NAME}" do_clean exit; fi exit; export_cross openlibs/build.sh
@@ -1,6 +1,27 @@ #!/bin/bash function do_compile # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) cd $PRJ_PATH #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function do_build { for dir in `ls` do @@ -12,5 +33,25 @@ done } do_compile function do_clean() { for dir in `ls` do if [ -f $dir/build*.sh ] ; then cd $dir ./build*.sh -c cd - fi done rm -rf install } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_build openlibs/curl/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile curl for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://github.com/curl/curl/releases/ LIB_NAME=curl-8.2.1 PACK_SUFIX=tar.bz2 PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/lib/libgpiod.so # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,49 +132,53 @@ export CFLAGS= } function compile_curl() function do_fetch() { SRC_NAME=curl-7.65.3 PACK_SUFIX=tar.bz2 if [ -f ${PREFIX_PATH}/bin/curl ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://github.com/curl/curl/releases/download/curl-7_65_3/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xjf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi msg_banner "Start cross compile $SRC_NAME " ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --with-ssl=${PREFIX_PATH} check_result "ERROR: configure ${SRC_NAME} failure" make && make install check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} ${PREFIX_PATH}/bin/curl cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME cd ../openssl ./build.sh cd - do_export export_cross ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --with-ssl=${PREFIX_PATH} check_result "ERROR: configure ${LIB_NAME} failure" compile_curl make -j ${JOBS} && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi cd ../openssl && ./build.sh && cd - do_fetch do_build openlibs/dhcpd/build.sh
@@ -46,7 +46,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -81,16 +81,28 @@ --with-srv-pid-file=/var/run/dhcpd.pid --with-relay-pid-file=/var/run/dhcrelay.pid check_result "ERROR: configure ${SRC_NAME} failure" make make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} server/${IMG_NAME} cp server/${IMG_NAME} ${PREFIX_PATH} cp client/dhclient ${PREFIX_PATH} cp server/${IMG_NAME} ${PREFIX_PATH} cp client/dhclient ${PREFIX_PATH} cd - } function do_clean() { rm -rf dhcpd* } if [[ $# == 1 && $1 == -c ]] ;then echo "start clean ${LIB_NAME}" do_clean exit; fi exit; export_cross openlibs/dnsmasq/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile dnsmasq for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://thekelleys.org.uk/dnsmasq/doc.html LIB_NAME=dnsmasq-2.79 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install/bin # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/dnsmasq # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,40 +132,51 @@ export CFLAGS= } function compile_dnsmasq() function do_fetch() { SRC_NAME=dnsmasq-2.79 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/dnsmasq ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget http://www.thekelleys.org.uk/dnsmasq/${SRC_NAME}.${PACK_SUFIX} wget $LYFTP_SRC/$SRC_NAME.$PACK_SUFIX check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi msg_banner "Start cross compile $SRC_NAME " make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} src/dnsmasq cp src/dnsmasq ../ cp src/dnsmasq ${PREFIX_PATH} cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } export_cross function do_build() { cd $LIB_NAME compile_dnsmasq do_export make -j ${JOBS} check_result "ERROR: compile ${LIB_NAME} failure" install -d ${BIN_PATH} install -m 755 src/dnsmasq ${BIN_PATH} } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/dosfstools/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile dosfstools for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://github.com/dosfstools/dosfstools LIB_NAME=dosfstools-4.1 PACK_SUFIX=tar.xz PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/sbin/fsck.fat # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,45 +132,51 @@ export CFLAGS= } function compile_dosfstools() function do_fetch() { SRC_NAME=dosfstools-4.1 PACK_SUFIX=tar.xz if [ -f ${PREFIX_PATH}/sbin/fsck.vfat ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then # https://github.com/dosfstools/dosfstools/releases wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xJf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi msg_banner "Start cross compile $SRC_NAME " ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static check_result "ERROR: configure ${SRC_NAME} failure" make && make install # check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} ${PREFIX_PATH}/sbin/fsck.fat mv ${PREFIX_PATH}/sbin/fsck.fat ${PREFIX_PATH}/sbin/fsck.vfat cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } export_cross function do_build() { cd $LIB_NAME compile_dosfstools do_export ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static check_result "ERROR: configure ${LIB_NAME} failure" make -j ${JOBS} && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/dropbear/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile dropbear for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: http://matt.ucc.asn.au/dropbear/releases LIB_NAME=dropbear-2019.78 PACK_SUFIX=tar.bz2 PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/dropbear # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,71 +132,55 @@ export CFLAGS= } function compile_x86() function do_fetch() { # compile for X86 and generate Key msg_banner "Start compile $SRC_NAME for X86" make distclean ./configure && make ./dropbearkey -t rsa -f ${PREFIX_PATH}/dropbear_rsa_host_key chmod 644 ${PREFIX_PATH}/dropbear_rsa_host_key make distclean if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi do_unpack ${LIB_NAME}.${PACK_SUFIX} } function compile_dropbear() function do_build() { SRC_NAME=dropbear-2019.78 PACK_SUFIX=tar.bz2 cd $LIB_NAME if [ -f ${PREFIX_PATH}/bin/dropbear ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget http://matt.ucc.asn.au/dropbear/releases/${SRC_NAME}.${PACK_SUFIX} wget $LYFTP_SRC/$SRC_NAME.$PACK_SUFIX check_result "ERROR: download ${SRC_NAME} failure" fi tar -xjf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} msg_banner "Start cross compile $SRC_NAME " do_export ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --disable-zlib check_result "ERROR: configure ${SRC_NAME} failure" check_result "ERROR: configure ${LIB_NAME} failure" make check_result "ERROR: compile ${SRC_NAME} failure" make -j ${JOBS} check_result "ERROR: compile ${LIB_NAME} failure" ${STRIP} dbclient dropbear cp dropbear .. cp dbclient ../ssh cp dbclient ${PREFIX_PATH}/bin/ssh cp dropbear ${PREFIX_PATH}/bin/ cd - install -d ${BIN_PATH} install -m 755 dbclient ${BIN_PATH}/ssh install -m 755 dropbear ${BIN_PATH}/ } function install_script() function do_clean() { init_script=S20_dropbear cat << EOF > ${init_script} #!/bin/sh mkdir -p /etc/dropbear/ dropbear -R EOF chmod 755 ${init_script} rm -rf *${LIB_NAME}* } export_cross if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi compile_dropbear do_fetch install_script do_build openlibs/e2fsprogs/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile e2fsprogs for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git LIB_NAME=e2fsprogs-1.45.3 PACK_SUFIX=tar.xz PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/sbin/blkid # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,45 +132,52 @@ export CFLAGS= } function compile_e2fsprogs() function do_fetch() { SRC_NAME=e2fsprogs-1.45.3 PACK_SUFIX=tar.xz if [ -f ${PREFIX_PATH}/sbin/fsck.ext4 ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then # https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xJf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi msg_banner "Start cross compile $SRC_NAME " ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static \ --without-libpth-prefix --without-libintl-prefix check_result "ERROR: configure ${SRC_NAME} failure" make && make install # check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} ${PREFIX_PATH}/sbin/fsck.* cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } export_cross function do_build() { cd $LIB_NAME compile_e2fsprogs do_export export DESTDIR=${PREFIX_PATH} ./configure ${CONFIG_CROSS} --enable-static --without-libpth-prefix --without-libintl-prefix check_result "ERROR: configure ${LIB_NAME} failure" make -j ${JOBS} && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/ethtool/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile ethtool for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://mirrors.edge.kernel.org/pub/software/network/ethtool/ LIB_NAME=ethtool-5.2 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install/bin # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/ethtool # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,43 +132,52 @@ export CFLAGS= } function compile_ethtool() function do_fetch() { SRC_NAME=ethtool-5.2 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/ethtool ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://mirrors.edge.kernel.org/pub/software/network/ethtool/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} check_result "ERROR: configure ${SRC_NAME} failure" make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} ethtool cp ethtool ${PREFIX_PATH} cp ethtool .. cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_ethtool ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static check_result "ERROR: configure ${LIB_NAME} failure" pr_info "${LIB_NAME} installed to '${BIN_PATH}'" make -j ${JOBS} && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/fbgrab/build.sh
@@ -1,44 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile fbgrab for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://fbgrab.monells.se LIB_NAME=fbgrab-1.3 PACK_SUFIX=tar.gz PRJ_PATH=`pwd` PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/fbgrab # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -47,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -55,52 +132,55 @@ export CFLAGS= } function compile_fbgrab() function do_fetch() { IMG_NAME=fbgrab SRC_NAME=fbgrab-1.3 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/bin/${IMG_NAME} ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://fbgrab.monells.se/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi export LDFLAGS=" -L${PREFIX_PATH}/lib -static " export CFLAGS+=" -I${PREFIX_PATH}/include " sed -i "s/-lpng -lz/-lpng -lz -lm/g" Makefile do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME do_export export LDFLAGS=" -L${LIB_PATH}/ -static " export CFLAGS+=" -I${INC_PATH}/ " sed -i "s/-lpng -lz/-lpng -lz -lm/g" Makefile make check_result "ERROR: compile ${SRC_NAME} failure" set -x ${STRIP} ${IMG_NAME} cp ${IMG_NAME} .. cp ${IMG_NAME} ${PREFIX_PATH}/bin cd - install -d ${BIN_PATH} install -m 755 fbgrab ${BIN_PATH} } function do_clean() { rm -rf *${LIB_NAME}* } export_cross if [ ! -f ${PREFIX_PATH}/lib/libpng.a ] ; then cd ../libpng ./build.sh cd - if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi compile_fbgrab do_fetch do_build openlibs/ffmpeg/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile ffmpeg for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: http://ffmpeg.org/releases LIB_NAME=ffmpeg-4.1.4 PACK_SUFIX=tar.bz2 PREFIX_PATH=`pwd`/../install/bin/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/ethtool # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,44 +132,51 @@ export CFLAGS= } function compile_ffmpeg() function do_fetch() { SRC_NAME=ffmpeg-4.1.4 PACK_SUFIX=tar.bz2 IMG_NAME=ffmpeg if [ -f ${PREFIX_PATH}/${IMG_NAME} ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget http://ffmpeg.org/releases/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xjf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${PREFIX_PATH} --cross-prefix=${CROSS_COMPILE} --target-os=linux --enable-cross-compile --arch=arm check_result "ERROR: configure ${SRC_NAME} failure" make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} ${IMG_NAME} cp ${IMG_NAME} ${PREFIX_PATH} cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_ffmpeg ./configure --prefix=${PREFIX_PATH} --cross-prefix=${CROSS_COMPILE} --target-os=linux --enable-cross-compile --arch=arm check_result "ERROR: configure ${LIB_NAME} failure" make -j ${JOBS} && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/file/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile file for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: ftp://ftp.astron.com/pub/file LIB_NAME=file-5.04 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install/bin # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/file # shell script will exit once get command error #set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,44 +132,54 @@ export CFLAGS= } function compile_file() function do_fetch() { # CentOS 6.0 use file-5.04, so we should cross compile 5.04 for ARM too, for make magic file SRC_NAME=file-5.04 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/file ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget ftp://ftp.astron.com/pub/file/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --disable-shared check_result "ERROR: configure ${SRC_NAME} failure" make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} src/file cp src/file .. cp src/file ${PREFIX_PATH} cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_file ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --disable-shared check_result "ERROR: configure ${LIB_NAME} failure" make -j ${JOBS} pr_info "${LIB_NAME} installed to '${BIN_PATH}'" install -d ${BIN_PATH} install -m 755 src/file ${BIN_PATH} } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/glib/build.sh
@@ -48,7 +48,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -68,7 +68,7 @@ fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget ftp://sourceware.org/pub/libffi/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" @@ -79,7 +79,7 @@ msg_banner "Start cross compile $SRC_NAME " ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} check_result "ERROR: configure ${SRC_NAME} failure" @@ -137,6 +137,19 @@ cd - } function do_clean() { rm -rf libffi* glib* } if [[ $# == 1 && $1 == -c ]] ;then echo "start clean ${LIB_NAME}" do_clean exit; fi exit export_cross compile_libffi openlibs/gstreamer/build.sh
@@ -49,7 +49,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -106,19 +106,19 @@ if [ -f ${PREFIX_PATH}/lib/libgstaudio-1.0.so ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; fi fi if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then msg_banner "Start download ${SRC_NAME}.${PACK_SUFIX} " #wget https://gstreamer.freedesktop.org/src/gst-plugins-base/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" fi fi msg_banner "Start decompress $SRC_NAME.${PACK_SUFIX} " if [ ! -d ${SRC_NAME} ] ; then tar -xJf ${SRC_NAME}.${PACK_SUFIX} fi fi cd ${SRC_NAME} @@ -134,9 +134,9 @@ LDFLAGS="-L${PREFIX_PATH}/lib -lglib-2.0 -lgobject-2.0 -lgmodule-2.0 -lffi" check_result "ERROR: configure ${SRC_NAME} failure" check_result "ERROR: configure ${SRC_NAME} failure" make && make install make && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - @@ -150,19 +150,19 @@ if [ -f ${PREFIX_PATH}/lib/gstreamer-1.0/libgstcamerabin.so ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; fi fi if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then msg_banner "Start download ${SRC_NAME}.${PACK_SUFIX} " #wget https://gstreamer.freedesktop.org/src/gst-plugins-bad/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" fi fi msg_banner "Start decompress $SRC_NAME.${PACK_SUFIX} " if [ ! -d ${SRC_NAME} ] ; then tar -xJf ${SRC_NAME}.${PACK_SUFIX} fi fi cd ${SRC_NAME} @@ -180,9 +180,9 @@ CFLAGS="-I${PREFIX_PATH}/include/glib-2.0" \ LDFLAGS="-L${PREFIX_PATH}/lib -lglib-2.0 -lgobject-2.0 -lgmodule-2.0 -lffi" check_result "ERROR: configure ${SRC_NAME} failure" check_result "ERROR: configure ${SRC_NAME} failure" make -v && make install make -v && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - @@ -196,19 +196,19 @@ if [ -f ${PREFIX_PATH}/lib/gstreamer-1.0/libgstmultifile.so ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; fi fi if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then msg_banner "Start download ${SRC_NAME}.${PACK_SUFIX} " #wget https://gstreamer.freedesktop.org/src/gst-plugins-good/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" fi fi msg_banner "Start decompress $SRC_NAME.${PACK_SUFIX} " if [ ! -d ${SRC_NAME} ] ; then tar -xJf ${SRC_NAME}.${PACK_SUFIX} fi fi cd ${SRC_NAME} @@ -224,18 +224,31 @@ CFLAGS="-I${PREFIX_PATH}/include/glib-2.0" \ LDFLAGS="-L${PREFIX_PATH}/lib -lglib-2.0 -lgobject-2.0 -lgmodule-2.0 -lffi" check_result "ERROR: configure ${SRC_NAME} failure" check_result "ERROR: configure ${SRC_NAME} failure" make -v && make install make -v && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - } function do_clean() { rm -rf gst* } if [ ! -f ${PREFIX_PATH}/lib/libglib-2.0.so ] ; then cd ../glib ./build.sh if [[ $# == 1 && $1 == -c ]] ;then echo "start clean ${LIB_NAME}" do_clean exit; fi exit if [ ! -f ${PREFIX_PATH}/lib/libglib-2.0.so ] ; then cd ../glib ./build.sh cd - fi openlibs/iconv/build.sh
@@ -1,44 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile libiconv for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://ftp.gnu.org/gnu/libiconv/ LIB_NAME=libiconv-1.15 PACK_SUFIX=tar.gz PROJ_PATH=`pwd`/../ INST_PATH=${PROJ_PATH}/install CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/lib/libiconv.so # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -47,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -55,38 +131,55 @@ export CFLAGS= } function compile_libiconv() function do_fetch() { SRC_NAME=libiconv-1.15 PACK_SUFIX=tar.gz if [ -f ${INST_PATH}/lib/libiconv.so ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://ftp.gnu.org/gnu/libiconv/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${INST_PATH} ${CONFIG_CROSS} make && make install cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_libiconv export CFLAGS=" -I${INC_PATH}" export CPPFLAGS=" -I${INC_PATH}" export LDFLAGS=" -L${LIB_PATH}" ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static check_result "ERROR: configure ${LIB_NAME} failure" make && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/imageMagick/build.sh
@@ -1,43 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile imageMagick for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://imagemagick.org/archive/releases/ LIB_NAME=ImageMagick-6.9.10-57 PACK_SUFIX=tar.bz2 PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/animate # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,45 +131,60 @@ export CFLAGS= } function compile_imageMagick() function do_fetch() { SRC_NAME=ImageMagick6-6.9.4-0 PACK_SUFIX=tar.gz if [ -f $PREFIX_PATH/lib/libMagickCore-6.Q16.a ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME do_export CFLAGS="-I${PREFIX_PATH}/include -DMAGICKCORE_QUANTUM_DEPTH=16" LDFLAGS=-L${PREFIX_PATH}/lib \ ./configure --host=arm-linux --enable-static --disable-shared --prefix=$PREFIX_PATH \ --without-magick-plus-plus --without-perl --without-x --without-dps --without-xml \ --without-pango --without-freetype --without-png --without-openexr --without-fontconfig \ --without-lzma check_result "ERROR: configure ${SRC_NAME} failure" check_result "ERROR: configure ${LIB_NAME} failure" make && make install # check_result "ERROR: compile ${SRC_NAME} failure" check_result "ERROR: compile ${LIB_NAME} failure" cd - pr_info "${LIB_NAME} installed to '${BIN_PATH}'" mkdir -p ${BIN_PATH} install -m 755 src/lsz ${BIN_PATH}/sz install -m 755 src/lrz ${BIN_PATH}/rz } function do_clean() { rm -rf *${LIB_NAME}* } export_cross if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi compile_imageMagick do_fetch do_build openlibs/iptables/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile iptables for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: http://www.netfilter.org/projects/iptables LIB_NAME=iptables-1.4.21 PACK_SUFIX=tar.bz2 PREFIX_PATH=`pwd`/../install/bin # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/iptables # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,44 +132,55 @@ export CFLAGS= } function compile_iptables() function do_fetch() { SRC_NAME=iptables-1.4.21 PACK_SUFIX=tar.bz2 IMG_NAME=iptables if [ -f ${PREFIX_PATH}/${IMG_NAME} ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget http://www.netfilter.org/projects/iptables/files/${SRC_NAME}.${PACK_SUFIX} wget $LYFTP_SRC/$SRC_NAME.$PACK_SUFIX check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xjf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --disable-shared --disable-ipv6 --disable-largefile check_result "ERROR: configure ${SRC_NAME} failure" make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} iptables/xtables-multi cp iptables/xtables-multi ${PREFIX_PATH}/${IMG_NAME} cp iptables/xtables-multi ../${IMG_NAME} cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_iptables ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --disable-shared --disable-ipv6 --disable-largefile check_result "ERROR: configure ${LIB_NAME} failure" make -j ${JOBS} check_result "ERROR: compile ${LIB_NAME} failure" pr_info "${LIB_NAME} installed to '${BIN_PATH}'" mkdir -p ${BIN_PATH} install -m 755 iptables/xtables-multi ${BIN_PATH}/iptables } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/libconfig/build.sh
@@ -1,41 +1,117 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile libconfig for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: http://hyperrealm.github.io/libconfig/ LIB_NAME=libconfig-1.7.2 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/lib/libconfig.so # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ @@ -47,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -55,40 +131,52 @@ export CFLAGS= } function compile_libconfig() function do_fetch() { SRC_NAME=libconfig-1.7.2 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/lib/libconfig.so ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget http://hyperrealm.github.io/libconfig/dist/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME do_export export "CFLAGS+=-undefHAVE_USELOCALE" ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} check_result "ERROR: configure ${SRC_NAME} failure" check_result "ERROR: configure ${LIB_NAME} failure" make && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } export_cross if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi compile_libconfig do_fetch do_build openlibs/libdrm/build.sh
@@ -1,54 +1,129 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile libdrm for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://dri.freedesktop.org/libdrm/ LIB_NAME=libdrm-2.4.99 PACK_SUFIX=tar.gz PROJ_PATH=`pwd`/../ CUR_PATH=`pwd` INST_PATH=${PROJ_PATH}/install CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/modetest # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld export NM=${CROSS_COMPILE}nm export RANLIB=${CROSS_COMPILE}ranlib export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip INST_PATEFIX_PATHTRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -56,41 +131,57 @@ export CFLAGS= } function compile_libdrm() function do_fetch() { SRC_NAME=libdrm-2.4.99 PACK_SUFIX=tar.gz if [ -f ${INST_PATH}/lib/libiconv.so ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${INST_PATH} ${CONFIG_CROSS} --disable-radeon --disable-amdgpu \ --disable-nouveau --disable-vmwgfx --disable-freedreno --disable-vc4 make set -x cp tests/modetest/.libs/modetest ${CUR_PATH}/ cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_libdrm #export DESTDIR=${PREFIX_PATH} ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --disable-radeon --disable-amdgpu \ --disable-nouveau --disable-vmwgfx --disable-freedreno --disable-vc4 check_result "ERROR: configure ${LIB_NAME} failure" make && make install check_result "ERROR: compile ${LIB_NAME} failure" pr_info "${LIB_NAME} installed to '${BIN_PATH}'" mkdir -p ${BIN_PATH} install -m 755 tests/modetest/.libs/modetest ${BIN_PATH}/ } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/libkcapi/build.sh
@@ -1,48 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile libkcapi for ARM #| libkcapi is linux kernel crypto userspace API library, official introduction site: #| Linux Kernel: https://www.kernel.org/doc/html/latest/crypto/userspace-if.html #| libkcapi: http://www.chronox.de/libkcapi.html #| #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://codeload.github.com/smuellerDD/libkcapi/tar.gz/v1.1.5 LIB_NAME=libkcapi-1.1.5 PACK_SUFIX=tar.gz PRJ_PATH=`pwd` PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/kcapi # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -51,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -59,47 +131,58 @@ export CFLAGS= } function compile_libkcapi() function do_fetch() { SRC_NAME=libkcapi-1.1.5 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/lib/libkcapi.a ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then wget https://codeload.github.com/smuellerDD/libkcapi/tar.gz/v1.1.5 -O ${SRC_NAME}.${PACK_SUFIX} #wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi export CFLAGS=" -I${PREFIX_PATH}/include" export CPPFLAGS=" -I${PREFIX_PATH}/include" export LDFLAGS=" -L${PREFIX_PATH}/lib" do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME do_export export CFLAGS=" -I${PREFIX_PATH}/include" export CPPFLAGS=" -I${PREFIX_PATH}/include" export LDFLAGS=" -L${PREFIX_PATH}/lib" autoreconf -i ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --enable-shared --enable-kcapi-test \ --enable-kcapi-rngapp --enable-kcapi-rngapp check_result "ERROR: configure ${SRC_NAME} failure" make && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - check_result "ERROR: compile ${LIB_NAME} failure" } export_cross function do_clean() { rm -rf *${LIB_NAME}* } compile_libkcapi if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/libpng/build.sh
@@ -1,44 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile libpng for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://nchc.dl.sourceforge.net/project/libpng/ LIB_NAME=libpng-1.6.37 PACK_SUFIX=tar.gz PRJ_PATH=`pwd` PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/lib/libpng.so # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -47,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -55,49 +131,55 @@ export CFLAGS= } function compile_png() function do_fetch() { SRC_NAME=libpng-1.6.37 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/lib/libpng.a ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://nchc.dl.sourceforge.net/project/libpng/libpng16/1.6.37/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi export CFLAGS=" -I${PREFIX_PATH}/include" export CPPFLAGS=" -I${PREFIX_PATH}/include" export LDFLAGS=" -L${PREFIX_PATH}/lib" ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --enable-shared --enable-arm-neon check_result "ERROR: configure ${SRC_NAME} failure" make && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } export_cross function do_build() { cd $LIB_NAME if [ ! -f ${PREFIX_PATH}/lib/libz.a ] ; then cd ../zlib ./build.sh cd - do_export export CFLAGS=" -I${INC_PATH}" export CPPFLAGS=" -I${INC_PATH}" export LDFLAGS=" -L${LIB_PATH}" ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --enable-shared --enable-arm-neon check_result "ERROR: configure ${LIB_NAME} failure" make && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi compile_png do_fetch do_build openlibs/libressl/build.sh
@@ -1,43 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile libressl for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL LIB_NAME=libressl-3.9.0 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/lib/libssl.so # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,42 +131,53 @@ export CFLAGS= } function compile_libressl() function do_fetch() { SRC_NAME=libressl-2.9.2 PACK_SUFIX=tar.gz if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi if [ -f ${PREFIX_PATH}/lib/libcrypto.a ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" fi if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} touch * export CFLAGS=-fPIC #./configure ${CONFIG_CROSS} --prefix=${PREFIX_PATH} --with-pic --disable-shared --enable-static LIBS="-lpthread" if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME do_export ./configure ${CONFIG_CROSS} --prefix=${PREFIX_PATH} --with-pic LIBS="-lpthread" check_result "ERROR: configure ${LIB_NAME} failure" make && make install check_result "ERROR: compile ${SRC_NAME} failure" make && make install check_result "ERROR: compile ${LIB_NAME} failure" } cd - } function do_clean() { rm -rf *${LIB_NAME}* } printf "\nWARRNING: libressl is a candidate of openssl, so don't compile it if openssl enabled\n\n" exit; if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi export_cross exit compile_libressl do_fetch do_build openlibs/mplayer/build.sh
@@ -1,45 +1,118 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile mplayer for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| #| Usage: #| mplayer -slave -quiet test.mp4 -vo fbdev2 -vf scale -fs -zoom -x 320 -y 240 #| #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: http://www.mplayerhq.hu/MPlayer/releases LIB_NAME=MPlayer-1.4 PACK_SUFIX=tar.xz PREFIX_PATH=`pwd`/../install # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/ethtool # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ @@ -51,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -59,27 +132,34 @@ export CFLAGS= } function compile_mplayer() function do_fetch() { SRC_NAME=MPlayer-1.4 PACK_SUFIX=tar.xz if [ -f ${PREFIX_PATH}/bin/mencoder ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget wget http://www.mplayerhq.hu/MPlayer/releases/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xJf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME do_export export CFLAGS=-I${INC_PATH} export LDFLAGS="-L${LIB_PATH} " ./configure --prefix=${PREFIX_PATH} --enable-cross-compile --disable-mencoder \ --disable-gui --disable-termcap --disable-termios --disable-lirc --disable-lircc \ @@ -92,20 +172,30 @@ --cc=${CC} --as=${AS} --ar=${AR} --nm=${NM} --ranlib=${RANLIB} \ --target=arm-linux check_result "ERROR: configure ${SRC_NAME} failure" check_result "ERROR: configure ${LIB_NAME} failure" #make -j ${JOBS} make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} mplayer make install cd - check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } export_cross if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi compile_mplayer # failed on: ./libavutil/arm/intmath.h:77:5: error: impossible constraint in 'asm' exit; cd ../zlib/ && ./build.sh && cd - do_fetch do_build openlibs/ntpdate/build.sh
@@ -1,43 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile ntpdate for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://www.eecis.udel.edu/ LIB_NAME=ntp-4.2.6p5 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/ntpdate # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,45 +131,52 @@ export CFLAGS= } function compile_ntpdate() function do_fetch() { SRC_NAME=ntp-4.2.6p5 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/bin/ntpdate ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi msg_banner "Start cross compile $SRC_NAME " ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --disable-ipv6 --disable-tickadj --disable-tick \ --disable-ntp-signd check_result "ERROR: configure ${SRC_NAME} failure" make && make install check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} ${PREFIX_PATH}/bin/ntpdate cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } export_cross function do_build() { cd $LIB_NAME compile_ntpdate do_export ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --disable-ipv6 \ --disable-tickadj --disable-tick --disable-ntp-signd check_result "ERROR: configure ${LIB_NAME} failure" make && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/openssh/build.sh
@@ -1,45 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile openssh for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/${SRC_NAME}.${PACK_SUFIX} LIB_NAME=openssh-8.0p1 PACK_SUFIX=tar.gz PRJ_PATH=`pwd` PREFIX_PATH=${PRJ_PATH}/../install/ #PREFIX_PATH=${PRJ_PATH}/install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/sbin/sshd # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -48,12 +123,32 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS export LDFLAGS= export CFLAGS= } function do_fetch() { if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi do_unpack ${LIB_NAME}.${PACK_SUFIX} } function modify_config() @@ -63,72 +158,51 @@ #sed -i -e "s|.*HAS_SHADOW_EXPIRE.*|/* #undef HAS_SHADOW_EXPIRE */|g" config.h #sed -i -e "s|.*USE_LINUX_AUDIT.*|/* #undef USE_LINUX_AUDIT */|g" config.h sed -i -e "s|.*HAVE___PROGNAME.*|/* #undef HAVE___PROGNAME */|g" config.h echo "modify done" sed -i -e "s|^prefix=.*|prefix=|g" Makefile sed -i -e "s|^DESTDIR=.*|DESTDIR=${PREFIX_PATH}|g" Makefile pr_warn "modify done" } function compile_openssh() function do_build() { SRC_NAME=openssh-8.0p1 PACK_SUFIX=tar.gz cd $LIB_NAME if [ -f ${PREFIX_PATH}/sbin/sshd ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" fi rm -rf ${SRC_NAME} tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} msg_banner "Start cross compile $SRC_NAME " do_export # must --disable-utmpx for lost these files # must --with-audit=debug can not use linux # must --without-pie or environ is NULL will case SIGSEGV export ac_cv_func_realloc_0_nonnull=yes export ac_cv_func_malloc_0_nonnull=yes ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --disable-largefile --disable-pkcs11 --disable-strip \ ./configure ${CONFIG_CROSS} --disable-largefile --disable-pkcs11 --disable-strip \ --disable-etc-default-login --disable-lastlog --disable-utmp --disable-utmpx --disable-wtmp --without-stackprotect \ --disable-wtmpx --disable-pututline --disable-pututxline --without-hardening --without-rpath \ --with-audit=debug --without-pie --without-pam --with-privsep-user=sshd --without-selinux \ --with-libs --with-zlib=${PREFIX_PATH} --with-ssl-dir=${PREFIX_PATH} --with-ssl-engine check_result "ERROR: configure ${SRC_NAME} failure" --with-libs --with-zlib=${PREFIX_PATH} --with-ssl-dir=${PREFIX_PATH} --with-ssl-engine check_result "ERROR: configure ${LIB_NAME} failure" modify_config make && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - make && make install-nosysconf check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [ ! -f ${PREFIX_PATH}/lib/libz.a ] ; then cd ../zlib ./build.sh cd - if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi cd ../zlib/ && ./build.sh && cd - if [ ! -f ${PREFIX_PATH}/lib/libcrypto.a ] ; then cd ../openssl ./build.sh cd - fi cd ../openssl/ && ./build.sh && cd - export_cross compile_openssh do_fetch do_build openlibs/openssh/openssl/build.sh
File was deleted openlibs/openssh/zlib/build.sh
File was deleted openlibs/qt/build.sh
File was renamed from openlibs/qt/build_QT5.sh @@ -62,7 +62,7 @@ return 0; fi if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then msg_banner "Start download ${SRC_NAME}.${PACK_SUFIX} " wget ${LYFTP_SRC}/qt/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" @@ -78,7 +78,7 @@ QMAKE_FILE=qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf grep "`dirname ${CROSS_COMPILE}`" ${QMAKE_FILE} > /dev/null 2>&1 if [ $? != 0 ] ; then if [ $? != 0 ] ; then sed -i "s|arm-linux-gnueabi-|$CROSS_COMPILE|" ${QMAKE_FILE} fi @@ -117,7 +117,7 @@ fi if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then msg_banner "Start download ${SRC_NAME}.${PACK_SUFIX} " wget ${LYFTP_SRC}/qt/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" @@ -130,7 +130,7 @@ cd ${SRC_NAME} ${QT_INST_PATH}/bin/qmake ${QT_INST_PATH}/bin/qmake make && make install } @@ -151,6 +151,18 @@ #rm -rf ${QTDIR_NAME} } function do_clean() { rm -rf appweb* php* } if [[ $# == 1 && $1 == -c ]] ;then echo "start clean ${LIB_NAME}" do_clean exit; fi exit; compile_qt openlibs/tree/build.sh
@@ -1,43 +1,124 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile tree for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: ftp://ftp.astron.com/pub/file LIB_NAME=tree-1.8.0 PACK_SUFIX=tgz PREFIX_PATH=`pwd`/../install/bin # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/bin/tree # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tgz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +127,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,42 +135,53 @@ export CFLAGS= } function compile_tree() function do_fetch() { SRC_NAME=tree-1.8.0 PACK_SUFIX=tgz if [ -f ${PREFIX_PATH}/tree ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget ftp://ftp.astron.com/pub/file/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/tree-1.8.0.tgz check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi sed -i -e "s|^CC=.*|CC=${CROSS_COMPILE}gcc|g" Makefile make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} tree cp tree ${PREFIX_PATH} cp tree .. cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_tree sed -i -e "s|^CC=.*|CC=${CROSS_COMPILE}gcc|g" Makefile make check_result "ERROR: compile ${LIB_NAME} failure" pr_info "${LIB_NAME} installed to '${BIN_PATH}'" mkdir -p ${BIN_PATH} install -m 755 tree ${BIN_PATH}/ } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/util-linux/build.sh
@@ -1,43 +1,121 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile util-linux for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://github.com/karelzak/util-linux/releases LIB_NAME=util-linux-2.33 PACK_SUFIX=tar.xz PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/sbin/fsck # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,47 +132,56 @@ export CFLAGS= } function compile_util-linux() function do_fetch() { SRC_NAME=util-linux-2.33 PACK_SUFIX=tar.xz if [ -f ${PREFIX_PATH}/sbin/fsck ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start donwload $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then # https://github.com/karelzak/util-linux/releases wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xJf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi msg_banner "Start cross compile $SRC_NAME " do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME do_export ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static \ --without-ncursesw --without-selinux --without-audit --without-udev \ --without-ncurses --without-tinfo --without-utempter --without-cap-ng \ --without-user --without-btrfs --without-systemd --without-python check_result "ERROR: configure ${LIB_NAME} failure" check_result "ERROR: configure ${SRC_NAME} failure" make && make install # check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} ${PREFIX_PATH}/sbin/fsck cd - make -j ${JOBS} && make install #check_result "ERROR: compile ${LIB_NAME} failure" } export_cross function do_clean() { rm -rf *${LIB_NAME}* } compile_util-linux if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi exit; do_fetch do_build openlibs/vsftpd/build.sh
@@ -1,41 +1,118 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile vsftpd for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2018.08.16 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://ftp.osuosl.org/pub/blfs/conglomeration/vsftpd/ LIB_NAME=vsftpd-3.0.3 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/vsftpd # check installed or not file INST_FILE=$PREFIX_PATH/bin/ethtool # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" exit fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ @@ -47,7 +124,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -55,41 +132,53 @@ export CFLAGS= } function compile_vsftpd() function do_fetch() { SRC_NAME=vsftpd-3.0.3 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/bin/vsftpd ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://ftp.osuosl.org/pub/blfs/conglomeration/vsftpd/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi sed -i -e "s|^CC.*|CC = ${CROSS_COMPILE}gcc|g" Makefile make check_result "ERROR: compile ${SRC_NAME} failure" ${STRIP} vsftpd cp vsftpd ${PREFIX_PATH}/bin cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } export_cross function do_build() { cd $LIB_NAME compile_vsftpd do_export sed -i -e "s|^CC.*|CC = ${CROSS_COMPILE}gcc|g" Makefile sed -i -e "s|-Werror||g" Makefile make pr_info "${LIB_NAME} installed to '${BIN_PATH}'" mkdir -p ${BIN_PATH} install -m 755 vsftpd ${BIN_PATH} } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build openlibs/zbar/build.sh
@@ -1,41 +1,117 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile zbar for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2018.08.16 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://zbar.sourceforge.net/ LIB_NAME=zbar-0.10 PACK_SUFIX=tar.bz2 PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/lib/libzbar.so # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ @@ -47,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -55,72 +131,70 @@ export CFLAGS= } function compile_zbar() function do_fetch() { #SRC_NAME=zbar-latest SRC_NAME=zbar-0.10 PACK_SUFIX=tar.bz2 set -e if [ -f ${PREFIX_PATH}/bin/zbarcam ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xjf ${SRC_NAME}.${PACK_SUFIX} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi cd ${SRC_NAME} do_unpack ${LIB_NAME}.${PACK_SUFIX} } # zbar-latest need follow command #git checkout 8edfa5f8c4d11a54 && rm -rf * && git checkout . #autoreconf --install #libtoolize -f #sed -i -e "s|-Wno-parentheses -Werror|-Wno-parentheses|g" configure function do_build() { cd $LIB_NAME do_export CFLAGS="-DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" \ ./configure --host=arm-linux --enable-static --enable-shared --prefix=$PREFIX_PATH \ --without-gtk --without-python --without-qt --without-x --without-java --disable-video \ --with-imagemagick=${PREFIX_PATH}/ --without-graphicsmagick \ MAGICK_CFLAGS=-I${PREFIX_PATH}//include/ImageMagick-6 \ MAGICK_LIBS="-L${PREFIX_PATH}/lib -lMagickWand-6.Q16 -lMagickCore-6.Q16 -lm -lz -L`pwd`/zbar/.libs/ -lzbar" MAGICK_LIBS="-L${PREFIX_PATH}/lib -lMagickWand-6.Q16 -lMagickCore-6.Q16 -lm -lz -L`pwd`/zbar/.libs/ -lzbar" #LIBS="-liconv" sed -i -e "s|^LIBS = -lpthread.*|LIBS = -lpthread -liconv|g" Makefile mkdir -p ./doc/man/ touch ./doc/man/zbarimg.1 touch ./doc/man/zbarcam.1 make all && make install cd - mkdir -p ./doc/man/ touch ./doc/man/zbarimg.1 touch ./doc/man/zbarcam.1 make all && make install check_result "ERROR: compile ${LIB_NAME} failure" } cd ../iconv ./build.sh cd - function do_clean() { rm -rf *${LIB_NAME}* } cd ../zlib ./build.sh cd - if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi cd ../imageMagick ./build.sh cd - cd ../zlib/ && ./build.sh && cd - cd ../iconv/ && ./build.sh && cd - export_cross cd ../imageMagick && ./build.sh && cd - compile_zbar cd $PRJ_PATH do_fetch do_build openlibs/zlib/build.sh
@@ -1,43 +1,120 @@ #!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used download and compile zlib for ARM #| Author: GuoWenxue <guowenxue@gmail.com> #| ChangeLog: #| 1, Initialize 1.0.0 on 2011.04.12 #+-------------------------------------------------------------------------------------------- # library name and version # Official: https://zlib.net/ LIB_NAME=zlib-1.2.11 PACK_SUFIX=tar.gz PREFIX_PATH=`pwd`/../install/ # LingYun source code FTP server LYFTP_SRC=http://master.weike-iot.com:2211/src/ # library download URL address LIB_URL=$LYFTP_SRC # Cross compiler for cross compile on Linux server CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- function msg_banner() { echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" # compile jobs JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l` # this project absolute path PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) # top project absolute path TOP_PATH=$(realpath $PRJ_PATH/..) # binaries install path PREFIX_PATH=$TOP_PATH/install BIN_PATH=$PREFIX_PATH/bin LIB_PATH=$PREFIX_PATH/lib INC_PATH=$PREFIX_PATH/include # check installed or not file INST_FILE=$PREFIX_PATH/lib/libz.a # shell script will exit once get command error set -e #+-------------------------+ #| Shell script functions | #+-------------------------+ function pr_error() { echo -e "\033[40;31m $1 \033[0m" } function pr_warn() { echo -e "\033[40;33m $1 \033[0m" } function pr_info() { echo -e "\033[40;32m $1 \033[0m" } function check_result() { if [ $? != 0 ] ; then echo "" echo "+-----------------------------------------------------------------------" echo "| $1 " echo "+-----------------------------------------------------------------------" echo "" exit ; pr_error "$1" fi } function export_cross() # decompress a packet to destination path function do_unpack() { tarball=$1 dstpath=`pwd` if [[ $# == 2 ]] ; then dstpath=$2 fi pr_info "decompress $tarball => $dstpath" mkdir -p $dstpath case $tarball in *.tar.gz) tar -xzf $tarball -C $dstpath ;; *.tar.bz2) tar -xjf $tarball -C $dstpath ;; *.tar.xz) tar -xJf $tarball -C $dstpath ;; *.tar.zst) tar -I zstd -xf $tarball -C $dstpath ;; *.tar) tar -xf $tarball -C $dstpath ;; *.zip) unzip -qo $tarball -d $dstpath ;; *) pr_error "decompress Unsupport packet: $tarball" return 1; ;; esac } function do_export() { BUILD_ARCH=$(uname -m) if [[ $BUILD_ARCH =~ "arm" ]] ; then pr_warn "local($BUILD_ARCH) compile $LIB_NAME" return ; fi pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME" # export cross toolchain export CC=${CROSS_COMPILE}gcc export CXX=${CROSS_COMPILE}g++ export AS=${CROSS_COMPILE}as export AR=${CROSS_COMPILE}ar export LD=${CROSS_COMPILE}ld @@ -46,7 +123,7 @@ export OBJDUMP=${CROSS_COMPILE}objdump export STRIP=${CROSS_COMPILE}strip # export cross configure # export cross configure export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux " # Clear LDFLAGS and CFLAGS @@ -54,41 +131,51 @@ export CFLAGS= } function compile_zlib() function do_fetch() { SRC_NAME=zlib-1.2.11 PACK_SUFIX=tar.gz if [ -f ${PREFIX_PATH}/lib/libz.a ] ; then msg_banner "$SRC_NAME already compile and installed" return 0; if [ -e ${INST_FILE} ] ; then pr_warn "$LIB_NAME compile and installed alredy" exit ; fi msg_banner "Start cross compile $SRC_NAME " if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then #wget https://zlib.net/${SRC_NAME}.${PACK_SUFIX} wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX} check_result "ERROR: download ${SRC_NAME} failure" if [ -d $LIB_NAME ] ; then pr_warn "$LIB_NAME fetch already" return ; fi tar -xzf ${SRC_NAME}.${PACK_SUFIX} cd ${SRC_NAME} if [ ! -f ${LIB_NAME}.${PACK_SUFIX} ] ; then wget ${LIB_URL}/${LIB_NAME}.${PACK_SUFIX} check_result "ERROR: download ${LIB_NAME} failure" fi ./configure --prefix=${PREFIX_PATH} check_result "ERROR: configure ${SRC_NAME} failure" make && make install check_result "ERROR: compile ${SRC_NAME} failure" cd - do_unpack ${LIB_NAME}.${PACK_SUFIX} } function do_build() { cd $LIB_NAME export_cross do_export compile_zlib ./configure --prefix=${PREFIX_PATH} check_result "ERROR: configure ${LIB_NAME} failure" make && make install check_result "ERROR: compile ${LIB_NAME} failure" } function do_clean() { rm -rf *${LIB_NAME}* } if [[ $# == 1 && $1 == -c ]] ;then pr_warn "start clean ${LIB_NAME}" do_clean exit; fi do_fetch do_build