[PATCH] bootstd: Allow PXE boot to be disabled

Tom Rini trini at konsulko.com
Fri Oct 10 23:40:56 CEST 2025


On Fri, Oct 10, 2025 at 01:59:43PM -0700, Tony Dinh wrote:
> Hi Tom,
> 
> On Fri, Oct 10, 2025 at 1:07 PM Tom Rini <trini at konsulko.com> wrote:
> >
> > On Fri, Oct 10, 2025 at 12:38:58PM -0700, Tony Dinh wrote:
> > > Hi Tom & Simon,
> > >
> > > On Fri, Oct 10, 2025 at 7:28 AM Tom Rini <trini at konsulko.com> wrote:
> > > >
> > > > On Thu, Oct 09, 2025 at 10:29:17PM -0700, Tony Dinh wrote:
> > > >
> > > > > Make it possible to disable CMD_PXE.
> > > > > Remove unnecessary PXE_UTILS selection in BOOTMETH_EXTLINUX config.
> > > > > In extlinux_boot(), invoke pxe utils only when
> > > > > CONFIG_BOOTMETH_EXTLINUX_PXE is enabled.
> > > > >
> > > > > This patch results in about 9K reduction in image size when
> > > > > PXE boot is disabled.
> > > > >
> > > > > Signed-off-by: Tony Dinh <mibodhi at gmail.com>
> > > > > ---
> > > > >
> > > > >  boot/Kconfig             |  3 +--
> > > > >  boot/bootmeth_extlinux.c | 18 ++++++++++--------
> > > > >  2 files changed, 11 insertions(+), 10 deletions(-)
> > > >
> > > > Is some part of the symbol logic here wrong? A challenge is that "PXE"
> > > > is also where the logic to parse extlinux.conf style files came from,
> > > > and I thought we had split those two out. And then there's this:
> > > >
> > > > >
> > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > index 2993cd7f9ba..403ce4c3d46 100644
> > > > > --- a/boot/Kconfig
> > > > > +++ b/boot/Kconfig
> > > > > @@ -421,10 +421,10 @@ config BOOT_DEFAULTS_CMDS
> > > > >       select CMD_PART if PARTITIONS
> > > > >       select CMD_DHCP if CMD_NET
> > > > >       select CMD_PING if CMD_NET
> > > > > -     select CMD_PXE if CMD_NET
> > > > >       select CMD_BOOTI if ARM64
> > > > >       select CMD_BOOTZ if ARM && !ARM64
> > > > >       imply CMD_MII if NET
> > > > > +     imply CMD_PXE if CMD_NET
> > > >
> > > > This is one of the things where defaults isn't supposed to be so easy to
> > > > get out of. How many platforms are you wanting to then disable CMD_PXE
> > > > on to save space?
> > >
> > > I'm simply trying to compile out PXE for a board that I'm working on!
> > > The only thing I need is booting with scripts on a block device. And
> > > it looks like we have to include everything in bootstd to use it. It
> > > seems wrong to make the image a lot larger than needed for boards that
> > > never use a specific feature.
> > >
> > > I would agree about  "defaults isn't supposed to be so easy to get out
> > > of". But in this case (and similarly in other CMD_x), CMD_PXE brings
> > > in all dependencies for PXE including pxe_utils.
> >
> > So, as a preface, it's quite likely that we do need to tweak some of the
> > Kconfig logic here. To help better understand the use case:
> > - Does this platform have networking devices in U-Boot?
> > - Are you wanting to support arbitrary off the shelf OS distributions?
> 
> Yes to both. Networking is enabled in U-Boot, but not used for
> booting. And it should boot various off-the-shell OS. U-Boot is on a
> 512KB partition on SPI flash (why I want to keep u-boot image as small
> as possible).

This is the hard case then. The point of the options is that if you
enable them, all of the common cases like network booting work. Without
knowing the device itself, I'm unsure why no one would ever use the
network to install the OS.

I suspect you need to look for where you can change "select
something-boot-standard" to "imply something-boot-standard" and then
turn it off for your platform, and turn on what you want to support for
it. It's taking the Kconfig change you proposed to start with one step
further.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20251010/f154651d/attachment.sig>


More information about the U-Boot mailing list