Skip to contentSkip to conversation

Merge mkimage tool

PATCH Superseded Josh Boyer 8 participants 22 messages Jan 3, 2008 – Jan 5, 2008

Subsystems (3)
lore
Share & tools
lore

Josh Boyer

author
#0 lore raw

cover Merge mkimage tool

The following patches merge the mkimage tool into the kernel. This utility is used by several arches to create a uImage file suitable for booting with U-Boot.

As it stands today, a mkuboot.sh script is called, which searches for the mkimage utility installed on the host system. This is slightly suboptimal as it prevents things like automated rebuilds of certain platforms on those architectures.

This is currently based on the mkimage version found in U-Boot 1.3.1. The tool is called mkubootimg in these patches, as mkimage is slightly ambiguous outside of the U-Boot source tree.

Note: arch/powerpc the conversion in these patches as Paul's tree has some changes that haven't hit Linus' tree yet. I'll fixup arch/powerpc as soon as these patches get merged.

josh

author
#1 lore raw

PATCH 1/3 Merge mkubootimg tool for building U-Boot images

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

---
 scripts/Makefile             |    1 
 scripts/mkubootimg/Makefile  |    6 
 scripts/mkubootimg/crc32.c   |  199 +++++++++++
 scripts/mkubootimg/mkimage.c |  728 +++++++++++++++++++++++++++++++++++++++++++
 scripts/mkubootimg/sha1.c    |  413 ++++++++++++++++++++++++
 scripts/mkubootimg/sha1.h    |  115 ++++++
 scripts/mkubootimg/uimage.h  |  161 +++++++++
 7 files changed, 1623 insertions(+)
scripts/Makefile +1 -0
@@ -20,6 +20,7 @@ hostprogs-y += unifdef
 
 subdir-$(CONFIG_MODVERSIONS) += genksyms
 subdir-y                     += mod
+subdir-y                     += mkubootimg
 
 # Let clean descend into subdirs
 subdir-	+= basic kconfig package
scripts/mkubootimg/Makefile new file +6 -0
@@ -0,0 +1,6 @@
+hostprogs-y	:= mkubootimg
+always		:= $(hostprogs-y)
+
+mkubootimg-objs	:= mkimage.o crc32.o sha1.o
+
+HOSTCFLAGS_crc32.o := -DUSE_HOSTCC
scripts/mkubootimg/crc32.c new file +199 -0

199 lines not on this page · raw message

scripts/mkubootimg/mkimage.c new file +728 -0

728 lines not on this page · raw message

scripts/mkubootimg/sha1.c new file +413 -0

413 lines not on this page · raw message

scripts/mkubootimg/sha1.h new file +115 -0

115 lines not on this page · raw message

scripts/mkubootimg/uimage.h new file +161 -0

161 lines not on this page · raw message

#2 lore raw

Re: [PATCH 1/3] Merge mkubootimg tool for building U-Boot images

Quoted 9 lines · Josh Boyer

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

Quoted 9 lines
---
 scripts/Makefile             |    1
 scripts/mkubootimg/Makefile  |    6
 scripts/mkubootimg/crc32.c   |  199 +++++++++++
 scripts/mkubootimg/mkimage.c |  728 +++++++++++++++++++++++++++++++++++++++++++
 scripts/mkubootimg/sha1.c    |  413 ++++++++++++++++++++++++
 scripts/mkubootimg/sha1.h    |  115 ++++++
 scripts/mkubootimg/uimage.h  |  161 +++++++++
 7 files changed, 1623 insertions(+)

i'm fairly certain sha1 is not needed. the u-boot makefile has a bug in the 1.3.1 release where mkimage depends on sha1.o but doesnt actually use sha1 functions. i posted a patch to u-boot mailing list to get this dropped. regardless, no need for the kernel to import it. -mike

author
#3 lore raw

Re: [PATCH 1/3] Merge mkubootimg tool for building U-Boot images

Quoted 20 lines · On Thu, 3 Jan 2008 17:15:48 -0500 "Mike Frysinger" <[email protected]> wrote:
Quoted 9 lines · Josh Boyer

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

Quoted 9 lines
---
 scripts/Makefile             |    1
 scripts/mkubootimg/Makefile  |    6
 scripts/mkubootimg/crc32.c   |  199 +++++++++++
 scripts/mkubootimg/mkimage.c |  728 +++++++++++++++++++++++++++++++++++++++++++
 scripts/mkubootimg/sha1.c    |  413 ++++++++++++++++++++++++
 scripts/mkubootimg/sha1.h    |  115 ++++++
 scripts/mkubootimg/uimage.h  |  161 +++++++++
 7 files changed, 1623 insertions(+)
Quoted 4 lines

i'm fairly certain sha1 is not needed. the u-boot makefile has a bug in the 1.3.1 release where mkimage depends on sha1.o but doesnt actually use sha1 functions. i posted a patch to u-boot mailing list to get this dropped. regardless, no need for the kernel to import it.

No need to yet anyway. There are discussions on-going to make a new image format that can do sha1 sums instead of crc32. Either way is fine with me, I just opted to include it now to keep it the same as U-Boot and avoid having to include it in the future.

If you want an updated patch with the sha1 code removed, I can do that. Sam, Wolfgang?

josh

#4 lore raw

Re: [PATCH 1/3] Merge mkubootimg tool for building U-Boot images

Quoted 26 lines · Josh Boyer
Quoted 20 lines · On Thu, 3 Jan 2008 17:15:48 -0500 "Mike Frysinger" <[email protected]> wrote:
Quoted 9 lines · Josh Boyer

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

Quoted 9 lines
---
 scripts/Makefile             |    1
 scripts/mkubootimg/Makefile  |    6
 scripts/mkubootimg/crc32.c   |  199 +++++++++++
 scripts/mkubootimg/mkimage.c |  728 +++++++++++++++++++++++++++++++++++++++++++
 scripts/mkubootimg/sha1.c    |  413 ++++++++++++++++++++++++
 scripts/mkubootimg/sha1.h    |  115 ++++++
 scripts/mkubootimg/uimage.h  |  161 +++++++++
 7 files changed, 1623 insertions(+)
Quoted 4 lines

i'm fairly certain sha1 is not needed. the u-boot makefile has a bug in the 1.3.1 release where mkimage depends on sha1.o but doesnt actually use sha1 functions. i posted a patch to u-boot mailing list to get this dropped. regardless, no need for the kernel to import it.

Quoted 7 lines

No need to yet anyway. There are discussions on-going to make a new image format that can do sha1 sums instead of crc32. Either way is fine with me, I just opted to include it now to keep it the same as U-Boot and avoid having to include it in the future.

If you want an updated patch with the sha1 code removed, I can do that. Sam, Wolfgang?

yes, but i think the next image format is going to require quite a bit of changes in the build system anyways, especially since with the kernel you will want the option to produce either format, so simply dropping the sha1 makes sense to me. but i dont really care either way, just making sure you're aware of the issue (and it sounds like you are).
-mike

author
#5 lore raw

Re: [PATCH 1/3] Merge mkubootimg tool for building U-Boot images

Quoted 35 lines · On Thu, 3 Jan 2008 17:33:20 -0500 "Mike Frysinger" <[email protected]> wrote:
Quoted 26 lines · Josh Boyer
Quoted 20 lines · On Thu, 3 Jan 2008 17:15:48 -0500 "Mike Frysinger" <[email protected]> wrote:
Quoted 9 lines · Josh Boyer

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

Quoted 9 lines
---
 scripts/Makefile             |    1
 scripts/mkubootimg/Makefile  |    6
 scripts/mkubootimg/crc32.c   |  199 +++++++++++
 scripts/mkubootimg/mkimage.c |  728 +++++++++++++++++++++++++++++++++++++++++++
 scripts/mkubootimg/sha1.c    |  413 ++++++++++++++++++++++++
 scripts/mkubootimg/sha1.h    |  115 ++++++
 scripts/mkubootimg/uimage.h  |  161 +++++++++
 7 files changed, 1623 insertions(+)
Quoted 4 lines

i'm fairly certain sha1 is not needed. the u-boot makefile has a bug in the 1.3.1 release where mkimage depends on sha1.o but doesnt actually use sha1 functions. i posted a patch to u-boot mailing list to get this dropped. regardless, no need for the kernel to import it.

Quoted 7 lines

No need to yet anyway. There are discussions on-going to make a new image format that can do sha1 sums instead of crc32. Either way is fine with me, I just opted to include it now to keep it the same as U-Boot and avoid having to include it in the future.

If you want an updated patch with the sha1 code removed, I can do that. Sam, Wolfgang?

Quoted 6 lines

yes, but i think the next image format is going to require quite a bit of changes in the build system anyways, especially since with the kernel you will want the option to produce either format, so simply dropping the sha1 makes sense to me. but i dont really care either way, just making sure you're aware of the issue (and it sounds like you are).

Yep, I am. I plan on maintaining the in-kernel version too, as most of the PPC 44x boards these days use U-Boot. So I'll be sure to keep on top of things.

josh

#6 lore raw

Re: [PATCH 1/3] Merge mkubootimg tool for building U-Boot images

Quoted 45 lines · Josh Boyer
Quoted 35 lines · On Thu, 3 Jan 2008 17:33:20 -0500 "Mike Frysinger" <[email protected]> wrote:
Quoted 26 lines · Josh Boyer
Quoted 20 lines · On Thu, 3 Jan 2008 17:15:48 -0500 "Mike Frysinger" <[email protected]> wrote:
Quoted 9 lines · Josh Boyer

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

Quoted 9 lines
---
 scripts/Makefile             |    1
 scripts/mkubootimg/Makefile  |    6
 scripts/mkubootimg/crc32.c   |  199 +++++++++++
 scripts/mkubootimg/mkimage.c |  728 +++++++++++++++++++++++++++++++++++++++++++
 scripts/mkubootimg/sha1.c    |  413 ++++++++++++++++++++++++
 scripts/mkubootimg/sha1.h    |  115 ++++++
 scripts/mkubootimg/uimage.h  |  161 +++++++++
 7 files changed, 1623 insertions(+)
Quoted 4 lines

i'm fairly certain sha1 is not needed. the u-boot makefile has a bug in the 1.3.1 release where mkimage depends on sha1.o but doesnt actually use sha1 functions. i posted a patch to u-boot mailing list to get this dropped. regardless, no need for the kernel to import it.

Quoted 7 lines

No need to yet anyway. There are discussions on-going to make a new image format that can do sha1 sums instead of crc32. Either way is fine with me, I just opted to include it now to keep it the same as U-Boot and avoid having to include it in the future.

If you want an updated patch with the sha1 code removed, I can do that. Sam, Wolfgang?

Quoted 6 lines

yes, but i think the next image format is going to require quite a bit of changes in the build system anyways, especially since with the kernel you will want the option to produce either format, so simply dropping the sha1 makes sense to me. but i dont really care either way, just making sure you're aware of the issue (and it sounds like you are).

Quoted 3 lines

Yep, I am. I plan on maintaining the in-kernel version too, as most of the PPC 44x boards these days use U-Boot. So I'll be sure to keep on top of things.

We do not want sha1.* files around because we expect them to be used. So I dropped those.
Otherwise I applied all three patches.
I will await one day for ack's from Russell and Paulus before I push out the tree.

Sam

#7 lore raw

Re: [PATCH 1/3] Merge mkubootimg tool for building U-Boot images

In reply to Josh Boyer
Quoted 6 lines · Josh Boyer

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

I got following warnings:
HOSTCC scripts/mkubootimg/mkimage.o
scripts/mkubootimg/mkimage.c:40: warning: function declaration isn’t a prototype scripts/mkubootimg/mkimage.c: In function ‘main’:
scripts/mkubootimg/mkimage.c:199: warning: dereferencing type-punned pointer will break strict-aliasing rules scripts/mkubootimg/mkimage.c:216: warning: dereferencing type-punned pointer will break strict-aliasing rules

And sparse gave following warnings (with default options)

$ sparse -DUSE_HOSTCC *.c
crc32.c:154:5: warning: non-ANSI definition of function 'crc32'
/usr/include/asm/errno.h:9:4: warning: This machine appears to be neither x86_64 nor i386.
/usr/include/asm/socket.h:9:4: warning: This machine appears to be neither x86_64 nor i386.
mkimage.c:40:12: warning: non-ANSI function declaration of function '__errno_location'
mkimage.c:574:8: warning: non-ANSI function declaration of function 'usage'
mkimage.c:46:6: warning: symbol 'cmdname' was not declared. Should it be static?
mkimage.c:56:15: warning: symbol 'arch_name' was not declared. Should it be static?
mkimage.c:78:15: warning: symbol 'os_name' was not declared. Should it be static?
mkimage.c:102:15: warning: symbol 'type_name' was not declared. Should it be static?
mkimage.c:115:15: warning: symbol 'comp_name' was not declared. Should it be static?
mkimage.c:138:6: warning: symbol 'datafile' was not declared. Should it be static?
mkimage.c:139:6: warning: symbol 'imagefile' was not declared. Should it be static?
mkimage.c:141:5: warning: symbol 'dflag' was not declared. Should it be static?
mkimage.c:142:5: warning: symbol 'eflag' was not declared. Should it be static?
mkimage.c:143:5: warning: symbol 'lflag' was not declared. Should it be static?
mkimage.c:144:5: warning: symbol 'vflag' was not declared. Should it be static?
mkimage.c:145:5: warning: symbol 'xflag' was not declared. Should it be static?
mkimage.c:146:5: warning: symbol 'opt_os' was not declared. Should it be static?
mkimage.c:147:5: warning: symbol 'opt_arch' was not declared. Should it be static?
mkimage.c:148:5: warning: symbol 'opt_type' was not declared. Should it be static?
mkimage.c:149:5: warning: symbol 'opt_comp' was not declared. Should it be static?
mkimage.c:151:16: warning: symbol 'header' was not declared. Should it be static?
mkimage.c:152:16: warning: symbol 'hdr' was not declared. Should it be static?
mkimage.c:300:31: warning: Using plain integer as NULL pointer
mkimage.c:438:30: warning: Using plain integer as NULL pointer
mkimage.c:518:30: warning: Using plain integer as NULL pointer
mkimage.c:574:1: warning: symbol 'usage' was not declared. Should it be static?

Please fix and resubmit (without the sha1 files).

Sam

author
#8 lore raw

PATCH v2 1/3 Merge mkubootimg tool for building U-Boot images

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

---
 scripts/Makefile             |    1 
 scripts/mkubootimg/Makefile  |    6 
 scripts/mkubootimg/crc32.c   |  196 +++++++++++
 scripts/mkubootimg/mkimage.c |  727 +++++++++++++++++++++++++++++++++++++++++++
 scripts/mkubootimg/uimage.h  |  161 +++++++++
 5 files changed, 1091 insertions(+)
scripts/Makefile +1 -0
@@ -20,6 +20,7 @@ hostprogs-y += unifdef
 
 subdir-$(CONFIG_MODVERSIONS) += genksyms
 subdir-y                     += mod
+subdir-y                     += mkubootimg
 
 # Let clean descend into subdirs
 subdir-	+= basic kconfig package
scripts/mkubootimg/Makefile new file +6 -0
@@ -0,0 +1,6 @@
+hostprogs-y	:= mkubootimg
+always		:= $(hostprogs-y)
+
+mkubootimg-objs	:= mkimage.o crc32.o
+
+HOSTCFLAGS_crc32.o := -DUSE_HOSTCC
scripts/mkubootimg/crc32.c new file +196 -0

196 lines not on this page · raw message

scripts/mkubootimg/mkimage.c new file +727 -0

727 lines not on this page · raw message

scripts/mkubootimg/uimage.h new file +161 -0

161 lines not on this page · raw message

#9 lore raw

Re: [PATCH 1/3 v2] Merge mkubootimg tool for building U-Boot images

Quoted 8 lines · Josh Boyer

Several platforms require the mkimage tool to generate a uImage file that is used with U-Boot. This brings the mkimage tool in-kernel to enable building those platforms without having mkimage externally provided. The tool is named mkubootimg for better clarity.

This is currently based off of the version found in U-Boot 1.3.1.

I added following comment to the changelog:
======
Note: This patchs trigger followings output from checkpatch.pl:
total: 45 errors, 144 warnings, 1097 lines checked

As this is based on a copy of SW from U-boot this is accepted as an exception.
======

Next time please indicate result of checkpatch.pl run. Usually I does not accept errors from checkpatch.pl (unless checkpatch.pl has become utterly confused).

And I added Wolfgang as Cc:

Sam

author
#10 lore raw

PATCH 2/3 Rework arch specific Makefiles to use mkubootimg

In reply to Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

---
 arch/arm/boot/Makefile          |    4 ++--
 arch/avr32/boot/images/Makefile |    4 ++--
 arch/blackfin/boot/Makefile     |    4 ++--
 arch/ppc/boot/images/Makefile   |    4 ++--
 arch/sh/boot/Makefile           |    4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/boot/Makefile +2 -2
@@ -11,7 +11,7 @@
 # Copyright (C) 1995-2002 Russell King
 #
 
-MKIMAGE         := $(srctree)/scripts/mkuboot.sh
+MKIMAGE         := $(srctree)/scripts/mkubootimg/mkubootimg
 
 ifneq ($(MACHINE),)
 include $(srctree)/$(MACHINE)/Makefile.boot
@@ -60,7 +60,7 @@ $(obj)/zImage:	$(obj)/compressed/vmlinux
 endif
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A arm -O linux -T kernel \
 		   -C none -a $(ZRELADDR) -e $(ZRELADDR) \
 		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
arch/avr32/boot/images/Makefile +2 -2
@@ -6,7 +6,7 @@
 # for more details.
 #
 
-MKIMAGE		:= $(srctree)/scripts/mkuboot.sh
+MKIMAGE		:= $(srctree)/scripts/mkubootimg/mkubootimg
 
 extra-y		:= vmlinux.bin vmlinux.gz
 
@@ -18,7 +18,7 @@ $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FO
 	$(call if_changed,gzip)
 
 quiet_cmd_uimage = UIMAGE $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A avr32 -O linux -T kernel	\
+      cmd_uimage = $(MKIMAGE) -A avr32 -O linux -T kernel	\
 		-C gzip -a $(CONFIG_LOAD_ADDRESS) -e $(CONFIG_ENTRY_ADDRESS)	\
 		-n 'Linux-$(KERNELRELEASE)' -d $< $@
 
arch/blackfin/boot/Makefile +2 -2
@@ -6,13 +6,13 @@
 # for more details.
 #
 
-MKIMAGE := $(srctree)/scripts/mkuboot.sh
+MKIMAGE := $(srctree)/scripts/mkubootimg/mkubootimg
 
 targets := vmImage
 extra-y += vmlinux.bin vmlinux.gz
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
                    -C gzip -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
                    -e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \
                    -d $< $@
arch/ppc/boot/images/Makefile +2 -2
@@ -2,7 +2,7 @@
 # This dir holds all of the images for PPC machines.
 # Tom Rini	January 2001
 
-MKIMAGE		:= $(srctree)/scripts/mkuboot.sh
+MKIMAGE		:= $(srctree)/scripts/mkubootimg/mkubootimg
 
 extra-y		:= vmlinux.bin vmlinux.gz
 
@@ -19,7 +19,7 @@ $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FO
 	$(call if_changed,mygzip)
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A ppc -O linux -T kernel \
                -C gzip -a 00000000 -e 00000000 -n 'Linux-$(KERNELRELEASE)' \
                -d $< $@
 
arch/sh/boot/Makefile +2 -2
@@ -8,7 +8,7 @@
 # Copyright (C) 1999 Stuart Menefy
 #
 
-MKIMAGE := $(srctree)/scripts/mkuboot.sh
+MKIMAGE := $(srctree)/scripts/mkubootimg/mkubootimg
 
 #
 # Assign safe dummy values if these variables are not defined,
@@ -38,7 +38,7 @@ KERNEL_LOAD	:= $(shell /bin/bash -c 'pri
 			$(CONFIG_ZERO_PAGE_OFFSET)+0x1000]')
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A sh -O linux -T kernel \
 		   -C none -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \
 		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
#11 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

Quoted 4 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

A CC: to RMK and any other arch maintainers being touched by this would have useful too.

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
author
#12 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

Quoted 8 lines · On Thu, 3 Jan 2008 22:41:40 +0000 Ben Dooks <[email protected]> wrote:
Quoted 4 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

A CC: to RMK and any other arch maintainers being touched by this would have useful too.

D'oh. I thought I had fixed that in this round. Bit late now, but CC'd.

josh

Acked-by
#13 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

Quoted 7 lines · Josh Boyer
Quoted 4 lines · On Thu, 3 Jan 2008 22:41:40 +0000 Ben Dooks <[email protected]> wrote:
Quoted 3 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

A CC: to RMK and any other arch maintainers being touched by this would have useful too.

D'oh. I thought I had fixed that in this round. Bit late now, but CC'd.

Looks fine to me.

#14 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

Quoted 13 lines · Paul Mundt
Quoted 12 lines · Josh Boyer
Quoted 8 lines · On Thu, 3 Jan 2008 22:41:40 +0000 Ben Dooks <[email protected]> wrote:
Quoted 4 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

A CC: to RMK and any other arch maintainers being touched by this would have useful too.

Quoted 6 lines
Quoted 3 lines

D'oh. I thought I had fixed that in this round. Bit late now, but CC'd.

Looks fine to me.

No sign of a patch. So no ack from me.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#15 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

Quoted 14 lines · Russell King
Quoted 13 lines · Paul Mundt
Quoted 12 lines · Josh Boyer
Quoted 8 lines · On Thu, 3 Jan 2008 22:41:40 +0000 Ben Dooks <[email protected]> wrote:
Quoted 4 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

A CC: to RMK and any other arch maintainers being touched by this would have useful too.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

D'oh. I thought I had fixed that in this round. Bit late now, but CC'd.

Looks fine to me.

No sign of a patch. So no ack from me.

Indeed, it would be nice to actually be CC'ed on the patch itself at the time of submission without having to dig through the list archives for it. Hopefully the next iteration gets this right, as well as Haavard's email address ;-)

author
#16 lore raw

PATCH 2/3 Rework arch specific Makefiles to use mkubootimg

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

---
 arch/arm/boot/Makefile          |    4 ++--
 arch/avr32/boot/images/Makefile |    4 ++--
 arch/blackfin/boot/Makefile     |    4 ++--
 arch/ppc/boot/images/Makefile   |    4 ++--
 arch/sh/boot/Makefile           |    4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/boot/Makefile +2 -2
@@ -11,7 +11,7 @@
 # Copyright (C) 1995-2002 Russell King
 #
 
-MKIMAGE         := $(srctree)/scripts/mkuboot.sh
+MKIMAGE         := $(srctree)/scripts/mkubootimg/mkubootimg
 
 ifneq ($(MACHINE),)
 include $(srctree)/$(MACHINE)/Makefile.boot
@@ -60,7 +60,7 @@ $(obj)/zImage:	$(obj)/compressed/vmlinux
 endif
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A arm -O linux -T kernel \
 		   -C none -a $(ZRELADDR) -e $(ZRELADDR) \
 		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
arch/avr32/boot/images/Makefile +2 -2
@@ -6,7 +6,7 @@
 # for more details.
 #
 
-MKIMAGE		:= $(srctree)/scripts/mkuboot.sh
+MKIMAGE		:= $(srctree)/scripts/mkubootimg/mkubootimg
 
 extra-y		:= vmlinux.bin vmlinux.gz
 
@@ -18,7 +18,7 @@ $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FO
 	$(call if_changed,gzip)
 
 quiet_cmd_uimage = UIMAGE $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A avr32 -O linux -T kernel	\
+      cmd_uimage = $(MKIMAGE) -A avr32 -O linux -T kernel	\
 		-C gzip -a $(CONFIG_LOAD_ADDRESS) -e $(CONFIG_ENTRY_ADDRESS)	\
 		-n 'Linux-$(KERNELRELEASE)' -d $< $@
 
arch/blackfin/boot/Makefile +2 -2
@@ -6,13 +6,13 @@
 # for more details.
 #
 
-MKIMAGE := $(srctree)/scripts/mkuboot.sh
+MKIMAGE := $(srctree)/scripts/mkubootimg/mkubootimg
 
 targets := vmImage
 extra-y += vmlinux.bin vmlinux.gz
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
                    -C gzip -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
                    -e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \
                    -d $< $@
arch/ppc/boot/images/Makefile +2 -2
@@ -2,7 +2,7 @@
 # This dir holds all of the images for PPC machines.
 # Tom Rini	January 2001
 
-MKIMAGE		:= $(srctree)/scripts/mkuboot.sh
+MKIMAGE		:= $(srctree)/scripts/mkubootimg/mkubootimg
 
 extra-y		:= vmlinux.bin vmlinux.gz
 
@@ -19,7 +19,7 @@ $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FO
 	$(call if_changed,mygzip)
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A ppc -O linux -T kernel \
                -C gzip -a 00000000 -e 00000000 -n 'Linux-$(KERNELRELEASE)' \
                -d $< $@
 
arch/sh/boot/Makefile +2 -2
@@ -8,7 +8,7 @@
 # Copyright (C) 1999 Stuart Menefy
 #
 
-MKIMAGE := $(srctree)/scripts/mkuboot.sh
+MKIMAGE := $(srctree)/scripts/mkubootimg/mkubootimg
 
 #
 # Assign safe dummy values if these variables are not defined,
@@ -38,7 +38,7 @@ KERNEL_LOAD	:= $(shell /bin/bash -c 'pri
 			$(CONFIG_ZERO_PAGE_OFFSET)+0x1000]')
 
 quiet_cmd_uimage = UIMAGE  $@
-      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
+      cmd_uimage = $(MKIMAGE) -A sh -O linux -T kernel \
 		   -C none -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \
 		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
#18 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

In reply to Josh Boyer
Quoted 8 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

From the point of view of no overall change: Ack.

From the point of view of whether we should have this in the kernel:

probably not.

See http://lists.arm.linux.org.uk/lurker/thread/20071203.131631.85e7a1a5.en.html#20071203.131631.85e7a1a5

for a recent discussion on the ins and outs, multiple formats, options and so forth passed to mk(u)image. It looks like we're heading for 5 or 6 different kernel image formats for the ARM architecture. ;(

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
author
#19 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

Quoted 7 lines · On Fri, 4 Jan 2008 16:04:45 +0000 Russell King <[email protected]>…
Quoted 4 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

From the point of view of no overall change: Ack.

Ok, thanks. As it really is no change from the current status quo, I'll go with this until something happens from the discussion below.

Quoted 8 lines

From the point of view of whether we should have this in the kernel:
probably not.

See http://lists.arm.linux.org.uk/lurker/thread/20071203.131631.85e7a1a5.en.html#20071203.131631.85e7a1a5

for a recent discussion on the ins and outs, multiple formats, options and so forth passed to mk(u)image. It looks like we're heading for 5 or 6 different kernel image formats for the ARM architecture. ;(

Hm, that's a bit unfortunate indeed. I'm not very familiar with ARM, but is there a "majority" image format that is used? If so, we could have the kernel build system generate that by default for uImages.

If not, perhaps it would be better to remove the uImage stuff completely for ARM as you hinted at in that thread. The other architectures don't seem to suffer from as many differences and are probably OK.

josh

Acked-by
#20 lore raw

Re: [PATCH 2/3] Rework arch specific Makefiles to use mkubootimg

In reply to Josh Boyer
Quoted 7 lines · Josh Boyer
Quoted 4 lines · On Thu, 3 Jan 2008 22:41:40 +0000 Ben Dooks <[email protected]> wrote:
Quoted 3 lines · Josh Boyer

Rework the architecture specific Makefiles to use the in-kernel version of the mkubootimg tool.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

A CC: to RMK and any other arch maintainers being touched by this would have useful too.

D'oh. I thought I had fixed that in this round. Bit late now, but CC'd.

It is OK for Blackfin, Thanks.
But Mike is still discussing with you about the first Patch of this series.

author
#21 lore raw

PATCH 3/3 Remove mkuboot.sh script

In reply to Josh Boyer

Now that the mkubootimg tool is merged into the kernel, we can remove the unused mkuboot.sh script.

---
 scripts/mkuboot.sh |   19 -------------------
 1 file changed, 19 deletions(-)
scripts/mkuboot.sh deleted +0 -19
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-#
-# Build U-Boot image when `mkimage' tool is available.
-#
-
-MKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
-
-if [ -z "${MKIMAGE}" ]; then
-	MKIMAGE=$(type -path mkimage)
-	if [ -z "${MKIMAGE}" ]; then
-		# Doesn't exist
-		echo '"mkimage" command not found - U-Boot images will not be built' >&2
-		exit 0;
-	fi
-fi
-
-# Call "mkimage" to create U-Boot image
-${MKIMAGE} "$@"