summaryrefslogtreecommitdiff
path: root/boot/bootmeth_extlinux.c
AgeCommit message (Collapse)Author
2025-04-03membuf: Rename structSimon Glass
Rename the struct to match the function prefix and filenames. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuff: Rename functions to have membuf_ prefixSimon Glass
The double 'f' is not necessary and is a bit annoying as elsewhere in U-Boot we use 'buf'. Rename all the functions before it is used more widely. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-15Merge patch series "bootstd: Support recording images"Tom Rini
Simon Glass <sjg@chromium.org> says: This series provides a way to keep track of the images used in bootstd, including the type of each image. At present this is sort-of handled by struct bootflow but in quite an ad-hoc way. The structure has become quite large and is hard to query. Future work will be able to reduce its size. Ultimately the 'bootflow info' command may change to also show images as a list, but that is left for later, as this series is already fairly long. So for now, just introduce the concept and adjust bootstd to use it, with a simple command to list the images. This series includes various alist enhancements, to make use of this new data structure a little easier. [trini: Drop patch 18 and 19 for now due to size considerations] Link: https://lore.kernel.org/r/20241115231926.211999-1-sjg@chromium.org
2025-01-15boot: Update extlinux pxe_getfile_func() to include typeSimon Glass
Add a file-type parameter to this function and update all users. Add a proper comment to the function which we are here. This will allow tracking of the file types loaded by the extlinux bootmeth. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-15bootmeth: Update the read_file() method to include a typeSimon Glass
We want to record the type of each file which is loaded. Add an new parameter for this, to the read_file() method. Update all users. Make bootmeth_common_read_file() store information about the image that is read. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2025-01-15bootstd: Update bootmeth_alloc_file() to record imagesSimon Glass
As a first step to recording images and where they came from, update this function to do so, since it is used by two bootmeths Create a helper function in the bootflow system, since recorded images are always associated with bootflows. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-18boot: extlinux: Fix unaligned buffer for reading data from file systemNam Cao
extlinux_read_bootflow() allocates a buffer to read from file system without any alignment. But for some block devices which transfer data via DMA, ARCH_DMA_MINALIGN alignment is required. For example, due to misaligned buffer, the below boot failure is observed. => boot CACHE: Misaligned operation at range [9efa25f8, 9efa27f8] CACHE: Misaligned operation at range [9efa25f8, 9efa27f8] CACHE: Misaligned operation at range [9efa25f8, 9efa27f8] CACHE: Misaligned operation at range [9efa25f8, 9efa27f8] ** Booting bootflow 'mmc@2194000.bootdev.part_1' with extlinux Ignoring unknown command: �D���D�� Boot failed (err=-14) Change the buffer alignment to ARCH_DMA_MINALIGN. Fixes: 31aefaf89a5b ("bootstd: Add an implementation of distro boot") Signed-off-by: Nam Cao <namcao@linutronix.de> Tested-by: Javier Fernandez Pastrana <javier.pastrana@linutronix.de>
2024-10-15bootstd: Add command to enable setting of bootmeth specific propertiesMartyn Welch
We have previously added logic to allow a "fallback" option to be specified in the extlinux configuration. Provide a command that allows us to set this as the preferred default option when booting. Combined with the bootcount functionality, this allows the "altbootcmd" to provide a means of falling back to a previously known good state after a failed update. For example, if "bootcmd" is set to: bootflow scan -lb We would set "altbootcmd" to: bootmeth set extlinux fallback 1; bootflow scan -lb Causing the boot process to boot from the fallback option. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
2024-10-15boot: Add logic to enable booting from fallback optionMartyn Welch
The "fallback" extlinux config option allows us to set an alternative default boot option for when it has been detected that the default is failing. Implement the logic required to boot from this option when desired. Signed-off-by: Martyn Welch <martyn.welch@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-19bootstd: Tidy up comments on the boothmeth driversSimon Glass
Fix a typo in the comment and add one to the EFI driver too. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06boot: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from all "boot/" files and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-09lib: membuff: fix readline not returning line in case of overflowIon Agorria
If line overflows readline it will not be returned, fix this behavior, make it optional and documented properly. Signed-off-by: Ion Agorria <ion@agorria.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20240105072212.6615-6-clamor95@gmail.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-08-28bootstd: Adjust the default bootmeth orderSimon Glass
The existing distro scripts check extlinux and scripts before EFI. Adjust the default ordering to do the same, to avoid breaking existing flows. Add some documentation, mentioning that this order will likely change in future. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Da Xue <da@libre.computer>
2023-06-14bootstd: Fix relative path use in extlinux bootmethJonas Karlman
Using relative path in a /boot/extlinux/extlinux.conf file fails to load linux kernel. Using a /boot/extlinux/extlinux.conf file: LABEL test LINUX ../linux/Image Result in following error: Retrieving file: ../linux/Image Skipping test for failure retrieving kernel Boot failed (err=-14) However, using sysboot cmd successfully load kernel using same file: sysboot mmc 1:1 any ${scriptaddr} /boot/extlinux/extlinux.conf Retrieving file: /boot/extlinux/../linux/Image Fix relative path using bootmeth extlinux by supplying bootfile path instead of subdir path in the call to pxe_setup_ctx, same as done in the sysboot command. Fixes: 31aefaf89a5b ("bootstd: Add an implementation of distro boot") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-13bootstd: Rename distro and syslinux to extlinuxSimon Glass
We use the terms 'distro' to mean extlinux but they are not really the same. 'Distro' could refer to any method of booting a distribution, whereas extlinux is a particular method. Also we sometimes use syslinux, but it is better to use the same term in all cases. Rename distro to syslinux and also update bootstd uses of syslinux to use extlinux instead. Signed-off-by: Simon Glass <sjg@chromium.org>