Add coreutils overlay bundle
This commit is contained in:
parent
f740473319
commit
cbdaa63284
@ -47,6 +47,12 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0
|
|||||||
#
|
#
|
||||||
CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary&source=github
|
CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary&source=github
|
||||||
|
|
||||||
|
# You can find the latest coreutils source bundles here:
|
||||||
|
#
|
||||||
|
# http://ftp.gnu.org/gnu/coreutils/
|
||||||
|
#
|
||||||
|
COREUTILS_SOURCE_URL=http://ftp.gnu.org/gnu/coreutils/coreutils-8.28.tar.xz
|
||||||
|
|
||||||
# You can find the latest Dropbear source bundles here:
|
# You can find the latest Dropbear source bundles here:
|
||||||
#
|
#
|
||||||
# http://matt.ucc.asn.au/dropbear/dropbear.html
|
# http://matt.ucc.asn.au/dropbear/dropbear.html
|
||||||
@ -200,6 +206,7 @@ COPY_SOURCE_ISO=true
|
|||||||
#
|
#
|
||||||
# glibc_full - all core GNU C libraries (useful if other software is included).
|
# glibc_full - all core GNU C libraries (useful if other software is included).
|
||||||
# cf_cli - CLoud Foundry CLI (command line interface).
|
# cf_cli - CLoud Foundry CLI (command line interface).
|
||||||
|
# coreutils - set of commonly used GNU executable utilities.
|
||||||
# dhcp - DHCP and DNS functionality.
|
# dhcp - DHCP and DNS functionality.
|
||||||
# dropbear - SSH server and client.
|
# dropbear - SSH server and client.
|
||||||
# felix - Apache Felix OSGi framework.
|
# felix - Apache Felix OSGi framework.
|
||||||
@ -217,7 +224,7 @@ COPY_SOURCE_ISO=true
|
|||||||
#
|
#
|
||||||
# Refer to the README file for more information.
|
# Refer to the README file for more information.
|
||||||
#
|
#
|
||||||
#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib
|
#OVERLAY_BUNDLES=glibc_full,cf_cli,coreutils,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib
|
||||||
#OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib
|
#OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib
|
||||||
|
|
||||||
# This property enables the standard penguin boot logo in the upper left corner
|
# This property enables the standard penguin boot logo in the upper left corner
|
||||||
|
@ -27,6 +27,8 @@ Currently available overlay bundles:
|
|||||||
|
|
||||||
This overlay bundle depends on the GLIBC build process.
|
This overlay bundle depends on the GLIBC build process.
|
||||||
|
|
||||||
|
* coreutils - set of commonly used GNU executable utilities.
|
||||||
|
|
||||||
* dhcp - DHCP and DNS functionality to connect to the Internet.
|
* dhcp - DHCP and DNS functionality to connect to the Internet.
|
||||||
|
|
||||||
* Dropbear - SSH server/client. Requires ~1MB additional space. The build
|
* Dropbear - SSH server/client. Requires ~1MB additional space. The build
|
||||||
|
41
src/minimal_overlay/bundles/coreutils/01_get.sh
Executable file
41
src/minimal_overlay/bundles/coreutils/01_get.sh
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
. ../../common.sh
|
||||||
|
|
||||||
|
# Grab everything after the '=' character.
|
||||||
|
DOWNLOAD_URL=$(grep -i COREUTILS_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 coreutils source bundle file. The '-c' option allows the download to resume.
|
||||||
|
echo "Downloading coreutils source bundle from $DOWNLOAD_URL"
|
||||||
|
wget -c $DOWNLOAD_URL
|
||||||
|
else
|
||||||
|
echo "Using local coreutils source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Delete folder with previously extracted coreutils.
|
||||||
|
echo "Removing coreutils work area. This may take a while..."
|
||||||
|
rm -rf $WORK_DIR/overlay/coreutils
|
||||||
|
mkdir $WORK_DIR/overlay/coreutils
|
||||||
|
|
||||||
|
# Extract coreutils to folder 'work/overlay/coreutils'.
|
||||||
|
# Full path will be something like 'work/overlay/coreutils/coreutils-8.28'.
|
||||||
|
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/coreutils
|
||||||
|
|
||||||
|
cd $SRC_DIR
|
||||||
|
|
38
src/minimal_overlay/bundles/coreutils/02_build.sh
Executable file
38
src/minimal_overlay/bundles/coreutils/02_build.sh
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
. ../../common.sh
|
||||||
|
|
||||||
|
cd $WORK_DIR/overlay/coreutils
|
||||||
|
|
||||||
|
DESTDIR="$PWD/coreutils_installed"
|
||||||
|
|
||||||
|
# Change to the coreutils source directory which ls finds, e.g. 'coreutils-8.28'.
|
||||||
|
cd $(ls -d coreutils-*)
|
||||||
|
|
||||||
|
echo "Preparing coreutils work area. This may take a while..."
|
||||||
|
make -j $NUM_JOBS clean
|
||||||
|
|
||||||
|
rm -rf $DESTDIR
|
||||||
|
|
||||||
|
echo "Configuring coreutils..."
|
||||||
|
CFLAGS="$CFLAGS" ./configure \
|
||||||
|
--prefix=/usr
|
||||||
|
|
||||||
|
echo "Building coreutils..."
|
||||||
|
make -j $NUM_JOBS
|
||||||
|
|
||||||
|
echo "Installing coreutils..."
|
||||||
|
make -j $NUM_JOBS install DESTDIR=$DESTDIR
|
||||||
|
|
||||||
|
echo "Reducing coreutils size..."
|
||||||
|
strip -g $DESTDIR/usr/bin/*
|
||||||
|
|
||||||
|
ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs"
|
||||||
|
|
||||||
|
cp -r $DESTDIR/* $ROOTFS
|
||||||
|
|
||||||
|
echo "coreutils has been installed."
|
||||||
|
|
||||||
|
cd $SRC_DIR
|
9
src/minimal_overlay/bundles/coreutils/bundle.sh
Executable file
9
src/minimal_overlay/bundles/coreutils/bundle.sh
Executable 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