Add files via upload

This commit is contained in:
Michael McMahon 2017-11-09 13:08:47 -05:00 committed by GitHub
parent cc5c247762
commit be2d6604d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,41 @@
#!/bin/sh
SRC_DIR=$(pwd)
. ../../common.sh
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i UTIL_LINUX_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
# Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd $MAIN_SRC_DIR/source/overlay
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading util-linux source bundle file. The '-c' option allows the download to resume.
echo "Downloading util-linux source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL
else
echo "Using local util-linux source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted util-linux.
echo "Removing util-linux work area. This may take a while..."
rm -rf $WORK_DIR/overlay/util_linux
mkdir $WORK_DIR/overlay/util_linux
# Extract util-linux to folder 'work/overlay/util_linux'.
# Full path will be something like 'work/overlay/util_linux/util-linux-2.31'.
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/util_linux
cd $SRC_DIR

View File

@ -0,0 +1,46 @@
#!/bin/bash
SRC_DIR=$(pwd)
. ../../common.sh
cd $WORK_DIR/overlay/util_linux
DESTDIR="$PWD/util_linux_installed"
# Change to the util-linux source directory which ls finds, e.g. 'util-linux-2.31'.
cd $(ls -d util-linux-*)
echo "Preparing util-linux work area. This may take a while..."
make -j $NUM_JOBS clean
rm -rf $DESTDIR
echo "Configuring util-linux..."
CFLAGS="$CFLAGS" ./configure \
--prefix=/usr \
--disable-graphics \
--disable-utf8 \
--without-ipv6 \
--without-ssl \
--without-zlib \
--without-x
echo "Building util-linux..."
make -j $NUM_JOBS
echo "Installing util-linux..."
make -j $NUM_JOBS install DESTDIR=$DESTDIR
echo "Reducing util-linux size..."
strip -g $DESTDIR/usr/bin/*
ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs"
mkdir -p "$ROOTFS/usr/bin"
cp -r $DESTDIR/usr/bin/* $ROOTFS/usr/bin/
echo "util-linux has been installed."
cd $SRC_DIR

View File

@ -0,0 +1,9 @@
#!/bin/sh
SRC_DIR=$(pwd)
time sh 01_get.sh
time sh 02_build.sh
cd $SRC_DIR