Skip to content

Boot CD ROM Builder

opencode-agent[bot] edited this page May 10, 2026 · 1 revision

Boot CD-ROM Builder

Builder for bootable CD-ROM ISO images in JNode's build system.

Overview

The Boot CD-ROM Builder is the build system component that assembles all JNode artifacts (boot image, init-jar, GRUB bootloader) into a bootable ISO-9660 formatted CD-ROM image. It is invoked by the cdrom, cdrom-lite, and cdrom_64-lite targets in the build system.

Key Components

File Purpose
all/build.xml Master build file, defines CD-ROM targets
all/build-x86.xml Contains create-cdrom macro and cdrom/cdrom-lite targets
builder/lib/iso9660.jar ISOTask library for ISO-9660 image creation

How It Works

Build Targets

The build system exposes three CD-ROM targets:

sh build.sh cd-x86        # Full distribution ISO
sh build.sh cd-x86-lite  # Lite x86 ISO
sh build.sh cd-x86_64-lite # Lite x86_64 ISO

create-cdrom Macro

The create-cdrom macro in all/build-x86.xml:286 assembles the CD-ROM contents:

Directory contents:
  ├── boot/grub/           GRUB boot files (eltorito.s2, fat.s15, grub.s1, grub.s2)
  ├── boot/grub/menu.lst   Boot menu configuration
  ├── licenses/            License files
  ├── jnode*.gz            Boot image (compressed kernel)
  └── initjars/            Plugin JARs and descriptors

ISO Creation

The macro supports two ISO creation backends:

  1. mkisofs (Unix/Linux): Uses the system mkisofs utility with El Torito boot catalog

    mkisofs -o <destfile> -R -b boot/grub/eltorito.s2 \
      -no-emul-boot -boot-load-size 4 -boot-info-table <dir>
    
  2. ISOTask (cross-platform): Uses de.tu_darmstadt.informatik.rbg.hatlak.iso9660.ISOTask from iso9660.jar

    • enableRockRidge: Enables Rock Ridge extensions for Unix-style filenames
    • mkisofsCompatibility: Ensures compatibility with mkisofs-generated images
    • bootImage: Specifies the El Torito boot image
    • bootImageSectorCount: Boot image size in sectors (4 for GRUB)
    • genBootInfoTable: Generates boot info table for BIOS

Boot Image Structure

The CD-ROM follows this layout:

Component Location Purpose
Boot image Root jnode*.gz - compressed boot image
Init JAR Root initjars/ - all plugin JARs
GRUB boot/grub/ Bootloader stages
Menu boot/grub/menu.lst Boot configuration
Licenses licenses/ GPL/LGPL license files

GRUB Configuration

The menu.lst file is copied from all/conf/menu-cdrom.lst and provides boot menu options. GRUB is configured to:

  • Boot from El Torito emulation (no-emulation boot)
  • Load the boot image from CD-ROM
  • Pass multiboot parameters to the kernel

ISOTask Library

The ISOTask library (de.tu_darmstadt.informatik.rbg.hatlak.iso9660.ISOTask) is a Java-based ISO-9660 image creator that:

  • Implements ISO-9660 Level 1 and Level 2 formats
  • Supports Rock Ridge extensions for long filenames
  • Generates El Torito bootable CDs
  • Provides mkisofs-compatible output

Gotchas

  • Platform dependency: The mkisofs path is Unix/Linux only; Windows builds must use ISOTask
  • mkisofs spaces issue: Build fails on Windows if the path contains spaces
  • Boot image size: The boot image sector count (4 sectors = 2KB) must match GRUB expectations
  • ISOTask classpath: The iso9660.jar must be in the build classpath for ISOTask to work
  • Rock Ridge: Enabled by default but can affect compatibility with non-Unix systems
  • Output path: CD-ROM images are written to all/build/cdroms/jnode-*.iso

Related Pages

Clone this wiki locally