summaryrefslogtreecommitdiff
path: root/dhcp3/dhcpd.etherboot-udhcp
blob: 9a3e4426ca45e8ad1cdb3d5e638b9ff27ab40b42 (plain)
  1. # This ISC dhcpd 3.x config snippet is inspired by initrd code in
  2. # contrib area of etherboot source (dhcpd.conf.etherboot.include).
  3. # Usage:
  4. #
  5. # include "/etc/local-COMMON/dhcp3/dhcpd.etherboot";
  6. # include "/etc/local-COMMON/dhcp3/dhcpd.etherboot-udhcp";
  7. # include "/etc/local/dhcpd.conf.etherboot-pcimap.include"; # file generated by mknbi-set
  8. #
  9. # (...common options...)
  10. #
  11. # subclass "etherboot-udhcp-hosts" 00:01:02:03:04:05;
  12. # subclass "etherboot-udhcp-hosts" 00:01:02:03:04:06 { fixed-address 192.168.1.101; another-option "bla bla"; }
  13. #
  14. class "etherboot-udhcp-hosts" {
  15. match pick-first-value (option dhcp-client-identifier, hardware);
  16. }
  17. # Apply Etherboot options only for Etherboot clients
  18. #
  19. if substring ( option vendor-class-identifier, 0, 9 ) = "Etherboot" {
  20. # We must specify this value for etherboot-magic, or Etherboot will
  21. # ignore all other options.
  22. #
  23. option etherboot.magic E4:45:74:68:00:00;
  24. # Bootfile name: derive from etherboot.kmod (calculated below)
  25. # Use boot.nbi if no NIC_DEV_ID option present
  26. # (i.e. if etherboot.kmod doesn't get set)
  27. # Also pass filename back in filename field
  28. #
  29. option bootfile-name = pick-first-value (
  30. concat (
  31. "boot-",
  32. config-option etherboot.kmod,
  33. ".nbi"
  34. ),
  35. "boot.nbi"
  36. ) ;
  37. filename = config-option bootfile-name;
  38. # "Sensible" default values for some options
  39. # Mount devfs (will probably be needed for a network-boot)
  40. option etherboot.kernel-cmdline " devfs=mount";
  41. # Info message (includes client IP address, MAC address, hardware ID string,
  42. # server IP address and name of boot file)
  43. option etherboot.motd-4 = concat (
  44. "Using Etherboot to boot ",
  45. binary-to-ascii ( 10, 8, ".", leased-address ),
  46. " [",
  47. binary-to-ascii ( 16, 8, ":", suffix ( hardware, 6 ) ),
  48. "] [",
  49. pick-first-value ( option etherboot.nic-dev-id, "unknown card" ),
  50. "]", 0d:0a, " from ",
  51. binary-to-ascii ( 10, 8, ".", option dhcp-server-identifier ),
  52. " with file ",
  53. config-option tftp-server-name,
  54. ":",
  55. config-option bootfile-name,
  56. " [",
  57. pick-first-value ( config-option etherboot.kmod, "unknown module" ),
  58. "]", 0d:0a
  59. );
  60. }
  61. # Some options should be set for both Etherboot and the udhcpc client
  62. #
  63. if (
  64. ( substring ( option vendor-class-identifier, 0, 9 ) = "Etherboot" )
  65. or
  66. ( substring ( option vendor-class-identifier, 0, 5 ) = "udhcp" )
  67. ) {
  68. # TFTP server defaults to DHCP server and is specified in both
  69. # next-server field and tftp-server-name option field
  70. #
  71. option tftp-server-name = binary-to-ascii ( 10, 8, ".", config-option dhcp-server-identifier );
  72. server-name = config-option tftp-server-name;
  73. next-server = config-option dhcp-server-identifier;
  74. # Root path defaults to root of TFTP server
  75. option root-path = concat ( config-option tftp-server-name, ":/" );
  76. # A fallback hostname, generated from the IP address
  77. option host-name = concat ( "client_", binary-to-ascii ( 10, 8, "_", leased-address ) );
  78. }
  79. # Force some items onto parameter request list for udhcp
  80. #
  81. if substring ( option vendor-class-identifier, 0, 5 ) = "udhcp" {
  82. # Forcibly add root-path to list
  83. option dhcp-parameter-request-list = concat ( option dhcp-parameter-request-list, 11 );
  84. }