a script designed to generate bootable live ISO images from a provided mkobsidiansfs-created system image.
This script streamlines the creation of live ISOs, enabling users to package a complete system into a portable, bootable image. It is particularly useful for packing weird distros like Void which need Void, and for several other purposes.
To create a live ISO, mkobsidianiso requires a configuration file, the path to your root filesystem (which can be either a directory or a squashfs system image), and the desired output path for the ISO file.
mkobsidianiso [OPTIONS] <config> <rootfs> <output.iso><config>: Path to the configuration file.<rootfs>: The source root filesystem (a directory or a squashfs system image).<output.iso>: The path where the generated ISO file will be saved.
-k, --kernel <version>: Specify the kernel version to use. If not provided, the script attempts to auto-detect it from the root filesystem.-h, --help: Display the help message and exit.-v, --version: Display the script version and exit.
The <config> file is sourced by the script and can define the following variables:
DISTRO: The distribution name displayed in the GRUB menu.ISO_NAME: The product name for the ISO file.ISO_VERSION: The product version for the ISO file.EXTRA_GRUB_CONFIG: Additional GRUB menu entries or configuration.BUSYBOX: Path to the BusyBox binary.EXTRA_BOOT_OPT: Extra boot options to append likequiet splash.BINARIES: Paths of binary files to copy to the system before booting and symlinking them.
# Create an ISO using a configuration file, a rootfs directory, and output to obsidian.iso
mkobsidianiso myconfig.conf /path/to/your/rootfs obsidian.iso
# Create an ISO with a specific kernel version from a squashfs image
mkobsidianiso myconfig.conf -k 6.12.62_1 /path/to/rootfs.sfs custom_obsidian.isoThe script relies on the following tools, which must be installed on your system:
mksquashfs(fromsquashfs-tools)grub-mkrescue(fromgrub)unzstd(fromzstd)busybox(orbusybox-static)
- Initialization: Sets up a temporary working directory and handles cleanup on exit.
- Kernel Detection: Identifies or uses a specified kernel version from the root filesystem.
- SquashFS Creation (if necessary): If a directory is provided as the root filesystem, it is converted into a compressed squashfs image (
system.sfs). - Module Extraction: Extracts critical kernel modules (
squashfs.ko,loop.ko,overlay.ko) required for the live environment. - BusyBox Integration: Copies the BusyBox binary into the ISO's sbin directory for essential utilities.
- Init Script Generation: Creates a custom
initscript responsible for mounting the squashfs, setting up an overlay filesystem, and pivoting the root to the live system. - GRUB Configuration: Generates
grub.cfgto enable booting the live ISO. - ISO Assembly: Utilizes
grub-mkrescueto compile all components into the final bootable ISO image.
This project is licensed under the MIT License.