From 25a1cb19b213f7825fcc080a29991beeb70f6b93 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Mon, 16 Apr 2018 00:51:48 -0400 Subject: It works! A getty now spawns on the serial console on boot Todo: DNS resolution doesn't work yet. DHCP for eth0? SSH server? `tmux`? ------- Added busybox config Switched the pathing around yet again in the `inc` file Added `local` files to be copied into the prefix before creating the tarball ( TODO ) Added tree command to the build Install runit --- scripts/build.sh | 4 +--- scripts/busybox.sh | 14 ++++++++++++++ scripts/linux.sh | 2 +- scripts/musl.sh | 2 +- scripts/runit.sh | 7 +++++++ scripts/tree.sh | 22 ++++++++++++++++++++++ scripts/uClibc-ng.sh | 12 ++++++++++++ scripts/vim.sh | 2 +- 8 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 scripts/busybox.sh create mode 100644 scripts/tree.sh create mode 100644 scripts/uClibc-ng.sh (limited to 'scripts') diff --git a/scripts/build.sh b/scripts/build.sh index 9daae79..c2c96b4 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -3,10 +3,8 @@ shell="/bin/sh" set -e $shell scripts/musl.sh $shell scripts/mksh.sh -$shell scripts/sbase.sh -$shell scripts/ubase.sh $shell scripts/linux.sh -$shell scripts/sinit.sh $shell scripts/ncurses.sh $shell scripts/vim.sh +$shell scripts/busybox.sh # $shell scripts/grub.sh diff --git a/scripts/busybox.sh b/scripts/busybox.sh new file mode 100644 index 0000000..1fcbdd3 --- /dev/null +++ b/scripts/busybox.sh @@ -0,0 +1,14 @@ +#!/bin/sh +. ./.vars +VERSION=1.28.3 +BUILD_DIR="$build_dir/busybox-$VERSION" +cd $build_dir +if ! [ -d "$BUILD_DIR" ] ; then + bunzip2 -dc < $dist_dir/busybox-$VERSION.tar.bz2 | tar -xvf - +fi +cd $BUILD_DIR +if ! [ -e ./.config ] ; then + cp "${base_dir}/busybox-config" ./.config +fi +make -j$(nproc) +make install diff --git a/scripts/linux.sh b/scripts/linux.sh index bbb0477..d701216 100644 --- a/scripts/linux.sh +++ b/scripts/linux.sh @@ -12,7 +12,7 @@ if ! [ -e ./.config ] ; then fi if ! [ -f "$KERNEL_TAR_PKG" ] ; then make olddefconfig - make -j8 bzImage modules + make -j$(nproc) bzImage modules make tar-pkg fi cd "$prefix" diff --git a/scripts/musl.sh b/scripts/musl.sh index 0da3128..ed6d1bb 100644 --- a/scripts/musl.sh +++ b/scripts/musl.sh @@ -4,7 +4,7 @@ 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 +./configure --prefix=$prefix/usr/local/musl # --enable-static make -j$(nproc) make install diff --git a/scripts/runit.sh b/scripts/runit.sh index 39bcbaa..2552250 100644 --- a/scripts/runit.sh +++ b/scripts/runit.sh @@ -11,8 +11,15 @@ if ! [ -d "$BUILD_DIR" ] ; then fi cd "$BUILD_DIR/src" export CC=musl-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 make +echo "Done Building" +for ex in runit-init runit runsvdir runsv sv svlogd utmpset ; do + _dest="$prefix/sbin/$ex" + if [ -e "$_dest" ] ; then rm -f "$dest" ; fi + install -m 555 "$ex" "$_dest" +done diff --git a/scripts/tree.sh b/scripts/tree.sh new file mode 100644 index 0000000..ee2d61b --- /dev/null +++ b/scripts/tree.sh @@ -0,0 +1,22 @@ +#!/bin/sh +. ./.vars +export DESTDIR=$prefix +VERSION=1.7.0 +APP_NAME="tree" +BUILD_DIR="${build_dir}/$APP_NAME-$VERSION" +if ! [ -d "$BUILD_DIR" ] ; then + cd "$build_dir" + 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' \ + -e"s@^prefix.*\$@prefix = $prefix/usr@g" \ + < Makefile.bak > Makefile +rm Makefile.bak +make clean || echo "" > /dev/null +make +make install diff --git a/scripts/uClibc-ng.sh b/scripts/uClibc-ng.sh new file mode 100644 index 0000000..6c910aa --- /dev/null +++ b/scripts/uClibc-ng.sh @@ -0,0 +1,12 @@ +#!/bin/sh +. ./.vars +VERSION=1.0.29 +APP_NAME="uClibc-ng" +BUILD_DIR="$build_dir/$APP_NAME-$VERSION" +cd $build_dir +if ! [ -d "$BUILD_DIR" ] ; then + xz -dc < $dist_dir/$APP_NAME-$VERSION.tar.bz2 | tar -xvf - +fi +cd "$BUILD_DIR" +export CLFAGS="-I$prefix/usr/include" +export LDFLAGS="-L$prefix/usr/include" diff --git a/scripts/vim.sh b/scripts/vim.sh index 7fbcbb6..e2b4d14 100644 --- a/scripts/vim.sh +++ b/scripts/vim.sh @@ -5,7 +5,7 @@ VERSION=8.0.1298 BUILD_DIR="${build_dir}/vim-$VERSION" if ! [ -d "$BUILD_DIR" ] ; then cd "$build_dir" - tar xfjv ${dist_dir}/vim-$VERSION.tar.bz2 + tar xfzv ${dist_dir}/vim-$VERSION.tar.gz fi cd "${build_dir}/vim-$VERSION" export CC=musl-gcc -- cgit v1.2.3