diff --git a/src/.config b/src/.config index ef7403396..6e7d64dad 100644 --- a/src/.config +++ b/src/.config @@ -103,34 +103,35 @@ OVERLAY_TYPE=folder # # Currently available overlay software: # -# glibc_full - all core GNU C libraries (useful if other software is included). -# bosh_cli - BOSH CLI (command line interface). -# cf_cli - Cloud Foundry CLI (command line interface). -# cf_tools - all BOSH and CLoud Foundry tools. -# coreutils - set of commonly used GNU executable utilities. -# dhcp - DHCP and DNS functionality. -# dialog - shell scripting for ncurses -# dropbear - SSH server and client. -# felix - Apache Felix OSGi framework. -# fio - I/O load generator. -# java - installs Oracle's JRE or JDK. Manual preparations are required. -# kbd - keyboard utilities -# kexec_tools - execute another kernel from userspace -# libevent - event notification library. -# links - text browser for the web. -# lua - scripting language. -# make - GNU make utility -# mll_utils - set of executable utilities (mll-*). -# mll_source - MLL source code provided in directory '/usr/src'. -# nano - simple command-line text editor with on-screen shortcuts.git -# ncurses - "GUI-like" API that runs within a terminal emulator. -# nweb - simple mini http server. -# openjdk - installs Open JDK. All operations are automated. -# static_get - portable binaries for Linux (http://s.minos.io). -# stress - CPU and RAM load generator. -# util_linux - set of executable utilities distributed by the Linux Kernel Org. -# vim - an advanced text editor. -# zlib - DEFLATE compression/decompression library. +# glibc_full - all core GNU C libraries. +# bosh_cli - BOSH CLI (command line interface). +# cf_cli - Cloud Foundry CLI (command line interface). +# cf_tools - all BOSH and Cloud Foundry tools. +# coreutils - set of commonly used GNU executable utilities. +# dhcp - DHCP and DNS functionality. +# dialog - shell scripting for ncurses +# dropbear - SSH server and client. +# felix - Apache Felix OSGi framework. +# fio - I/O load generator. +# java - Oracle JRE or JDK. Manual preparations are required. +# kbd - keyboard utilities +# kernel_modules - default MLL kernel modules and 'mdev' hotplug manager. +# kexec_tools - execute another kernel from userspace +# libevent - event notification library. +# links - text browser for the web. +# lua - scripting language. +# make - GNU make utility +# mll_utils - set of executable utilities (mll-*). +# mll_source - MLL source code provided in directory '/usr/src'. +# nano - simple command-line text editor with on-screen shortcuts. +# ncurses - 'GUI-like' API that runs within a terminal emulator. +# nweb - simple mini http server. +# openjdk - installs Open JDK. All operations are automated. +# static_get - portable binaries for Linux (http://s.minos.io). +# stress - CPU and RAM load generator. +# util_linux - executable utilities distributed by the Linux Kernel org. +# vim - advanced text editor. +# zlib - DEFLATE compression/decompression library. # # Refer to the README file for more information. # diff --git a/src/README b/src/README index 6b0cea967..830ce7352 100644 --- a/src/README +++ b/src/README @@ -19,121 +19,112 @@ you can change the property 'OVERLAY_BUNDLES' and build your own flavor of MLL. Currently available overlay bundles: - GLIBC - Set of all core GNU C libraries packaged together. Requires ~3MB - additional space. This overlay bundle is not host specific and - can always be built. The libraries are useful if you plan to use - more software after boot. + GLIBC - set of all core GNU C libraries packaged together. This + overlay bundle is not host specific and can always be built. + The libraries are useful if you plan to use more software in + MLL. This overlay bundle depends on the GLIBC build process. - This overlay bundle depends on the GLIBC build process. + bosh_cli - BOSH command line tool. It can be used as landscape manager + for virtual network and server infrastructures in cloud + environment, e.g. AWS, Google Cloud, etc. The most common use + case for this tool is to create and manage Cloud Foundry + infrastructures. - bosh_cli - BOSH command line tool. It can be used as landscape manager for - virtual network and server infrastructures in cloud environment, - e.g. AWS, Google Cloud, etc. The most common use case for this - tool is to create and manage Cloud Foundry infrastructures. + cf_cli - Cloud Foundry command line tool. It can be used to manage all + aspects of already existing Cloud Foundry installation, + including the full software development lifecycle in cloud + environment. - cf_cli - Cloud Foundry command line tool. It can be used to manage all - aspects of already existing Cloud Foundry installation, including - the full software development lifecycle in cloud environment. + cf_tools - this is metapackage which installs all BOSH and Cloud Foundry + tools. Note that in MLL context these tools are mostly useful + as remote managers for existing BOSH and Cloud Foundry cloud + infrastructures. - cf_tools - This is metapackage which installs all BOSH and Cloud Foundry - tools. Note that in MLL context these tools are mostly useful - as remote managers for already existing BOSH and Cloud Foundry - cloud infrastructures. + coreutils - set of commonly used GNU executable utilities. - 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. + dialog - shell scripting library for 'ncurses'. This overlay bundle + requires 'ncurses'. - dialog - Shell scripting library for ncurses + Dropbear - SSH server/client. This overlay bundle requires some GLIBC + libraries.The build process creates user 'root' with password + 'toor'. These are sample commands which demonstrate how to + use Dropbear: - This overlay bundle requires ncurses + SSH server (Alt + F1): dropbear -E -F + SSH client (Alt + F2): dbclient 10.0.2.15 -l root - Dropbear - SSH server/client. Requires ~1MB additional space. The build - process creates user 'root' with password 'toor'. These are - sample commands which demonstrate how to use Dropbear: + Felix OSGi - Apache Felix OSGi framework. Use the 'felix-start' command to + run the Apache Felix OSGi framework. This overlay bundle + requires JRE or JDK. - SSH server (Alt + F1): dropbear -E -F - SSH client (Alt + F2): dbclient 10.0.2.15 -l root + fio - I/O load generator that can simulate a wide variety of + workloads on RAM or disks. 'fio' is essential for + troubleshootingdata I/O bottlenecks. - This overlay bundle requires GLIBC. + JRE / JDK - Oracle's JRE or JDK. This overlay bundle requires some manual + preparation steps. Refer to the 'JAVA_ARCHIVE' property in + the '.config' file for more information. 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. + kbd - keyboard utilities and keymaps. For example, you can load + German keyboard layout like this: - This overlay bundle requires JRE or JDK. + loadkeys de - fio - I/O load generator that can simulate a wide variety of workloads - on RAM or disks. fio is essential for troubleshooting data - bottlenecks. + kernel_modules - kernel modules and 'mdev' hotplug manager. - JRE / JDK - Oracle's JRE or JDK. Requires ~366MB additional space for JDK. - This overlay bundle requires some manual preparation steps. Refer - to the "JAVA_ARCHIVE" property in the ".config" file for more - detailed information. + kexec_tools - these tools can be used to boot another kernel and initramfs + from userspace. - This overlay bundle requires GLIBC. JDK 9 requires ZLIB. + libevent - event notification library API provides a mechanism to + execute a callback function when a specific event occurs on + a file descriptor or after a timeout has been reached. - kbd - Keyboard utilities and keymaps. For example, you can load - German keyboard layout like this: + Links - text based web browser. Use the 'links' command to activate + the browser. - loadkeys de + Open JDK - the open source JDK. No need for manual steps. This overlay + bundle requires GLIBC and ZLIB. - libevent - event notification library API provides a mechanism to execute a - callback function when a specific event occurs on a file - descriptor or after a timeout has been reached. + Lua - the Lua Scripting Language. Use the 'lua' command to run an + interactive LUA interpreter. - kexec_tools - Kexec tools, can be used to boot another kernel from userspace + make - GNU make utility. - Links - Text based browser. Requires ~1MB additional space. Use the - "links" command to activate the browser. + MLL Utils - set of experimental shell scripts (mll-*.sh) which provide + additional functionality, e.g. installer and useful tools. + This overlay bundle is currently experimental and its build + process depends on the host machine. - Open JDK - The open source JDK. No need for manual steps. + MLL Source - this overlay bundle provides all MLL source code in the + directory 'usr/src'. - This overlay bundle requires GLIBC and ZLIB. + nano - simple command-line text editor with on-screen shortcuts. + This overlay bundle requires 'ncurses'. - Lua - The Lua Scripting Language 5.3. Requires ~ 800kb additional - space. Use the "lua" command to run an interactive lua - interpreter. + ncurses - 'GUI-like' API that runs within a terminal emulator. - make - GNU make utility + nweb - 'nweb' is a very small and easy to use webserver, it runs + automatically on port 80. To portforward port 80 from the + QEMU guest (minimal) to port 8080 on the host, add + '-net nic,model=e1000 -net user,hostfwd=tcp::8080-:80' to + 'cmd' in the qemu.sh file. - MLL Utils - Set of experimental shell scripts (mll-*.sh) which provide - additional functionality, e.g. installer and useful tools. + stress - simple workload generator. Imposes a configurable amount of + CPU, memory, I/O, and disk stress on the system. stress is + useful for troubleshooting CPU and RAM issues. - This overlay bundle is currently experimental and its build - process depends on the host machine. + util_linux - set of executable utilities distributed by the Linux Kernel, + similar to busybox or GNU Core Utils. Some packages in this + overlay bundle require 'ncurses'. - MLL Source - This overlay bundle provides all MLL source code in the - directory 'usr/src'. + vim - advanced text editor that seeks to provide the power of the + de-facto Unix editor 'vi', with a more complete feature set. + This package will create symlinks on top of 'vi'. - nano - Simple command-line text editor with on-screen shortcuts. - - This overlay bundle requires ncurses. - - ncurses - "GUI-like" API that runs within a terminal emulator. - - nweb - nweb is a very small and easy to use webserver, it is run - automatically on port 80. To portforward port 80 from the - guest (minimal) to port 8080 on the host add - '-net nic,model=e1000 -net user,hostfwd=tcp::8080-:80' to - 'cmd' in the qemu.sh file. - - stress - Simple workload generator. Imposes a configurable amount of CPU, - memory, I/O, and disk stress on the system. stress is useful for - troubleshooting CPU and RAM. - - util_linux - Set of executable utilities distributed by the Linux Kernel - similar to busybox or GNU Core Utils. - - Some packages in this overlay bundle require ncurses. - - vim - An advanced text editor that seeks to provide the power of - the de-facto Unix editor 'Vi', with a more complete feature - set. - - This package will create symlinks on top of vi. - - ZLIB - Software library used for data compression. + ZLIB - software library used for data compression. The overlay bundles can be found in this directory: diff --git a/src/minimal_overlay/bundles/dhcp/01_network.sh b/src/minimal_overlay/bundles/dhcp/20_network.sh similarity index 100% rename from src/minimal_overlay/bundles/dhcp/01_network.sh rename to src/minimal_overlay/bundles/dhcp/20_network.sh diff --git a/src/minimal_overlay/bundles/dhcp/bundle.sh b/src/minimal_overlay/bundles/dhcp/bundle.sh index 748dc4d8a..62bf8027e 100755 --- a/src/minimal_overlay/bundles/dhcp/bundle.sh +++ b/src/minimal_overlay/bundles/dhcp/bundle.sh @@ -14,7 +14,7 @@ install -m644 "$SRC_DIR/hosts" "$OVERLAY_ROOTFS/etc/hosts" install -m644 "$SRC_DIR/nsswitch.conf" "$OVERLAY_ROOTFS/etc/nsswitch.conf" install -m644 "$SRC_DIR/resolv.conf" "$OVERLAY_ROOTFS/etc/resolv.conf" install -d -m755 "$OVERLAY_ROOTFS/etc/autorun" -install -m755 "$SRC_DIR/01_network.sh" "$OVERLAY_ROOTFS/etc/autorun/01_network.sh" +install -m755 "$SRC_DIR/20_network.sh" "$OVERLAY_ROOTFS/etc/autorun/20_network.sh" install -m755 "$SRC_DIR/05_rc.dhcp" "$OVERLAY_ROOTFS/etc/05_rc.dhcp" echo "DHCP scripts and libraries have been installed." diff --git a/src/minimal_overlay/bundles/dropbear/02_build.sh b/src/minimal_overlay/bundles/dropbear/02_build.sh index e99df6e42..2e5028711 100755 --- a/src/minimal_overlay/bundles/dropbear/02_build.sh +++ b/src/minimal_overlay/bundles/dropbear/02_build.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -ex +set -e . ../../common.sh diff --git a/src/minimal_overlay/bundles/kernel_modules/10_modules.sh b/src/minimal_overlay/bundles/kernel_modules/10_modules.sh new file mode 100755 index 000000000..762a75d0b --- /dev/null +++ b/src/minimal_overlay/bundles/kernel_modules/10_modules.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Enable the 'mdev' hotplug manager. +echo /sbin/mdev > /proc/sys/kernel/hotplug + +# Initial execution of the 'mdev' hotpug manager. +/sbin/mdev -s + +cat << CEOF + The 'mdev' hotplug manager is active. +CEOF diff --git a/src/minimal_overlay/bundles/kernel_modules/bundle.sh b/src/minimal_overlay/bundles/kernel_modules/bundle.sh new file mode 100755 index 000000000..657a05038 --- /dev/null +++ b/src/minimal_overlay/bundles/kernel_modules/bundle.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +set -e + +. ../../common.sh + + +if [ ! -d $WORK_DIR/kernel/linux-* ] ; then + echo "Kernel source directory is missing. Cannot continue." + exit 1 +else + echo "Kernel source directory exists." +fi + +if [ ! -d $KERNEL_INSTALLED ] ; then + echo "Kernel is not built. Cannot continue." + exit 1 +else + echo "Kernel is built." +fi + +rm -rf $DEST_DIR + +cd $WORK_DIR/kernel/linux-* + +echo "Building kernel modules." +make_target modules + +echo "Installing kernel modules." +make_target \ + INSTALL_MOD_PATH=$DEST_DIR \ + modules_install + +echo "Removing unnecessary links." +cd $DEST_DIR/lib/modules/* +unlink build +unlink source + +echo "Reducing the size of all generated kernel modules." +reduce_size $DEST_DIR/lib/modules + +mkdir -p $DEST_DIR/etc/autorun +cp $SRC_DIR/10_modules.sh $DEST_DIR/etc/autorun + +install_to_overlay + +cd $SRC_DIR diff --git a/src/minimal_overlay/common.sh b/src/minimal_overlay/common.sh index 3ba241e72..e252adb9b 100755 --- a/src/minimal_overlay/common.sh +++ b/src/minimal_overlay/common.sh @@ -123,7 +123,7 @@ reduce_size() ( done elif [ -f $1 ] ; then set +e - strip -g $1 + strip -g $1 2>/dev/null set -e fi