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,18 +103,19 @@ OVERLAY_TYPE=folder
#
# 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).
# 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.
# 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.
# 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.
@ -122,14 +123,14 @@ OVERLAY_TYPE=folder
# 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.
# 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 - set of executable utilities distributed by the Linux Kernel Org.
# vim - an advanced text editor.
# 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.

View File

@ -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.
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
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.
as remote managers for 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.
dialog - Shell scripting library for ncurses
dialog - shell scripting library for 'ncurses'. This overlay bundle
requires 'ncurses'.
This overlay bundle requires ncurses
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:
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:
SSH server (Alt + F1): dropbear -E -F
SSH client (Alt + F2): dbclient 10.0.2.15 -l root
This overlay bundle requires GLIBC.
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.
Felix OSGi - Apache Felix OSGi framework. Requires ~2MB additional space. Use
the "felix-start" command to run the Apache Felix OSGi framework.
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 JRE or JDK.
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.
fio - I/O load generator that can simulate a wide variety of workloads
on RAM or disks. fio is essential for troubleshooting data
bottlenecks.
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.
This overlay bundle requires GLIBC. JDK 9 requires ZLIB.
kbd - Keyboard utilities and keymaps. For example, you can load
kbd - keyboard utilities and keymaps. For example, you can load
German keyboard layout like this:
loadkeys de
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.
kernel_modules - kernel modules and 'mdev' hotplug manager.
kexec_tools - Kexec tools, can be used to boot another kernel from userspace
kexec_tools - these tools can be used to boot another kernel and initramfs
from userspace.
Links - Text based browser. Requires ~1MB additional space. Use the
"links" command to activate the browser.
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.
Open JDK - The open source JDK. No need for manual steps.
Links - text based web browser. Use the 'links' command to activate
the browser.
This overlay bundle requires GLIBC and ZLIB.
Open JDK - the open source JDK. No need for manual steps. This overlay
bundle requires GLIBC and ZLIB.
Lua - The Lua Scripting Language 5.3. Requires ~ 800kb additional
space. Use the "lua" command to run an interactive lua
interpreter.
Lua - the Lua Scripting Language. Use the 'lua' command to run an
interactive LUA interpreter.
make - GNU make utility
make - GNU make utility.
MLL Utils - Set of experimental shell scripts (mll-*.sh) which provide
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.
MLL Source - This overlay bundle provides all MLL source code in the
MLL Source - this overlay bundle provides all MLL source code in the
directory 'usr/src'.
nano - Simple command-line text editor with on-screen shortcuts.
nano - simple command-line text editor with on-screen shortcuts.
This overlay bundle requires 'ncurses'.
This overlay bundle requires ncurses.
ncurses - 'GUI-like' API that runs within a terminal emulator.
ncurses - "GUI-like" API that runs within a terminal emulator.
nweb - nweb is a very small and easy to use webserver, it is run
nweb - 'nweb' is a very small and easy to use webserver, it runs
automatically on port 80. To portforward port 80 from the
guest (minimal) to port 8080 on the host add
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.
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.
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.
util_linux - Set of executable utilities distributed by the Linux Kernel
similar to busybox or GNU Core Utils.
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'.
Some packages in this overlay bundle require ncurses.
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'.
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:

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/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."

View File

@ -1,6 +1,6 @@
#!/bin/sh
set -ex
set -e
. ../../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
elif [ -f $1 ] ; then
set +e
strip -g $1
strip -g $1 2>/dev/null
set -e
fi