diff --git a/src/minimal_overlay/bundles/nano/02_build.sh b/src/minimal_overlay/bundles/nano/02_build.sh new file mode 100644 index 000000000..b63a4208a --- /dev/null +++ b/src/minimal_overlay/bundles/nano/02_build.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/nano + +DESTDIR="$PWD/nano_installed" + +# Change to the nano source directory which ls finds, e.g. 'nano-2.8.7'. +cd $(ls -d nano-*) + +echo "Preparing nano work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Configuring nano..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + --disable-utf8 \ + CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" + +echo "Building nano..." +make -j $NUM_JOBS + +echo "Installing nano..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Reducing nano size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/* $ROOTFS + +echo "nano has been installed." + +cd $SRC_DIR