diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-05-10 14:51:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-05-10 14:51:58 +0200 |
commit | 7839011f61c02b42b44e540dfb18464f4bb79fba (patch) | |
tree | e80f59c4ca1d7a7ee9b9a24941212ef4375bcbd1 /common | |
parent | ece204a8acea2ae5f4343fef28e9e987a133e9ea (diff) | |
download | barebox-7839011f61c02b42b44e540dfb18464f4bb79fba.tar.gz barebox-7839011f61c02b42b44e540dfb18464f4bb79fba.tar.xz |
bootm: Move bootm options to common/Kconfig
bootm has a C API, so the bootm options have to depend on the
option providing the bootm code (CONFIG_BOOTM), not on the
option providing the command (CONFIG_CMD_BOOTM). Fixing the
dependencies makes it possible to fully use bootm from C without
enabling the bootm command support.
This also removes the CMD_ prefix from the options which means
we have to update the defconfigs aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 89 | ||||
-rw-r--r-- | common/bootm.c | 8 | ||||
-rw-r--r-- | common/image.c | 2 | ||||
-rw-r--r-- | common/uimage.c | 2 |
4 files changed, 91 insertions, 10 deletions
diff --git a/common/Kconfig b/common/Kconfig index 928db0a159..aa257bfe3c 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -40,10 +40,6 @@ config HAS_DMA config GENERIC_GPIO bool -config BOOTM - select UIMAGE - bool - config BLOCK bool @@ -546,6 +542,91 @@ config TIMESTAMP commands like bootm or iminfo. This option is automatically enabled when you select CFG_CMD_DATE . +menuconfig BOOTM + select UIMAGE + default y if COMMAND_SUPPORT + bool "bootm support" + +config BOOTM_SHOW_TYPE + bool + depends on BOOTM + prompt "show image information" + help + Displays some tags from the uImage: + + - OS type + - architecture, + - type + - compression method. + +config BOOTM_VERBOSE + bool + prompt "verbose support" + depends on BOOTM + help + Adds the verbose (-v switch) command line option. + +config BOOTM_INITRD + bool + prompt "initial RAM disk (initrd) support" + depends on BOOTM + help + Adds support for initial RAM disk and this two command line options: + + -r INITRD specify an initrd image + -L ADDR specify initrd load address + +config BOOTM_OFTREE + bool + depends on BOOTM + select OFTREE + prompt "device tree (oftree) support" + help + Add support to pass a device tree (a.k.a Open Firmware Tree, oftree). Adds + this command line option: + + -o DTS specify device tree + +config BOOTM_OFTREE_UIMAGE + bool + prompt "support passing device tree (oftree) uImages" + depends on BOOTM_OFTREE + help + Support using oftree uImages. Without this only raw oftree + blobs can be used. + +config BOOTM_AIMAGE + bool + prompt "Android image support" + depends on BOOTM && ARM + help + Support using Android Images. + +config BOOTM_FITIMAGE + bool + prompt "FIT image support" + select FITIMAGE + depends on BOOTM && ARM + help + Support using Flattened Image Tree (FIT) Images. FIT is an image + format introduced by U-Boot. A FIT image contains one or multiple + kernels, device trees and initrds. The FIT image itself is a flattened + device tree binary. Have a look at the u-boot source tree + in the "doc/uImage.FIT" folder for more information: + http://git.denx.de/?p=u-boot.git;a=tree;f=doc/uImage.FIT + +config BOOTM_FITIMAGE_SIGNATURE + bool + prompt "support verifying signed FIT images" + depends on BOOTM_FITIMAGE + select FITIMAGE_SIGNATURE + help + Support verifying signed FIT images. This requires FIT images + as described in: + http://git.denx.de/?p=u-boot.git;a=blob;f=doc/uImage.FIT/signature.txt + Additionally the barebox device tree needs a /signature node with the + public key with which the image has been signed. + config BLSPEC depends on BLOCK depends on FLEXIBLE_BOOTARGS diff --git a/common/bootm.c b/common/bootm.c index cad8c73efe..b74b922aaa 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -142,7 +142,7 @@ int bootm_load_os(struct image_data *data, unsigned long load_address) bool bootm_has_initrd(struct image_data *data) { - if (!IS_ENABLED(CONFIG_CMD_BOOTM_INITRD)) + if (!IS_ENABLED(CONFIG_BOOTM_INITRD)) return false; if (data->os_fit && data->os_fit->initrd) @@ -196,7 +196,7 @@ int bootm_load_initrd(struct image_data *data, unsigned long load_address) enum filetype type; int ret; - if (!IS_ENABLED(CONFIG_CMD_BOOTM_INITRD)) + if (!IS_ENABLED(CONFIG_BOOTM_INITRD)) return -ENOSYS; if (!bootm_has_initrd(data)) @@ -274,7 +274,7 @@ static int bootm_open_oftree_uimage(struct image_data *data, size_t *size, printf("Loading devicetree from '%s'@%d\n", oftree, num); - if (!IS_ENABLED(CONFIG_CMD_BOOTM_OFTREE_UIMAGE)) + if (!IS_ENABLED(CONFIG_BOOTM_OFTREE_UIMAGE)) return -EINVAL; if (!strcmp(data->os_file, oftree)) { @@ -651,7 +651,7 @@ static int bootm_init(void) globalvar_add_simple("bootm.image.loadaddr", NULL); globalvar_add_simple("bootm.oftree", NULL); globalvar_add_simple_bool("bootm.appendroot", &bootm_appendroot); - if (IS_ENABLED(CONFIG_CMD_BOOTM_INITRD)) { + if (IS_ENABLED(CONFIG_BOOTM_INITRD)) { globalvar_add_simple("bootm.initrd", NULL); globalvar_add_simple("bootm.initrd.loadaddr", NULL); } diff --git a/common/image.c b/common/image.c index 9252d5e775..f3ec071ee1 100644 --- a/common/image.c +++ b/common/image.c @@ -31,7 +31,7 @@ #include <time.h> #endif -#if defined(CONFIG_CMD_BOOTM_SHOW_TYPE) || !defined(__BAREBOX__) +#if defined(CONFIG_BOOTM_SHOW_TYPE) || !defined(__BAREBOX__) typedef struct table_entry { int id; /* as defined in image.h */ char *sname; /* short (input) name */ diff --git a/common/uimage.c b/common/uimage.c index 34daf70dc1..28a25bba2d 100644 --- a/common/uimage.c +++ b/common/uimage.c @@ -50,7 +50,7 @@ void uimage_print_contents(struct uimage_handle *handle) tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); #endif -#if defined(CONFIG_CMD_BOOTM_SHOW_TYPE) +#if defined(CONFIG_BOOTM_SHOW_TYPE) printf(" OS: %s\n", image_get_os_name(hdr->ih_os)); printf(" Architecture: %s\n", image_get_arch_name(hdr->ih_arch)); printf(" Type: %s\n", image_get_type_name(hdr->ih_type)); |