Added Google's Go programming language (golang) as overlay bundle.
This commit is contained in:
parent
201ec9aa9b
commit
4e70ecc942
@ -135,6 +135,7 @@ OVERLAY_TYPE=folder
|
||||
# dropbear - SSH server and client.
|
||||
# felix - Apache Felix OSGi framework.
|
||||
# fio - I/O load generator.
|
||||
# golang - Google's Go programming language.
|
||||
# graalvm - VM for Java, JavaScript, Python, Ruby, R, LLVM.
|
||||
# java - Oracle JRE or JDK. Manual preparations are required.
|
||||
# kbd - keyboard utilities.
|
||||
|
@ -63,6 +63,9 @@ Currently available overlay bundles:
|
||||
workloads on RAM or disks. 'fio' is essential for
|
||||
troubleshooting data I/O bottlenecks.
|
||||
|
||||
Golang - Go is an open source programming language that makes it easy
|
||||
to build simple, reliable, and efficient software.
|
||||
|
||||
GraalVM - Universal virtual machine for running applications written
|
||||
in JavaScript, Python, Ruby, R, JVM-based languages like
|
||||
Java, Scala, Clojure, Kotlin, and LLVM-based languages such
|
||||
|
5
src/minimal_overlay/bundles/golang/.config
Normal file
5
src/minimal_overlay/bundles/golang/.config
Normal file
@ -0,0 +1,5 @@
|
||||
# You can find the latest Golang archives here:
|
||||
#
|
||||
# http://golang.org/dl
|
||||
#
|
||||
GOLANG_URL=https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
|
38
src/minimal_overlay/bundles/golang/01_get.sh
Executable file
38
src/minimal_overlay/bundles/golang/01_get.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
# Read the common configuration properties.
|
||||
DOWNLOAD_URL=`read_property GOLANG_URL`
|
||||
USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE`
|
||||
|
||||
# Grab everything after the last '/' character.
|
||||
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
|
||||
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "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 Golang bundle file. The '-c' option allows the download to resume.
|
||||
echo "Downloading Golang bundle from $DOWNLOAD_URL"
|
||||
wget -c $DOWNLOAD_URL
|
||||
else
|
||||
echo "Using local Golang bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
fi
|
||||
|
||||
# Delete folder with previously extracted Felix.
|
||||
echo "Removing Golang work area. This may take a while."
|
||||
rm -rf $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
mkdir $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
|
||||
# Extract Golang to folder 'work/overlay/golang'.
|
||||
# Full path will be something like 'work/overlay/golang/go'.
|
||||
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
|
||||
cd $SRC_DIR
|
32
src/minimal_overlay/bundles/golang/02_install.sh
Executable file
32
src/minimal_overlay/bundles/golang/02_install.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
cd $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
mv `ls -d *` $BUNDLE_NAME
|
||||
|
||||
mkdir opt
|
||||
mv $BUNDLE_NAME opt
|
||||
|
||||
mkdir -p usr/local
|
||||
cd $WORK_DIR/overlay/$BUNDLE_NAME/usr/local
|
||||
ln -s ../../opt/$BUNDLE_NAME go
|
||||
|
||||
mkdir $WORK_DIR/overlay/$BUNDLE_NAME/bin
|
||||
cd $WORK_DIR/overlay/$BUNDLE_NAME/bin
|
||||
|
||||
for FILE in $(ls ../usr/local/go/bin)
|
||||
do
|
||||
ln -s ../usr/local/go/bin/$FILE $FILE
|
||||
done
|
||||
|
||||
# With '--remove-destination' all possibly existing soft links in
|
||||
# '$OVERLAY_ROOTFS' will be overwritten correctly.
|
||||
cp -r --remove-destination $WORK_DIR/overlay/$BUNDLE_NAME/* \
|
||||
$OVERLAY_ROOTFS
|
||||
|
||||
echo "Golang has been installed."
|
||||
|
||||
cd $SRC_DIR
|
10
src/minimal_overlay/bundles/golang/bundle.sh
Executable file
10
src/minimal_overlay/bundles/golang/bundle.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
./01_get.sh
|
||||
./02_install.sh
|
||||
|
||||
cd $SRC_DIR
|
1
src/minimal_overlay/bundles/golang/bundle_deps
Normal file
1
src/minimal_overlay/bundles/golang/bundle_deps
Normal file
@ -0,0 +1 @@
|
||||
glibc_libpthread
|
Loading…
x
Reference in New Issue
Block a user