diff --git a/README.md b/README.md index 2ce8f2b31..c41848fe1 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,19 @@ This is a screenshot of the current development version of Minimal Linux Live: ![Minimal Linux Live](http://minimal.idzona.com/assets/img/minimal_linux_live.png) -## Current development state (29-Jan-2017) +## Current development state (23-Sep-2017) -* Linux kernel 4.4.44 (longterm) -* GNU C Library 2.24 (stable) -* BusyBox 1.26.2 (stable) -* Stable on default Ubuntu 16.04.1 installation (32-bit and 64-bit) with applied system updates. +* Linux kernel 4.13.3 (stable) +* GNU C Library 2.26 (stable) +* BusyBox 1.27.2 (stable) +* Stable on default Ubuntu 16.04 installation with applied system updates. ## Future improvements * Add kernel modules and firmware. * Reorganize and simplify the ISO image generation script. * Allow individual overlay bundles to be downloaded and installed. +* Add more overlay bundles. The above list is not fixed it may be updated at any time. diff --git a/src/.config b/src/.config index c96b839f1..67d659e72 100644 --- a/src/.config +++ b/src/.config @@ -11,7 +11,7 @@ # # http://kernel.org # -KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.12.4.tar.xz +KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.13.3.tar.xz # You can find the latest GNU libc source bundles here: # @@ -23,7 +23,7 @@ GLIBC_SOURCE_URL=http://ftp.gnu.org/gnu/glibc/glibc-2.26.tar.bz2 # # http://busybox.net # -BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.27.1.tar.bz2 +BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.27.2.tar.bz2 # You can find the latest Syslinux source bundles here: # @@ -57,7 +57,7 @@ DROPBEAR_SOURCE_URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-2017.75.ta # # http://felix.apache.org # -FELIX_SOURCE_URL=http://archive.apache.org/dist/felix/org.apache.felix.main.distribution-5.6.4.tar.gz +FELIX_SOURCE_URL=http://archive.apache.org/dist/felix/org.apache.felix.main.distribution-5.6.8.tar.gz # You need to manually download Oracle's JRE or JDK and set the property with # the absolute path to the downloaded archive. Example: @@ -65,7 +65,7 @@ FELIX_SOURCE_URL=http://archive.apache.org/dist/felix/org.apache.felix.main.dist # JAVA_ARCHIVE=/home/ivan/Downloads/jdk-8u131-linux-x64.tar.gz # #JAVA_ARCHIVE=/absolute/path/to/java.archive.tar.gz -#JAVA_ARCHIVE=/home/ivan/Downloads/jdk-8u131-linux-x64.tar.gz +#JAVA_ARCHIVE=/home/ivan/Downloads/jdk-9_linux-x64_bin.tar.gz # You can find the latest Lua source bundes here: # @@ -86,6 +86,20 @@ STATIC_GET_SOURCE_URL=http://s.minos.io/s # CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary&source=github +# You can find the latest Open JDK archives here: +# +# http://jdk.java.net/9 +# +OPENJDK_URL=http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gz + +# You can find the latest ZLIB source bundles here: +# +# http://zlib.net +# +ZLIB_SOURCE_URL=http://zlib.net/zlib-1.2.11.tar.xz + + + #################################################### # # # This section contains configuration properties # @@ -162,9 +176,10 @@ COPY_SOURCE_ISO=true # Currently available overlay software: # # glibc_full - all core GNU C libraries (useful if other software is included). -# links - text browser. +# links - text browser for the web. # dropbear - SSH server and client. # java - installs Oracle's JRE or JDK. Manual preparations are required. +# openjdk - installs Open JDK. All operations are automated. # felix - Apache Felix OSGi framework. # mll_utils - set of executable utilities (mll-*). # lua - scripting language @@ -172,11 +187,12 @@ COPY_SOURCE_ISO=true # cf_cli - CLoud Foundry CLI (command line interface) # nweb - simple mini http server # dhcp - DHCP and DNS functionality +# zlib - DEFLATE compression/decompression library. # # Refer to the README file for more information. # #OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils,lua,static_get,cf_cli,nweb,dhcp -OVERLAY_BUNDLES=nweb,dhcp +OVERLAY_BUNDLES=dhcp,glibc_full,zlib,openjdk,felix,links # This property enables the standard penguin boot logo in the upper left corner # of the screen. The property is used in 'xx_build_kernel.sh'. The default value diff --git a/src/02_build_kernel.sh b/src/02_build_kernel.sh index 45eb2e1d6..17f4ea6a3 100755 --- a/src/02_build_kernel.sh +++ b/src/02_build_kernel.sh @@ -49,11 +49,14 @@ else # Changes the name of the system to 'minimal'. sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config - # Enable overlay support, e.g. merge ro and rw directories. + # Enable overlay support, e.g. merge ro and rw directories (3.18+). sed -i "s/.*CONFIG_OVERLAY_FS.*/CONFIG_OVERLAY_FS=y/" .config - # Enable overlayfs redirection + # Enable overlayfs redirection (4.10+). echo "CONFIG_OVERLAY_FS_REDIRECT_DIR=y" >> .config + + # Turn on inodes index feature by default (4.13+). + echo "CONFIG_OVERLAY_FS_INDEX=y" >> .config # Step 1 - disable all active kernel compression options (should be only one). sed -i "s/.*\\(CONFIG_KERNEL_.*\\)=y/\\#\\ \\1 is not set/" .config diff --git a/src/README b/src/README index 8e581c395..3cd2744db 100644 --- a/src/README +++ b/src/README @@ -27,6 +27,11 @@ Currently available overlay bundles: This overlay bundle depends on the GLIBC build process. +* ZLIB - Software library used for data compression. + + This overlay bundle is self sufficient and doesn't require other + overlay bundles. + * Links - text based browser. Requires ~1MB additional space. Use the "links" command to activate the browser. @@ -49,6 +54,10 @@ Currently available overlay bundles: This overlay bundle requires GLIBC. +* Open JDK - The open source JDK. No need for manual steps. + + This overlay bundle requires GLIBC and ZLIB. + * Felix OSGi - Apache Felix OSGi framework. Requires ~2MB additional space. Use the "felix-start" command to run the Apache Felix OSGi framework. diff --git a/src/minimal_overlay/bundles/openjdk/01_get.sh b/src/minimal_overlay/bundles/openjdk/01_get.sh new file mode 100755 index 000000000..a2c360919 --- /dev/null +++ b/src/minimal_overlay/bundles/openjdk/01_get.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i OPENJDK_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 "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 Open JDK bundle file. The '-c' option allows the download to resume. + echo "Downloading Open JDK bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local Open JDK bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted Felix. +echo "Removing Open JDK work area. This may take a while..." +rm -rf $WORK_DIR/overlay/openjdk +mkdir $WORK_DIR/overlay/openjdk + +# Extract Open JDK to folder 'work/overlay/openjdk'. +# Full path will be something like 'work/overlay/openjdk/jdk-9'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/openjdk + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/openjdk/02_install.sh b/src/minimal_overlay/bundles/openjdk/02_install.sh new file mode 100755 index 000000000..d65a9e231 --- /dev/null +++ b/src/minimal_overlay/bundles/openjdk/02_install.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/openjdk +mv `ls -d *` openjdk + +mkdir opt +mv openjdk opt + +mkdir $WORK_DIR/overlay/openjdk/bin +cd $WORK_DIR/overlay/openjdk/bin + +for FILE in $(ls ../opt/openjdk/bin) +do + ln -s ../opt/openjdk/bin/$FILE $FILE +done + +cp -r $WORK_DIR/overlay/openjdk/* \ + $WORK_DIR/src/minimal_overlay/rootfs + +echo "Open JDK has been installed." + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/openjdk/bundle.sh b/src/minimal_overlay/bundles/openjdk/bundle.sh new file mode 100755 index 000000000..cf641b3e8 --- /dev/null +++ b/src/minimal_overlay/bundles/openjdk/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +time sh 01_get.sh +time sh 02_install.sh + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/zlib/01_get.sh b/src/minimal_overlay/bundles/zlib/01_get.sh new file mode 100755 index 000000000..bcaf452ab --- /dev/null +++ b/src/minimal_overlay/bundles/zlib/01_get.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i ZLIB_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 ZLIB source bundle file. The '-c' option allows the download to resume. + echo "Downloading ZLIB source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local ZLIB source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted ZLIB. +echo "Removing ZLIB work area. This may take a while..." +rm -rf $WORK_DIR/overlay/zlib +mkdir $WORK_DIR/overlay/zlib + +# Extract ZLIB to folder 'work/overlay/zlib'. +# Full path will be something like 'work/overlay/zlib/zlib-1.2.11'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/zlib + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/zlib/02_build.sh b/src/minimal_overlay/bundles/zlib/02_build.sh new file mode 100755 index 000000000..2c9b12d1a --- /dev/null +++ b/src/minimal_overlay/bundles/zlib/02_build.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/zlib + +DESTDIR="$WORK_DIR/overlay/zlib/zlib_installed" + +# Change to the Links source directory which ls finds, e.g. 'zlib-1.2.11'. +cd $(ls -d zlib-*) + +echo "Preparing ZLIB work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Configuring ZLIB..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=$DESTDIR + +echo "Building ZLIB..." +make -j $NUM_JOBS + +echo "Installing ZLIB..." +make -j $NUM_JOBS install + +echo "Reducing ZLIB size..." +strip -g $DESTDIR/lib/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +mkdir -p "$ROOTFS/lib" +cp -r $DESTDIR/lib/libz.so.1.* $ROOTFS/lib/libz.so.1 + +echo "ZLIB has been installed." + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/zlib/bundle.sh b/src/minimal_overlay/bundles/zlib/bundle.sh new file mode 100755 index 000000000..6284178ab --- /dev/null +++ b/src/minimal_overlay/bundles/zlib/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +time sh 01_get.sh +time sh 02_build.sh + +cd $SRC_DIR +