diff --git a/mdbook/book.toml b/mdbook/book.toml new file mode 100644 index 000000000..235f114a9 --- /dev/null +++ b/mdbook/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["John Davidson"] +language = "en" +multilingual = false +src = "src" +title = "Minimal Linux Live" diff --git a/mdbook/book/.nojekyll b/mdbook/book/.nojekyll new file mode 100644 index 000000000..863121594 --- /dev/null +++ b/mdbook/book/.nojekyll @@ -0,0 +1 @@ +This file makes sure that Github Pages doesn't process mdBook's output. \ No newline at end of file diff --git a/mdbook/book/00_clean.html b/mdbook/book/00_clean.html new file mode 100644 index 000000000..4810ed2da --- /dev/null +++ b/mdbook/book/00_clean.html @@ -0,0 +1,246 @@ + + +
+ + +This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +Welcome to the wonderful world of Minimal Linux Live! :)
+Minimal Linux Live (MLL) is a tiny educational Linux distribution, which is designed to be built from scratch by using a collection of automated shell scripts. Minimal Linux Live offers a core environment with just the Linux kernel, GNU C library, and Busybox userland utilities. Additional software can be included in the ISO image at build time by using a well-documented configuration file.
+The generated ISO image file contains Linux kernel, GNU C library compiled with default options, Busybox compiled with default options, quite simple initramfs structure and some "overlay bundles" (the default build process provides few overlay bundles). 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 with default Busybox applets, network support via DHCP and... well, that's all. This is why it's called "minimal".
+Note that by default Minimal Linux Live provides support for legacy BIOS systems. You can change the build configuration settings in the .config file and rebuild MLL with support for modern UEFI systems.
+All build scripts are well organized and quite small in size. You can easily learn from the scripts, reverse engineer the build process 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 which you have built entirely from scratch.
+ +syslinux.cfg
which describes where the Linux kernel (kernel.xz) and the initramfs (rootfs.xz) files are located in the ISO image./init
, which is present in the initramfs file.Refer to the init section below for more details on how /init
handles the OS preparation.
EFI/BOOT/BOOTx64.EFI
(for 64-bit machines) from the previously described EFI boot image. This special file is the entry point of the systemd-boot UEFI boot manager.systemd-boot
UEFI boot manager has special configuration files (loader.conf and all files in the entries/ folder) which describe where the Linux kernel (kernel.xz) and the initramfs (rootfs.xz) files are located in the EFI boot image.systemd-boot
loads the kernel in the RAM./init
, which is present in the initramfs file.Refer to the init section below for more details on how /init
handles the OS preparation.
The /init
shell script is responsible to prepare the actual OS environment and to present the user with functional shell prompt.
The base initramfs structure is located here:
+https://github.com/ivandavidov/minimal/tree/master/src/minimal_rootfs
+The actual /init
script is located here:
https://github.com/ivandavidov/minimal/blob/master/src/minimal_rootfs/init
+This is what happens when /init
is executed:
/sbin/init
which is located in the initramfs./sbin/init
uses the special configuration file /etc/inittab which describes the system initialization actions.The MLL build process can be divided in several major phases.
+The shell script file common.sh is sourced in all MLL scripts. It provides common properties and functions.
+SRC_DIR=src/
This is the main source directory, i.e. the property references the main project directory src/
.
CONFIG=src/.config
This is the main configuration file. The configuration properties are described here.
+SOURCE_DIR=src/source/
This is the directory where all source archives are downloaded.
+WORK_DIR=src/work/
This is the directory where all MLL artifacts are processed. All build actions happen in this directory.
+KERNEL_INSTALLED=src/work/kernel/kernel_installed/
This is the directory where the kernel and its corresponding header files are placed after the kernel build phase has been completed.
+GLIBC_OBJECTS=src/work/glibc/glibc_objects/
TODO...
+GLIBC_INSTALLED=src/work/glibc/glibc_installed/
TODO...
+BUSYBOX_INSTALLED=src/work/busybox/busybox_installed/
TODO...
+SYSROOT=src/work/sysroot/
TODO...
+ROOTFS=src/work/rootfs/
TODO...
+OVERLAY_ROOTFS=src/work/overlay_rootfs/
TODO...
+OVERLAY_ROOTFS=src/work/isoimage/
TODO...
+OVERLAY_ROOTFS=src/work/isoimage_overlay/
TODO...
+This function reads properties from the main .config
file.
# Example
+
+JOB_FACTOR=`read_property JOB_FACTOR`
+
+This function downloads the url
resource and saves it as $file_to_save
.
# Example
+#
+# This is the filesystem structure before the execution
+# of the function.
+#
+# src/
+# └── source/
+# └── (no files/folders)
+
+download_source \
+ 'https://busybox.net/downloads/busybox-1.32.0.tar.bz2' \
+ $SOURCE_DIR/busybox-1.32.0.tar.bz2
+
+# This is the filesystem structure after the execution
+# of the function.
+#
+# src/
+# └── source/
+# └── busybox-1.32.0.tar.bz2
+
+This function extracts the archive archive_file
in the directory src/work/$dest_dir/
.
# Example
+#
+# This is the filesystem structure before the execution
+# of the function.
+#
+# src/
+# ├── source/
+# │ └── busybox-1.32.0.tar.bz2
+# └── work/
+# └── (no files/folders)
+
+extract_source \
+ $SOURCE_DIR/busybox-1.32.0.tar.bz2 \
+ busybox
+
+# This is the filesystem structure after the execution
+# of the function.
+#
+# src/
+# ├── source/
+# │ └── busybox-1.32.0.tar.bz2
+# └── work/
+# └── busybox
+# └── busybox-1.32.0/
+
+
+ The default build process generates a bootable ISO image file named minimal_linux_live.iso
.
When the property FIRMWARE_TYPE
in the configuration file .config
is set to bios
, the generated ISO image has the following structure.
# FIRMWARE_TYPE=bios
+
+minimal_linux_live.iso
+├── boot/
+│ ├── kernel.xz
+│ ├── rootfs.xz
+│ └── syslinux/
+├── EFI/
+└── minimal/
+
+This folder contains all files that are necessary for the proper BIOS boot process. More precisely, you can find the Linux kernel, the initial RAM filesystem (initramfs) and the boot loader.
+This is the Linux kernel. The kernel detects the available hardware, loads necessary drivers and then it passes the execution control to the initramfs.
+This is the initial RAM filesystem. The initramfs file is an archive, automatically unpacked by the kernel in the RAM. The actual execution control is passed to the shell script file /init
, which must be present in the initramfs file.
This folder contains the ISOLINUX boot loader (binaries and configuration files), part of the Syslinux project.
+This folder contains a simple .nsh
script which allows MLL to boot on EFI based machines, provided that these machines support UEFI shell.
This folder contains all MLL overlay bundles (i.e. additional software prepared during the build process).
+When the property FIRMWARE_TYPE
in the configuration file .config
is set to uefi
, the generated ISO image has the following structure.
# FIRMWARE_TYPE=uefi
+
+minimal_linux_live.iso
+├── boot/
+│ └── uefi.img
+└── minimal/
+
+This folder contains all files that are necessary for the proper UEFI boot process. More precisely, you can find the EFI boot image.
+This is the EFI boot image. It contains the systemd-boot UEFI boot manager, corresponding boot configurations, the Linux kernel and the initramfs.
+This folder contains all MLL overlay bundles (i.e. additional software prepared during the build process).
+ +Welcome to the wonderful world of Minimal Linux Live! :)
+Minimal Linux Live (MLL) is a tiny educational Linux distribution, which is designed to be built from scratch by using a collection of automated shell scripts. Minimal Linux Live offers a core environment with just the Linux kernel, GNU C library, and Busybox userland utilities. Additional software can be included in the ISO image at build time by using a well-documented configuration file.
+The generated ISO image file contains Linux kernel, GNU C library compiled with default options, Busybox compiled with default options, quite simple initramfs structure and some "overlay bundles" (the default build process provides few overlay bundles). 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 with default Busybox applets, network support via DHCP and... well, that's all. This is why it's called "minimal".
+Note that by default Minimal Linux Live provides support for legacy BIOS systems. You can change the build configuration settings in the .config file and rebuild MLL with support for modern UEFI systems.
+All build scripts are well organized and quite small in size. You can easily learn from the scripts, reverse engineer the build process 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 which you have built entirely from scratch.
+ +