Added kernel modules and 'mdev' hotplug manager as overlay bundle. Applied some enhancements on other scripts.

This commit is contained in:
Ivan Davidov 2017-12-08 18:46:10 +02:00
parent 75cba13b70
commit 3768275daa
8 changed files with 167 additions and 117 deletions

View File

@ -103,34 +103,35 @@ OVERLAY_TYPE=folder
# #
# Currently available overlay software: # Currently available overlay software:
# #
# glibc_full - all core GNU C libraries (useful if other software is included). # glibc_full - all core GNU C libraries.
# bosh_cli - BOSH CLI (command line interface). # bosh_cli - BOSH CLI (command line interface).
# cf_cli - Cloud Foundry CLI (command line interface). # cf_cli - Cloud Foundry CLI (command line interface).
# cf_tools - all BOSH and CLoud Foundry tools. # cf_tools - all BOSH and Cloud Foundry tools.
# coreutils - set of commonly used GNU executable utilities. # coreutils - set of commonly used GNU executable utilities.
# dhcp - DHCP and DNS functionality. # dhcp - DHCP and DNS functionality.
# dialog - shell scripting for ncurses # dialog - shell scripting for ncurses
# dropbear - SSH server and client. # dropbear - SSH server and client.
# felix - Apache Felix OSGi framework. # felix - Apache Felix OSGi framework.
# fio - I/O load generator. # fio - I/O load generator.
# java - installs Oracle's JRE or JDK. Manual preparations are required. # java - Oracle JRE or JDK. Manual preparations are required.
# kbd - keyboard utilities # kbd - keyboard utilities
# kexec_tools - execute another kernel from userspace # kernel_modules - default MLL kernel modules and 'mdev' hotplug manager.
# libevent - event notification library. # kexec_tools - execute another kernel from userspace
# links - text browser for the web. # libevent - event notification library.
# lua - scripting language. # links - text browser for the web.
# make - GNU make utility # lua - scripting language.
# mll_utils - set of executable utilities (mll-*). # make - GNU make utility
# mll_source - MLL source code provided in directory '/usr/src'. # mll_utils - set of executable utilities (mll-*).
# nano - simple command-line text editor with on-screen shortcuts.git # mll_source - MLL source code provided in directory '/usr/src'.
# ncurses - "GUI-like" API that runs within a terminal emulator. # nano - simple command-line text editor with on-screen shortcuts.
# nweb - simple mini http server. # ncurses - 'GUI-like' API that runs within a terminal emulator.
# openjdk - installs Open JDK. All operations are automated. # nweb - simple mini http server.
# static_get - portable binaries for Linux (http://s.minos.io). # openjdk - installs Open JDK. All operations are automated.
# stress - CPU and RAM load generator. # static_get - portable binaries for Linux (http://s.minos.io).
# util_linux - set of executable utilities distributed by the Linux Kernel Org. # stress - CPU and RAM load generator.
# vim - an advanced text editor. # util_linux - executable utilities distributed by the Linux Kernel org.
# zlib - DEFLATE compression/decompression library. # vim - advanced text editor.
# zlib - DEFLATE compression/decompression library.
# #
# Refer to the README file for more information. # Refer to the README file for more information.
# #

View File

@ -19,121 +19,112 @@ you can change the property 'OVERLAY_BUNDLES' and build your own flavor of MLL.
Currently available overlay bundles: Currently available overlay bundles:
GLIBC - Set of all core GNU C libraries packaged together. Requires ~3MB GLIBC - set of all core GNU C libraries packaged together. This
additional space. This overlay bundle is not host specific and overlay bundle is not host specific and can always be built.
can always be built. The libraries are useful if you plan to use The libraries are useful if you plan to use more software in
more software after boot. 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 cf_cli - Cloud Foundry command line tool. It can be used to manage all
virtual network and server infrastructures in cloud environment, aspects of already existing Cloud Foundry installation,
e.g. AWS, Google Cloud, etc. The most common use case for this including the full software development lifecycle in cloud
tool is to create and manage Cloud Foundry infrastructures. environment.
cf_cli - Cloud Foundry command line tool. It can be used to manage all cf_tools - this is metapackage which installs all BOSH and Cloud Foundry
aspects of already existing Cloud Foundry installation, including tools. Note that in MLL context these tools are mostly useful
the full software development lifecycle in cloud environment. as remote managers for existing BOSH and Cloud Foundry cloud
infrastructures.
cf_tools - This is metapackage which installs all BOSH and Cloud Foundry coreutils - set of commonly used GNU executable utilities.
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. 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 Felix OSGi - Apache Felix OSGi framework. Use the 'felix-start' command to
process creates user 'root' with password 'toor'. These are run the Apache Felix OSGi framework. This overlay bundle
sample commands which demonstrate how to use Dropbear: requires JRE or JDK.
SSH server (Alt + F1): dropbear -E -F fio - I/O load generator that can simulate a wide variety of
SSH client (Alt + F2): dbclient 10.0.2.15 -l root 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 kbd - keyboard utilities and keymaps. For example, you can load
the "felix-start" command to run the Apache Felix OSGi framework. 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 kernel_modules - kernel modules and 'mdev' hotplug manager.
on RAM or disks. fio is essential for troubleshooting data
bottlenecks.
JRE / JDK - Oracle's JRE or JDK. Requires ~366MB additional space for JDK. kexec_tools - these tools can be used to boot another kernel and initramfs
This overlay bundle requires some manual preparation steps. Refer from userspace.
to the "JAVA_ARCHIVE" property in the ".config" file for more
detailed information.
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 Links - text based web browser. Use the 'links' command to activate
German keyboard layout like this: 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 Lua - the Lua Scripting Language. Use the 'lua' command to run an
callback function when a specific event occurs on a file interactive LUA interpreter.
descriptor or after a timeout has been reached.
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 MLL Utils - set of experimental shell scripts (mll-*.sh) which provide
"links" command to activate the browser. 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 ncurses - 'GUI-like' API that runs within a terminal emulator.
space. Use the "lua" command to run an interactive lua
interpreter.
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 stress - simple workload generator. Imposes a configurable amount of
additional functionality, e.g. installer and useful tools. 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 util_linux - set of executable utilities distributed by the Linux Kernel,
process depends on the host machine. 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 vim - advanced text editor that seeks to provide the power of the
directory 'usr/src'. 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. ZLIB - software library used for data compression.
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.
The overlay bundles can be found in this directory: The overlay bundles can be found in this directory:

View File

@ -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/nsswitch.conf" "$OVERLAY_ROOTFS/etc/nsswitch.conf"
install -m644 "$SRC_DIR/resolv.conf" "$OVERLAY_ROOTFS/etc/resolv.conf" install -m644 "$SRC_DIR/resolv.conf" "$OVERLAY_ROOTFS/etc/resolv.conf"
install -d -m755 "$OVERLAY_ROOTFS/etc/autorun" 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" install -m755 "$SRC_DIR/05_rc.dhcp" "$OVERLAY_ROOTFS/etc/05_rc.dhcp"
echo "DHCP scripts and libraries have been installed." echo "DHCP scripts and libraries have been installed."

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
set -ex set -e
. ../../common.sh . ../../common.sh

View File

@ -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

View File

@ -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

View File

@ -123,7 +123,7 @@ reduce_size() (
done done
elif [ -f $1 ] ; then elif [ -f $1 ] ; then
set +e set +e
strip -g $1 strip -g $1 2>/dev/null
set -e set -e
fi fi