summaryrefslogtreecommitdiff
path: root/cmd/pxe.c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-19command: Remove the cmd_tbl_t typedefSimon Glass1-9/+10
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move functions for loading from fat/ext2 to fs.hSimon Glass1-0/+1
These are filesystem functions and belong in the filesystem header file. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move do_tftpb() to net.hSimon Glass1-0/+1
This function belongs in the network header file. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-12-07cmd: pxe: Fix checkpatch WARNING/CHECKPatrice Chotard1-7/+6
Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-12-07cmd: sysboot: Create a sysboot command dedicated filePatrice Chotard1-132/+0
Extract all sysboot command related code from pxe.c to new sysboot.c Update Kconfig to insure that DISTRO_DEFAULT select new CMD_SYSBOOT command. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-12-07cmd: Prepare sysboot command independencePatrice Chotard1-1416/+2
As sysboot and pxe commands are sharing piece of code, migrate this common code into a new file pxe_utils.c to prepare sysboot command code extraction from pxe.c Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-12-07cmd: Migrate from_env() from pxe.c to nvedit.cPatrice Chotard1-17/+0
Migrate from_env() from pxe.c to nvedit.c as it's not pxe specific. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-12-03cmd: pxe: Fix bootm argument countAbhishek Shah1-0/+1
pxe command parses the init ramfs address(through initrd lable in pxe config file), but is not passing it to bootm command as argument as bootm_argc count is not increased. Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com> Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_set() to env.hSimon Glass1-0/+1
Move env_set() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-05-05cmd: pxe: add board specific PXE default pathMarek BehĂșn1-0/+3
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: Marek BehĂșn <marek.behun@nic.cz>
2019-04-27cmd: pxe: Display splashscreen from extlinux.conf inputPatrice Chotard1-0/+24
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: Patrice Chotard <patrice.chotard@st.com>
2018-10-08cmd: pxe: add support for FIT config selectionPatrick Delaunay1-3/+51
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: Patrick Delaunay <patrick.delaunay@st.com>
2018-06-06menu: fix timeout durationMasahiro Yamada1-2/+2
For distro-boot, the TIMEOUT directive in the boot script specifies how long to pause in units of 1/10 sec. [1] Commit 8594753ba0a7 ("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: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
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: Tom Rini <trini@konsulko.com>
2017-10-16cmd/pxe.c: Rework bootargs construction to clarify string checksTom Rini1-9/+10
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: 48ee0a87bc46 ("cmd/pxe.c: Rework initrd and bootargs handling slightly") Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-06cmd/pxe.c: Rework initrd and bootargs handling slightlyTom Rini1-6/+6
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: Tom Rini <trini@konsulko.com>
2017-08-16env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()Simon Glass1-2/+1
Rename this function for consistency with env_get(). Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass1-15/+15
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass1-3/+3
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-07pxe: Fix pxe boot with FIT imageYork Sun1-4/+5
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: York Sun <york.sun@nxp.com> Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
2016-02-06Use correct spelling of "U-Boot"Bin Meng1-2/+2
Correct spelling of "U-Boot" shall be used in all written text (documentation, comments in source files etc.). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass1-0/+1725
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>