[U-Boot] [PATCH][RFC] bootm: Added CONFIG_BOOTM_{LINUX, NETBSD, RTEMS}

Added the ability to config out bootm support for Linux, NetBSD, RTEMS
Signed-off-by: Kumar Gala galak@kernel.crashing.org ---
Looking for suggestions on how to deal with enabling LINUX, NETBSD, and RTEMS.
common/cmd_bootm.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 1b2dfc4..47f9b45 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -103,13 +103,23 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1 + +#ifdef CONFIG_BOOTM_LINUX extern boot_os_fn do_bootm_linux; +#endif +#ifdef CONFIG_BOOTM_NETBSD static boot_os_fn do_bootm_netbsd; +#endif #if defined(CONFIG_LYNXKDI) static boot_os_fn do_bootm_lynxkdi; extern void lynxkdi_boot (image_header_t *); #endif +#ifdef CONFIG_BOOTM_RTEMS static boot_os_fn do_bootm_rtems; +#endif #if defined(CONFIG_CMD_ELF) static boot_os_fn do_bootm_vxworks; static boot_os_fn do_bootm_qnxelf; @@ -121,12 +131,18 @@ static boot_os_fn do_bootm_integrity; #endif
boot_os_fn * boot_os[] = { +#ifdef CONFIG_BOOTM_LINUX [IH_OS_LINUX] = do_bootm_linux, +#endif +#ifdef CONFIG_BOOTM_NETBSD [IH_OS_NETBSD] = do_bootm_netbsd, +#endif #ifdef CONFIG_LYNXKDI [IH_OS_LYNXOS] = do_bootm_lynxkdi, #endif +#ifdef CONFIG_BOOTM_RTEMS [IH_OS_RTEMS] = do_bootm_rtems, +#endif #if defined(CONFIG_CMD_ELF) [IH_OS_VXWORKS] = do_bootm_vxworks, [IH_OS_QNX] = do_bootm_qnxelf, @@ -1161,6 +1177,7 @@ static void fixup_silent_linux () /* OS booting routines */ /*******************************************************************/
+#ifdef CONFIG_BOOTM_NETBSD static int do_bootm_netbsd (int flag, int argc, char *argv[], bootm_headers_t *images) { @@ -1246,6 +1263,7 @@ static int do_bootm_netbsd (int flag, int argc, char *argv[],
return 1; } +#endif /* CONFIG_BOOTM_NETBSD*/
#ifdef CONFIG_LYNXKDI static int do_bootm_lynxkdi (int flag, int argc, char *argv[], @@ -1269,6 +1287,7 @@ static int do_bootm_lynxkdi (int flag, int argc, char *argv[], } #endif /* CONFIG_LYNXKDI */
+#ifdef CONFIG_BOOTM_RTEMS static int do_bootm_rtems (int flag, int argc, char *argv[], bootm_headers_t *images) { @@ -1299,6 +1318,7 @@ static int do_bootm_rtems (int flag, int argc, char *argv[],
return 1; } +#endif /* CONFIG_BOOTM_RTEMS */
#if defined(CONFIG_CMD_ELF) static int do_bootm_vxworks (int flag, int argc, char *argv[],

Dear Kumar Gala,
In message 1224520793-28186-1-git-send-email-galak@kernel.crashing.org you wrote:
Added the ability to config out bootm support for Linux, NetBSD, RTEMS
Signed-off-by: Kumar Gala galak@kernel.crashing.org
Looking for suggestions on how to deal with enabling LINUX, NETBSD, and RTEMS.
...
--- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -103,13 +103,23 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
Comment?
Best regards,
Wolfgang Denk

On Oct 21, 2008, at 2:35 PM, Wolfgang Denk wrote:
Dear Kumar Gala,
In message <1224520793-28186-1-git-send-email-galak@kernel.crashing.org
you wrote: Added the ability to config out bootm support for Linux, NetBSD, RTEMS
Signed-off-by: Kumar Gala galak@kernel.crashing.org
Looking for suggestions on how to deal with enabling LINUX, NETBSD, and RTEMS.
...
--- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -103,13 +103,23 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
Comment?
Hmm, can we hold off on this until we have Kconfig than? It would be much easier at that point rather me having to touch ~450 config.h's.
- k

Dear Kumar Gala,
In message 4DE53147-6FF6-4145-AB35-68D124CD20F8@kernel.crashing.org you wrote:
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
Comment?
Hmm, can we hold off on this until we have Kconfig than? It would be much easier at that point rather me having to touch ~450 config.h's.
OK from my POV. Should we check in your patch as is, then?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
Dear Kumar Gala,
In message 4DE53147-6FF6-4145-AB35-68D124CD20F8@kernel.crashing.org you wrote:
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
Comment?
Hmm, can we hold off on this until we have Kconfig than? It would be much easier at that point rather me having to touch ~450 config.h's.
OK from my POV. Should we check in your patch as is, then?
Best regards,
Wolfgang Denk
Ugly but effective work-around would be to put in an appropriate location: /* * Todo: REMOVE when Kconfig becomes real! */ #ifndef CONFIG_BOOTM_LINUX #define CONFIG_BOOTM_LINUX 1 #endif
Best regards, gvb

Jerry Van Baren wrote:
Wolfgang Denk wrote:
Dear Kumar Gala,
In message 4DE53147-6FF6-4145-AB35-68D124CD20F8@kernel.crashing.org you wrote:
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
Comment?
Hmm, can we hold off on this until we have Kconfig than? It would be much easier at that point rather me having to touch ~450 config.h's.
OK from my POV. Should we check in your patch as is, then?
Best regards,
Wolfgang Denk
Ugly but effective work-around would be to put in an appropriate location: /*
- Todo: REMOVE when Kconfig becomes real!
*/ #ifndef CONFIG_BOOTM_LINUX #define CONFIG_BOOTM_LINUX 1 #endif
...or not. I'm OK with it as is. My #define hack is mostly useless.
gvb

On Oct 21, 2008, at 2:42 PM, Wolfgang Denk wrote:
Dear Kumar Gala,
In message <4DE53147-6FF6-4145- AB35-68D124CD20F8@kernel.crashing.org> you wrote:
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
Comment?
Hmm, can we hold off on this until we have Kconfig than? It would be much easier at that point rather me having to touch ~450 config.h's.
OK from my POV. Should we check in your patch as is, then?
I say commit as is than.
- k

On 21:42 Tue 21 Oct , Wolfgang Denk wrote:
Dear Kumar Gala,
In message 4DE53147-6FF6-4145-AB35-68D124CD20F8@kernel.crashing.org you wrote:
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
Comment?
Hmm, can we hold off on this until we have Kconfig than? It would be much easier at that point rather me having to touch ~450 config.h's.
OK from my POV. Should we check in your patch as is, then?
Maybe simple add the CONFIG_BOOTM to include/config_cmd_default.h and include/config_cmd_all.h until we have Kconfig? So if a board do not need an OS support it will just add an #undef to its config.
Best Regards, J.

Rather than declare default bootm OS support options in cmd_bootm.c where boards cannot override it, move the options to config_cmd_default.h. Now boards that want to disable certain default OS's can do just that.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- common/cmd_bootm.c | 4 ---- include/config_cmd_default.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 365ceeb..a2e8456 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -102,10 +102,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */
-#define CONFIG_BOOTM_LINUX 1 -#define CONFIG_BOOTM_NETBSD 1 -#define CONFIG_BOOTM_RTEMS 1 - #ifdef CONFIG_BOOTM_LINUX extern boot_os_fn do_bootm_linux; #endif diff --git a/include/config_cmd_default.h b/include/config_cmd_default.h index a5d87a6..a28ad4d 100644 --- a/include/config_cmd_default.h +++ b/include/config_cmd_default.h @@ -39,4 +39,8 @@ #define CONFIG_CMD_SOURCE /* "source" command support */ #define CONFIG_CMD_XIMG /* Load part of Multi Image */
+#define CONFIG_BOOTM_LINUX +#define CONFIG_BOOTM_NETBSD +#define CONFIG_BOOTM_RTEMS + #endif /* _CONFIG_CMD_DEFAULT_H */

Dear Mike Frysinger,
In message 1252500954-31428-1-git-send-email-vapier@gentoo.org you wrote:
Rather than declare default bootm OS support options in cmd_bootm.c where boards cannot override it, move the options to config_cmd_default.h. Now boards that want to disable certain default OS's can do just that.
While I agree with your intention (i. e. I also think it wouldbe better if this could be more easily changed), I disagree with the implementation: config_cmd_default.h is intended to select which commands are enabled by default; it is not the right place to add any default settings for any commands.
We need to find a better place for that.
Best regards,
Wolfgang Denk

On Wednesday 09 September 2009 09:06:21 Wolfgang Denk wrote:
Mike Frysinger wrote:
Rather than declare default bootm OS support options in cmd_bootm.c where boards cannot override it, move the options to config_cmd_default.h. Now boards that want to disable certain default OS's can do just that.
While I agree with your intention (i. e. I also think it wouldbe better if this could be more easily changed), I disagree with the implementation: config_cmd_default.h is intended to select which commands are enabled by default; it is not the right place to add any default settings for any commands.
We need to find a better place for that.
i'm not familiar enough with the nest of includes to locate a better place. a quick grep starting at common.h indicates a new header would have to be made. -mike

Dear Mike Frysinger,
In message 200909091007.33776.vapier@gentoo.org you wrote:
i'm not familiar enough with the nest of includes to locate a better place. a quick grep starting at common.h indicates a new header would have to be made.
Probably. There are many areas where default settings would make sense; environment variables, BOOTP / DHCP options, ...
Best regards,
Wolfgang Denk

On Wednesday 09 September 2009 10:28:23 Wolfgang Denk wrote:
Mike Frysinger wrote:
i'm not familiar enough with the nest of includes to locate a better place. a quick grep starting at common.h indicates a new header would have to be made.
Probably. There are many areas where default settings would make sense; environment variables, BOOTP / DHCP options, ...
presumably a new "config_defaults.h" that is added to the generated config.h before including the board config ? -mike

There are a bunch of features in U-Boot that we want to enable by default, and it's best if we centralize them in one place rather than updating all the board files out there.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- common/cmd_bootm.c | 4 ---- include/config_defaults.h | 17 +++++++++++++++++ mkconfig | 7 +++++-- 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 include/config_defaults.h
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index a4b2e26..f275d02 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -102,10 +102,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */
-#define CONFIG_BOOTM_LINUX 1 -#define CONFIG_BOOTM_NETBSD 1 -#define CONFIG_BOOTM_RTEMS 1 - #ifdef CONFIG_BOOTM_LINUX extern boot_os_fn do_bootm_linux; #endif diff --git a/include/config_defaults.h b/include/config_defaults.h new file mode 100644 index 0000000..08b6ede --- /dev/null +++ b/include/config_defaults.h @@ -0,0 +1,17 @@ +/* + * config_defaults.h - sane defaults for everyone + * + * Copyright (c) 2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef _CONFIG_DEFAULTS_H_ +#define _CONFIG_DEFAULTS_H_ + +/* Support bootm-ing different OSes */ +#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1 + +#endif diff --git a/mkconfig b/mkconfig index 4c5675b..0d2e0f7 100755 --- a/mkconfig +++ b/mkconfig @@ -89,7 +89,10 @@ for i in ${TARGETS} ; do echo "#define CONFIG_MK_${i} 1" >>config.h ; done
-echo "#include <configs/$1.h>" >>config.h -echo "#include <asm/config.h>" >>config.h +cat << EOF >> config.h +#include <config_defaults.h> +#include <configs/$1.h> +#include <asm/config.h> +EOF
exit 0

Dear Mike Frysinger,
In message 1257371196-11360-1-git-send-email-vapier@gentoo.org you wrote:
There are a bunch of features in U-Boot that we want to enable by default, and it's best if we centralize them in one place rather than updating all the board files out there.
Signed-off-by: Mike Frysinger vapier@gentoo.org
common/cmd_bootm.c | 4 ---- include/config_defaults.h | 17 +++++++++++++++++ mkconfig | 7 +++++-- 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 include/config_defaults.h
Sorry, but does not apply:
Applying: config_defaults.h: new header for common u-boot config defaults error: patch failed: mkconfig:89 error: mkconfig: patch does not apply fatal: sha1 information is lacking or useless (common/cmd_bootm.c). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 config_defaults.h: new header for common u-boot config defaults
Please rebase patch series against "next" branch and resubmit. Thanks.
Best regards,
Wolfgang Denk

There are a bunch of features in U-Boot that we want to enable by default, and it's best if we centralize them in one place rather than updating all the board files out there.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- note: the LMB patch should be applied before this small series to avoid conflicts -- there isnt any actual dependency on each other
v2 - rebased onto latest next
common/cmd_bootm.c | 4 ---- include/config_defaults.h | 17 +++++++++++++++++ mkconfig | 10 ++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 include/config_defaults.h
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 22aa7f8..2101162 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -102,10 +102,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */
-#define CONFIG_BOOTM_LINUX 1 -#define CONFIG_BOOTM_NETBSD 1 -#define CONFIG_BOOTM_RTEMS 1 - #ifdef CONFIG_BOOTM_LINUX extern boot_os_fn do_bootm_linux; #endif diff --git a/include/config_defaults.h b/include/config_defaults.h new file mode 100644 index 0000000..08b6ede --- /dev/null +++ b/include/config_defaults.h @@ -0,0 +1,17 @@ +/* + * config_defaults.h - sane defaults for everyone + * + * Copyright (c) 2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef _CONFIG_DEFAULTS_H_ +#define _CONFIG_DEFAULTS_H_ + +/* Support bootm-ing different OSes */ +#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1 + +#endif diff --git a/mkconfig b/mkconfig index bdc9d91..01e6ced 100755 --- a/mkconfig +++ b/mkconfig @@ -96,9 +96,11 @@ for i in ${TARGETS} ; do echo "#define CONFIG_MK_${i} 1" >>config.h ; done
-echo "#define CONFIG_BOARDDIR board/$BOARDDIR" >>config.h - -echo "#include <configs/$1.h>" >>config.h -echo "#include <asm/config.h>" >>config.h +cat << EOF >> config.h +#define CONFIG_BOARDDIR board/$BOARDDIR +#include <config_defaults.h> +#include <configs/$1.h> +#include <asm/config.h> +EOF
exit 0

Dear Mike Frysinger,
In message 1259806503-19853-1-git-send-email-vapier@gentoo.org you wrote:
There are a bunch of features in U-Boot that we want to enable by default, and it's best if we centralize them in one place rather than updating all the board files out there.
Signed-off-by: Mike Frysinger vapier@gentoo.org
note: the LMB patch should be applied before this small series to avoid conflicts -- there isnt any actual dependency on each other
v2
- rebased onto latest next
common/cmd_bootm.c | 4 ---- include/config_defaults.h | 17 +++++++++++++++++ mkconfig | 10 ++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 include/config_defaults.h
Applied, thanks.
Best regards,
Wolfgang Denk

If you really want to slim down U-Boot and you would rather use a higher compression scheme (like LZMA), it'd be nice to disable gzip/zlib since these code bases take up a significant amount of space.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- common/cmd_bootm.c | 2 ++ include/config_defaults.h | 3 +++ lib_generic/Makefile | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index f275d02..ce174d7 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -348,6 +348,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) *load_end = load + image_len; puts("OK\n"); break; +#ifdef CONFIG_GZIP case IH_COMP_GZIP: printf (" Uncompressing %s ... ", type_name); if (gunzip ((void *)load, unc_len, @@ -361,6 +362,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
*load_end = load + image_len; break; +#endif /* CONFIG_GZIP */ #ifdef CONFIG_BZIP2 case IH_COMP_BZIP2: printf (" Uncompressing %s ... ", type_name); diff --git a/include/config_defaults.h b/include/config_defaults.h index 08b6ede..0337163 100644 --- a/include/config_defaults.h +++ b/include/config_defaults.h @@ -14,4 +14,7 @@ #define CONFIG_BOOTM_NETBSD 1 #define CONFIG_BOOTM_RTEMS 1
+#define CONFIG_GZIP 1 +#define CONFIG_ZLIB 1 + #endif diff --git a/lib_generic/Makefile b/lib_generic/Makefile index 8d23c5d..ae2c282 100644 --- a/lib_generic/Makefile +++ b/lib_generic/Makefile @@ -36,7 +36,7 @@ COBJS-y += crc32.o COBJS-y += ctype.o COBJS-y += display_options.o COBJS-y += div64.o -COBJS-y += gunzip.o +COBJS-$(CONFIG_GZIP) += gunzip.o COBJS-$(CONFIG_LMB) += lmb.o COBJS-y += ldiv.o COBJS-$(CONFIG_MD5) += md5.o @@ -45,7 +45,7 @@ COBJS-$(CONFIG_SHA256) += sha256.o COBJS-y += string.o COBJS-y += strmhz.o COBJS-y += vsprintf.o -COBJS-y += zlib.o +COBJS-$(CONFIG_ZLIB) += zlib.o COBJS-$(CONFIG_RBTREE) += rbtree.o
COBJS := $(COBJS-y)

Dear Mike Frysinger,
In message 1257371196-11360-2-git-send-email-vapier@gentoo.org you wrote:
If you really want to slim down U-Boot and you would rather use a higher compression scheme (like LZMA), it'd be nice to disable gzip/zlib since these code bases take up a significant amount of space.
Signed-off-by: Mike Frysinger vapier@gentoo.org
common/cmd_bootm.c | 2 ++ include/config_defaults.h | 3 +++ lib_generic/Makefile | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-)
Does not apply any more:
Applying: gzip/zlib: make features optional error: patch failed: lib_generic/Makefile:36 error: lib_generic/Makefile: patch does not apply fatal: sha1 information is lacking or useless (common/cmd_bootm.c). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 gzip/zlib: make features optional
Can you please rebase and resend?
Best regards,
Wolfgang Denk

If you really want to slim down U-Boot and you would rather use a higher compression scheme (like LZMA), it'd be nice to disable gzip/zlib since these code bases take up a significant amount of space.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- v2 - rebased onto latest master
common/cmd_bootm.c | 2 ++ include/config_defaults.h | 3 +++ lib_generic/Makefile | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index f28e88f..23ab0c4 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -352,6 +352,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) *load_end = load + image_len; puts("OK\n"); break; +#ifdef CONFIG_GZIP case IH_COMP_GZIP: printf (" Uncompressing %s ... ", type_name); if (gunzip ((void *)load, unc_len, @@ -365,6 +366,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
*load_end = load + image_len; break; +#endif /* CONFIG_GZIP */ #ifdef CONFIG_BZIP2 case IH_COMP_BZIP2: printf (" Uncompressing %s ... ", type_name); diff --git a/include/config_defaults.h b/include/config_defaults.h index 08b6ede..0337163 100644 --- a/include/config_defaults.h +++ b/include/config_defaults.h @@ -14,4 +14,7 @@ #define CONFIG_BOOTM_NETBSD 1 #define CONFIG_BOOTM_RTEMS 1
+#define CONFIG_GZIP 1 +#define CONFIG_ZLIB 1 + #endif diff --git a/lib_generic/Makefile b/lib_generic/Makefile index 4e4496a..c45f07c 100644 --- a/lib_generic/Makefile +++ b/lib_generic/Makefile @@ -37,7 +37,7 @@ COBJS-y += crc32.o COBJS-y += ctype.o COBJS-y += display_options.o COBJS-y += div64.o -COBJS-y += gunzip.o +COBJS-$(CONFIG_GZIP) += gunzip.o COBJS-$(CONFIG_LMB) += lmb.o COBJS-y += ldiv.o COBJS-$(CONFIG_MD5) += md5.o @@ -48,7 +48,7 @@ COBJS-y += string.o COBJS-y += strmhz.o COBJS-y += time.o COBJS-y += vsprintf.o -COBJS-y += zlib.o +COBJS-$(CONFIG_ZLIB) += zlib.o COBJS-$(CONFIG_RBTREE) += rbtree.o
COBJS := $(COBJS-y)

Dear Mike Frysinger,
In message 1264120236-7618-1-git-send-email-vapier@gentoo.org you wrote:
If you really want to slim down U-Boot and you would rather use a higher compression scheme (like LZMA), it'd be nice to disable gzip/zlib since these code bases take up a significant amount of space.
Signed-off-by: Mike Frysinger vapier@gentoo.org
v2
- rebased onto latest master
common/cmd_bootm.c | 2 ++ include/config_defaults.h | 3 +++ lib_generic/Makefile | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

The sha1 code is currently compiled for everyone, but in reality, it's only used by the FIT code. So make it optional just like MD5.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- include/image.h | 1 + lib_generic/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/include/image.h b/include/image.h index b82f4b9..6474eca 100644 --- a/include/image.h +++ b/include/image.h @@ -56,6 +56,7 @@ #include <libfdt.h> #include <fdt_support.h> #define CONFIG_MD5 /* FIT images need MD5 support */ +#define CONFIG_SHA1 /* and SHA1 */ #endif
/* diff --git a/lib_generic/Makefile b/lib_generic/Makefile index ae2c282..63b8cca 100644 --- a/lib_generic/Makefile +++ b/lib_generic/Makefile @@ -40,7 +40,7 @@ COBJS-$(CONFIG_GZIP) += gunzip.o COBJS-$(CONFIG_LMB) += lmb.o COBJS-y += ldiv.o COBJS-$(CONFIG_MD5) += md5.o -COBJS-y += sha1.o +COBJS-$(CONFIG_SHA1) += sha1.o COBJS-$(CONFIG_SHA256) += sha256.o COBJS-y += string.o COBJS-y += strmhz.o

The sha1 code is currently compiled for everyone, but in reality, it's only used by the FIT code. So make it optional just like MD5.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- v2 - rebased onto latest tree
include/image.h | 1 + lib_generic/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/include/image.h b/include/image.h index 8c0c1b0..4ed0379 100644 --- a/include/image.h +++ b/include/image.h @@ -56,6 +56,7 @@ #include <libfdt.h> #include <fdt_support.h> #define CONFIG_MD5 /* FIT images need MD5 support */ +#define CONFIG_SHA1 /* and SHA1 */ #endif
/* diff --git a/lib_generic/Makefile b/lib_generic/Makefile index 2938825..c45f07c 100644 --- a/lib_generic/Makefile +++ b/lib_generic/Makefile @@ -42,7 +42,7 @@ COBJS-$(CONFIG_LMB) += lmb.o COBJS-y += ldiv.o COBJS-$(CONFIG_MD5) += md5.o COBJS-y += net_utils.o -COBJS-y += sha1.o +COBJS-$(CONFIG_SHA1) += sha1.o COBJS-$(CONFIG_SHA256) += sha256.o COBJS-y += string.o COBJS-y += strmhz.o

Dear Mike Frysinger,
In message 1263780480-7036-1-git-send-email-vapier@gentoo.org you wrote:
The sha1 code is currently compiled for everyone, but in reality, it's only used by the FIT code. So make it optional just like MD5.
Signed-off-by: Mike Frysinger vapier@gentoo.org
v2
- rebased onto latest tree
include/image.h | 1 + lib_generic/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Signed-off-by: Mike Frysinger vapier@gentoo.org --- common/cmd_bootm.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index ce174d7..ab636c0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -57,6 +57,10 @@ #include <lzma/LzmaTools.h> #endif /* CONFIG_LZMA */
+ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ + +#ifndef CONFIG_SYS_NO_BOOTM + DECLARE_GLOBAL_DATA_PTR;
extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long *lenp); @@ -147,7 +151,6 @@ static boot_os_fn *boot_os[] = { #endif };
-ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ static bootm_headers_t images; /* pointers to os/initrd/fdt images */
/* Allow for arch specific config before we boot */ @@ -1453,3 +1456,5 @@ static int do_bootm_integrity (int flag, int argc, char *argv[], return 1; } #endif + +#endif /* CONFIG_SYS_NO_BOOTM */

Dear Mike Frysinger,
In message 1257371196-11360-4-git-send-email-vapier@gentoo.org you wrote:
Signed-off-by: Mike Frysinger vapier@gentoo.org
common/cmd_bootm.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index ce174d7..ab636c0 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -57,6 +57,10 @@ #include <lzma/LzmaTools.h> #endif /* CONFIG_LZMA */
+ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */
+#ifndef CONFIG_SYS_NO_BOOTM
DECLARE_GLOBAL_DATA_PTR;
extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long *lenp); @@ -147,7 +151,6 @@ static boot_os_fn *boot_os[] = { #endif };
-ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ static bootm_headers_t images; /* pointers to os/initrd/fdt images */
/* Allow for arch specific config before we boot */ @@ -1453,3 +1456,5 @@ static int do_bootm_integrity (int flag, int argc, char *argv[], return 1; } #endif
+#endif /* CONFIG_SYS_NO_BOOTM */
Hm... please let's not invent a new style to configure commands - please use CONFIG_CMD_BOOTM instead (enabled by default).
Best regards,
Wolfgang Denk

On Thursday 21 January 2010 16:17:19 Wolfgang Denk wrote:
Mike Frysinger wrote:
--- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -57,6 +57,10 @@ #include <lzma/LzmaTools.h> #endif /* CONFIG_LZMA */
+ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */
+#ifndef CONFIG_SYS_NO_BOOTM
DECLARE_GLOBAL_DATA_PTR;
extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long *lenp); @@ -147,7 +151,6 @@ static boot_os_fn *boot_os[] = { #endif };
-ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ static bootm_headers_t images; /* pointers to os/initrd/fdt images */
/* Allow for arch specific config before we boot */ @@ -1453,3 +1456,5 @@ static int do_bootm_integrity (int flag, int argc, char *argv[], return 1; } #endif
+#endif /* CONFIG_SYS_NO_BOOTM */
Hm... please let's not invent a new style to configure commands - please use CONFIG_CMD_BOOTM instead (enabled by default).
i did it this way because u-boot doesnt have a default list for everyone of commands. the config_cmd_default.h isnt included by all boards. i can (semi-)reuse the new config_defaults.h if you're OK with that. -mike

Dear Mike Frysinger,
In message 201001211934.21010.vapier@gentoo.org you wrote:
Hm... please let's not invent a new style to configure commands - please use CONFIG_CMD_BOOTM instead (enabled by default).
i did it this way because u-boot doesnt have a default list for everyone of commands. the config_cmd_default.h isnt included by all boards. i can
Those boards need to be adapted, then.
(semi-)reuse the new config_defaults.h if you're OK with that.
No, please don't. Let's not scatter this allover the place.
Best regards,
Wolfgang Denk

On Tuesday 21 October 2008, Wolfgang Denk wrote:
Dear Kumar Gala,
In message 1224520793-28186-1-git-send-email-galak@kernel.crashing.org you
wrote:
Added the ability to config out bootm support for Linux, NetBSD, RTEMS
Signed-off-by: Kumar Gala galak@kernel.crashing.org
Looking for suggestions on how to deal with enabling LINUX, NETBSD, and RTEMS.
...
--- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -103,13 +103,23 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */
+#define CONFIG_BOOTM_LINUX 1 +#define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_RTEMS 1
The only somewhat reasonable thing I can come up with is to add a "#define CONFIG_BOOTM_LINUX" to all board config files, so all support Linux by default, and leave it up to the board maintainers to add additioonal OS support if needed.
sounds great to me -mike
participants (5)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Jerry Van Baren
-
Kumar Gala
-
Mike Frysinger
-
Wolfgang Denk