diff options
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/Kconfig | 20 | ||||
| -rw-r--r-- | boot/Makefile | 4 | ||||
| -rw-r--r-- | boot/bootmeth_extlinux.c (renamed from boot/bootmeth_distro.c) | 58 | ||||
| -rw-r--r-- | boot/bootmeth_pxe.c | 50 | ||||
| -rw-r--r-- | boot/bootmeth_qfw.c | 2 | ||||
| -rw-r--r-- | boot/bootmeth_sandbox.c | 2 |
6 files changed, 73 insertions, 63 deletions
diff --git a/boot/Kconfig b/boot/Kconfig index fad8e530b17..3f8e407be7c 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -462,25 +462,33 @@ config BOOTMETH_GLOBAL EFI bootmgr, since they take full control over which bootdevs are selected to boot. -config BOOTMETH_DISTRO - bool "Bootdev support for distro boot" +config BOOTMETH_EXTLINUX + bool "Bootdev support for extlinux boot" select PXE_UTILS default y help - Enables support for distro boot using bootdevs. This makes the + Enables support for extlinux boot using bootdevs. This makes the bootdevs look for a 'extlinux/extlinux.conf' on each filesystem they scan. + The specification for this filed is here: + + https://uapi-group.org/specifications/specs/boot_loader_specification/ + This provides a way to try out standard boot on an existing boot flow. -config BOOTMETH_DISTRO_PXE - bool "Bootdev support for distro boot over network" +config BOOTMETH_EXTLINUX_PXE + bool "Bootdev support for extlinux boot over network" depends on CMD_PXE && CMD_NET && DM_ETH default y help - Enables support for distro boot using bootdevs. This makes the + Enables support for extlinux boot using bootdevs. This makes the bootdevs look for a 'extlinux/extlinux.conf' on the tftp server. + The specification for this file is here: + + https://uapi-group.org/specifications/specs/boot_loader_specification/ + This provides a way to try out standard boot on an existing boot flow. config BOOTMETH_EFILOADER diff --git a/boot/Makefile b/boot/Makefile index 88193a1b60e..f94c31d922d 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -24,8 +24,8 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootmeth-uclass.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootstd-uclass.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_DISTRO) += bootmeth_distro.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_DISTRO_PXE) += bootmeth_pxe.o +obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX) += bootmeth_extlinux.o +obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX_PXE) += bootmeth_pxe.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFILOADER) += bootmeth_efi.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o diff --git a/boot/bootmeth_distro.c b/boot/bootmeth_extlinux.c index b4b73ecbf58..24be0760229 100644 --- a/boot/bootmeth_distro.c +++ b/boot/bootmeth_extlinux.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Bootmethod for distro boot (syslinux boot from a block device) + * Bootmethod for extlinux boot from a block device * * Copyright 2021 Google LLC * Written by Simon Glass <[email protected]> @@ -14,15 +14,15 @@ #include <bootmeth.h> #include <bootstd.h> #include <command.h> -#include <distro.h> #include <dm.h> +#include <extlinux.h> #include <fs.h> #include <malloc.h> #include <mapmem.h> #include <mmc.h> #include <pxe_utils.h> -static int distro_get_state_desc(struct udevice *dev, char *buf, int maxsize) +static int extlinux_get_state_desc(struct udevice *dev, char *buf, int maxsize) { if (IS_ENABLED(CONFIG_SANDBOX)) { int len; @@ -35,10 +35,10 @@ static int distro_get_state_desc(struct udevice *dev, char *buf, int maxsize) return 0; } -static int distro_getfile(struct pxe_context *ctx, const char *file_path, - char *file_addr, ulong *sizep) +static int extlinux_getfile(struct pxe_context *ctx, const char *file_path, + char *file_addr, ulong *sizep) { - struct distro_info *info = ctx->userdata; + struct extlinux_info *info = ctx->userdata; ulong addr; int ret; @@ -54,7 +54,7 @@ static int distro_getfile(struct pxe_context *ctx, const char *file_path, return 0; } -static int distro_check(struct udevice *dev, struct bootflow_iter *iter) +static int extlinux_check(struct udevice *dev, struct bootflow_iter *iter) { int ret; @@ -67,12 +67,12 @@ static int distro_check(struct udevice *dev, struct bootflow_iter *iter) } /** - * distro_fill_info() - Decode the extlinux file to find out distro info + * extlinux_fill_info() - Decode the extlinux file to find out its info * * @bflow: Bootflow to process * @return 0 if OK, -ve on error */ -static int distro_fill_info(struct bootflow *bflow) +static int extlinux_fill_info(struct bootflow *bflow) { struct membuff mb; char line[200]; @@ -98,7 +98,7 @@ static int distro_fill_info(struct bootflow *bflow) return 0; } -static int distro_read_bootflow(struct udevice *dev, struct bootflow *bflow) +static int extlinux_read_bootflow(struct udevice *dev, struct bootflow *bflow) { struct blk_desc *desc; const char *const *prefixes; @@ -121,7 +121,7 @@ static int distro_read_bootflow(struct udevice *dev, struct bootflow *bflow) do { prefix = prefixes ? prefixes[i] : NULL; - ret = bootmeth_try_file(bflow, desc, prefix, DISTRO_FNAME); + ret = bootmeth_try_file(bflow, desc, prefix, EXTLINUX_FNAME); } while (ret && prefixes && prefixes[++i]); if (ret) return log_msg_ret("try", ret); @@ -131,25 +131,25 @@ static int distro_read_bootflow(struct udevice *dev, struct bootflow *bflow) if (ret) return log_msg_ret("read", ret); - ret = distro_fill_info(bflow); + ret = extlinux_fill_info(bflow); if (ret) return log_msg_ret("inf", ret); return 0; } -static int distro_boot(struct udevice *dev, struct bootflow *bflow) +static int extlinux_boot(struct udevice *dev, struct bootflow *bflow) { struct cmd_tbl cmdtp = {}; /* dummy */ struct pxe_context ctx; - struct distro_info info; + struct extlinux_info info; ulong addr; int ret; addr = map_to_sysmem(bflow->buf); info.dev = dev; info.bflow = bflow; - ret = pxe_setup_ctx(&ctx, &cmdtp, distro_getfile, &info, true, + ret = pxe_setup_ctx(&ctx, &cmdtp, extlinux_getfile, &info, true, bflow->subdir, false); if (ret) return log_msg_ret("ctx", -EINVAL); @@ -161,33 +161,33 @@ static int distro_boot(struct udevice *dev, struct bootflow *bflow) return 0; } -static int distro_bootmeth_bind(struct udevice *dev) +static int extlinux_bootmeth_bind(struct udevice *dev) { struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev); plat->desc = IS_ENABLED(CONFIG_BOOTSTD_FULL) ? - "Syslinux boot from a block device" : "syslinux"; + "Extlinux boot from a block device" : "extlinux"; return 0; } -static struct bootmeth_ops distro_bootmeth_ops = { - .get_state_desc = distro_get_state_desc, - .check = distro_check, - .read_bootflow = distro_read_bootflow, +static struct bootmeth_ops extlinux_bootmeth_ops = { + .get_state_desc = extlinux_get_state_desc, + .check = extlinux_check, + .read_bootflow = extlinux_read_bootflow, .read_file = bootmeth_common_read_file, - .boot = distro_boot, + .boot = extlinux_boot, }; -static const struct udevice_id distro_bootmeth_ids[] = { - { .compatible = "u-boot,distro-syslinux" }, +static const struct udevice_id extlinux_bootmeth_ids[] = { + { .compatible = "u-boot,extlinux" }, { } }; -U_BOOT_DRIVER(bootmeth_distro) = { - .name = "bootmeth_distro", +U_BOOT_DRIVER(bootmeth_extlinux) = { + .name = "bootmeth_extlinux", .id = UCLASS_BOOTMETH, - .of_match = distro_bootmeth_ids, - .ops = &distro_bootmeth_ops, - .bind = distro_bootmeth_bind, + .of_match = extlinux_bootmeth_ids, + .ops = &extlinux_bootmeth_ops, + .bind = extlinux_bootmeth_bind, }; diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c index 5a8af2bbd0b..ce986bd260d 100644 --- a/boot/bootmeth_pxe.c +++ b/boot/bootmeth_pxe.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Bootmethod for distro boot using PXE (network boot) + * Bootmethod for extlinux boot using PXE (network boot) * * Copyright 2021 Google LLC * Written by Simon Glass <[email protected]> @@ -13,8 +13,8 @@ #include <bootflow.h> #include <bootmeth.h> #include <command.h> -#include <distro.h> #include <dm.h> +#include <extlinux.h> #include <fs.h> #include <log.h> #include <malloc.h> @@ -23,10 +23,10 @@ #include <net.h> #include <pxe_utils.h> -static int distro_pxe_getfile(struct pxe_context *ctx, const char *file_path, - char *file_addr, ulong *sizep) +static int extlinux_pxe_getfile(struct pxe_context *ctx, const char *file_path, + char *file_addr, ulong *sizep) { - struct distro_info *info = ctx->userdata; + struct extlinux_info *info = ctx->userdata; ulong addr; int ret; @@ -39,7 +39,7 @@ static int distro_pxe_getfile(struct pxe_context *ctx, const char *file_path, return 0; } -static int distro_pxe_check(struct udevice *dev, struct bootflow_iter *iter) +static int extlinux_pxe_check(struct udevice *dev, struct bootflow_iter *iter) { int ret; @@ -54,7 +54,8 @@ static int distro_pxe_check(struct udevice *dev, struct bootflow_iter *iter) return 0; } -static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) +static int extlinux_pxe_read_bootflow(struct udevice *dev, + struct bootflow *bflow) { const char *addr_str; char fname[200]; @@ -90,7 +91,7 @@ static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) } } snprintf(fname, sizeof(fname), "%s%s", - bflow->subdir ? bflow->subdir : "", DISTRO_FNAME); + bflow->subdir ? bflow->subdir : "", EXTLINUX_FNAME); bflow->fname = strdup(fname); if (!bflow->fname) @@ -108,8 +109,9 @@ static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) return 0; } -static int distro_pxe_read_file(struct udevice *dev, struct bootflow *bflow, - const char *file_path, ulong addr, ulong *sizep) +static int extlinux_pxe_read_file(struct udevice *dev, struct bootflow *bflow, + const char *file_path, ulong addr, + ulong *sizep) { char *tftp_argv[] = {"tftp", NULL, NULL, NULL}; struct pxe_context *ctx = dev_get_priv(dev); @@ -133,11 +135,11 @@ static int distro_pxe_read_file(struct udevice *dev, struct bootflow *bflow, return 0; } -static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) +static int extlinux_pxe_boot(struct udevice *dev, struct bootflow *bflow) { struct pxe_context *ctx = dev_get_priv(dev); struct cmd_tbl cmdtp = {}; /* dummy */ - struct distro_info info; + struct extlinux_info info; ulong addr; int ret; @@ -145,7 +147,7 @@ static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) info.dev = dev; info.bflow = bflow; info.cmdtp = &cmdtp; - ret = pxe_setup_ctx(ctx, &cmdtp, distro_pxe_getfile, &info, false, + ret = pxe_setup_ctx(ctx, &cmdtp, extlinux_pxe_getfile, &info, false, bflow->subdir, false); if (ret) return log_msg_ret("ctx", -EINVAL); @@ -157,7 +159,7 @@ static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) return 0; } -static int distro_bootmeth_pxe_bind(struct udevice *dev) +static int extlinux_bootmeth_pxe_bind(struct udevice *dev) { struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev); @@ -167,23 +169,23 @@ static int distro_bootmeth_pxe_bind(struct udevice *dev) return 0; } -static struct bootmeth_ops distro_bootmeth_pxe_ops = { - .check = distro_pxe_check, - .read_bootflow = distro_pxe_read_bootflow, - .read_file = distro_pxe_read_file, - .boot = distro_pxe_boot, +static struct bootmeth_ops extlinux_bootmeth_pxe_ops = { + .check = extlinux_pxe_check, + .read_bootflow = extlinux_pxe_read_bootflow, + .read_file = extlinux_pxe_read_file, + .boot = extlinux_pxe_boot, }; -static const struct udevice_id distro_bootmeth_pxe_ids[] = { - { .compatible = "u-boot,distro-pxe" }, +static const struct udevice_id extlinux_bootmeth_pxe_ids[] = { + { .compatible = "u-boot,extlinux-pxe" }, { } }; U_BOOT_DRIVER(bootmeth_pxe) = { .name = "bootmeth_pxe", .id = UCLASS_BOOTMETH, - .of_match = distro_bootmeth_pxe_ids, - .ops = &distro_bootmeth_pxe_ops, - .bind = distro_bootmeth_pxe_bind, + .of_match = extlinux_bootmeth_pxe_ids, + .ops = &extlinux_bootmeth_pxe_ops, + .bind = extlinux_bootmeth_pxe_bind, .priv_auto = sizeof(struct pxe_context), }; diff --git a/boot/bootmeth_qfw.c b/boot/bootmeth_qfw.c index a5f95d4d0c5..ecd4b082fd2 100644 --- a/boot/bootmeth_qfw.c +++ b/boot/bootmeth_qfw.c @@ -89,7 +89,7 @@ static struct bootmeth_ops qfw_bootmeth_ops = { }; static const struct udevice_id qfw_bootmeth_ids[] = { - { .compatible = "u-boot,qfw-syslinux" }, + { .compatible = "u-boot,qfw-extlinux" }, { } }; diff --git a/boot/bootmeth_sandbox.c b/boot/bootmeth_sandbox.c index 13ec5e95e64..aabc57e635a 100644 --- a/boot/bootmeth_sandbox.c +++ b/boot/bootmeth_sandbox.c @@ -56,7 +56,7 @@ static struct bootmeth_ops sandbox_bootmeth_ops = { }; static const struct udevice_id sandbox_bootmeth_ids[] = { - { .compatible = "u-boot,sandbox-syslinux" }, + { .compatible = "u-boot,sandbox-extlinux" }, { } }; |
