Merge pull request #110 from bauen1/misc-changes
Misc changes - added deps for some bundles, autorun enhancements, host resolution, code refactoring.
This commit is contained in:
commit
23f34f3941
47
src/.config
47
src/.config
@ -238,29 +238,30 @@ COPY_SOURCE_ISO=true
|
|||||||
#
|
#
|
||||||
# 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 (useful if other software is included).
|
||||||
# cf_cli - CLoud Foundry CLI (command line interface).
|
# cf_cli - CLoud Foundry CLI (command line interface).
|
||||||
# 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 - installs Oracle's JRE or JDK. Manual preparations are required.
|
||||||
# kbd - keyboard utilities
|
# kbd - keyboard utilities
|
||||||
# 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.
|
||||||
# mll_utils - set of executable utilities (mll-*).
|
# lua - scripting language.
|
||||||
# nano - simple command-line text editor with on-screen shortcuts.git
|
# mll_utils - set of executable utilities (mll-*).
|
||||||
# ncurses - "GUI-like" API that runs within a terminal emulator.
|
# nano - simple command-line text editor with on-screen shortcuts.git
|
||||||
# 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 - set of executable utilities distributed by the Linux Kernel Org.
|
||||||
# zlib - DEFLATE compression/decompression library.
|
# vim - an advanced text editor.
|
||||||
|
# zlib - DEFLATE compression/decompression library.
|
||||||
#
|
#
|
||||||
# Refer to the README file for more information.
|
# Refer to the README file for more information.
|
||||||
#
|
#
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "*** CLEAN BEGIN ***"
|
echo "*** CLEAN BEGIN ***"
|
||||||
|
|
||||||
echo "Cleaning up the main work area. This may take a while..."
|
echo "Cleaning up the main work area. This may take a while..."
|
||||||
rm -rf work
|
rm -rf work
|
||||||
mkdir work
|
mkdir work
|
||||||
|
|
||||||
# -p stops errors if the directory already exists
|
|
||||||
mkdir -p source
|
mkdir -p source
|
||||||
|
|
||||||
echo "*** CLEAN END ***"
|
echo "*** CLEAN END ***"
|
||||||
|
@ -39,7 +39,7 @@ fi
|
|||||||
|
|
||||||
if [ "$USE_PREDEFINED_KERNEL_CONFIG" = "true" ] ; then
|
if [ "$USE_PREDEFINED_KERNEL_CONFIG" = "true" ] ; then
|
||||||
# Use predefined configuration file for the kernel.
|
# Use predefined configuration file for the kernel.
|
||||||
echo "Using config file $SRC_DIR/minimal_config/kernel.config"
|
echo "Using config file $SRC_DIR/minimal_config/kernel.config"
|
||||||
cp -f $SRC_DIR/minimal_config/kernel.config .config
|
cp -f $SRC_DIR/minimal_config/kernel.config .config
|
||||||
else
|
else
|
||||||
# Create default configuration file for the kernel.
|
# Create default configuration file for the kernel.
|
||||||
@ -51,16 +51,16 @@ else
|
|||||||
|
|
||||||
# Enable overlay support, e.g. merge ro and rw directories (3.18+).
|
# Enable overlay support, e.g. merge ro and rw directories (3.18+).
|
||||||
sed -i "s/.*CONFIG_OVERLAY_FS.*/CONFIG_OVERLAY_FS=y/" .config
|
sed -i "s/.*CONFIG_OVERLAY_FS.*/CONFIG_OVERLAY_FS=y/" .config
|
||||||
|
|
||||||
# Enable overlayfs redirection (4.10+).
|
# Enable overlayfs redirection (4.10+).
|
||||||
echo "CONFIG_OVERLAY_FS_REDIRECT_DIR=y" >> .config
|
echo "CONFIG_OVERLAY_FS_REDIRECT_DIR=y" >> .config
|
||||||
|
|
||||||
# Turn on inodes index feature by default (4.13+).
|
# Turn on inodes index feature by default (4.13+).
|
||||||
echo "CONFIG_OVERLAY_FS_INDEX=y" >> .config
|
echo "CONFIG_OVERLAY_FS_INDEX=y" >> .config
|
||||||
|
|
||||||
# Step 1 - disable all active kernel compression options (should be only one).
|
# Step 1 - disable all active kernel compression options (should be only one).
|
||||||
sed -i "s/.*\\(CONFIG_KERNEL_.*\\)=y/\\#\\ \\1 is not set/" .config
|
sed -i "s/.*\\(CONFIG_KERNEL_.*\\)=y/\\#\\ \\1 is not set/" .config
|
||||||
|
|
||||||
# Step 2 - enable the 'xz' compression option.
|
# Step 2 - enable the 'xz' compression option.
|
||||||
sed -i "s/.*CONFIG_KERNEL_XZ.*/CONFIG_KERNEL_XZ=y/" .config
|
sed -i "s/.*CONFIG_KERNEL_XZ.*/CONFIG_KERNEL_XZ=y/" .config
|
||||||
|
|
||||||
@ -77,13 +77,13 @@ else
|
|||||||
sed -i "s/.*CONFIG_LOGO_LINUX_CLUT224.*/\\# CONFIG_LOGO_LINUX_CLUT224 is not set/" .config
|
sed -i "s/.*CONFIG_LOGO_LINUX_CLUT224.*/\\# CONFIG_LOGO_LINUX_CLUT224 is not set/" .config
|
||||||
echo "Boot logo is disabled."
|
echo "Boot logo is disabled."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable debug symbols in kernel => smaller kernel binary.
|
# Disable debug symbols in kernel => smaller kernel binary.
|
||||||
sed -i "s/^CONFIG_DEBUG_KERNEL.*/\\# CONFIG_DEBUG_KERNEL is not set/" .config
|
sed -i "s/^CONFIG_DEBUG_KERNEL.*/\\# CONFIG_DEBUG_KERNEL is not set/" .config
|
||||||
|
|
||||||
# Enable the EFI stub
|
# Enable the EFI stub
|
||||||
sed -i "s/.*CONFIG_EFI_STUB.*/CONFIG_EFI_STUB=y/" .config
|
sed -i "s/.*CONFIG_EFI_STUB.*/CONFIG_EFI_STUB=y/" .config
|
||||||
|
|
||||||
# Disable Apple Properties (Useful for Macs but useless in general)
|
# Disable Apple Properties (Useful for Macs but useless in general)
|
||||||
echo "CONFIG_APPLE_PROPERTIES=n" >> .config
|
echo "CONFIG_APPLE_PROPERTIES=n" >> .config
|
||||||
|
|
||||||
|
@ -38,13 +38,13 @@ fi
|
|||||||
|
|
||||||
if [ "$USE_PREDEFINED_BUSYBOX_CONFIG" = "true" ] ; then
|
if [ "$USE_PREDEFINED_BUSYBOX_CONFIG" = "true" ] ; then
|
||||||
# Use predefined configuration file for Busybox.
|
# Use predefined configuration file for Busybox.
|
||||||
echo "Using config file $SRC_DIR/minimal_config/busybox.config"
|
echo "Using config file $SRC_DIR/minimal_config/busybox.config"
|
||||||
cp -f $SRC_DIR/minimal_config/busybox.config .config
|
cp -f $SRC_DIR/minimal_config/busybox.config .config
|
||||||
else
|
else
|
||||||
# Create default configuration file.
|
# Create default configuration file.
|
||||||
echo "Generating default BusyBox configuration..."
|
echo "Generating default BusyBox configuration..."
|
||||||
make defconfig -j $NUM_JOBS
|
make defconfig -j $NUM_JOBS
|
||||||
|
|
||||||
# The 'inetd' applet fails to compile because we use the glibc installation area as
|
# The 'inetd' applet fails to compile because we use the glibc installation area as
|
||||||
# main pointer to the kernel headers (see 05_prepare_glibc.sh) and some headers are
|
# main pointer to the kernel headers (see 05_prepare_glibc.sh) and some headers are
|
||||||
# not resolved. The easiest solution is to ignore this particular applet.
|
# not resolved. The easiest solution is to ignore this particular applet.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "*** PREPARE SRC BEGIN ***"
|
echo "*** PREPARE SRC BEGIN ***"
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "*** GENERATE ROOTFS BEGIN ***"
|
echo "*** GENERATE ROOTFS BEGIN ***"
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ cp -r src/minimal_rootfs/* rootfs
|
|||||||
|
|
||||||
cd rootfs
|
cd rootfs
|
||||||
|
|
||||||
# Remove 'linuxrc' which is used when we boot in 'RAM disk' mode.
|
# Remove 'linuxrc' which is used when we boot in 'RAM disk' mode.
|
||||||
rm -f linuxrc
|
rm -f linuxrc
|
||||||
|
|
||||||
# Read the 'COPY_SOURCE_ROOTFS' property from '.config'
|
# Read the 'COPY_SOURCE_ROOTFS' property from '.config'
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "*** PACK ROOTFS BEGIN ***"
|
echo "*** PACK ROOTFS BEGIN ***"
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "*** GET SYSLINUX BEGIN ***"
|
echo "*** GET SYSLINUX BEGIN ***"
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
# TODO - this shell script file needs serios refactoring since right now it does
|
# TODO - this shell script file needs serios refactoring since right now it does
|
||||||
# too many things:
|
# too many things:
|
||||||
#
|
#
|
||||||
# 1) Deal with 'src' copy.
|
# 1) Deal with 'src' copy.
|
||||||
# 2) Generate the 'overlay' software bundles.
|
# 2) Generate the 'overlay' software bundles.
|
||||||
# 3) Create proper overlay structure.
|
# 3) Create proper overlay structure.
|
||||||
# 4) Prepare the actual ISO structure.
|
# 4) Prepare the actual ISO structure.
|
||||||
# 5) Generate the actual ISO image.
|
# 5) Generate the actual ISO image.
|
||||||
#
|
#
|
||||||
# Probably it's best to create separate shell scripts for each functionality.
|
# Probably it's best to create separate shell scripts for each functionality.
|
||||||
|
|
||||||
echo "*** GENERATE ISO BEGIN ***"
|
echo "*** GENERATE ISO BEGIN ***"
|
||||||
|
|
||||||
@ -76,51 +76,51 @@ if [ "$OVERLAY_TYPE" = "sparse" -a "$(id -u)" = "0" ] ; then
|
|||||||
# script is executed with root permissions or otherwise this block is skipped.
|
# script is executed with root permissions or otherwise this block is skipped.
|
||||||
# All files and folders located in the folder 'minimal_overlay' will be merged
|
# All files and folders located in the folder 'minimal_overlay' will be merged
|
||||||
# with the root folder on boot.
|
# with the root folder on boot.
|
||||||
|
|
||||||
echo "Using sparse file for overlay."
|
echo "Using sparse file for overlay."
|
||||||
|
|
||||||
# This is the BusyBox executable that we have already generated.
|
# This is the BusyBox executable that we have already generated.
|
||||||
BUSYBOX=../rootfs/bin/busybox
|
BUSYBOX=../rootfs/bin/busybox
|
||||||
|
|
||||||
# Create sparse image file with 1MB size. Note that this increases the ISO
|
# Create sparse image file with 1MB size. Note that this increases the ISO
|
||||||
# image size.
|
# image size.
|
||||||
$BUSYBOX truncate -s 1M minimal.img
|
$BUSYBOX truncate -s 1M minimal.img
|
||||||
|
|
||||||
# Find available loop device.
|
# Find available loop device.
|
||||||
LOOP_DEVICE=$($BUSYBOX losetup -f)
|
LOOP_DEVICE=$($BUSYBOX losetup -f)
|
||||||
|
|
||||||
# Associate the available loop device with the sparse image file.
|
# Associate the available loop device with the sparse image file.
|
||||||
$BUSYBOX losetup $LOOP_DEVICE minimal.img
|
$BUSYBOX losetup $LOOP_DEVICE minimal.img
|
||||||
|
|
||||||
# Format the sparse image file with Ext2 file system.
|
# Format the sparse image file with Ext2 file system.
|
||||||
$BUSYBOX mkfs.ext2 $LOOP_DEVICE
|
$BUSYBOX mkfs.ext2 $LOOP_DEVICE
|
||||||
|
|
||||||
# Mount the sparse file in folder 'sparse".
|
# Mount the sparse file in folder 'sparse".
|
||||||
mkdir sparse
|
mkdir sparse
|
||||||
$BUSYBOX mount minimal.img sparse
|
$BUSYBOX mount minimal.img sparse
|
||||||
|
|
||||||
# Create the overlay folders.
|
# Create the overlay folders.
|
||||||
mkdir -p sparse/rootfs
|
mkdir -p sparse/rootfs
|
||||||
mkdir -p sparse/work
|
mkdir -p sparse/work
|
||||||
|
|
||||||
# Copy the overlay content.
|
# Copy the overlay content.
|
||||||
cp -r $SRC_DIR/work/src/minimal_overlay/rootfs/* sparse/rootfs/
|
cp -r $SRC_DIR/work/src/minimal_overlay/rootfs/* sparse/rootfs/
|
||||||
|
|
||||||
# Unmount the sparse file and delete the temporary folder.
|
# Unmount the sparse file and delete the temporary folder.
|
||||||
$BUSYBOX umount sparse
|
$BUSYBOX umount sparse
|
||||||
rm -rf sparse
|
rm -rf sparse
|
||||||
|
|
||||||
# Detach the loop device since we no longer need it.
|
# Detach the loop device since we no longer need it.
|
||||||
$BUSYBOX losetup -d $LOOP_DEVICE
|
$BUSYBOX losetup -d $LOOP_DEVICE
|
||||||
elif [ "$OVERLAY_TYPE" = "folder" ] ; then
|
elif [ "$OVERLAY_TYPE" = "folder" ] ; then
|
||||||
# Use normal folder structure for overlay. All files and folders located in
|
# Use normal folder structure for overlay. All files and folders located in
|
||||||
# the folder 'minimal_overlay' will be merged with the root folder on boot.
|
# the folder 'minimal_overlay' will be merged with the root folder on boot.
|
||||||
|
|
||||||
echo "Using folder structure for overlay."
|
echo "Using folder structure for overlay."
|
||||||
|
|
||||||
mkdir -p minimal/rootfs
|
mkdir -p minimal/rootfs
|
||||||
mkdir -p minimal/work
|
mkdir -p minimal/work
|
||||||
|
|
||||||
cp -rf $SRC_DIR/work/src/minimal_overlay/rootfs/* \
|
cp -rf $SRC_DIR/work/src/minimal_overlay/rootfs/* \
|
||||||
minimal/rootfs/
|
minimal/rootfs/
|
||||||
else
|
else
|
||||||
|
126
src/README
126
src/README
@ -20,100 +20,102 @@ additional software being downloaded, built and installed on the ISO image.
|
|||||||
|
|
||||||
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. Requires ~3MB
|
||||||
additional space. This overlay bundle is not host specific and
|
additional space. This overlay bundle is not host specific and
|
||||||
can always be built. The libraries are useful if you plan to use
|
can always be built. The libraries are useful if you plan to use
|
||||||
more software after boot.
|
more software after boot.
|
||||||
|
|
||||||
This overlay bundle depends on the GLIBC build process.
|
This overlay bundle depends on the GLIBC build process.
|
||||||
|
|
||||||
* 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
|
* 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
|
* Dropbear - SSH server/client. Requires ~1MB additional space. The build
|
||||||
process creates user 'root' with password 'toor'. These are
|
process creates user 'root' with password 'toor'. These are
|
||||||
sample commands which demonstrate how to use Dropbear:
|
sample commands which demonstrate how to use Dropbear:
|
||||||
|
|
||||||
SSH server (Alt + F1): dropbear -E -F
|
SSH server (Alt + F1): dropbear -E -F
|
||||||
SSH client (Alt + F2): dbclient 10.0.2.15 -l root
|
SSH client (Alt + F2): dbclient 10.0.2.15 -l root
|
||||||
|
|
||||||
This overlay bundle requires GLIBC.
|
This overlay bundle requires GLIBC.
|
||||||
|
|
||||||
* Felix OSGi - Apache Felix OSGi framework. Requires ~2MB additional space. Use
|
* Felix OSGi - Apache Felix OSGi framework. Requires ~2MB additional space. Use
|
||||||
the "felix-start" command to run the Apache Felix OSGi framework.
|
the "felix-start" command to run the Apache Felix OSGi framework.
|
||||||
|
|
||||||
This overlay bundle requires JRE or JDK.
|
This overlay bundle requires JRE or JDK.
|
||||||
|
|
||||||
* fio - I/O load generator that can simulate a wide variety of workloads
|
* fio - I/O load generator that can simulate a wide variety of workloads
|
||||||
on RAM or disks. fio is essential for troubleshooting data
|
on RAM or disks. fio is essential for troubleshooting data
|
||||||
bottlenecks.
|
bottlenecks.
|
||||||
|
|
||||||
* JRE / JDK - Oracle's JRE or JDK. Requires ~366MB additional space for JDK.
|
* JRE / JDK - Oracle's JRE or JDK. Requires ~366MB additional space for JDK.
|
||||||
This overlay bundle requires some manual preparation steps. Refer
|
This overlay bundle requires some manual preparation steps. Refer
|
||||||
to the "JAVA_ARCHIVE" property in the ".config" file for more
|
to the "JAVA_ARCHIVE" property in the ".config" file for more
|
||||||
detailed information.
|
detailed information.
|
||||||
|
|
||||||
This overlay bundle requires GLIBC. JDK 9 requires ZLIB.
|
This overlay bundle requires GLIBC. JDK 9 requires ZLIB.
|
||||||
|
|
||||||
* kbd - Keyboard utilities and keymaps, you can for example load
|
* kbd - Keyboard utilities and keymaps, you can for example load
|
||||||
a german keyboard layout:
|
a german keyboard layout:
|
||||||
|
|
||||||
loadkeys de
|
loadkeys de
|
||||||
|
|
||||||
* libevent - event notification library API provides a mechanism to execute a
|
* libevent - event notification library API provides a mechanism to execute a
|
||||||
callback function when a specific event occurs on a file
|
callback function when a specific event occurs on a file
|
||||||
descriptor or after a timeout has been reached.
|
descriptor or after a timeout has been reached.
|
||||||
|
|
||||||
* Links - Text based browser. Requires ~1MB additional space. Use the
|
* kexec-tools - Kexec tools, can be used to boot another kernel from userspace
|
||||||
"links" command to activate the browser.
|
|
||||||
|
|
||||||
* Open JDK - The open source JDK. No need for manual steps.
|
* Links - Text based browser. Requires ~1MB additional space. 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.
|
||||||
|
|
||||||
* Lua - The Lua Scripting Language 5.3. Requires ~ 800kb additional
|
This overlay bundle requires GLIBC and ZLIB.
|
||||||
space. Use the "lua" command to run an interactive lua
|
|
||||||
interpreter.
|
|
||||||
|
|
||||||
* MLL Utils - Set of experimental shell scripts (mll-*.sh) which provide
|
* Lua - The Lua Scripting Language 5.3. Requires ~ 800kb additional
|
||||||
additional functionality, e.g. installer and useful tools.
|
space. Use the "lua" command to run an interactive lua
|
||||||
|
interpreter.
|
||||||
|
|
||||||
This overlay bundle is currently experimental and its build
|
* MLL Utils - Set of experimental shell scripts (mll-*.sh) which provide
|
||||||
process depends on the host machine.
|
additional functionality, e.g. installer and useful tools.
|
||||||
|
|
||||||
* nano - Simple command-line text editor with on-screen shortcuts.
|
This overlay bundle is currently experimental and its build
|
||||||
|
process depends on the host machine.
|
||||||
|
|
||||||
This overlay bundle requires ncurses.
|
* nano - Simple command-line text editor with on-screen shortcuts.
|
||||||
|
|
||||||
* ncurses - "GUI-like" API that runs within a terminal emulator.
|
This overlay bundle requires ncurses.
|
||||||
|
|
||||||
* nweb - nweb is a very small and easy to use webserver, it is run
|
* ncurses - "GUI-like" API that runs within a terminal emulator.
|
||||||
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,
|
* nweb - nweb is a very small and easy to use webserver, it is run
|
||||||
memory, I/O, and disk stress on the system. stress is useful for
|
automatically on port 80. To portforward port 80 from the
|
||||||
troubleshooting CPU and RAM.
|
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.
|
||||||
|
|
||||||
* util_linux - Set of executable utilities distributed by the Linux Kernel
|
* stress - simple workload generator. Imposes a configurable amount of CPU,
|
||||||
similar to busybox or GNU Core Utils.
|
memory, I/O, and disk stress on the system. stress is useful for
|
||||||
|
troubleshooting CPU and RAM.
|
||||||
|
|
||||||
Some packages in this overlay bundle require ncurses.
|
* util_linux - Set of executable utilities distributed by the Linux Kernel
|
||||||
|
similar to busybox or GNU Core Utils.
|
||||||
|
|
||||||
* vim - An advanced text editor that seeks to provide the power of
|
Some packages in this overlay bundle require ncurses.
|
||||||
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.
|
||||||
|
|
||||||
* ZLIB - Software library used for data compression.
|
This package will create symlinks on top of vi.
|
||||||
|
|
||||||
|
* ZLIB - Software library used for data compression.
|
||||||
|
|
||||||
|
|
||||||
### ### ###
|
### ### ###
|
||||||
|
@ -12,36 +12,36 @@ elif [ "$1" = "-f" -o "$1" = "--folder" ] ; then
|
|||||||
echo "Using option '-f' (or '--folder') requires root permissions."
|
echo "Using option '-f' (or '--folder') requires root permissions."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f hdd.img
|
rm -f hdd.img
|
||||||
truncate -s 20M hdd.img
|
truncate -s 20M hdd.img
|
||||||
echo "Created new hard disk image file 'hdd.img' with 20MB size."
|
echo "Created new hard disk image file 'hdd.img' with 20MB size."
|
||||||
|
|
||||||
LOOP_DEVICE=$(losetup -f)
|
LOOP_DEVICE=$(losetup -f)
|
||||||
losetup $LOOP_DEVICE hdd.img
|
losetup $LOOP_DEVICE hdd.img
|
||||||
echo "Attached hard disk image file to loop device."
|
echo "Attached hard disk image file to loop device."
|
||||||
|
|
||||||
mkfs.ext2 $LOOP_DEVICE
|
mkfs.ext2 $LOOP_DEVICE
|
||||||
echo "Hard disk image file has been formatted with Ext2 filesystem."
|
echo "Hard disk image file has been formatted with Ext2 filesystem."
|
||||||
|
|
||||||
mkdir folder
|
mkdir folder
|
||||||
mount hdd.img folder
|
mount hdd.img folder
|
||||||
echo "Mounted hard disk image file to temporary folder."
|
echo "Mounted hard disk image file to temporary folder."
|
||||||
|
|
||||||
mkdir -p folder/minimal/rootfs
|
mkdir -p folder/minimal/rootfs
|
||||||
mkdir -p folder/minimal/work
|
mkdir -p folder/minimal/work
|
||||||
echo "Overlay structure has been created."
|
echo "Overlay structure has been created."
|
||||||
|
|
||||||
echo "This file is on external hard disk." > folder/minimal/rootfs/overlay.txt
|
echo "This file is on external hard disk." > folder/minimal/rootfs/overlay.txt
|
||||||
echo "Created sample text file."
|
echo "Created sample text file."
|
||||||
|
|
||||||
umount folder
|
umount folder
|
||||||
rm -rf folder
|
rm -rf folder
|
||||||
echo "Unmounted hard disk image file."
|
echo "Unmounted hard disk image file."
|
||||||
|
|
||||||
losetup -d $LOOP_DEVICE
|
losetup -d $LOOP_DEVICE
|
||||||
echo "Detached hard disk image file from loop device."
|
echo "Detached hard disk image file from loop device."
|
||||||
|
|
||||||
chown $(logname) hdd.img
|
chown $(logname) hdd.img
|
||||||
echo "Applied original ownership to hard disk image file."
|
echo "Applied original ownership to hard disk image file."
|
||||||
elif [ "$1" = "-s" -o "$1" = "--sparse" ] ; then
|
elif [ "$1" = "-s" -o "$1" = "--sparse" ] ; then
|
||||||
@ -49,22 +49,22 @@ elif [ "$1" = "-s" -o "$1" = "--sparse" ] ; then
|
|||||||
echo "Using option '-s' (or '--sparse') requires root permissions."
|
echo "Using option '-s' (or '--sparse') requires root permissions."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f hdd.img
|
rm -f hdd.img
|
||||||
truncate -s 20M hdd.img
|
truncate -s 20M hdd.img
|
||||||
echo "Created new hard disk image file 'hdd.img' with 20MB size."
|
echo "Created new hard disk image file 'hdd.img' with 20MB size."
|
||||||
|
|
||||||
LOOP_DEVICE_HDD=$(losetup -f)
|
LOOP_DEVICE_HDD=$(losetup -f)
|
||||||
losetup $LOOP_DEVICE_HDD hdd.img
|
losetup $LOOP_DEVICE_HDD hdd.img
|
||||||
echo "Attached hard disk image file to loop device."
|
echo "Attached hard disk image file to loop device."
|
||||||
|
|
||||||
mkfs.vfat $LOOP_DEVICE_HDD
|
mkfs.vfat $LOOP_DEVICE_HDD
|
||||||
echo "Hard disk image file has been formatted with FAT filesystem."
|
echo "Hard disk image file has been formatted with FAT filesystem."
|
||||||
|
|
||||||
mkdir sparse
|
mkdir sparse
|
||||||
mount hdd.img sparse
|
mount hdd.img sparse
|
||||||
echo "Mounted hard disk image file to temporary folder."
|
echo "Mounted hard disk image file to temporary folder."
|
||||||
|
|
||||||
rm -f sparse/minimal.img
|
rm -f sparse/minimal.img
|
||||||
truncate -s 1M sparse/minimal.img
|
truncate -s 1M sparse/minimal.img
|
||||||
echo "Created new overlay image file with 1MB size."
|
echo "Created new overlay image file with 1MB size."
|
||||||
@ -79,11 +79,11 @@ elif [ "$1" = "-s" -o "$1" = "--sparse" ] ; then
|
|||||||
mkdir ovl
|
mkdir ovl
|
||||||
mount sparse/minimal.img ovl
|
mount sparse/minimal.img ovl
|
||||||
echo "Mounted overlay image file to temporary folder."
|
echo "Mounted overlay image file to temporary folder."
|
||||||
|
|
||||||
mkdir -p ovl/rootfs
|
mkdir -p ovl/rootfs
|
||||||
mkdir -p ovl/work
|
mkdir -p ovl/work
|
||||||
echo "Overlay structure has been created."
|
echo "Overlay structure has been created."
|
||||||
|
|
||||||
echo "Create sample text file."
|
echo "Create sample text file."
|
||||||
echo "This file is on external hard disk." > ovl/rootfs/overlay.txt
|
echo "This file is on external hard disk." > ovl/rootfs/overlay.txt
|
||||||
|
|
||||||
@ -99,15 +99,15 @@ elif [ "$1" = "-s" -o "$1" = "--sparse" ] ; then
|
|||||||
sleep 1
|
sleep 1
|
||||||
echo "Overlay image file has been detached from loop device."
|
echo "Overlay image file has been detached from loop device."
|
||||||
|
|
||||||
umount sparse
|
umount sparse
|
||||||
sleep 1
|
sleep 1
|
||||||
rm -rf sparse
|
rm -rf sparse
|
||||||
echo "Unmounted hard disk image file."
|
echo "Unmounted hard disk image file."
|
||||||
|
|
||||||
losetup -d $LOOP_DEVICE_HDD
|
losetup -d $LOOP_DEVICE_HDD
|
||||||
sleep 1
|
sleep 1
|
||||||
echo "Hard disk image file has been detached from loop device."
|
echo "Hard disk image file has been detached from loop device."
|
||||||
|
|
||||||
chown $(logname) hdd.img
|
chown $(logname) hdd.img
|
||||||
echo "Applied original ownership to hard disk image file."
|
echo "Applied original ownership to hard disk image file."
|
||||||
elif [ "$1" = "-h" -o "$1" = "--help" ] ; then
|
elif [ "$1" = "-h" -o "$1" = "--help" ] ; then
|
||||||
@ -115,7 +115,7 @@ elif [ "$1" = "-h" -o "$1" = "--help" ] ; then
|
|||||||
Usage: $0 [OPTION]
|
Usage: $0 [OPTION]
|
||||||
This utility generates 20MB sparse file 'hdd.img' which can be used as QEMU
|
This utility generates 20MB sparse file 'hdd.img' which can be used as QEMU
|
||||||
disk image where all filesystem changes from the live session are persisted.
|
disk image where all filesystem changes from the live session are persisted.
|
||||||
|
|
||||||
-e, --empty Create empty sparse image file which is not formatted.
|
-e, --empty Create empty sparse image file which is not formatted.
|
||||||
-f, --folder Create sparse image file formatted with Ext2 filesystem which
|
-f, --folder Create sparse image file formatted with Ext2 filesystem which
|
||||||
contains compatible overlay folder structure.
|
contains compatible overlay folder structure.
|
||||||
|
@ -13,6 +13,8 @@ DESTDIR="$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs"
|
|||||||
mkdir -p "$DESTDIR"
|
mkdir -p "$DESTDIR"
|
||||||
|
|
||||||
install -d -m755 "$DESTDIR/etc"
|
install -d -m755 "$DESTDIR/etc"
|
||||||
|
install -m644 "$SRC_DIR/hosts" "$DESTDIR/etc/hosts"
|
||||||
|
install -m644 "$SRC_DIR/nsswitch.conf" "$DESTDIR/etc/nsswitch.conf"
|
||||||
install -m644 "$SRC_DIR/resolv.conf" "$DESTDIR/etc/resolv.conf"
|
install -m644 "$SRC_DIR/resolv.conf" "$DESTDIR/etc/resolv.conf"
|
||||||
install -d -m755 "$DESTDIR/etc/autorun"
|
install -d -m755 "$DESTDIR/etc/autorun"
|
||||||
install -m755 "$SRC_DIR/01_network.sh" "$DESTDIR/etc/autorun/01_network.sh"
|
install -m755 "$SRC_DIR/01_network.sh" "$DESTDIR/etc/autorun/01_network.sh"
|
||||||
@ -22,6 +24,7 @@ install -m755 "$SRC_DIR/05_rc.dhcp" "$DESTDIR/etc/05_rc.dhcp"
|
|||||||
install -d -m755 "$DESTDIR/lib"
|
install -d -m755 "$DESTDIR/lib"
|
||||||
install -m755 "$SYSROOT/lib/libresolv.so.2" "$DESTDIR/lib/libresolv.so.2"
|
install -m755 "$SYSROOT/lib/libresolv.so.2" "$DESTDIR/lib/libresolv.so.2"
|
||||||
install -m755 "$SYSROOT/lib/libnss_dns.so.2" "$DESTDIR/lib/libnss_dns.so.2"
|
install -m755 "$SYSROOT/lib/libnss_dns.so.2" "$DESTDIR/lib/libnss_dns.so.2"
|
||||||
|
install -m755 "$SYSROOT/lib/libnss_files.so.2" "$DESTDIR/lib/libnss_files.so.2"
|
||||||
strip -g "$DESTDIR/lib/*" 2>/dev/null
|
strip -g "$DESTDIR/lib/*" 2>/dev/null
|
||||||
|
|
||||||
echo "dhcp scripts and libraries have been installed"
|
echo "dhcp scripts and libraries have been installed"
|
||||||
|
5
src/minimal_overlay/bundles/dhcp/hosts
Normal file
5
src/minimal_overlay/bundles/dhcp/hosts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# /etc/hosts
|
||||||
|
127.0.0.1 localhost
|
||||||
|
|
||||||
|
# ipv6
|
||||||
|
::1 localhost ipv6-localhost
|
1
src/minimal_overlay/bundles/dhcp/nsswitch.conf
Normal file
1
src/minimal_overlay/bundles/dhcp/nsswitch.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
hosts: files dns
|
1
src/minimal_overlay/bundles/dialog/mll_deps
Normal file
1
src/minimal_overlay/bundles/dialog/mll_deps
Normal file
@ -0,0 +1 @@
|
|||||||
|
ncurses
|
1
src/minimal_overlay/bundles/dropbear/mll_deps
Normal file
1
src/minimal_overlay/bundles/dropbear/mll_deps
Normal file
@ -0,0 +1 @@
|
|||||||
|
glibc_full
|
1
src/minimal_overlay/bundles/nano/mll_deps
Normal file
1
src/minimal_overlay/bundles/nano/mll_deps
Normal file
@ -0,0 +1 @@
|
|||||||
|
ncurses
|
@ -24,7 +24,7 @@ install -m644 "$SRC_DIR/index.html" "$DESTDIR/srv/www/index.html"
|
|||||||
install -m644 "$SRC_DIR/favicon.ico" "$DESTDIR/srv/www/favicon.ico"
|
install -m644 "$SRC_DIR/favicon.ico" "$DESTDIR/srv/www/favicon.ico"
|
||||||
install -d -m755 "$DESTDIR/etc"
|
install -d -m755 "$DESTDIR/etc"
|
||||||
install -d -m755 "$DESTDIR/etc/autorun"
|
install -d -m755 "$DESTDIR/etc/autorun"
|
||||||
install -m755 "$SRC_DIR/nweb.sh" "$DESTDIR/etc/autorun/90_nweb.sh"
|
install -m755 "$SRC_DIR/90_nweb.sh" "$DESTDIR/etc/autorun/90_nweb.sh"
|
||||||
|
|
||||||
echo "nweb has been installed."
|
echo "nweb has been installed."
|
||||||
echo "It will be autostarted on boot."
|
echo "It will be autostarted on boot."
|
||||||
|
1
src/minimal_overlay/bundles/vim/mll_deps
Normal file
1
src/minimal_overlay/bundles/vim/mll_deps
Normal file
@ -0,0 +1 @@
|
|||||||
|
ncurses
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
SRC_DIR=$(pwd)
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ for dir in $(ls -d */ 2>/dev/null) ; do
|
|||||||
cp -r $dir $SRC_DIR/../work/src/minimal_overlay/rootfs
|
cp -r $dir $SRC_DIR/../work/src/minimal_overlay/rootfs
|
||||||
echo "Default overlay folder '$dir' has been prepared."
|
echo "Default overlay folder '$dir' has been prepared."
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Ready to continue with the overlay software."
|
echo "Ready to continue with the overlay software."
|
||||||
|
|
||||||
cd $SRC_DIR
|
cd $SRC_DIR
|
||||||
|
@ -30,8 +30,10 @@ echo -e "Welcome to \\e[1mMinimal \\e[32mLinux \\e[31mLive\\e[0m (/sbin/init)"
|
|||||||
if [ -d /etc/autorun ] ; then
|
if [ -d /etc/autorun ] ; then
|
||||||
for AUTOSCRIPT in /etc/autorun/*
|
for AUTOSCRIPT in /etc/autorun/*
|
||||||
do
|
do
|
||||||
echo -e "Executing \\e[32m$AUTOSCRIPT\\e[0m in subshell."
|
if [ -f "$AUTOSCRIPT" ] && [ -x "$AUTOSCRIPT" ]; then
|
||||||
sh $AUTOSCRIPT
|
echo -e "Executing \\e[32m$AUTOSCRIPT\\e[0m in subshell."
|
||||||
|
$AUTOSCRIPT
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user