diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2018-04-22 12:33:52 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2018-04-22 12:33:52 -0400 |
| commit | 4b1cd7ad1e1463a45b444d066b49574a9b6ad04a (patch) | |
| tree | d8d86e9f86827f5f6ea4fe68f5aece99fa78173c | |
| parent | db54ef567f4c724299ad1830d574052170247e04 (diff) | |
| download | min-4b1cd7ad1e1463a45b444d066b49574a9b6ad04a.tar.gz min-4b1cd7ad1e1463a45b444d066b49574a9b6ad04a.tar.xz | |
Sweeping changes, switching to musl-cross-make
Updated busybox-config to reflect the toolchain change
Nginx and Openssh build and are now apart of the system.
Runit is included, still need to install configuration files
| -rw-r--r-- | busybox-config | 6 | ||||
| -rw-r--r-- | inc | 10 | ||||
| -rw-r--r-- | scripts/build.sh | 3 | ||||
| -rw-r--r-- | scripts/coreutils.sh | 21 | ||||
| -rw-r--r-- | scripts/dump_needed.sh | 2 | ||||
| -rw-r--r-- | scripts/find_dynamic.sh | 3 | ||||
| -rw-r--r-- | scripts/libressl.sh | 12 | ||||
| -rw-r--r-- | scripts/mksh.sh | 1 | ||||
| -rw-r--r-- | scripts/musl.sh | 2 | ||||
| -rw-r--r-- | scripts/ncurses.sh | 6 | ||||
| -rw-r--r-- | scripts/nginx.sh | 34 | ||||
| -rw-r--r-- | scripts/openssh.sh | 21 | ||||
| -rw-r--r-- | scripts/runit.sh | 6 | ||||
| -rw-r--r-- | scripts/tree.sh | 3 | ||||
| -rw-r--r-- | scripts/vim.sh | 8 | ||||
| -rw-r--r-- | scripts/zlib.sh | 6 | ||||
| -rw-r--r-- | sources.lst | 1 |
17 files changed, 115 insertions, 30 deletions
diff --git a/busybox-config b/busybox-config index 8268c9a..06ae0b6 100644 --- a/busybox-config +++ b/busybox-config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Busybox version: 1.28.0 -# Sun Apr 15 15:39:18 2018 +# Busybox version: 1.28.3 +# Sat Apr 21 08:32:56 2018 # CONFIG_HAVE_DOT_CONFIG=y @@ -46,7 +46,7 @@ CONFIG_STATIC=y # CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set # CONFIG_FEATURE_INDIVIDUAL is not set # CONFIG_FEATURE_SHARED_BUSYBOX is not set -CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_CROSS_COMPILER_PREFIX="x86_64-linux-musl-" CONFIG_SYSROOT="" CONFIG_EXTRA_CFLAGS="" CONFIG_EXTRA_LDFLAGS="" @@ -13,5 +13,11 @@ if ! [ -d $prefix ] ; then mkdir $prefix; fi # Reset our PATH . /etc/profile -# PATH="$prefix/usr/local/musl/bin:$prefix/usr/sbin:$prefix/usr/bin:$prefix/bin:$prefix/sbin:${PATH}" -PATH="${PATH}:$prefix/usr/local/musl/bin:$prefix/usr/sbin:$prefix/usr/bin:$prefix/bin:$prefix/sbin" +export BUILD_TGT="x86_64-linux-musl" + +PATH="$prefix/usr/local/musl/bin:$prefix/usr/sbin:$prefix/usr/bin:$prefix/bin:$prefix/sbin:${PATH}" +# PATH="${PATH}:$prefix/usr/local/musl/bin:$prefix/usr/sbin:$prefix/usr/bin:$prefix/bin:$prefix/sbin" + +PATH="$base_dir/$BUILD_TGT/bin:$base_dir/toolchain/bin:$prefix/usr/local/musl/bin:$prefix/usr/sbin:$prefix/usr/bin:$prefix/bin:$prefix/sbin:${PATH}" + +# export CC=${DEST}cc diff --git a/scripts/build.sh b/scripts/build.sh index 6d162a6..da3ea68 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -10,4 +10,7 @@ $shell scripts/busybox.sh $shell scripts/tree.sh $shell scripts/zlib.sh $shell scripts/libressl.sh +$shell scripts/openssh.sh +$shell scripts/nginx.sh +$shell scripts/runit.sh # $shell scripts/grub.sh diff --git a/scripts/coreutils.sh b/scripts/coreutils.sh new file mode 100644 index 0000000..1df321f --- /dev/null +++ b/scripts/coreutils.sh @@ -0,0 +1,21 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=8.29 +APP_NAME="coreutils" +BUILD_DIR="${build_dir}/$APP_NAME-$VERSION" +if ! [ -d "$BUILD_DIR" ] ; then + cd "$build_dir" + tar xfJv ${dist_dir}/$APP_NAME-$VERSION.tar.xz +fi +cd "$BUILD_DIR" +# export CC=musl-gcc +# export CFLAGS="-static -I$prefix/usr/include" +# export LDFLAGS="-static -L$prefix/usr/lib" +export DESTDIR="$prefix" +./configure --prefix=/ \ + --with-sysroot="$prefix" \ + --with-lib-path="$prefix/lib" \ + --disable-werror +make -j$(nproc) +make install diff --git a/scripts/dump_needed.sh b/scripts/dump_needed.sh new file mode 100644 index 0000000..e36f1fa --- /dev/null +++ b/scripts/dump_needed.sh @@ -0,0 +1,2 @@ +#!/bin/sh +objdump -x "$1" | grep NEEDED diff --git a/scripts/find_dynamic.sh b/scripts/find_dynamic.sh new file mode 100644 index 0000000..d538079 --- /dev/null +++ b/scripts/find_dynamic.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +find "$1" -type f -perm -100 -exec file {} \; | grep dynamic diff --git a/scripts/libressl.sh b/scripts/libressl.sh index 8706f93..ed330e0 100644 --- a/scripts/libressl.sh +++ b/scripts/libressl.sh @@ -9,11 +9,13 @@ if ! [ -d "$BUILD_DIR" ] ; then tar xfzv ${dist_dir}/$APP_NAME-$VERSION.tar.gz fi cd "$BUILD_DIR" -# export CC=musl-gcc -# export CFLAGS="-static -I$prefix/usr/include" -# export LDFLAGS="-static -L$prefix/usr/lib" +export CFLAGS="-static -I$prefix/usr/include" +export LDFLAGS="-static -L$prefix/usr/lib" export DESTDIR="$prefix" -make clean -./configure --prefix=/usr +make clean || echo "" +./configure --prefix=/usr \ + --host=$BUILD_TGT \ + --with-sysroot=$prefix \ + --enable-static=yes make -j$(nproc) make install diff --git a/scripts/mksh.sh b/scripts/mksh.sh index 6b29362..992df11 100644 --- a/scripts/mksh.sh +++ b/scripts/mksh.sh @@ -5,7 +5,6 @@ cd $build_dir gzip -dc < ${dist_dir}/mksh-$VERSION.tgz | tar -xvf - cd mksh export LDFLAGS="-static" -export CC="musl-gcc" sh ./Build.sh install -d $prefix/bin install -m 555 mksh $prefix/bin/sh diff --git a/scripts/musl.sh b/scripts/musl.sh index 24cd9d1..d8a2912 100644 --- a/scripts/musl.sh +++ b/scripts/musl.sh @@ -7,7 +7,7 @@ cd musl-$VERSION MUSL_OPTS="--enable-static --enable-shared" ./configure --prefix=$prefix/usr/local/musl $MUSL_OPTS make -j$(nproc) -make install +# make install export DESTDIR=$prefix ./configure --prefix=/usr $MUSL_OPTS diff --git a/scripts/ncurses.sh b/scripts/ncurses.sh index b6b340e..3f12d93 100644 --- a/scripts/ncurses.sh +++ b/scripts/ncurses.sh @@ -8,10 +8,12 @@ if ! [ -d "$BUILD_DIR" ] ; then tar xfzv ${dist_dir}/ncurses-$VERSION.tar.gz fi cd "${build_dir}/ncurses-$VERSION" -export CC=musl-gcc export CLFAGS="-I$prefix/usr/include" export LDFLAGS="-static -L$prefix/usr/include" export DESTDIR="$prefix" -./configure --prefix=/usr --enable-static +./configure \ + --host=$BUILD_TGT \ + --prefix=/usr \ + --enable-static make -j$(numproc) make install diff --git a/scripts/nginx.sh b/scripts/nginx.sh new file mode 100644 index 0000000..5035a19 --- /dev/null +++ b/scripts/nginx.sh @@ -0,0 +1,34 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +ZLIB=zlib-1.2.11 +VERSION=1.14.0 +APP_NAME="nginx" +BUILD_DIR="${build_dir}/$APP_NAME-$VERSION" +if ! [ -d "$BUILD_DIR" ] ; then + cd "$build_dir" + tar xfzv ${dist_dir}/$APP_NAME-$VERSION.tar.gz +fi +cd "$BUILD_DIR" +# export CC=${BUILD_TGT}-gcc +export CFLAGS="-static -I$prefix/usr/include" +export LDFLAGS="-static -L$prefix/usr/lib" +export DESTDIR="$prefix" +make clean || echo "" +./configure --prefix=/usr \ + --without-pcre \ + --conf-path="/etc/nginx/nginx.conf" \ + --error-log-path="/var/log/nginx.error.log" \ + --http-log-path="/var/log/nginx.access.log" \ + --pid-path="/var/log/nginx.pid" \ + --without-http_rewrite_module \ + --with-openssl=$prefix/usr/include/openssl \ + --with-zlib=$build_dir/$ZLIB +cp objs/Makefile objs/Makefile.bak +sed -e"s/^CC =.*$/CC = ${BUILD_TGT}-gcc/g" \ + -e"s/^CPP =.*$/CPP = ${BUILD_TGT}-g++/g" \ + -e'1aLDFLAGS = -static' \ + objs/Makefile.bak > objs/Makefile +make -j$(nproc) +# make +make install diff --git a/scripts/openssh.sh b/scripts/openssh.sh index 8ab8397..78e814f 100644 --- a/scripts/openssh.sh +++ b/scripts/openssh.sh @@ -8,13 +8,20 @@ if ! [ -d "$BUILD_DIR" ] ; then tar xfzv ${dist_dir}/openssh-$VERSION.tar.gz fi cd "$BUILD_DIR" -export CC=musl-gcc +# export CC=gcc export CFLAGS="-I$prefix/usr/include" -export CPPFLAGS="$CFLAGS" -export CXXFLAGS="$CFLAGS" -export LDFLAGS="-static -L$prefix/usr/lib/ -L$prefix/usr/include" +# export CPPFLAGS="$CFLAGS" +# export CXXFLAGS="$CFLAGS" +export LDFLAGS="-static -L$prefix/usr/lib/" export DESTDIR="$prefix" -./configure --prefix=/usr # --enable-static -# make -j$(numproc) -# make install +rm config.log || echo "" +make clean || echo "" +./configure \ + --host=$BUILD_TGT \ + --prefix=/usr \ + --without-openssl +cp Makefile Makefile.bak +sed -e"s@^DESTDIR.*\$@DESTDIR = $prefix@g" Makefile.bak > Makefile +make -j$(numproc) +make install-nokeys diff --git a/scripts/runit.sh b/scripts/runit.sh index 2552250..aa29fee 100644 --- a/scripts/runit.sh +++ b/scripts/runit.sh @@ -10,12 +10,12 @@ if ! [ -d "$BUILD_DIR" ] ; then rmdir admin fi cd "$BUILD_DIR/src" -export CC=musl-gcc +export CC=$BUILD_TGT-gcc # busybox will handle this for us export LDFLAGS="-static" export DESTDIR="$prefix" -echo "musl-gcc -O2 -Wall $CFLAGS" > conf-cc -echo "musl-gcc -s $LDFLAGS" > conf-ld +echo "$BUILD_TGT-gcc -O2 -Wall $CFLAGS" > conf-cc +echo "$BUILD_TGT-gcc -s $LDFLAGS" > conf-ld make echo "Done Building" for ex in runit-init runit runsvdir runsv sv svlogd utmpset ; do diff --git a/scripts/tree.sh b/scripts/tree.sh index ee2d61b..7f804cf 100644 --- a/scripts/tree.sh +++ b/scripts/tree.sh @@ -9,11 +9,10 @@ if ! [ -d "$BUILD_DIR" ] ; then tar xfzv ${dist_dir}/$APP_NAME-$VERSION.tgz fi cd "$BUILD_DIR" -export CC=musl-gcc export LDFLAGS="-static" export DESTDIR="$prefix" cp Makefile Makefile.bak -sed -e's/^CC.*$/CC = musl-gcc/g' \ +sed -e's/^CC.*$/CC = gcc/g' \ -e"s@^prefix.*\$@prefix = $prefix/usr@g" \ < Makefile.bak > Makefile rm Makefile.bak diff --git a/scripts/vim.sh b/scripts/vim.sh index 5e401ac..cf611f9 100644 --- a/scripts/vim.sh +++ b/scripts/vim.sh @@ -8,10 +8,14 @@ if ! [ -d "$BUILD_DIR" ] ; then tar xfjv ${dist_dir}/vim-$VERSION.tar.bz2 fi cd "$BUILD_DIR" -export CC=musl-gcc export LDFLAGS="-static" export DESTDIR="$prefix" make distclean || echo "" -./configure --prefix=/usr --with-tlib=ncurses --with-local-dir=$prefix/usr +./configure --prefix=/usr \ + --host=$BUILD_TGT \ + --with-tlib=ncurses \ + --enable-gui=no \ + --without-x \ + --with-local-dir=$prefix/usr make -j$(numproc) make install diff --git a/scripts/zlib.sh b/scripts/zlib.sh index 070076f..2215fd1 100644 --- a/scripts/zlib.sh +++ b/scripts/zlib.sh @@ -9,11 +9,13 @@ if ! [ -d "$BUILD_DIR" ] ; then tar xfzv ${dist_dir}/$APP_NAME-$VERSION.tar.gz fi cd "$BUILD_DIR" -export CC=musl-gcc +export CC="gcc" export CFLAGS="-static" export DESTDIR="$prefix" export LDFLAGS="-static" -./configure --prefix=/usr --static +./configure \ + --prefix=/usr \ + --static make -j$(numproc) make install diff --git a/sources.lst b/sources.lst index ee7e7e0..dbe2330 100644 --- a/sources.lst +++ b/sources.lst @@ -12,3 +12,4 @@ https://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz https://www.zlib.net/zlib-1.2.11.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.2.tar.gz https://www.openssl.org/source/openssl-1.0.2o.tar.gz +http://nginx.org/download/nginx-1.14.0.tar.gz |
