Skip to content

Commit e829df5

Browse files
committed
Added a note on core.efi prefix limitation and guidance for multi-environment subdirectory PXE setups.
1 parent ddff989 commit e829df5

2 files changed

Lines changed: 82 additions & 4 deletions

File tree

tasks/sles-pxe-server-configure-grub2.xml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
<section xml:id="sles-pxe-server-configure-grub2-main-config">
8080
<title>Creating the &grub; configuration</title>
8181
<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
8484
approach provides flexibility for different deployment scenarios.
8585
</para>
8686
<procedure xml:id="proc-create-main-grub-config">
@@ -663,6 +663,70 @@ EOF
663663
</procedure>
664664
</section>
665665
</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>&mdash;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>&mdash;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>&mdash;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>&mdash;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>&mdash;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>&mdash;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>&mdash; 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>
666730
<section xml:id="sles-pxe-server-configure-grub2-next-steps">
667731
<title>Next steps</title>
668732
<para>

tasks/sles-pxe-server-netboot-directories-uefi-secure-boot.xml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,22 @@
127127
<filename>/srv/tftpboot/boot/grub2/<replaceable>ARCH</replaceable>-efi/core.efi</filename>
128128
file installed by the <command>grub2-mknetdir</command> command for &x86-64; or &aarch64;
129129
architectures for UEFI PXE as well. However, they are <emphasis>not signed</emphasis> and
130-
do not support &uefisecboot;. To optionally enable &uefisecboot; for the supported
131-
&x86-64; and &aarch64; architectures, perform any of the following steps:
130+
do not support &uefisecboot;.
131+
</para>
132+
<note>
133+
<title><filename>core.efi</filename> and subdirectory setups</title>
134+
<para>
135+
The <filename>core.efi</filename> file generated by <command>grub2-mknetdir</command>
136+
has <filename>/boot/grub2</filename> hardcoded as an embedded prefix. &grub; always
137+
fetches modules and configuration from this prefix relative to the TFTP root,
138+
regardless of where <filename>core.efi</filename> itself was loaded from. If you need
139+
to serve multiple environments from subdirectories under one TFTP root, use
140+
<filename>shim</filename> and <filename>grub.efi</filename> from the installation
141+
media ISO or the <package>shim</package> package instead, as described below.
142+
</para>
143+
</note>
144+
<para>
145+
To optionally enable &uefisecboot; for the supported &x86-64; and &aarch64; architectures, perform any of the following steps:
132146
</para>
133147
<stepalternatives>
134148
<step>

0 commit comments

Comments
 (0)