Add files via upload
This commit is contained in:
parent
cc5c247762
commit
be2d6604d6
41
src/minimal_overlay/bundles/util_linux/01_get.sh
Normal file
41
src/minimal_overlay/bundles/util_linux/01_get.sh
Normal 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
|
||||||
|
|
46
src/minimal_overlay/bundles/util_linux/02_build.sh
Normal file
46
src/minimal_overlay/bundles/util_linux/02_build.sh
Normal 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
|
||||||
|
|
9
src/minimal_overlay/bundles/util_linux/bundle.sh
Normal file
9
src/minimal_overlay/bundles/util_linux/bundle.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
time sh 01_get.sh
|
||||||
|
time sh 02_build.sh
|
||||||
|
|
||||||
|
cd $SRC_DIR
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user