Create 02_build.sh

This commit is contained in:
Michael McMahon 2017-11-13 17:23:47 -05:00 committed by GitHub
parent 0a16fc08bd
commit 4dedabf93d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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