Skip to content
Snippets Groups Projects
  1. Dec 06, 2019
  2. Dec 03, 2019
  3. Aug 11, 2019
  4. May 05, 2019
    • Marek Behún's avatar
      cmd: pxe: add board specific PXE default path · 2455efa2
      Marek Behún authored
      
      The list of PXE default paths contains ARCH and SOC specific paths, but
      one PXE server can serve different board with the same ARCH and SOC.
      This is the case for Turris Omnia and Turris Mox, where ARCH=arm and
      SOC=mvebu.
      
      If CONFIG_SYS_BOARD is defined, also try "default-$ARCH-$SOC-$BOARD"
      path.
      
      Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
      2455efa2
  5. Apr 26, 2019
    • Patrice Chotard's avatar
      cmd: pxe: Display splashscreen from extlinux.conf input · ee8a4a3f
      Patrice Chotard authored
      The objective is to provide a simple way to retrieve a BMP file,
      and display it as splashscreen, from extlinux.conf file input.
      
      For this, we take example on https://www.syslinux.org/wiki/
      
      
      index.php?title=Menu#The_advanced_menu_system
      and more particularly on MENU BACKGROUND chapter.
      For this, add "menu background" support in pxe command.
      
      As example, extlinux.conf content will look like:
      
      # Generic Distro Configuration file generated by OpenEmbedded
      menu title Select the boot mode
      TIMEOUT 20
      menu background ../splash.bmp
      DEFAULT stm32mp157c-ev1-sdcard
      LABEL stm32mp157c-ev1-sdcard
      	KERNEL /uImage
      	FDT /stm32mp157c-ev1.dtb
      	APPEND root=/dev/mmcblk0p6 rootwait rw earlyprintk console=ttySTM0,115200
      
      Signed-off-by: default avatarPatrice Chotard <patrice.chotard@st.com>
      ee8a4a3f
  6. Oct 08, 2018
    • Patrick Delaunay's avatar
      cmd: pxe: add support for FIT config selection · 2023000a
      Patrick Delaunay authored
      
      Add a way in configuration files (exlinux.conf for sysboot command)
      to select a specific FIT configuration. The configuration is selected
      with a string added after the FIT filename in the label "KERNEL" or
      "LINUX", using the same format than bootm command:
      
      KERNEL [Filename]#<conf>[#<extra-conf[#...]]
      
      This configuration string, beginning by '#', is directly appended
      to bootm argument 1 after <kernel_addr_r>.
      
      bootm [<kernel_addr_r>]#<conf>[#<extra-conf[#...]]
      
      see doc/uImage.FIT/command_syntax_extensions.txt for details
      
      Example :
       KERNEL /fit.itb#cfg1
       KERNEL /fit.itb#cfg2
      
      Configuration can be use also for overlay management :
       KERNEL /fit.itb#cfg1#dtbo1#dtbo3
      
      see doc/uImage.FIT/overlay-fdt-boot.txt for details
      
      Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay@st.com>
      2023000a
  7. Jun 06, 2018
    • Masahiro Yamada's avatar
      menu: fix timeout duration · 86fbad24
      Masahiro Yamada authored
      For distro-boot, the TIMEOUT directive in the boot script specifies
      how long to pause in units of 1/10 sec. [1]
      
      Commit 8594753b ("menu: only timeout when menu is displayed")
      corrected this by simply dividing the timeout value by 10 in
      menu_interactive_choice().
      
      I see two problems:
      
       - For example, "TIMEOUT 5" should wait for 0.5 sec, but the current
         implementation cannot handle the granularity of 1/10 sec.
         In fact, it never breaks because "m->timeout / 10" is zero,
         which means no timeout.
      
       - The menu API is used not only by cmd/pxe.c but also by
         common/autoboot.c .  For the latter case, the unit of the
         timeout value is _second_ because its default is associated
         with CONFIG_BOOTDELAY.
      
      To fix the first issue, use DIV_ROUND_UP() so that the timeout value
      is rounded up to the closest integer.
      
      For the second issue, move the division to the boundary between
      cmd/pxe.c and common/menu.c .  This is a more desirable place because
      the comment of struct pxe_menu says:
      
       * timeout - time in tenths of a second to wait for a user key-press before
       *           booting the default label.
      
      Then, the comment of menu_create() says:
      
       * timeout - A delay in seconds to wait for user input. If 0, timeout is
       * disabled, and the default choice will be returned unless prompt is 1.
      
      [1] https://www.syslinux.org/wiki/index.php?title=SYSLINUX#TIMEOUT_timeout
      
      
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      86fbad24
  8. May 07, 2018
    • Tom Rini's avatar
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini authored
      
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      83d290c5
  9. Oct 16, 2017
    • Tom Rini's avatar
      cmd/pxe.c: Rework bootargs construction to clarify string checks · 59ee8f83
      Tom Rini authored
      
      As the code currently stands, we first check that the length of the
      given command line, along with ip_str/mac_str along with an additional 1
      for the NULL termination will fit within the buffer we have, and if not,
      we return an error.  The way this code was originally written however
      left Coverity "unhappy" due to using strcat rather than strncat.
      Switching this to strncat however causes clang to be unhappy that we
      aren't enforcing the "1" portion within strncat.  Rather than further
      re-work the code to include a "- 1" in this case as well, make the
      strcat code only be done within the else side of the length test.  This
      keeps both clang and Coverity happy.
      
      Fixes: 48ee0a87 ("cmd/pxe.c: Rework initrd and bootargs handling slightly")
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      59ee8f83
  10. Oct 06, 2017
    • Tom Rini's avatar
      cmd/pxe.c: Rework initrd and bootargs handling slightly · 48ee0a87
      Tom Rini authored
      
      For the initrd portion of handling our bootm arguments we do not have a
      sufficiently long enough buffer for some improbable 64bit cases.  Expand
      this buffer to allow for a 64bit address and almost 256MB initrd to be
      used.  Make use of strncpy/strncat when constructing the values here
      since we know what the worst case valid values are, length wise.
      
      Similarly for bootargs themselves, we need to make use of strlen/sizeof
      and strncpy/strncat to ensure that we don't overflow bootargs itself.
      
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Alexander Graf <agraf@suse.de>
      Reported-by: Coverity (CID: 131256)
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      48ee0a87
  11. Aug 16, 2017
  12. Sep 07, 2016
    • York Sun's avatar
      pxe: Fix pxe boot with FIT image · f63963f0
      York Sun authored
      
      When FIT image is used, a single image provides kernel, device
      tree and optionally ramdisk. Argc and argv need to be adjusted
      to support this.
      
      Test cases:
      	1. Booting with legacy images
      	2. Booting with legacy images without initrd
      	3. Booting with FIT image
      Test commands:
      	1. pxe get && pxe boot
      	2. sysboot
      
      Signed-off-by: default avatarYork Sun <york.sun@nxp.com>
      Signed-off-by: default avatarWenbin Song <wenbin.song@nxp.com>
      f63963f0
  13. Feb 06, 2016
  14. Jan 25, 2016
  15. Jul 27, 2015
    • Stephen Warren's avatar
      pxe: add AArch64 image support · 8b5c738b
      Stephen Warren authored
      
      The sysboot and pxe commands currently support either U-Boot formats or
      raw zImages. Add support for the AArch64 Linux port's native image format
      too.
      
      As with zImage support, there is no auto-detection of the native image
      format. Rather, if the image is auto-detected as a U-Boot format, U-Boot
      will try to interpret it as such. Otherwise, U-Boot will fall back to a
      raw/native image format, if one is enabled.
      
      My belief is that CONFIG_CMD_BOOTZ won't ever be enabled for any AArch64
      port, hence there's never a need to differentiate between CONFIG_CMD_
      _BOOTI and _BOOTZ at run-time; compile-time will do. Even if this isn't
      true, we want to prefer _BOOTI over _BOOTZ when defined, since _BOOTI is
      definitely the native format for AArch64.
      
      Change-Id: I83c5cc7566032afd72516de46f4e5eb7a780284a
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarTom Warren <twarren@nvidia.com>
      8b5c738b
  16. May 27, 2015
  17. Apr 19, 2015
  18. Apr 18, 2015
  19. Oct 10, 2014
    • Ian Campbell's avatar
      pxe: Ensure we don't overflow bootargs · 64a0c247
      Ian Campbell authored
      
      On a couple of platforms I've tripped over long PXE append lines overflowing
      this array, due to having CONFIG_SYS_CBSIZE == 256. When doing preseeded Debian
      installs it's pretty trivial to exceed that.
      
      Since the symptom can be a silent hang or a crash add a check. Of course the
      affected boards would also need an increased CBSIZE to actually work.
      
      Note that due to the printing of the final bootargs string CONFIG_SYS_PBSIZE
      also needs to be sufficiently large.
      
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      [trini: Use %zd not %d in printf for all args]
      Signed-off-by: default avatarTom Rini <trini@ti.com>
      64a0c247
  20. Aug 21, 2014
  21. Aug 09, 2014
    • Bryan Wu's avatar
      pxe: detect image format before calling bootm/bootz · 1fb7d0e6
      Bryan Wu authored
      
      Trying bootm for zImage will print out several error message which
      is not necessary for this case. So detect image format firstly, only
      try bootm for legacy and FIT format image then try bootz for others.
      
      This patch needs new function genimg_get_kernel_addr().
      
      Signed-off-by: default avatarBryan Wu <pengw@nvidia.com>
      1fb7d0e6
    • Stephen Warren's avatar
      pxe: clear Bootfile before returning · ded2e20e
      Stephen Warren authored
      
      When "pxe boot" downloads the initrd/kernel/DTB, netboot_common() saves
      the downloaded filename to global variable BootFile. If the boot
      operation is aborted, this global state is not cleared. If "dhcp" is
      executed later without any arguments, BootFile is not cleared, and when
      the DHCP response is received, BootpCopyNetParams() writes the value into
      environment variable bootfile.
      
      This causes the following scenario:
      
      * Boot script executes dhcp; pxe get; pxe boot
      
      * User CTRL-C's the PXE menu, which causes the first menu item to be
        booted, which causes some file to be downloaded.
      
        (This boot-on-CTRL-C behaviour is arguably a bug too, but it's a
        separate bug and the bug this patch fixes would still exist if the user
        simply waited to press CTRL-C until "pxe boot" started downloading
        files)
      
      * User CTRL-C's the file downloads, but the filename is still written to
        the bootfile environment variable.
      
      * User re-runs the boot command, which in my case executes "dhcp; pxe get;
        pxe boot" again, and "dhcp" picks up the saved bootfile environment
        variable and proceeds to download a file that it shouldn't.
      
      To solve this, modify the implementation of "pxe get" to clear BootFile
      if the whole boot operation fails, which avoids this whole mess.
      
      An alternative would be to modify netboot_common() such that the no-
      arguments case explicitly clears the global variable BootFile. However,
      that would prevent the following command sequences from working:
      
      $ dhcp filename # downloads "filename"
      $ dhcp          # downloads $bootfile, i.e. "filename"
      
      or:
      $ setenv bootfile filename
      $ dhcp          # downloads $bootfile, i.e. "filename"
      
      ... and I assume someone relies on U-Boot working that way.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
      ded2e20e
  22. Jul 18, 2014
  23. Feb 21, 2014
  24. Feb 04, 2014
    • Dennis Gilmore's avatar
    • Stephen Warren's avatar
      pxe: implement fdtdir extlinux.conf tag · c61d94d8
      Stephen Warren authored
      
      People who write (or scripts that auto-generate) extlinux.conf don't
      want to know about HW-specific information such as FDT filenames. Create
      a new extlinux.conf tag "fdtdir" that specifies only the directory where
      FDT files are located, and defer all knowledge of the filename to U-Boot.
      The algorithm implemented is:
      
      ==========
      if $fdt_addr_r is set:
        if "fdt" tag was specified in extlinux.conf:
          load the FDT from the filename in the tag
        else if "fdtdir" tag was specified in extlinux.conf:
          if "fdtfile" is set in the environment:
            load the FDT from filename in "$fdtfile"
          else:
            load the FDT from some automatically generated filename
      
      if no FDT file was loaded, and $fdtaddr is set:
        # This indicates an FDT packaged with firmware
        use the FDT at $fdtaddr
      ==========
      
      A small part of an example /boot/extlinux.conf might be:
      
      ==========
      LABEL primary
              LINUX zImage
              FDTDIR ./
      
      LABEL failsafe
              LINUX bkp/zImage
              FDTDIR bkp/
      ==========
      
      ... with /boot/tegra20-seaboard.dtb or /boot/bkp/tegra20-seaboard.dtb
      being loaded by the sysboot/pxe code.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      c61d94d8
    • Stephen Warren's avatar
      pxe: support "devicetree" tag · f43c401b
      Stephen Warren authored
      The specification for extlinux.conf[1] states that "fdt" is an alias for
      "devicetree". To date, U-Boot only implements "fdt". Rectify that.
      
      [1] http://freedesktop.org/wiki/Specifications/BootLoaderSpec/
      
      
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      f43c401b
  25. Jan 09, 2014
  26. Nov 04, 2013
  27. Oct 14, 2013
    • Steven Falco's avatar
      Prevent null pointer dereference originating in cmd_pxe.c · 0e3f3f8a
      Steven Falco authored
      
      Pass a valid cmdtp into do_tftpb(), do_ext2load(), and do_get_fat(), to
      avoid possible crashes due to null pointer dereferencing.
      
      Commit d7884e04 does not go far enough.
      There is still at least one call chain that can result in a crash.
      
      The do_tftpb(), do_ext2load(), and do_get_fat() functions expect a valid
      cmdtp.  Passing in NULL is particularly bad in the do_tftpb() case,
      because eventually boot_get_kernel() will be called with a NULL cmdtp:
      
      do_tftpb() -> netboot_common() -> bootm_maybe_autostart() -> do_bootm()
      -> do_bootm_states() -> bootm_find_os() -> boot_get_kernel()
      
      Around line 991 in cmd_bootm.c, boot_get_kernel() will dereference the
      null pointer, and the board will crash.
      
      Signed-off-by: default avatarSteven A. Falco <stevenfalco@gmail.com>
      0e3f3f8a
  28. Sep 24, 2013
  29. Jul 24, 2013
  30. Jun 25, 2013
Loading