Building a Debian Live OS fom a GLF configuration fileset 15 Feb 2022 GLF --------------------------------------------------------------------------------------- GLF (the author, Gary L. Flispart) has made a practice of creating live bootable Linux operating system images for over 10 years. These custom remixes of officially released operating systems are distributed as ISO image files (*.iso) which may be burned to DVD+R or imaged to USB flash drive. GLF has for several years limited all such custom OS distributions to variants of Debian Mate, currently based on Debian Mate 11 (bullseye). GLF provides and distributes via internet several such custom remix OS images which contain to the extent possible only open source, free, and/or public domain content, including personally developed projects distributed freely by GLF. All GLF OSes contain all the necessary support utilities to allow a user to replicate the building of an equivalent OS and all its prepackages applications, provided access to the configuration fileset used by GLF to produce the originally distributed ISO image file. GLF also openly distributes archived configuration sets (.tar.gz files) which were used to produce each dated release version of live boot OS, along with documented procedures and tutorials. See the "CustomOSMaker" YouTube site -- download site address is provided in the comments for the tutorial videos. If you want to build an equivalent or customized ISO yourself ------------------------------------------------------------- The official Debian release and its package repository support rebuilding the live bootable OS using an officially supported package "live-build". The build process starts with a set of supported configuration files which describe various details about the desired OS including lists of packages by name to install from the repositories. Also supported is a collection of *.deb package files which might not exist in the official repositories, might be customized variations, or might be entirely locally compiled executable files and support data. In addition, a mechanism is provided to isert special data into specific folders in the built filesystem, or to perform various script operations during the build process. The resulting image, when imaged to bootable medium, can present a complete running OS and a custom suite of applications, utilities, and other tools to a user who wishes to use a Linux OS without formal installation to any specific PC. GLF also promotes a collection of concepts, methods, and tutorials which if followed allow any interested user to reproduce, update, and further customize similar live build OSes, perhaps to suit special project needs by individuals or work groups. Such custom remixes can provide the specialized toolsets and working data to perform special tasks, along with tested working OS environments independent of user's own computer installations, which can be used without unintended risk of altering the personal permanent computer installations or data. GLF has prepared examples of Debian "live build" configuration sets which serve to specify all the needed elements to be installed from the Debian repositories, plus supplemental data, to make a bootable live OS ISO image. Any GLF-produced Linux OS disk based on Debian will contain by design all the necessary tools to rebuild itself given it original configuration archive set, or a similar valid customized version thereof. Examples of such remix OSes include "GLFPE" and "GFPCB", in versions for AMD64 (x86-064) and i686 CPU. To build or rebuild using this process, you need to be running a compatible flavor of the OS as the build host (AMD64 built on an AMD64 OS, i686 built on an i686 host). The basic process to build or rebuild a live boot OS using this method: Acquire an ISO image for a compatible live boot OS targeting the same CPU type as the desired target OS (32-bit i686 or 64-bit AMD64 are the supported PC types). Burn the ISO image file to USB or DVD, boot the drive in live boot mode on a computer with at least 2 to 4 Gb of RAM and access to broadband internet (at least 30Mbit/sec download during the build). Prepare a work drive by formatting a USB external flash or hard drive with at least 64Gb of free space using the Linux EXT4 format. This will be used to build the image by downloading repository files in chroot mode and constructing a compressed filesystem to hold the new OS data and applications. This requires a LOT of space, typically 30 Gb of working data to produce a 5 Gb OS image file. Unpack the archived configuration fileset (.tar.gz file) to the work drive into a folder named to match the OS release version. Perform the prescribed steps to install some special script files and set up the computer ready to build the OS. This requires a special remount process for the work drive to temporarly set special (not default) permissions on the work drive. Bring up a terminal, change to the configuration's top directory, and run the build. It should take an hour or so if a USB 3.0 external work drive and fast broadband are used. Reassign ownership, permissions, and name for the output *.iso file, move it to another folder, and erase the now unneeded configuration folder from the work drive. Specifics --------- Though the build process can be run from an installed version of a compatible Linux OS, the following PREFERRED procedure uses only a copy of a compatible live boot OS medium without full installation, a work drive as described, and the originating configuration set for the desired target image. It is assumed the user will run the build from a preexisting configuration (ex. gfpcb720_amd64.tar.gz) using a compatible Linux OS (which may be, SHOULD be a Debian live boot instance) from a work drive, an external USB hard drive or USB flash drive partition formatted to Linux Ext4. Using an external drive allows a user to build the OS without making any permanent changes to an underlying computer. DO NOT try to use NTFS, FAT32 or other non-Linux partition type. It won't work. GLF configurations are specific for PC CPU type (amd64 or 686). A typical configuration will be stored as a .tar.gz archive which will be unpacked to a folder on the work drive. The unpacked configuration should be edited to change any needed filenames, dates, and other pertinent configuration-specific variables prior to using it to build another copy of the OS image. Each build brings in the latest versions of applications and libraries from the Debian repositories, so repeated builds may function identically, but are not strictly replicable. After such edits, it is assumed the user will save the state of the new configuration by compressing the folder into a (newly named) .tar.gz archive. The *.tar.gz format is important to preserve the permission status of all contained files (ZIP won't work). Once the configuration is ready to use, copy the script below to the user's $HOME folder (it should already be executable), and bring up a terminal based at the home folder. remountforlb.sh -- Necessary script prior to building a Debian Live Build configuration from external USB EXT4 formatted drive. This script is assumed to be copied to the user's $HOME folder. It is assumd the user has unpacked a live build configuration set (ex. glfpe624_amd64.tar.gz) to the root of an external USB drive formatted to Linux Ext4 format (ex. folder "glfpe624_amd64"). That configuration must meet the current specs for the Debian "live-build" and "live-config" packages installed into the OS being used. It is also assumed that the CPU type of the OS being used matches the type built into the configuration. DO NOT try to build a 64-bit OS using a 32-bit OS host, nor the reverse. Provided the minimal dependencies are satisfied, one should be able to build an ISO image from the configuration set from even a base-level official build of Debian (currently 11, or "bullseye"). REQUIRES a single parameter, mounted drive name, assumed of form: /dev/sdd1 In order to find that device name precisely, prior to executing this script, perform the following from a terminal (from home folder): sudo fdisk -l ls The first command will list all drive names -- examine the list to identify the correct drive for the purpose (ex. /dev/sdd1). Look for drive partitions marked Linux Ext4. The ls command will bring up contents of the home folder, which should include this script, "remountforlb.sh". That will allow easy cut-paste operations to the command line to set up the following command to execute next: ./remountforlb.sh /dev/sdd1 Following the execution of this script, the selected drive should be remounted as ~/livebuild. Examine the home folder to verify this, then bring up a GUI file explorer window for ~/livebuild. Select the build configuration folder (prepared ahead of time) and bring up a terminal based on that folder (Ex. ~/livebuild/gfpcb720_amd64/). Begin the build process (about an hour or so) by executing: sudo lb build Avoid typing into the keyboard during the build to avoid accidentally breaking the build with say, a CTRL-C. If successful, the finished ISO file will be found in the same configuration folder (Ex. "live-image-amd64.hybrid.iso"). This file will be owned by root, so it will be necessary to change the permissions/owner from "root" to "user". The easiest way to do that is to explore to the folder, right click and select "Open As Administrator". In the now root file explorer, right click the *.iso file and select "Properties". Under the "Permissions" tab, change the owner and group from "root" to "user using the popup menu, then exit. Open the parent window also as Administrator, and drag the now user -owned file to the parent (user-owned) folder. Once the iso file is moved, you should delete the configuration folder which built that iso, since it is now MUCH larger than it started (went from 3 Gb to 30 Gb in the process of the build) and it holds many root-owned files within what is supposed to be a user area. You need to delete the configuration folder as root (Superuser). You should also exit the open terminal window which was used for the build script. A quirk of the current build system is that the ISO file is not named correctly, always showing "live-image-" as a prefix. The build config is SUPPOSED to rename it (Ex. "debian-live-gfpcb-720-amd64.hybrid.iso"), but it fails to do so. Once tyhe file's owner is changed to "user", you can manually change the ISO name to match the intended build name. The ISO file now may be imaged to USB flash stick (you can use "Applications", "Accessories", "Disks" from the menu to bring up the gnome- disk-utility application. Use the "hamburger" menu at top right to select "Restore Disk Image" to copy the ISO data to the selected USB stick to make a live bootable OS medium. BE VERY CAREFUL to select the CORRECT DRIVE if you use this method (or any other) to avoid accidentally wiping the wrong disk drive! You may alternatively burn the ISO to DVD+R disk by selecting "Brasero" from the "Applications", "Sound and Video", Brasero" menu, and following the menus. DVD is the safest way to test the OS since you cannot write again to the finished disk, hence you cannot accidentally modify your boot software. However, DVDs take a LONG time to burn and also take much longer to boot, and applications run much slower, too. When possible use a USB stick instead. Usually 8Gb is big enough. USB boots typically take only about 45 seconds to get to the GUI desktop screen. DVDs can take 6 minutes. Imaging software which can make a suitable USB boot disk from ISO is also available for a Windows OS machine, if the user is bootstrapping without a preexisting Linux system.