From 0441e69d0c6a791a527a86fa29ea619dcb2f9388 Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Sun, 3 Apr 2016 01:19:54 +0300 Subject: [PATCH] Moved the stable 'glibc-busybox' scripts from the experimental folder to the root script folder. Removed the 'experimental' folder because the DNS resolving issue has been fixed. Added website information about the '03-Apr-2016' release. --- src/.config | 10 +- .../glibc-busybox => }/00_prepare.sh | 0 .../glibc-busybox => }/01_get_kernel.sh | 0 .../glibc-busybox => }/02_build_kernel.sh | 0 .../glibc-busybox => }/03_get_glibc.sh | 0 .../glibc-busybox => }/04_build_glibc.sh | 0 .../glibc-busybox => }/05_prepare_glibc.sh | 0 .../glibc-busybox => }/06_get_busybox.sh | 0 .../glibc-busybox => }/07_build_busybox.sh | 0 .../glibc-busybox => }/08_generate_rootfs.sh | 0 .../glibc-busybox => }/09_pack_rootfs.sh | 0 src/0_prepare.sh | 8 -- .../glibc-busybox => }/10_generate_iso.sh | 0 src/1_get_kernel.sh | 24 ---- src/2_build_kernel.sh | 23 ---- src/3_get_busybox.sh | 24 ---- src/4_build_busybox.sh | 33 ----- src/5_generate_rootfs.sh | 116 ----------------- src/6_pack_rootfs.sh | 21 --- src/7_generate_iso.sh | 19 --- src/build_minimal_linux_live.sh | 20 +-- src/experimental/glibc-busybox/.config | 18 --- .../glibc-busybox/build_minimal_linux_live.sh | 14 -- src/experimental/glibc-busybox/qemu32.sh | 4 - src/experimental/glibc-busybox/qemu64.sh | 4 - src/experimental/glibc-toybox/.config | 12 -- src/experimental/glibc-toybox/0_prepare.sh | 8 -- src/experimental/glibc-toybox/1_get_kernel.sh | 24 ---- .../glibc-toybox/2_build_kernel.sh | 23 ---- src/experimental/glibc-toybox/3_get_toybox.sh | 24 ---- .../glibc-toybox/4_build_toybox.sh | 36 ----- .../glibc-toybox/5_generate_rootfs.sh | 70 ---------- .../glibc-toybox/6_pack_rootfs.sh | 14 -- .../glibc-toybox/7_generate_iso.sh | 19 --- .../glibc-toybox/build_minimal_linux_live.sh | 10 -- src/experimental/glibc-toybox/qemu32.sh | 4 - src/experimental/glibc-toybox/qemu64.sh | 4 - src/experimental/musl-busybox/.config | 18 --- src/experimental/musl-busybox/00_prepare.sh | 8 -- .../musl-busybox/01_get_kernel.sh | 24 ---- .../musl-busybox/02_build_kernel.sh | 26 ---- src/experimental/musl-busybox/03_get_musl.sh | 24 ---- .../musl-busybox/04_build_musl.sh | 18 --- .../musl-busybox/05_prepare_musl.sh | 30 ----- .../musl-busybox/06_get_busybox.sh | 24 ---- .../musl-busybox/07_build_busybox.sh | 41 ------ .../musl-busybox/08_generate_rootfs.sh | 123 ------------------ .../musl-busybox/09_pack_rootfs.sh | 14 -- .../musl-busybox/10_generate_iso.sh | 53 -------- .../musl-busybox/build_minimal_linux_live.sh | 14 -- src/experimental/musl-busybox/qemu32.sh | 4 - src/experimental/musl-busybox/qemu64.sh | 4 - src/experimental/musl-toybox/.config | 18 --- src/experimental/musl-toybox/00_prepare.sh | 8 -- src/experimental/musl-toybox/01_get_kernel.sh | 24 ---- .../musl-toybox/02_build_kernel.sh | 23 ---- src/experimental/musl-toybox/03_get_musl.sh | 24 ---- src/experimental/musl-toybox/04_build_musl.sh | 18 --- .../musl-toybox/05_prepare_musl.sh | 65 --------- src/experimental/musl-toybox/06_get_toybox.sh | 24 ---- .../musl-toybox/07_build_toybox.sh | 54 -------- .../musl-toybox/08_generate_rootfs.sh | 70 ---------- .../musl-toybox/09_pack_rootfs.sh | 14 -- .../musl-toybox/10_generate_iso.sh | 19 --- .../musl-toybox/build_minimal_linux_live.sh | 10 -- src/experimental/musl-toybox/qemu32.sh | 4 - src/experimental/musl-toybox/qemu64.sh | 4 - src/qemu32.sh | 2 +- src/qemu64.sh | 2 +- .../the_dao_of_minimal_linux_live.txt | 0 www/index.html | 121 ++++++++++++----- 71 files changed, 114 insertions(+), 1401 deletions(-) rename src/{experimental/glibc-busybox => }/00_prepare.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/01_get_kernel.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/02_build_kernel.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/03_get_glibc.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/04_build_glibc.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/05_prepare_glibc.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/06_get_busybox.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/07_build_busybox.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/08_generate_rootfs.sh (100%) mode change 100755 => 100644 rename src/{experimental/glibc-busybox => }/09_pack_rootfs.sh (100%) mode change 100755 => 100644 delete mode 100755 src/0_prepare.sh rename src/{experimental/glibc-busybox => }/10_generate_iso.sh (100%) mode change 100755 => 100644 delete mode 100755 src/1_get_kernel.sh delete mode 100755 src/2_build_kernel.sh delete mode 100755 src/3_get_busybox.sh delete mode 100755 src/4_build_busybox.sh delete mode 100755 src/5_generate_rootfs.sh delete mode 100755 src/6_pack_rootfs.sh delete mode 100755 src/7_generate_iso.sh delete mode 100644 src/experimental/glibc-busybox/.config delete mode 100755 src/experimental/glibc-busybox/build_minimal_linux_live.sh delete mode 100755 src/experimental/glibc-busybox/qemu32.sh delete mode 100755 src/experimental/glibc-busybox/qemu64.sh delete mode 100644 src/experimental/glibc-toybox/.config delete mode 100755 src/experimental/glibc-toybox/0_prepare.sh delete mode 100755 src/experimental/glibc-toybox/1_get_kernel.sh delete mode 100755 src/experimental/glibc-toybox/2_build_kernel.sh delete mode 100755 src/experimental/glibc-toybox/3_get_toybox.sh delete mode 100755 src/experimental/glibc-toybox/4_build_toybox.sh delete mode 100755 src/experimental/glibc-toybox/5_generate_rootfs.sh delete mode 100755 src/experimental/glibc-toybox/6_pack_rootfs.sh delete mode 100755 src/experimental/glibc-toybox/7_generate_iso.sh delete mode 100755 src/experimental/glibc-toybox/build_minimal_linux_live.sh delete mode 100755 src/experimental/glibc-toybox/qemu32.sh delete mode 100755 src/experimental/glibc-toybox/qemu64.sh delete mode 100644 src/experimental/musl-busybox/.config delete mode 100755 src/experimental/musl-busybox/00_prepare.sh delete mode 100755 src/experimental/musl-busybox/01_get_kernel.sh delete mode 100755 src/experimental/musl-busybox/02_build_kernel.sh delete mode 100755 src/experimental/musl-busybox/03_get_musl.sh delete mode 100755 src/experimental/musl-busybox/04_build_musl.sh delete mode 100755 src/experimental/musl-busybox/05_prepare_musl.sh delete mode 100755 src/experimental/musl-busybox/06_get_busybox.sh delete mode 100755 src/experimental/musl-busybox/07_build_busybox.sh delete mode 100755 src/experimental/musl-busybox/08_generate_rootfs.sh delete mode 100755 src/experimental/musl-busybox/09_pack_rootfs.sh delete mode 100755 src/experimental/musl-busybox/10_generate_iso.sh delete mode 100755 src/experimental/musl-busybox/build_minimal_linux_live.sh delete mode 100755 src/experimental/musl-busybox/qemu32.sh delete mode 100755 src/experimental/musl-busybox/qemu64.sh delete mode 100644 src/experimental/musl-toybox/.config delete mode 100755 src/experimental/musl-toybox/00_prepare.sh delete mode 100755 src/experimental/musl-toybox/01_get_kernel.sh delete mode 100755 src/experimental/musl-toybox/02_build_kernel.sh delete mode 100755 src/experimental/musl-toybox/03_get_musl.sh delete mode 100755 src/experimental/musl-toybox/04_build_musl.sh delete mode 100755 src/experimental/musl-toybox/05_prepare_musl.sh delete mode 100755 src/experimental/musl-toybox/06_get_toybox.sh delete mode 100755 src/experimental/musl-toybox/07_build_toybox.sh delete mode 100755 src/experimental/musl-toybox/08_generate_rootfs.sh delete mode 100755 src/experimental/musl-toybox/09_pack_rootfs.sh delete mode 100755 src/experimental/musl-toybox/10_generate_iso.sh delete mode 100755 src/experimental/musl-toybox/build_minimal_linux_live.sh delete mode 100755 src/experimental/musl-toybox/qemu32.sh delete mode 100755 src/experimental/musl-toybox/qemu64.sh rename src/{experimental/glibc-busybox => }/the_dao_of_minimal_linux_live.txt (100%) diff --git a/src/.config b/src/.config index 656a06199..1b2a837e9 100644 --- a/src/.config +++ b/src/.config @@ -2,11 +2,17 @@ # # http://kernel.org # -KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.6.tar.xz +KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.6.tar.xz + +# You can find the latest GNU libc source bundles here: +# +# http://gnu.org/software/libc +# +GLIBC_SOURCE_URL=http://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.bz2 # You can find the latest BusyBox source bundles here: # # http://busybox.net # -BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.23.2.tar.bz2 +BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.24.2.tar.bz2 diff --git a/src/experimental/glibc-busybox/00_prepare.sh b/src/00_prepare.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/00_prepare.sh rename to src/00_prepare.sh diff --git a/src/experimental/glibc-busybox/01_get_kernel.sh b/src/01_get_kernel.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/01_get_kernel.sh rename to src/01_get_kernel.sh diff --git a/src/experimental/glibc-busybox/02_build_kernel.sh b/src/02_build_kernel.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/02_build_kernel.sh rename to src/02_build_kernel.sh diff --git a/src/experimental/glibc-busybox/03_get_glibc.sh b/src/03_get_glibc.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/03_get_glibc.sh rename to src/03_get_glibc.sh diff --git a/src/experimental/glibc-busybox/04_build_glibc.sh b/src/04_build_glibc.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/04_build_glibc.sh rename to src/04_build_glibc.sh diff --git a/src/experimental/glibc-busybox/05_prepare_glibc.sh b/src/05_prepare_glibc.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/05_prepare_glibc.sh rename to src/05_prepare_glibc.sh diff --git a/src/experimental/glibc-busybox/06_get_busybox.sh b/src/06_get_busybox.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/06_get_busybox.sh rename to src/06_get_busybox.sh diff --git a/src/experimental/glibc-busybox/07_build_busybox.sh b/src/07_build_busybox.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/07_build_busybox.sh rename to src/07_build_busybox.sh diff --git a/src/experimental/glibc-busybox/08_generate_rootfs.sh b/src/08_generate_rootfs.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/08_generate_rootfs.sh rename to src/08_generate_rootfs.sh diff --git a/src/experimental/glibc-busybox/09_pack_rootfs.sh b/src/09_pack_rootfs.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/09_pack_rootfs.sh rename to src/09_pack_rootfs.sh diff --git a/src/0_prepare.sh b/src/0_prepare.sh deleted file mode 100755 index b1f8e4ed3..000000000 --- a/src/0_prepare.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -rm -rf work -mkdir work - -# -p stops errors if the directory already exists -mkdir -p source - diff --git a/src/experimental/glibc-busybox/10_generate_iso.sh b/src/10_generate_iso.sh old mode 100755 new mode 100644 similarity index 100% rename from src/experimental/glibc-busybox/10_generate_iso.sh rename to src/10_generate_iso.sh diff --git a/src/1_get_kernel.sh b/src/1_get_kernel.sh deleted file mode 100755 index 0d79b79a1..000000000 --- a/src/1_get_kernel.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character -DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading kernel file -# -c option allows the download to resume -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted kernel -rm -rf ../work/kernel -mkdir ../work/kernel - -# Extract kernel to folder 'work/kernel' -# Full path will be something like 'work/kernel/linux-3.16.1' -tar -xvf $ARCHIVE_FILE -C ../work/kernel - -cd .. - diff --git a/src/2_build_kernel.sh b/src/2_build_kernel.sh deleted file mode 100755 index 1734a0270..000000000 --- a/src/2_build_kernel.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -cd work/kernel - -# Change to the first directory ls finds, e.g. 'linux-3.18.6' -cd $(ls -d *) - -# Cleans up the kernel sources, including configuration files -make mrproper - -# Create a default configuration file for the kernel -make defconfig - -# Changes the name of the system -sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config - -# Compile the kernel with optimization for "parallel jobs" = "number of processors" -# Good explanation of the different kernels -# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux -make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l) - -cd ../../.. - diff --git a/src/3_get_busybox.sh b/src/3_get_busybox.sh deleted file mode 100755 index 672bb5841..000000000 --- a/src/3_get_busybox.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character -DOWNLOAD_URL=$(grep -i BUSYBOX_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading busybox source -# -c option allows the download to resume -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted busybox -rm -rf ../work/busybox -mkdir ../work/busybox - -# Extract busybox to folder 'busybox' -# Full path will be something like 'work/busybox/busybox-1.23.1' -tar -xvf $ARCHIVE_FILE -C ../work/busybox - -cd .. - diff --git a/src/4_build_busybox.sh b/src/4_build_busybox.sh deleted file mode 100755 index b54ada851..000000000 --- a/src/4_build_busybox.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -cd work/busybox - -# Change to the first directory ls finds, e.g. 'busybox-1.23.1' -cd $(ls -d *) - -# Remove previously generated artefacts -make clean - -# Create a default configuration file -make defconfig - -# Change the configuration, so that busybox is statically compiled -# You could do this manually with 'make menuconfig' -sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config - -# Busybox has "RPC networking" enabled in default configuration file. -# In glibc > 2.14 such support was removed by default. -# http://lists.busybox.net/pipermail/buildroot/2012-June/055173.html -# It causes failures on glibc toolchains without RPC support. -sed -e 's/.*CONFIG_FEATURE_HAVE_RPC.*/CONFIG_FEATURE_HAVE_RPC=n/' -i .config -sed -e 's/.*CONFIG_FEATURE_INETD_RPC.*/CONFIG_FEATURE_INETD_RPC=n/' -i .config - -# Compile busybox with optimization for "parallel jobs" = "number of processors" -make busybox -j $(grep ^processor /proc/cpuinfo | wc -l) - -# Create the symlinks for busybox -# It uses the file 'busybox.links' for this -make install - -cd ../../.. - diff --git a/src/5_generate_rootfs.sh b/src/5_generate_rootfs.sh deleted file mode 100755 index 7a4441f2c..000000000 --- a/src/5_generate_rootfs.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh - -cd work - -rm -rf rootfs - -cd busybox -cd $(ls -d *) - -# Copy all BusyBox generated stuff to the location of our "initramfs" folder. -cp -R _install ../../rootfs -cd ../../rootfs - -# Remove "linuxrc" which is used when we boot in "RAM disk" mode. -rm -f linuxrc - -# Create root FS folders -mkdir dev -mkdir etc -mkdir proc -mkdir root -mkdir src -mkdir sys -mkdir tmp - -# "1" means that only the owner of a file/directory (or root) can remove it. -chmod 1777 tmp - -cd etc - -# The script "/etc/bootscript.sh" is automatically executed as part of the -# "init" proess. We suppress most kernel messages, mount all crytical file -# systems, loop through all available network devices and we configure them -# through DHCP. -cat > bootscript.sh << EOF -#!/bin/sh - -dmesg -n 1 -mount -t devtmpfs none /dev -mount -t proc none /proc -mount -t sysfs none /sys - -for DEVICE in /sys/class/net/* ; do - ip link set \${DEVICE##*/} up - [ \${DEVICE##*/} != lo ] && udhcpc -b -i \${DEVICE##*/} -s /etc/rc.dhcp -done - -EOF - -chmod +x bootscript.sh - -# The script "/etc/rc.dhcp" is automatically invoked for each network device. -cat > rc.dhcp << EOF -#!/bin/sh - -ip addr add \$ip/\$mask dev \$interface - -if [ "\$router" ]; then - ip route add default via \$router dev \$interface -fi - -EOF - -chmod +x rc.dhcp - -# The file "/etc/welcome.txt" is displayed on every boot of the system in each -# available terminal. -cat > welcome.txt << EOF - - ##################################### - # # - # Welcome to "Minimal Linux Live" # - # # - ##################################### - -EOF - -# The file "/etc/inittab" contains the configuration which defines how the -# system will be initialized. Check the following URL for more details: -# http://git.busybox.net/busybox/tree/examples/inittab -cat > inittab << EOF -::sysinit:/etc/bootscript.sh -::restart:/sbin/init -::ctrlaltdel:/sbin/reboot -::once:cat /etc/welcome.txt -::respawn:/bin/cttyhack /bin/sh -tty2::once:cat /etc/welcome.txt -tty2::respawn:/bin/sh -tty3::once:cat /etc/welcome.txt -tty3::respawn:/bin/sh -tty4::once:cat /etc/welcome.txt -tty4::respawn:/bin/sh - -EOF - -cd .. - -# The "/init" script passes the execution to "/sbin/init" which in turn looks -# for the configuration file "/etc/inittab". -cat > init << EOF -#!/bin/sh - -exec /sbin/init - -EOF - -chmod +x init - -# Copy all source files to "/src". Note that the scripts won't work there. -cp ../../*.sh src -cp ../../.config src -chmod +r src/*.sh -chmod +r src/.config - -cd ../.. - diff --git a/src/6_pack_rootfs.sh b/src/6_pack_rootfs.sh deleted file mode 100755 index f7e1f08ad..000000000 --- a/src/6_pack_rootfs.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -cd work - -# Remove the old initramfs archive if it exists. -rm -f rootfs.cpio.gz - -cd rootfs - -# Suggested update by John Jolly. -# -# find . | cpio -R root:root -H newc -o | gzip > ../rootfs.cpio.gz -# -# This produces a root fs with files and directories all owned by user 0, group 0. -# Note: test this change as soon as possible! -# -# Packs the current folder structure in "cpio.gz" archive. -find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz - -cd ../.. - diff --git a/src/7_generate_iso.sh b/src/7_generate_iso.sh deleted file mode 100755 index 38c951585..000000000 --- a/src/7_generate_iso.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -rm -f minimal_linux_live.iso - -cd work/kernel -cd $(ls -d *) - -# Edit Makefile to look for genisoimage instead of mkisofs. This was added as a -# workaround for some "Debian" and "Arch Linux" distributions. In general this -# fix should be harmless. -sed -i 's/mkisofs/genisoimage/g' arch/x86/boot/Makefile - -# Generate the ISO image with optimization for "parallel jobs" = "number of processors" -make isoimage FDINITRD=../../rootfs.cpio.gz -j $(grep ^processor /proc/cpuinfo | wc -l) - -cp arch/x86/boot/image.iso ../../../minimal_linux_live.iso - -cd ../../.. - diff --git a/src/build_minimal_linux_live.sh b/src/build_minimal_linux_live.sh index 01644c044..dff5db4c4 100755 --- a/src/build_minimal_linux_live.sh +++ b/src/build_minimal_linux_live.sh @@ -1,10 +1,14 @@ #!/bin/sh -sh 0_prepare.sh -sh 1_get_kernel.sh -sh 2_build_kernel.sh -sh 3_get_busybox.sh -sh 4_build_busybox.sh -sh 5_generate_rootfs.sh -sh 6_pack_rootfs.sh -sh 7_generate_iso.sh +sh 00_prepare.sh +sh 01_get_kernel.sh +sh 02_build_kernel.sh +sh 03_get_glibc.sh +sh 04_build_glibc.sh +sh 05_prepare_glibc.sh +sh 06_get_busybox.sh +sh 07_build_busybox.sh +sh 08_generate_rootfs.sh +sh 09_pack_rootfs.sh +sh 10_generate_iso.sh + diff --git a/src/experimental/glibc-busybox/.config b/src/experimental/glibc-busybox/.config deleted file mode 100644 index 1b2a837e9..000000000 --- a/src/experimental/glibc-busybox/.config +++ /dev/null @@ -1,18 +0,0 @@ -# You can find the latest Linux kernel source bundles here: -# -# http://kernel.org -# -KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.6.tar.xz - -# You can find the latest GNU libc source bundles here: -# -# http://gnu.org/software/libc -# -GLIBC_SOURCE_URL=http://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.bz2 - -# You can find the latest BusyBox source bundles here: -# -# http://busybox.net -# -BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.24.2.tar.bz2 - diff --git a/src/experimental/glibc-busybox/build_minimal_linux_live.sh b/src/experimental/glibc-busybox/build_minimal_linux_live.sh deleted file mode 100755 index dff5db4c4..000000000 --- a/src/experimental/glibc-busybox/build_minimal_linux_live.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -sh 00_prepare.sh -sh 01_get_kernel.sh -sh 02_build_kernel.sh -sh 03_get_glibc.sh -sh 04_build_glibc.sh -sh 05_prepare_glibc.sh -sh 06_get_busybox.sh -sh 07_build_busybox.sh -sh 08_generate_rootfs.sh -sh 09_pack_rootfs.sh -sh 10_generate_iso.sh - diff --git a/src/experimental/glibc-busybox/qemu32.sh b/src/experimental/glibc-busybox/qemu32.sh deleted file mode 100755 index 3d0ca2a92..000000000 --- a/src/experimental/glibc-busybox/qemu32.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso - diff --git a/src/experimental/glibc-busybox/qemu64.sh b/src/experimental/glibc-busybox/qemu64.sh deleted file mode 100755 index 34392b5ce..000000000 --- a/src/experimental/glibc-busybox/qemu64.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso - diff --git a/src/experimental/glibc-toybox/.config b/src/experimental/glibc-toybox/.config deleted file mode 100644 index 3cca38cac..000000000 --- a/src/experimental/glibc-toybox/.config +++ /dev/null @@ -1,12 +0,0 @@ -# You can find the latest Linux kernel source bundles here: -# -# http://kernel.org -# -KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.6.tar.xz - -# You can find the latest ToyBox source bundles here: -# -# http://landley.net/toybox -# -TOYBOX_SOURCE_URL=http://landley.net/toybox/downloads/toybox-0.6.0.tar.gz - diff --git a/src/experimental/glibc-toybox/0_prepare.sh b/src/experimental/glibc-toybox/0_prepare.sh deleted file mode 100755 index e539d7f3a..000000000 --- a/src/experimental/glibc-toybox/0_prepare.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -rm -rf work -mkdir work - -# -p stops errors if the directory already exists. -mkdir -p source - diff --git a/src/experimental/glibc-toybox/1_get_kernel.sh b/src/experimental/glibc-toybox/1_get_kernel.sh deleted file mode 100755 index 0754f9f75..000000000 --- a/src/experimental/glibc-toybox/1_get_kernel.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character. -DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character. -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading kernel file. -# -c option allows the download to resume. -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted kernel. -rm -rf ../work/kernel -mkdir ../work/kernel - -# Extract kernel to folder 'work/kernel'. -# Full path will be something like 'work/kernel/linux-4.1.6'. -tar -xvf $ARCHIVE_FILE -C ../work/kernel - -cd .. - diff --git a/src/experimental/glibc-toybox/2_build_kernel.sh b/src/experimental/glibc-toybox/2_build_kernel.sh deleted file mode 100755 index 6651fbf19..000000000 --- a/src/experimental/glibc-toybox/2_build_kernel.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -cd work/kernel - -# Change to the first directory ls finds, e.g. 'linux-3.18.6'. -cd $(ls -d *) - -# Cleans up the kernel sources, including configuration files. -make mrproper - -# Create a default configuration file for the kernel. -make defconfig - -# Changes the name of the system. -sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config - -# Compile the kernel with optimization for "parallel jobs" = "number of processors". -# Good explanation of the different kernels: -# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux -make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l) - -cd ../../.. - diff --git a/src/experimental/glibc-toybox/3_get_toybox.sh b/src/experimental/glibc-toybox/3_get_toybox.sh deleted file mode 100755 index 0c2d1254e..000000000 --- a/src/experimental/glibc-toybox/3_get_toybox.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character. -DOWNLOAD_URL=$(grep -i TOYBOX_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character. -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading ToyBox source. -# -c option allows the download to resume. -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted ToyBox. -rm -rf ../work/toybox -mkdir ../work/toybox - -# Extract toybox to folder 'toybox'. -# Full path will be something like 'work/toybox/toybox-0.6.0'. -tar -xvf $ARCHIVE_FILE -C ../work/toybox - -cd .. - diff --git a/src/experimental/glibc-toybox/4_build_toybox.sh b/src/experimental/glibc-toybox/4_build_toybox.sh deleted file mode 100755 index f12323eef..000000000 --- a/src/experimental/glibc-toybox/4_build_toybox.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -cd work/toybox - -# Change to the first directory ls finds, e.g. 'toybox-0.6.0' -cd $(ls -d *) - -# Remove previously generated artefacts. -make distclean - -# Create a configuration file with all possible selections. -make allyesconfig - -# Static linking -export LDFLAGS="--static" - -# Compile ToyBox with optimization for "parallel jobs" = "number of processors". -make toybox -j $(grep ^processor /proc/cpuinfo | wc -l) - -# We no longer need flags for static linking. -unset LDFLAGS - -rm -rf rootfs -mkdir rootfs - -# Directory where ToyBox binary and symlink will be instaled. -export PREFIX=rootfs - -# Create the symlinks for toybox in single folder. -make install_flat - -# We no longer need this environment variable. -unset PREFIX - -cd ../../.. - diff --git a/src/experimental/glibc-toybox/5_generate_rootfs.sh b/src/experimental/glibc-toybox/5_generate_rootfs.sh deleted file mode 100755 index 1a4df1b37..000000000 --- a/src/experimental/glibc-toybox/5_generate_rootfs.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -cd work - -rm -rf rootfs -mkdir rootfs - -cd toybox -cd $(ls -d *) - -# Copy all toybox generated stuff to the location of our "initramfs/bin" folder. -cp -R rootfs ../../rootfs/bin -cd ../../rootfs - -# Create root FS folders -mkdir dev -mkdir etc -mkdir proc -mkdir root -mkdir src -mkdir sys -mkdir tmp - -# "1" means that only the owner of a file/directory (or root) can remove it. -chmod 1777 tmp - -cd etc - -# The file "/etc/welcome.txt" is displayed on every boot. -cat > welcome.txt << EOF - - ##################################### - # # - # Welcome to "Minimal Linux Live" # - # # - ##################################### - -EOF - -cd .. - -# For now we have simple console. -cat > init << EOF -#!/bin/sh -dmesg -n 1 - -mount -t devtmpfs none /dev -mount -t proc none /proc -mount -t sysfs none /sys - -ifconfig eth0 up -dhcp -i eth0 - -cat /etc/welcome.txt - -sh - -poweroff -EOF - -chmod +rx init - -# Copy all source files to "/src". Note that the scripts won't work there. -cp ../../*.sh src -cp ../../.config src -chmod +r src/*.sh -chmod +r src/.config - -cd ../.. - diff --git a/src/experimental/glibc-toybox/6_pack_rootfs.sh b/src/experimental/glibc-toybox/6_pack_rootfs.sh deleted file mode 100755 index f9e16e523..000000000 --- a/src/experimental/glibc-toybox/6_pack_rootfs.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -cd work - -# Remove the old initramfs archive if it exists. -rm -f rootfs.cpio.gz - -cd rootfs - -# Packs the current folder structure in "cpio.gz" archive. -find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz - -cd ../.. - diff --git a/src/experimental/glibc-toybox/7_generate_iso.sh b/src/experimental/glibc-toybox/7_generate_iso.sh deleted file mode 100755 index 38c951585..000000000 --- a/src/experimental/glibc-toybox/7_generate_iso.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -rm -f minimal_linux_live.iso - -cd work/kernel -cd $(ls -d *) - -# Edit Makefile to look for genisoimage instead of mkisofs. This was added as a -# workaround for some "Debian" and "Arch Linux" distributions. In general this -# fix should be harmless. -sed -i 's/mkisofs/genisoimage/g' arch/x86/boot/Makefile - -# Generate the ISO image with optimization for "parallel jobs" = "number of processors" -make isoimage FDINITRD=../../rootfs.cpio.gz -j $(grep ^processor /proc/cpuinfo | wc -l) - -cp arch/x86/boot/image.iso ../../../minimal_linux_live.iso - -cd ../../.. - diff --git a/src/experimental/glibc-toybox/build_minimal_linux_live.sh b/src/experimental/glibc-toybox/build_minimal_linux_live.sh deleted file mode 100755 index c9549c273..000000000 --- a/src/experimental/glibc-toybox/build_minimal_linux_live.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -sh 0_prepare.sh -sh 1_get_kernel.sh -sh 2_build_kernel.sh -sh 3_get_toybox.sh -sh 4_build_toybox.sh -sh 5_generate_rootfs.sh -sh 6_pack_rootfs.sh -sh 7_generate_iso.sh diff --git a/src/experimental/glibc-toybox/qemu32.sh b/src/experimental/glibc-toybox/qemu32.sh deleted file mode 100755 index 2e4d546c4..000000000 --- a/src/experimental/glibc-toybox/qemu32.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-i386 -cdrom minimal_linux_live.iso - diff --git a/src/experimental/glibc-toybox/qemu64.sh b/src/experimental/glibc-toybox/qemu64.sh deleted file mode 100755 index 8e5174a01..000000000 --- a/src/experimental/glibc-toybox/qemu64.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-x86_64 -cdrom minimal_linux_live.iso - diff --git a/src/experimental/musl-busybox/.config b/src/experimental/musl-busybox/.config deleted file mode 100644 index f5c193a94..000000000 --- a/src/experimental/musl-busybox/.config +++ /dev/null @@ -1,18 +0,0 @@ -# You can find the latest Linux kernel source bundles here: -# -# http://kernel.org -# -KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.6.tar.xz - -# You can find the latest Musl source bundles here: -# -# http://musl-libc.org -# -MUSL_SOURCE_URL=http://musl-libc.org/releases/musl-1.1.11.tar.gz - -# You can find the latest BusyBox source bundles here: -# -# http://busybox.net -# -BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.23.2.tar.bz2 - diff --git a/src/experimental/musl-busybox/00_prepare.sh b/src/experimental/musl-busybox/00_prepare.sh deleted file mode 100755 index b1f8e4ed3..000000000 --- a/src/experimental/musl-busybox/00_prepare.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -rm -rf work -mkdir work - -# -p stops errors if the directory already exists -mkdir -p source - diff --git a/src/experimental/musl-busybox/01_get_kernel.sh b/src/experimental/musl-busybox/01_get_kernel.sh deleted file mode 100755 index 0d79b79a1..000000000 --- a/src/experimental/musl-busybox/01_get_kernel.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character -DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading kernel file -# -c option allows the download to resume -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted kernel -rm -rf ../work/kernel -mkdir ../work/kernel - -# Extract kernel to folder 'work/kernel' -# Full path will be something like 'work/kernel/linux-3.16.1' -tar -xvf $ARCHIVE_FILE -C ../work/kernel - -cd .. - diff --git a/src/experimental/musl-busybox/02_build_kernel.sh b/src/experimental/musl-busybox/02_build_kernel.sh deleted file mode 100755 index b926f8a0b..000000000 --- a/src/experimental/musl-busybox/02_build_kernel.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -cd work/kernel - -# Change to the first directory ls finds, e.g. 'linux-3.18.6' -cd $(ls -d *) - -# Cleans up the kernel sources, including configuration files -make mrproper - -# Create a default configuration file for the kernel -make defconfig - -# Changes the name of the system -sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config - -# Compile the kernel with optimization for "parallel jobs" = "number of processors" -# Good explanation of the different kernels -# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux -make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l) - -# We need the kernel headers later, so we install them now in ./usr (this is not /usr) -make headers_install -j $(grep ^processor /proc/cpuinfo | wc -l) - -cd ../../.. - diff --git a/src/experimental/musl-busybox/03_get_musl.sh b/src/experimental/musl-busybox/03_get_musl.sh deleted file mode 100755 index b68679278..000000000 --- a/src/experimental/musl-busybox/03_get_musl.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character -DOWNLOAD_URL=$(grep -i MUSL_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading musl file -# -c option allows the download to resume -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted musl -rm -rf ../work/musl -mkdir ../work/musl - -# Extract musl to folder 'work/musl' -# Full path will be something like 'work/musl/musl-1.1.11' -tar -xvf $ARCHIVE_FILE -C ../work/musl - -cd .. - diff --git a/src/experimental/musl-busybox/04_build_musl.sh b/src/experimental/musl-busybox/04_build_musl.sh deleted file mode 100755 index 4195f9666..000000000 --- a/src/experimental/musl-busybox/04_build_musl.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -cd work/musl - -# Change to the first directory ls finds, e.g. 'musl-1.1.11' -cd $(ls -d *) - -make distclean - -mkdir musl-installed -./configure --prefix=$(pwd)/musl-installed - -make -j $(grep ^processor /proc/cpuinfo | wc -l) - -make install -j $(grep ^processor /proc/cpuinfo | wc -l) - -cd ../../.. - diff --git a/src/experimental/musl-busybox/05_prepare_musl.sh b/src/experimental/musl-busybox/05_prepare_musl.sh deleted file mode 100755 index cc5319d24..000000000 --- a/src/experimental/musl-busybox/05_prepare_musl.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -cd work/kernel -cd $(ls -d *) -WORK_KERNEL_DIR=$(pwd) -cd ../../.. - -cd work/musl - -# Change to the first directory ls finds, e.g. 'musl-1.1.11' -cd $(ls -d *) - -cd musl-installed/bin - -unlink musl-ar 2>/dev/null -ln -s `which ar` musl-ar - -unlink musl-strip 2>/dev/null -ln -s `which strip` musl-strip - -cd ../include - -# Copy all kernel headers to musl's 'include' folder -cp -rf $WORK_KERNEL_DIR/usr/include/* . - -# Make sure some C structs are not defined in kernel headers if thgey are already defined in musl -sed -i "s/^\#if.__UAPI_DEF_IN6_ADDR$/#if !defined(_NETINET_IN_H) \&\& defined(__UAPI_DEF_IN6_ADDR)/" ./linux/in6.h -sed -i "s/^\#if.__UAPI_DEF_SOCKADDR_IN6$/#if !defined(_NETINET_IN_H) \&\& defined(__UAPI_DEF_SOCKADDR_IN6)/" ./linux/in6.h -sed -i "s/^\#if.__UAPI_DEF_IPV6_MREQ$/#if !defined(_NETINET_IN_H) \&\& defined(__UAPI_DEF_IPV6_MREQ)/" ./linux/in6.h - diff --git a/src/experimental/musl-busybox/06_get_busybox.sh b/src/experimental/musl-busybox/06_get_busybox.sh deleted file mode 100755 index 672bb5841..000000000 --- a/src/experimental/musl-busybox/06_get_busybox.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character -DOWNLOAD_URL=$(grep -i BUSYBOX_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading busybox source -# -c option allows the download to resume -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted busybox -rm -rf ../work/busybox -mkdir ../work/busybox - -# Extract busybox to folder 'busybox' -# Full path will be something like 'work/busybox/busybox-1.23.1' -tar -xvf $ARCHIVE_FILE -C ../work/busybox - -cd .. - diff --git a/src/experimental/musl-busybox/07_build_busybox.sh b/src/experimental/musl-busybox/07_build_busybox.sh deleted file mode 100755 index c6bdf8c96..000000000 --- a/src/experimental/musl-busybox/07_build_busybox.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -cd work/musl -cd $(ls -d *) -cd musl-installed -cd bin -MUSL_BIN_DIR=$(pwd) -cd ../../../../.. - -cd work/busybox - -# Change to the first directory ls finds, e.g. 'busybox-1.23.1' -cd $(ls -d *) - -PATH_BACKUP=$PATH -PATH=$MUSL_BIN_DIR:$PATH - -# Remove previously generated artifacts -make distclean - -# Create a default configuration file -make defconfig - -# Change the configuration, so that busybox is statically compiled -# You could do this manually with 'make menuconfig' -sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config -sed -i "s/.*CONFIG_CROSS_COMPILER_PREFIX.*/CONFIG_CROSS_COMPILER_PREFIX=\"musl-\"/" .config -sed -i "s/.*CONFIG_IFPLUGD.*/CONFIG_IFPLUGD=n/" .config -sed -i "s/.*CONFIG_INETD.*/CONFIG_INETD=n/" .config - -# Compile busybox with optimization for "parallel jobs" = "number of processors" -make busybox -j $(grep ^processor /proc/cpuinfo | wc -l) - -# Create the symlinks for busybox -# It uses the file 'busybox.links' for this -make install - -PATH=$PATH_BACKUP - -cd ../../.. - diff --git a/src/experimental/musl-busybox/08_generate_rootfs.sh b/src/experimental/musl-busybox/08_generate_rootfs.sh deleted file mode 100755 index fd57114fa..000000000 --- a/src/experimental/musl-busybox/08_generate_rootfs.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh - -cd work - -rm -rf rootfs - -cd busybox -cd $(ls -d *) - -# Copy all BusyBox generated stuff to the location of our "initramfs" folder. -cp -R _install ../../rootfs -cd ../../rootfs - -# Remove "linuxrc" which is used when we boot in "RAM disk" mode. -rm -f linuxrc - -# Create root FS folders -mkdir dev -mkdir etc -mkdir proc -mkdir root -mkdir src -mkdir sys -mkdir tmp - -# "1" means that only the owner of a file/directory (or root) can remove it. -chmod 1777 tmp - -cd etc - -# The script "/etc/bootscript.sh" is automatically executed as part of the -# "init" proess. We suppress most kernel messages, mount all crytical file -# systems, loop through all available network devices and we configure them -# through DHCP. -cat > bootscript.sh << EOF -#!/bin/sh - -dmesg -n 1 -mount -t devtmpfs none /dev -mount -t proc none /proc -mount -t sysfs none /sys - -for DEVICE in /sys/class/net/* ; do - ip link set \${DEVICE##*/} up - [ \${DEVICE##*/} != lo ] && udhcpc -b -i \${DEVICE##*/} -s /etc/rc.dhcp -done - -EOF - -chmod +x bootscript.sh - -# The script "/etc/rc.dhcp" is automatically invoked for each network device. -cat > rc.dhcp << EOF -#!/bin/sh - -ip addr add \$ip/\$mask dev \$interface - -if [ "\$router" ]; then - ip route add default via \$router dev \$interface -fi - -EOF - -chmod +x rc.dhcp - -# DNS resolving is done by using Google's public DNS servers -cat > resolv.conf << EOF -nameserver 8.8.8.8 -nameserver 8.8.4.4 - -EOF - -# The file "/etc/welcome.txt" is displayed on every boot of the system in each -# available terminal. -cat > welcome.txt << EOF - - ##################################### - # # - # Welcome to "Minimal Linux Live" # - # # - ##################################### - -EOF - -# The file "/etc/inittab" contains the configuration which defines how the -# system will be initialized. Check the following URL for more details: -# http://git.busybox.net/busybox/tree/examples/inittab -cat > inittab << EOF -::sysinit:/etc/bootscript.sh -::restart:/sbin/init -::ctrlaltdel:/sbin/reboot -::once:cat /etc/welcome.txt -::respawn:/bin/cttyhack /bin/sh -tty2::once:cat /etc/welcome.txt -tty2::respawn:/bin/sh -tty3::once:cat /etc/welcome.txt -tty3::respawn:/bin/sh -tty4::once:cat /etc/welcome.txt -tty4::respawn:/bin/sh - -EOF - -cd .. - -# The "/init" script passes the execution to "/sbin/init" which in turn looks -# for the configuration file "/etc/inittab". -cat > init << EOF -#!/bin/sh - -exec /sbin/init - -EOF - -chmod +x init - -# Copy all source files to "/src". Note that the scripts won't work there. -cp ../../*.sh src -cp ../../.config src -chmod +r src/*.sh -chmod +r src/.config - -cd ../.. - diff --git a/src/experimental/musl-busybox/09_pack_rootfs.sh b/src/experimental/musl-busybox/09_pack_rootfs.sh deleted file mode 100755 index 678d9d2e4..000000000 --- a/src/experimental/musl-busybox/09_pack_rootfs.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -cd work - -# Remove the old initramfs archive if it exists. -rm -f rootfs.cpio.gz - -cd rootfs - -# Packs the current folder structure in "cpio.gz" archive. -find . | cpio -R root:root -H newc -o | gzip > ../rootfs.cpio.gz - -cd ../.. - diff --git a/src/experimental/musl-busybox/10_generate_iso.sh b/src/experimental/musl-busybox/10_generate_iso.sh deleted file mode 100755 index 61c8ca227..000000000 --- a/src/experimental/musl-busybox/10_generate_iso.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -cd work/kernel -cd $(ls -d *) -WORK_KERNEL_DIR=$(pwd) -cd ../../.. - -rm -f minimal_linux_live.iso -rm -rf work/isoimage - -# This is the root folder of the ISO image -mkdir work/isoimage -cd work/isoimage - -# Search and copy the files 'isolinux.bin' and 'ldlinux.c32' -for i in lib lib64 share end ; do - if [ -f /usr/$i/syslinux/isolinux.bin ]; then - cp /usr/$i/syslinux/isolinux.bin . - if [ -f /usr/$i/syslinux/ldlinux.c32 ]; then - cp /usr/$i/syslinux/ldlinux.c32 . - fi; - break; - fi; - if [ $i = end ]; then exit 1; fi; -done - -# Now we copy the kernel -cp $WORK_KERNEL_DIR/arch/x86/boot/bzImage ./kernel.bz - -# Now we copy the root file system -cp ../rootfs.cpio.gz ./rootfs.gz - -# Copy all source files to "/src". Note that the scripts won't work there. -mkdir src -cp ../../*.sh src -cp ../../.config src -chmod +rx src/*.sh -chmod +r src/.config - -# Create ISOLINUX configuration file -echo 'default kernel.bz initrd=rootfs.gz' > ./isolinux.cfg - -# Now we generate the ISO image file -genisoimage -J -r -o ../minimal_linux_live.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ./ - -# This allows the ISO image to be bootable if it is burned on USB flash drive -isohybrid ../minimal_linux_live.iso 2>/dev/null || true - -# Copy the ISO image to the root project folder -cp ../minimal_linux_live.iso ../../ - -cd ../.. - diff --git a/src/experimental/musl-busybox/build_minimal_linux_live.sh b/src/experimental/musl-busybox/build_minimal_linux_live.sh deleted file mode 100755 index fbfd5892c..000000000 --- a/src/experimental/musl-busybox/build_minimal_linux_live.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -sh 00_prepare.sh -sh 01_get_kernel.sh -sh 02_build_kernel.sh -sh 03_get_musl.sh -sh 04_build_musl.sh -sh 05_prepare_musl.sh -sh 06_get_busybox.sh -sh 07_build_busybox.sh -sh 08_generate_rootfs.sh -sh 09_pack_rootfs.sh -sh 10_generate_iso.sh - diff --git a/src/experimental/musl-busybox/qemu32.sh b/src/experimental/musl-busybox/qemu32.sh deleted file mode 100755 index 2e4d546c4..000000000 --- a/src/experimental/musl-busybox/qemu32.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-i386 -cdrom minimal_linux_live.iso - diff --git a/src/experimental/musl-busybox/qemu64.sh b/src/experimental/musl-busybox/qemu64.sh deleted file mode 100755 index 8e5174a01..000000000 --- a/src/experimental/musl-busybox/qemu64.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-x86_64 -cdrom minimal_linux_live.iso - diff --git a/src/experimental/musl-toybox/.config b/src/experimental/musl-toybox/.config deleted file mode 100644 index 55e6577ba..000000000 --- a/src/experimental/musl-toybox/.config +++ /dev/null @@ -1,18 +0,0 @@ -# You can find the latest Linux kernel source bundles here: -# -# http://kernel.org -# -KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.6.tar.xz - -# You can find the latest Musl source bundles here: -# -# http://musl-libc.org -# -MUSL_SOURCE_URL=http://musl-libc.org/releases/musl-1.1.11.tar.gz - -# You can find the latest ToyBox source bundles here: -# -# http://landley.net/toybox -# -TOYBOX_SOURCE_URL=http://landley.net/toybox/downloads/toybox-0.6.0.tar.gz - diff --git a/src/experimental/musl-toybox/00_prepare.sh b/src/experimental/musl-toybox/00_prepare.sh deleted file mode 100755 index e539d7f3a..000000000 --- a/src/experimental/musl-toybox/00_prepare.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -rm -rf work -mkdir work - -# -p stops errors if the directory already exists. -mkdir -p source - diff --git a/src/experimental/musl-toybox/01_get_kernel.sh b/src/experimental/musl-toybox/01_get_kernel.sh deleted file mode 100755 index 0754f9f75..000000000 --- a/src/experimental/musl-toybox/01_get_kernel.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character. -DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character. -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading kernel file. -# -c option allows the download to resume. -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted kernel. -rm -rf ../work/kernel -mkdir ../work/kernel - -# Extract kernel to folder 'work/kernel'. -# Full path will be something like 'work/kernel/linux-4.1.6'. -tar -xvf $ARCHIVE_FILE -C ../work/kernel - -cd .. - diff --git a/src/experimental/musl-toybox/02_build_kernel.sh b/src/experimental/musl-toybox/02_build_kernel.sh deleted file mode 100755 index 6651fbf19..000000000 --- a/src/experimental/musl-toybox/02_build_kernel.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -cd work/kernel - -# Change to the first directory ls finds, e.g. 'linux-3.18.6'. -cd $(ls -d *) - -# Cleans up the kernel sources, including configuration files. -make mrproper - -# Create a default configuration file for the kernel. -make defconfig - -# Changes the name of the system. -sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config - -# Compile the kernel with optimization for "parallel jobs" = "number of processors". -# Good explanation of the different kernels: -# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux -make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l) - -cd ../../.. - diff --git a/src/experimental/musl-toybox/03_get_musl.sh b/src/experimental/musl-toybox/03_get_musl.sh deleted file mode 100755 index b68679278..000000000 --- a/src/experimental/musl-toybox/03_get_musl.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character -DOWNLOAD_URL=$(grep -i MUSL_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading musl file -# -c option allows the download to resume -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted musl -rm -rf ../work/musl -mkdir ../work/musl - -# Extract musl to folder 'work/musl' -# Full path will be something like 'work/musl/musl-1.1.11' -tar -xvf $ARCHIVE_FILE -C ../work/musl - -cd .. - diff --git a/src/experimental/musl-toybox/04_build_musl.sh b/src/experimental/musl-toybox/04_build_musl.sh deleted file mode 100755 index 4195f9666..000000000 --- a/src/experimental/musl-toybox/04_build_musl.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -cd work/musl - -# Change to the first directory ls finds, e.g. 'musl-1.1.11' -cd $(ls -d *) - -make distclean - -mkdir musl-installed -./configure --prefix=$(pwd)/musl-installed - -make -j $(grep ^processor /proc/cpuinfo | wc -l) - -make install -j $(grep ^processor /proc/cpuinfo | wc -l) - -cd ../../.. - diff --git a/src/experimental/musl-toybox/05_prepare_musl.sh b/src/experimental/musl-toybox/05_prepare_musl.sh deleted file mode 100755 index 08d053114..000000000 --- a/src/experimental/musl-toybox/05_prepare_musl.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -cd work/kernel -cd $(ls -d *) -WORK_KERNEL_DIR=$(pwd) -cd ../../.. - -cd work/musl - -# Change to the first directory ls finds, e.g. 'musl-1.1.11' -cd $(ls -d *) - -cd musl-installed/bin - -unlink musl-cc -ln -s musl-gcc musl-cc - -unlink musl-ar -ln -s `which ar` musl-ar - -unlink musl-strip -ln -s `which strip` musl-strip - -cd ../include - -# -# Should work with headers from the newly downloaded kernel -# but it diesn't work. Damn!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# -#unlink linux -#ln -s $WORK_KERNEL_DIR/include/linux linux -# -#unlink mtd -#ln -s $WORK_KERNEL_DIR/include/linux/mtd mtd -# -#unlink asm -#ln -s $WORK_KERNEL_DIR/include/uapi/asm-generic asm -# -#unlink asm-generic -#ln -s $WORK_KERNEL_DIR/include/uapi/asm-generic asm-generic -# -#unlink uapi -#ln -s $WORK_KERNEL_DIR/include/uapi uapi -# -#unlink uapi -#ln -s $WORK_KERNEL_DIR/include/uapi uapi - -unlink linux -ln -s /usr/include/linux linux - -unlink mtd -ln -s /usr/include/mtd mtd - -if [ -d /usr/include/asm ] -then - unlink asm - ln -s /usr/include/asm asm -else - unlink asm - ln -s /usr/include/asm-generic asm -fi - -unlink asm-generic -ln -s /usr/include/asm-generic asm-generic - diff --git a/src/experimental/musl-toybox/06_get_toybox.sh b/src/experimental/musl-toybox/06_get_toybox.sh deleted file mode 100755 index 0c2d1254e..000000000 --- a/src/experimental/musl-toybox/06_get_toybox.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Grab everything after the '=' character. -DOWNLOAD_URL=$(grep -i TOYBOX_SOURCE_URL .config | cut -f2 -d'=') - -# Grab everything after the last '/' character. -ARCHIVE_FILE=${DOWNLOAD_URL##*/} - -cd source - -# Downloading ToyBox source. -# -c option allows the download to resume. -wget -c $DOWNLOAD_URL - -# Delete folder with previously extracted ToyBox. -rm -rf ../work/toybox -mkdir ../work/toybox - -# Extract toybox to folder 'toybox'. -# Full path will be something like 'work/toybox/toybox-0.6.0'. -tar -xvf $ARCHIVE_FILE -C ../work/toybox - -cd .. - diff --git a/src/experimental/musl-toybox/07_build_toybox.sh b/src/experimental/musl-toybox/07_build_toybox.sh deleted file mode 100755 index 933eca28a..000000000 --- a/src/experimental/musl-toybox/07_build_toybox.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -cd work/musl -cd $(ls -d *) -cd musl-installed -cd bin -MUSL_BIN_DIR=$(pwd) -cd ../../../../.. -cd work/toybox - -# Change to the first directory ls finds, e.g. 'toybox-0.6.0' -cd $(ls -d *) - -PATH_BACKUP=$PATH -PATH=$MUSL_BIN_DIR:$PATH - -# Remove previously generated artefacts. -make distclean - -# Create a configuration file with all possible selections. -#make allyesconfig -make defconfig - -sed -i "s/.*CONFIG_DHCP.is.*/CONFIG_DHCP=y/" .config - -# Static linking and cross compiling. -export CFLAGS="-std=c99" -export LDFLAGS="--static" -export CROSS_COMPILE="musl-" - -# Compile ToyBox with optimization for "parallel jobs" = "number of processors". -make toybox -j $(grep ^processor /proc/cpuinfo | wc -l) - -# We no longer need flags for static linking and cross compiling. -unset CFLAGS -unset LDFLAGS -unset CROSS_COMPILE - -rm -rf rootfs -mkdir rootfs - -# Directory where ToyBox binary and symlink will be instaled. -export PREFIX=rootfs - -# Create the symlinks for toybox in single folder. -make install_flat - -# We no longer need this environment variable. -unset PREFIX - -PATH=$PATH_BACKUP - -cd ../../.. - diff --git a/src/experimental/musl-toybox/08_generate_rootfs.sh b/src/experimental/musl-toybox/08_generate_rootfs.sh deleted file mode 100755 index 1a4df1b37..000000000 --- a/src/experimental/musl-toybox/08_generate_rootfs.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -cd work - -rm -rf rootfs -mkdir rootfs - -cd toybox -cd $(ls -d *) - -# Copy all toybox generated stuff to the location of our "initramfs/bin" folder. -cp -R rootfs ../../rootfs/bin -cd ../../rootfs - -# Create root FS folders -mkdir dev -mkdir etc -mkdir proc -mkdir root -mkdir src -mkdir sys -mkdir tmp - -# "1" means that only the owner of a file/directory (or root) can remove it. -chmod 1777 tmp - -cd etc - -# The file "/etc/welcome.txt" is displayed on every boot. -cat > welcome.txt << EOF - - ##################################### - # # - # Welcome to "Minimal Linux Live" # - # # - ##################################### - -EOF - -cd .. - -# For now we have simple console. -cat > init << EOF -#!/bin/sh -dmesg -n 1 - -mount -t devtmpfs none /dev -mount -t proc none /proc -mount -t sysfs none /sys - -ifconfig eth0 up -dhcp -i eth0 - -cat /etc/welcome.txt - -sh - -poweroff -EOF - -chmod +rx init - -# Copy all source files to "/src". Note that the scripts won't work there. -cp ../../*.sh src -cp ../../.config src -chmod +r src/*.sh -chmod +r src/.config - -cd ../.. - diff --git a/src/experimental/musl-toybox/09_pack_rootfs.sh b/src/experimental/musl-toybox/09_pack_rootfs.sh deleted file mode 100755 index f9e16e523..000000000 --- a/src/experimental/musl-toybox/09_pack_rootfs.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -cd work - -# Remove the old initramfs archive if it exists. -rm -f rootfs.cpio.gz - -cd rootfs - -# Packs the current folder structure in "cpio.gz" archive. -find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz - -cd ../.. - diff --git a/src/experimental/musl-toybox/10_generate_iso.sh b/src/experimental/musl-toybox/10_generate_iso.sh deleted file mode 100755 index 38c951585..000000000 --- a/src/experimental/musl-toybox/10_generate_iso.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -rm -f minimal_linux_live.iso - -cd work/kernel -cd $(ls -d *) - -# Edit Makefile to look for genisoimage instead of mkisofs. This was added as a -# workaround for some "Debian" and "Arch Linux" distributions. In general this -# fix should be harmless. -sed -i 's/mkisofs/genisoimage/g' arch/x86/boot/Makefile - -# Generate the ISO image with optimization for "parallel jobs" = "number of processors" -make isoimage FDINITRD=../../rootfs.cpio.gz -j $(grep ^processor /proc/cpuinfo | wc -l) - -cp arch/x86/boot/image.iso ../../../minimal_linux_live.iso - -cd ../../.. - diff --git a/src/experimental/musl-toybox/build_minimal_linux_live.sh b/src/experimental/musl-toybox/build_minimal_linux_live.sh deleted file mode 100755 index c9549c273..000000000 --- a/src/experimental/musl-toybox/build_minimal_linux_live.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -sh 0_prepare.sh -sh 1_get_kernel.sh -sh 2_build_kernel.sh -sh 3_get_toybox.sh -sh 4_build_toybox.sh -sh 5_generate_rootfs.sh -sh 6_pack_rootfs.sh -sh 7_generate_iso.sh diff --git a/src/experimental/musl-toybox/qemu32.sh b/src/experimental/musl-toybox/qemu32.sh deleted file mode 100755 index 2e4d546c4..000000000 --- a/src/experimental/musl-toybox/qemu32.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-i386 -cdrom minimal_linux_live.iso - diff --git a/src/experimental/musl-toybox/qemu64.sh b/src/experimental/musl-toybox/qemu64.sh deleted file mode 100755 index 8e5174a01..000000000 --- a/src/experimental/musl-toybox/qemu64.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -qemu-system-x86_64 -cdrom minimal_linux_live.iso - diff --git a/src/qemu32.sh b/src/qemu32.sh index 2e4d546c4..3d0ca2a92 100755 --- a/src/qemu32.sh +++ b/src/qemu32.sh @@ -1,4 +1,4 @@ #!/bin/sh -qemu-system-i386 -cdrom minimal_linux_live.iso +qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso diff --git a/src/qemu64.sh b/src/qemu64.sh index 8e5174a01..34392b5ce 100755 --- a/src/qemu64.sh +++ b/src/qemu64.sh @@ -1,4 +1,4 @@ #!/bin/sh -qemu-system-x86_64 -cdrom minimal_linux_live.iso +qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso diff --git a/src/experimental/glibc-busybox/the_dao_of_minimal_linux_live.txt b/src/the_dao_of_minimal_linux_live.txt similarity index 100% rename from src/experimental/glibc-busybox/the_dao_of_minimal_linux_live.txt rename to src/the_dao_of_minimal_linux_live.txt diff --git a/www/index.html b/www/index.html index 656660f0e..09e036de9 100644 --- a/www/index.html +++ b/www/index.html @@ -23,7 +23,7 @@ } function logSwap(itemIndex, show) { - for(var i = 1; i <= 4; i++) { + for(var i = 1; i <= 5; i++) { var showObj = document.getElementById("show" + i); var hideObj = document.getElementById("hide" + i); var textObj = document.getElementById("text" + i); @@ -72,9 +72,11 @@
- Minimal Linux Live is a set of Linux shell scripts which automatically build minimal Live - Linux OS based on Linux kernel - and BusyBox. All necessary source codes are automatically + Minimal Linux Live is a set of Linux shell scripts which automatically build minimalistic Live + Linux OS with basic network support via DHCP. The generated operating system is based on + Linux kernel, + GNU C library and + BusyBox. All necessary source codes are automatically downloaded and all build operations are fully encapsulated in the scripts.
@@ -91,7 +93,8 @@ Get the latest scripts from the download section.
  • - Extract the scripts to some folder. + Extract the scripts to some folder. Note that even though the scripts are small in size, you need ~2GB free disk space for the + actual build process.
  • Just for convenience, make sure that all scripts are executable (chmod +x *.sh). If you decide to skip this step you @@ -140,59 +143,82 @@ you have researched your problem in advance before you send me your question.
  • - When the scripts finish their job you will find newly created minimal_linux_live.iso in the same folder where you + When the scripts finish their job you will find newly generated minimal_linux_live.iso in the same folder where you executed the scripts. You can burn the ISO image file on CD/DVD, install it on USB flash drive via Universal USB Installer, - or run it directly via PC emulator like VirtualBox. + or run it directly via PC emulator like VirtualBox. Minimal Linux Live + requires at least 64MB RAM, otherwise the boot process most probably will hang.
  • - The produced ISO image file contains Linux kernel compiled with default options, BusyBox compiled with default options and very simple - initramfs. This means that you don't get Windows support out of the box, nor you get any fancy desktop environment. All you - get is a simple shell console which supports all BusyBox applets and... well, that's all. This is why it's called "minimal". + The generated ISO image file contains Linux kernel compiled with default options, GNU C library compiled with default options, + BusyBox compiled with default options and quite simple initramfs. This means that you don't get Windows support out of the box, + nor you get any fancy desktop environment. All you get is a simple shell console which supports all BusyBox applets and... well, + that's all. This is why it's called "minimal".
     
    - The good news is that even though the OS is small and simple, the build scripts are also very small and very simple. You can - quite easily learn from the scripts and later modify them to include more stuff (I encourage you to do so). After you learn - the basics you will have all the necessary tools and skills to create your own fully functional Linux based operating system! - Entirely from scratch! Isn't it great?! :) + The good news is that the build scripts are very small in size and simple to understand. You can easily learn from the scripts + and later modify them to include more stuff (I encourage you to do so). After you learn the basics you will have all the necessary + tools and skills to create your own fully functional Linux based operating system. Entirely from scratch!
     
    The tutorial provides more details about the inner structure - of the scripts and the overall build process. I encourage you to go through this document when you have the time. + of the scripts and the overall build process. I encourage you to go through this document when you have the time. The same tutorial + document is automatically included in the generated ISO image, so you can always refer to it.
     
    Below you can find several screenshots which show what the environment looks like when you boot your newly generated - Minimal Linux Live OS. + Minimal Linux Live OS.
     
    -
    + -
    + -
    +
    +
     
    +
    + +
    + + Minimal Linux Live + +
    +
    +
     
    +
    +
    + + Minimal Linux Live + +
    +
    + + Minimal Linux Live
    @@ -205,15 +231,52 @@
    -