pxe-bootserver/todo.md
2023-04-18 13:41:50 +02:00

3.8 KiB

To Do...

Modular Approach

Folder Structure

  • main.sh
    • ./services
      • main
      • tftpd-hpa
        • plugin.sh
        • config.sh
        • ./templates
        • ./build
      • nfs
      • samba
      • iscsi / tgt
      • lighthttpd
    • ./menues
      • ./pxelinux
        • plugin.sh
        • config.sh
        • ./templates
        • ./build
      • ./ipxe
      • ./custom-made
    • ./plugins
      • Knoppix
        • plugin.sh
        • config.sh
        • ./templates
        • ./build
        • ./resources
        • ./downloads
        • ./temp
      • Rescuezilla
      • FreeDOS
      • Clonezilla

Structure

main.sh

  • drives all actions:
    • init - bootstrap the bare minimum: debian packages, config files, etc.
    • build - build all enabled plugins: trigger downloads, file processing
    • build-all - build even disabled plugins
    • start / stop / restart - handle services
  • points all plugins to source global variables from ./services/main (could be changed!)
  • provides global variables:
    • IP / Hostname

./services

  • make services modular
  • plugin.sh
    • manages all actions: downloads, file processing, template parsing
  • config.sh
    • holds plugin specific variables
  • ./main
    • configure settings:
    • variables
      • tftp root dir
      • hook: pxelinux or ipxe menus? so plugins could provide matching menue entries
  • ./tftp-hpa and other services:
    • templates for config files

./menues

  • make modular menues
  • branding
  • which menue to use: menu.c32 or vesamenu.c32, even use iPXE menues (may be broken by plugins)
  • create menu sections: (maybe a kind of hook for plugin-types?)
    • put plugins into sections
    • types: livesystem, rescue, tools, installer, etc.
    • priority: sort stanzas

./plugins

  • plugin contains all needed files
  • plugin.sh
    • manages all actions: downloads, file processing, template parsing
  • config.sh
    • plugin name
    • enabled: y/n
    • type: rescue, os, installer (must be one of the menue hooks)
    • depends: nfs, samba, etc.
    • plugin specific variables and settings

Central config file approach

a main script with a conf.d/ directory. config files are sorted by numbers and special names: menu_20_pxelinux.conf, service_10_nfs.conf, plugin_30_knoppix.conf each .conf file contains the needed variables

the main script can select files by name (menu,service,plugin) and sort them by number for the desired lineup.

menu* files build the menu and processes all plugin* files to fill the menu

File structure

  • main.sh
  • ./conf.d/
    • menu_10_default.conf
    • service_10_tftp.conf
    • plugin_10_knoppix.conf
    • plugin_20_rescuezilla.conf

menu*.conf

  1. install tgt
  2. parse settings.sh and create tgt config files to:
  3. a Windows 10 DVD target (.iso under /srv/tftp/non-free/windows10.iso)

Remeber: Check if a iSCSI Tape-Target could be used to trick a Tape Backup Software to use HardDisks as Tapes