diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2018-04-19 00:11:14 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2018-04-19 00:11:14 -0400 |
| commit | 38de9074ff1effefa08bfc71471a97cd0658c10c (patch) | |
| tree | 23a2d9b90c4e6fc8136ea05daa697cc36a94ca9c | |
| parent | 25a1cb19b213f7825fcc080a29991beeb70f6b93 (diff) | |
| download | min-38de9074ff1effefa08bfc71471a97cd0658c10c.tar.gz min-38de9074ff1effefa08bfc71471a97cd0658c10c.tar.xz | |
Attempts to build zlib, libressl, dropbear, and...
openssh with musl using the host's toolchain.
I'm going to be moving to a toolchain specific to this
system.
Also changed how the kernel is installed, so it makes more sense.
Fixed missing sources for many projects
| -rw-r--r-- | readme.md | 6 | ||||
| -rw-r--r-- | scripts/build.sh | 3 | ||||
| -rw-r--r-- | scripts/dropbear.sh | 17 | ||||
| -rw-r--r-- | scripts/get_sources.sh | 2 | ||||
| -rw-r--r-- | scripts/libressl.sh | 19 | ||||
| -rw-r--r-- | scripts/linux.sh | 21 | ||||
| -rw-r--r-- | scripts/musl.sh | 9 | ||||
| -rw-r--r-- | scripts/openssh.sh | 20 | ||||
| -rw-r--r-- | scripts/openssl.sh | 18 | ||||
| -rw-r--r-- | scripts/php.sh | 17 | ||||
| -rw-r--r-- | scripts/vim.sh | 8 | ||||
| -rw-r--r-- | scripts/zlib.sh | 19 | ||||
| -rw-r--r-- | sources.lst | 7 |
13 files changed, 151 insertions, 15 deletions
@@ -42,3 +42,9 @@ just too tedious and boring for me, I'd rather do something different. Run `scripts/get_sources.sh` and then `scripts/build.sh` It's rather important to run them from the `min` directory so the paths and imports will be correct. + + +## Todo: + +Build `busybox` with `musl` libc +Build `ibressl` with `musl` libc diff --git a/scripts/build.sh b/scripts/build.sh index c2c96b4..6d162a6 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -7,4 +7,7 @@ $shell scripts/linux.sh $shell scripts/ncurses.sh $shell scripts/vim.sh $shell scripts/busybox.sh +$shell scripts/tree.sh +$shell scripts/zlib.sh +$shell scripts/libressl.sh # $shell scripts/grub.sh diff --git a/scripts/dropbear.sh b/scripts/dropbear.sh new file mode 100644 index 0000000..69e5fa3 --- /dev/null +++ b/scripts/dropbear.sh @@ -0,0 +1,17 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=2018.76 +BUILD_DIR="${build_dir}/dropbear-$VERSION" +if ! [ -d "$BUILD_DIR" ] ; then + cd "$build_dir" + tar xfjv ${dist_dir}/dropbear-$VERSION.tar.bz2 +fi +cd "$BUILD_DIR" +export CC=musl-gcc +export DESTDIR="$prefix" +export LDFLAGS="-static" +./configure --prefix=/usr # --enable-static +make -j$(numproc) +make install + diff --git a/scripts/get_sources.sh b/scripts/get_sources.sh index 45a834a..6bdc623 100644 --- a/scripts/get_sources.sh +++ b/scripts/get_sources.sh @@ -2,6 +2,8 @@ . ./.vars cd ${dist_dir} wget -i ${base_dir}/sources.lst +# Because otherwise it's saved as 'mirror'... *sigh* +wget -O php-7.2.4.tar.xz http://us3.php.net/get/php-7.2.4.tar.xz/from/this/mirror git clone git://git.suckless.org/sbase git clone git://git.suckless.org/ubase git clone git://git.suckless.org/sinit diff --git a/scripts/libressl.sh b/scripts/libressl.sh new file mode 100644 index 0000000..8706f93 --- /dev/null +++ b/scripts/libressl.sh @@ -0,0 +1,19 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=2.7.2 +APP_NAME="libressl" +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=musl-gcc +# export CFLAGS="-static -I$prefix/usr/include" +# export LDFLAGS="-static -L$prefix/usr/lib" +export DESTDIR="$prefix" +make clean +./configure --prefix=/usr +make -j$(nproc) +make install diff --git a/scripts/linux.sh b/scripts/linux.sh index d701216..2bfedd8 100644 --- a/scripts/linux.sh +++ b/scripts/linux.sh @@ -10,10 +10,17 @@ cd "linux-$VERSION" if ! [ -e ./.config ] ; then cp "${base_dir}/kernel-config" ./.config fi -if ! [ -f "$KERNEL_TAR_PKG" ] ; then - make olddefconfig - make -j$(nproc) bzImage modules - make tar-pkg -fi -cd "$prefix" -tar -xvf - < "$KERNEL_TAR_PKG" + +for _p in $prefix/boot $prefix/usr/include $prefix/lib/modules ; do + if ! [ -d "$_p" ] ; then mkdir -p "$_p"; fi +done + +export INSTALL_PATH="$prefix/boot" +# export INSTALL_MOD_PATH="$prefix/lib/modules/\$(KERNELRELEASE)" +export INSTALL_MOD_PATH="$prefix" +export INSTALL_HDR_PATH="$prefix/usr" +make olddefconfig +make -j$(nproc) bzImage modules +make install +make modules_install +make headers_install INSTALL_HDR_PATH="$INSTALL_HDR_PATH" diff --git a/scripts/musl.sh b/scripts/musl.sh index ed6d1bb..24cd9d1 100644 --- a/scripts/musl.sh +++ b/scripts/musl.sh @@ -4,10 +4,11 @@ VERSION="1.1.19" cd $build_dir gzip -dc < ${dist_dir}/musl-$VERSION.tar.gz | tar -xvf - cd musl-$VERSION -./configure --prefix=$prefix/usr/local/musl # --enable-static +MUSL_OPTS="--enable-static --enable-shared" +./configure --prefix=$prefix/usr/local/musl $MUSL_OPTS make -j$(nproc) make install -# export DESTDIR=$prefix -# ./configure --prefix=/usr --enable-static -# make install +export DESTDIR=$prefix +./configure --prefix=/usr $MUSL_OPTS +make install diff --git a/scripts/openssh.sh b/scripts/openssh.sh new file mode 100644 index 0000000..8ab8397 --- /dev/null +++ b/scripts/openssh.sh @@ -0,0 +1,20 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=7.7p1 +BUILD_DIR="${build_dir}/openssh-$VERSION" +if ! [ -d "$BUILD_DIR" ] ; then + cd "$build_dir" + tar xfzv ${dist_dir}/openssh-$VERSION.tar.gz +fi +cd "$BUILD_DIR" +export CC=musl-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 DESTDIR="$prefix" +./configure --prefix=/usr # --enable-static +# make -j$(numproc) +# make install + diff --git a/scripts/openssl.sh b/scripts/openssl.sh new file mode 100644 index 0000000..b739989 --- /dev/null +++ b/scripts/openssl.sh @@ -0,0 +1,18 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=1.0.2o +APP_NAME="openssl" +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=musl-gcc +export CFLAGS="-static -I$prefix/usr/include -I$base_dir/build/linux-4.16.2/include" +export LDFLAGS="-static -L$prefix/usr/lib" +export DESTDIR="$prefix" +./configure --prefix=/usr --enable-shared=no +make -j$(nproc) +make install diff --git a/scripts/php.sh b/scripts/php.sh new file mode 100644 index 0000000..5e401ac --- /dev/null +++ b/scripts/php.sh @@ -0,0 +1,17 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=8.0.586 +BUILD_DIR="${build_dir}/vim80" +if ! [ -d "$BUILD_DIR" ] ; then + cd "$build_dir" + 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 +make -j$(numproc) +make install diff --git a/scripts/vim.sh b/scripts/vim.sh index e2b4d14..5e401ac 100644 --- a/scripts/vim.sh +++ b/scripts/vim.sh @@ -1,13 +1,13 @@ #!/bin/sh . ./.vars export DESTDIR=$prefix -VERSION=8.0.1298 -BUILD_DIR="${build_dir}/vim-$VERSION" +VERSION=8.0.586 +BUILD_DIR="${build_dir}/vim80" if ! [ -d "$BUILD_DIR" ] ; then cd "$build_dir" - tar xfzv ${dist_dir}/vim-$VERSION.tar.gz + tar xfjv ${dist_dir}/vim-$VERSION.tar.bz2 fi -cd "${build_dir}/vim-$VERSION" +cd "$BUILD_DIR" export CC=musl-gcc export LDFLAGS="-static" export DESTDIR="$prefix" diff --git a/scripts/zlib.sh b/scripts/zlib.sh new file mode 100644 index 0000000..070076f --- /dev/null +++ b/scripts/zlib.sh @@ -0,0 +1,19 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=1.2.11 +APP_NAME="zlib" +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=musl-gcc +export CFLAGS="-static" +export DESTDIR="$prefix" +export LDFLAGS="-static" +./configure --prefix=/usr --static +make -j$(numproc) +make install + diff --git a/sources.lst b/sources.lst index a1b7160..1f824fb 100644 --- a/sources.lst +++ b/sources.lst @@ -4,3 +4,10 @@ http://www.cs.princeton.edu/~bwk/btl.mirror/awk.tar.gz http://busybox.net/downloads/busybox-1.28.3.tar.bz2 https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.2.tar.xz http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz +https://invisible-mirror.net/archives/ncurses/ncurses-6.1.tar.gz +http://ftp.vim.org/pub/vim/unix/vim-8.0.586.tar.bz2 +https://matt.ucc.asn.au/dropbear/releases/dropbear-2018.76.tar.bz2 +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 |
