moved scripts to subfolder
This commit is contained in:
56
static_binaries/build_static_busybox
Executable file
56
static_binaries/build_static_busybox
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage: ./build_static_busybox
|
||||
# or
|
||||
# bash build_static_busybox
|
||||
# Description: Download newest stable busybox release and
|
||||
# compiles a static binary
|
||||
# Author: Patrick Neumann (patrick@neumannsland.de)
|
||||
# Platform: Debian or Raspbian GNU/Linux (tested: 9.5)
|
||||
# Version: 1.0
|
||||
# Date: 06.07.2018
|
||||
# License: GPL3
|
||||
# Warranty: This program is distributed WITHOUT ANY WARRANTY
|
||||
|
||||
# autodetect arch:
|
||||
ARCH="$( /bin/uname --machine )"
|
||||
|
||||
# autodetect release or do it manualy:
|
||||
RELEASE="$( /usr/bin/curl --silent https://busybox.net/ \
|
||||
| /bin/grep --extended-regexp "BusyBox [[:digit:]]\.[[:digit:]]{1,2}\.[[:digit:]]{1,2} \(stable\)" \
|
||||
| /usr/bin/head --lines=1 \
|
||||
| /bin/grep --extended-regexp --only-matching "[[:digit:]]\.[[:digit:]]{1,2}\.[[:digit:]]{1,2}" )"
|
||||
#RELEASE="1.28.4"
|
||||
/usr/bin/test -n "${RELEASE}" || ( echo "Release detection failed - please edit script manually" ; exit 1 )
|
||||
|
||||
# dependencies (static libs):
|
||||
if [ ! -f /usr/share/build-essential/list ] ; then /usr/bin/sudo /usr/bin/apt install build-essential --assume-yes ; fi
|
||||
if [ ! -f /usr/lib/*-linux-gnu*/libc.a ] ; then /usr/bin/sudo /usr/bin/apt install libc6-dev --assume-yes ; fi
|
||||
|
||||
# downloading...
|
||||
/usr/bin/wget http://busybox.net/downloads/busybox-${RELEASE}.tar.bz2
|
||||
|
||||
# extracting...
|
||||
/bin/tar xjf busybox-${RELEASE}.tar.bz2
|
||||
|
||||
# compiling (and stripping)...
|
||||
cd busybox-${RELEASE}
|
||||
/usr/bin/make defconfig
|
||||
/bin/sed --expression='s/.*FEATURE_PREFER_APPLETS.*/CONFIG_FEATURE_PREFER_APPLETS=y/' --in-place .config
|
||||
/bin/sed --expression='s/.*FEATURE_SH_STANDALONE.*/CONFIG_FEATURE_SH_STANDALONE=y/' --in-place .config
|
||||
/bin/sed --expression='s/.*FEATURE_EDITING_SAVEHISTORY.*/# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set/' --in-place .config
|
||||
/bin/sed --expression='s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' --in-place .config
|
||||
/usr/bin/make
|
||||
|
||||
# rename binary:
|
||||
BINARY="busybox-${ARCH}-${RELEASE}"
|
||||
/bin/mv busybox "${BINARY}"
|
||||
|
||||
# final instructions:
|
||||
echo
|
||||
echo "Ready to copy:"
|
||||
echo
|
||||
echo " cp ${PWD}/${BINARY} /media/POLICE/"
|
||||
echo
|
||||
|
||||
exit 0
|
65
static_binaries/build_static_dropbear
Executable file
65
static_binaries/build_static_dropbear
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage: ./build_static_dropbear
|
||||
# or
|
||||
# bash build_static_dropbear
|
||||
# Description: Download newest stable dropbear release and
|
||||
# compiles static binaries (client, server and scp)
|
||||
# Author: Patrick Neumann (patrick@neumannsland.de)
|
||||
# Platform: Debian or Raspbian GNU/Linux (tested: 9.5)
|
||||
# Version: 1.0
|
||||
# Date: 06.07.2018
|
||||
# License: GPL3
|
||||
# Warranty: This program is distributed WITHOUT ANY WARRANTY
|
||||
|
||||
# autodetect arch:
|
||||
ARCH="$( /bin/uname --machine )"
|
||||
|
||||
# autodetect release or do it manualy:
|
||||
RELEASE="$( /usr/bin/curl --silent https://matt.ucc.asn.au/dropbear/dropbear.html \
|
||||
| /bin/grep --extended-regexp "Latest is [[:digit:]]{4}\.[[:digit:]]{1,3}" \
|
||||
| /bin/grep --extended-regexp --only-matching "[[:digit:]]{4}\.[[:digit:]]{1,3}" )"
|
||||
#RELEASE="2018.76"
|
||||
/usr/bin/test -n "${RELEASE}" || ( echo "Release detection failed - please edit script manually" ; exit 1 )
|
||||
|
||||
# dependencies (static libs):
|
||||
if [ ! -f /usr/share/build-essential/list ] ; then /usr/bin/sudo /usr/bin/apt install build-essential --assume-yes ; fi
|
||||
if [ ! -f /usr/lib/*-linux-gnu*/libc.a ] ; then /usr/bin/sudo /usr/bin/apt install libc6-dev --assume-yes ; fi
|
||||
if [ ! -f /usr/lib/*-linux-gnu*/zlib.a ] ; then /usr/bin/sudo /usr/bin/apt install zlib1g-dev --assume-yes ; fi
|
||||
|
||||
# downloading...
|
||||
/usr/bin/wget https://matt.ucc.asn.au/dropbear/releases/dropbear-${RELEASE}.tar.bz2
|
||||
|
||||
# extracting...
|
||||
/bin/tar xjf dropbear-${RELEASE}.tar.bz2
|
||||
|
||||
# compiling and stripping...
|
||||
cd dropbear-${RELEASE}
|
||||
./configure --enable-static \
|
||||
--disable-syslog \
|
||||
--disable-lastlog \
|
||||
--disable-utmp \
|
||||
--disable-utmpx \
|
||||
--disable-wtmp \
|
||||
--disable-wtmpx
|
||||
/usr/bin/make PROGRAMS="dropbear dbclient scp"
|
||||
/usr/bin/make strip
|
||||
|
||||
# rename binary:
|
||||
BINARY1="dbclient-${ARCH}-${RELEASE}"
|
||||
/bin/mv dbclient "${BINARY1}"
|
||||
BINARY2="scp-${ARCH}-${RELEASE}"
|
||||
/bin/mv scp "${BINARY2}"
|
||||
BINARY3="dropbear-${ARCH}-${RELEASE}"
|
||||
/bin/mv dropbear "${BINARY3}"
|
||||
|
||||
# final instructions:
|
||||
echo
|
||||
echo "Ready to copy:"
|
||||
echo
|
||||
echo " cp $PWD/${BINARY1} /media/POLICE/"
|
||||
echo " cp $PWD/${BINARY2} /media/POLICE/"
|
||||
echo " cp $PWD/${BINARY3} /media/POLICE/"
|
||||
echo
|
||||
|
||||
exit 0
|
51
static_binaries/build_static_rsync
Executable file
51
static_binaries/build_static_rsync
Executable file
@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage: ./build_static_rsync
|
||||
# or
|
||||
# bash build_static_rsync
|
||||
# Description: Download newest stable rsync release and
|
||||
# compiles a static binary
|
||||
# Author: Patrick Neumann (patrick@neumannsland.de)
|
||||
# Platform: Debian or Raspbian GNU/Linux (tested: 9.5)
|
||||
# Version: 1.0
|
||||
# Date: 06.07.2018
|
||||
# License: GPL3
|
||||
# Warranty: This program is distributed WITHOUT ANY WARRANTY
|
||||
|
||||
# autodetect arch:
|
||||
ARCH="$( /bin/uname --machine )"
|
||||
|
||||
# autodetect release or do it manualy:
|
||||
RELEASE="$( /usr/bin/curl -s https://rsync.samba.org/ \
|
||||
| /bin/grep -E "Rsync version [[:digit:]]\.[[:digit:]]{1,2}\.[[:digit:]]{1,2} released" \
|
||||
| /usr/bin/head -n 1 \
|
||||
| /bin/grep -o -E "[[:digit:]]\.[[:digit:]]{1,2}\.[[:digit:]]{1,2}" )"
|
||||
#VERSION="3.1.3"
|
||||
/usr/bin/test -n "${RELEASE}" || ( echo "Release detection failed - please edit script manually" ; exit 1 )
|
||||
|
||||
# dependencies (static libs):
|
||||
if [ ! -f /usr/share/build-essential/list ] ; then /usr/bin/sudo /usr/bin/apt install build-essential --assume-yes ; fi
|
||||
if [ ! -f /usr/lib/*-linux-gnu*/libc.a ] ; then /usr/bin/sudo /usr/bin/apt install libc6-dev --assume-yes ; fi
|
||||
if [ ! -f /usr/lib/*-linux-gnu*/libpopt.a ] ; then /usr/bin/sudo /usr/bin/apt install libpopt-dev --assume-yes ; fi
|
||||
if [ ! -f /usr/bin/yodl2man ] ; then /usr/bin/sudo /usr/bin/apt install yodl --assume-yes ; fi
|
||||
|
||||
# downloading...
|
||||
/usr/bin/wget https://download.samba.org/pub/rsync/rsync-${RELEASE}.tar.gz
|
||||
|
||||
# extracting...
|
||||
/bin/tar xzf rsync-${RELEASE}.tar.gz
|
||||
|
||||
# compiling and stripping...
|
||||
cd rsync-${RELEASE}/
|
||||
./configure
|
||||
/usr/bin/make CFLAGS="-I./popt -I./zlib -static" EXEEXT="-${ARCH}-${RELEASE}"
|
||||
/usr/bin/strip rsync-${ARCH}-${RELEASE}
|
||||
|
||||
# final instructions:
|
||||
echo
|
||||
echo "Ready to copy:"
|
||||
echo
|
||||
echo " cp $PWD/rsync-${ARCH}-${RELEASE} /media/POLICE/"
|
||||
echo
|
||||
|
||||
exit 0
|
52
static_binaries/cross_build_static_busybox_for_arm
Executable file
52
static_binaries/cross_build_static_busybox_for_arm
Executable file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage: ./cross_build_static_busybox_for_arm
|
||||
# or
|
||||
# bash cross_build_static_busybox_for_arm
|
||||
# Description: Download newest stable busybox release and
|
||||
# compiles a static binary for arm
|
||||
# Author: Patrick Neumann (patrick@neumannsland.de)
|
||||
# Platform: Debian or Raspbian GNU/Linux (tested: 9.5)
|
||||
# Version: 1.0
|
||||
# Date: 06.07.2018
|
||||
# License: GPL3
|
||||
# Warranty: This program is distributed WITHOUT ANY WARRANTY
|
||||
|
||||
# autodetect release or do it manualy:
|
||||
RELEASE="$( /usr/bin/curl --silent https://busybox.net/ \
|
||||
| /bin/grep --extended-regexp "BusyBox [[:digit:]]\.[[:digit:]]{1,2}\.[[:digit:]]{1,2} \(stable\)" \
|
||||
| /usr/bin/head --lines=1 \
|
||||
| /bin/grep --extended-regexp --only-matching "[[:digit:]]\.[[:digit:]]{1,2}\.[[:digit:]]{1,2}" )"
|
||||
#RELEASE="1.29.2"
|
||||
/usr/bin/test -n "${RELEASE}" || ( echo "Release detection failed - please edit script manually" ; exit 1 )
|
||||
|
||||
# dependencies:
|
||||
/usr/bin/sudo /usr/bin/apt install gcc-arm-linux-gnueabihf libncurses5 libncurses5-dev --assume-yes
|
||||
|
||||
# downloading...
|
||||
/usr/bin/wget http://busybox.net/downloads/busybox-${RELEASE}.tar.bz2
|
||||
|
||||
# extracting...
|
||||
/bin/tar xjf busybox-${RELEASE}.tar.bz2
|
||||
|
||||
# compiling (and stripping)...
|
||||
cd busybox-${RELEASE}/
|
||||
/usr/bin/make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig
|
||||
/bin/sed --expression='s/.*FEATURE_PREFER_APPLETS.*/CONFIG_FEATURE_PREFER_APPLETS=y/' --in-place .config
|
||||
/bin/sed --expression='s/.*FEATURE_SH_STANDALONE.*/CONFIG_FEATURE_SH_STANDALONE=y/' --in-place .config
|
||||
/bin/sed --expression='s/.*FEATURE_EDITING_SAVEHISTORY.*/# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set/' --in-place .config
|
||||
/bin/sed --expression='s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' --in-place .config
|
||||
/usr/bin/make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
|
||||
|
||||
# rename binary:
|
||||
BINARY="busybox-arm-${RELEASE}"
|
||||
/bin/mv busybox "${BINARY}"
|
||||
|
||||
# final instructions:
|
||||
echo
|
||||
echo "Ready to copy:"
|
||||
echo
|
||||
echo " cp ${PWD}/${BINARY} /media/POLICE/"
|
||||
echo
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user