|
79 | 79 | <section xml:id="sles-pxe-server-configure-grub2-main-config"> |
80 | 80 | <title>Creating the &grub; configuration</title> |
81 | 81 | <para> |
82 | | - The &grub; configuration file handles three main tasks: detecting the client's architecture, |
83 | | - managing network interfaces and loading other configuration files. This modular |
| 82 | + The &grub; configuration file handles three main tasks: detecting the client's architecture, |
| 83 | + managing network interfaces and loading other configuration files. This modular |
84 | 84 | approach provides flexibility for different deployment scenarios. |
85 | 85 | </para> |
86 | 86 | <procedure xml:id="proc-create-main-grub-config"> |
|
663 | 663 | </procedure> |
664 | 664 | </section> |
665 | 665 | </section> |
| 666 | + <section xml:id="sles-pxe-server-grub2-troubleshoot-multi-env"> |
| 667 | + <title>Multi-environment subdirectory setups</title> |
| 668 | + <para> |
| 669 | + If you want to serve multiple independent PXE environments from subdirectories under one TFTP root (for example, |
| 670 | + <filename>/srv/tftpboot/<replaceable>ENV1</replaceable>/boot/...</filename> and |
| 671 | + <filename>/srv/tftpboot/<replaceable>ENV2</replaceable>/boot/...</filename>), the standard |
| 672 | + <filename>/boot</filename> prefix used throughout this guide must be replaced with your custom |
| 673 | + prefix consistently in all of the following places. Missing even one will cause boot failures. |
| 674 | + </para> |
| 675 | + <itemizedlist> |
| 676 | + <listitem> |
| 677 | + <para> |
| 678 | + <emphasis role="bold">DHCP boot filename</emphasis>—the boot filename delivered to the |
| 679 | + client must include the custom prefix. For example, |
| 680 | + <filename>/<replaceable>ENV1</replaceable>/boot/grub2/x86_64-efi/bootx64.efi</filename>. |
| 681 | + </para> |
| 682 | + </listitem> |
| 683 | + <listitem> |
| 684 | + <para> |
| 685 | + <emphasis role="bold">nginx location alias</emphasis>—the <literal>location /boot</literal> |
| 686 | + block in <filename>/etc/nginx/nginx.conf</filename> must be updated to expose the custom |
| 687 | + prefix path. |
| 688 | + </para> |
| 689 | + </listitem> |
| 690 | + <listitem> |
| 691 | + <para> |
| 692 | + <emphasis role="bold"><filename>grub.cfg</filename> source paths</emphasis>—the hardcoded |
| 693 | + absolute paths inside <filename>/srv/tftpboot/boot/grub2/grub.cfg</filename>: |
| 694 | + </para> |
| 695 | +<screen>source "${config}/${net_default_mac}/grub.cfg"</screen> |
| 696 | +<screen>source "${prefix}/menu.cfg"</screen> |
| 697 | + <para> |
| 698 | + Both must be updated to use the custom prefix. |
| 699 | + </para> |
| 700 | + </listitem> |
| 701 | + <listitem> |
| 702 | + <para> |
| 703 | + <emphasis role="bold"><filename>menu.cfg</filename> paths</emphasis>—all |
| 704 | + <filename>/boot/images/...</filename> paths inside <filename>menu.cfg</filename> must be |
| 705 | + updated to use the custom prefix. |
| 706 | + </para> |
| 707 | + </listitem> |
| 708 | + <listitem> |
| 709 | + <para> |
| 710 | + <emphasis role="bold">Per-MAC host configurations</emphasis>—if you use machine-specific configurations, the |
| 711 | + <literal>source "/boot/grub2/menu.cfg"</literal> line inside each per-MAC <filename>grub.cfg</filename> must also be updated to use the custom prefix. |
| 712 | + </para> |
| 713 | + </listitem> |
| 714 | + <listitem> |
| 715 | + <para> |
| 716 | + <emphasis role="bold">&selnx; file context</emphasis>—run <command>restorecon</command> on your custom path: |
| 717 | + </para> |
| 718 | +<screen>&prompt.sudo;<command>restorecon -Rv /srv/tftpboot/<replaceable>ENV1</replaceable></command></screen> |
| 719 | + </listitem> |
| 720 | + <listitem> |
| 721 | + <para> |
| 722 | + <emphasis role="bold">&selnx; policy</emphasis>— running <command>setsebool -P |
| 723 | + httpd_serve_cobbler_files=1</command> only covers the standard <filename>/boot</filename> |
| 724 | + path. A custom &selnx; policy is required for a non-standard prefix. Use <command>ausearch -m avc -ts recent</command> |
| 725 | + to identify denials and create the appropriate policy module. |
| 726 | + </para> |
| 727 | + </listitem> |
| 728 | + </itemizedlist> |
| 729 | + </section> |
666 | 730 | <section xml:id="sles-pxe-server-configure-grub2-next-steps"> |
667 | 731 | <title>Next steps</title> |
668 | 732 | <para> |
|
0 commit comments