sharp zaurus: prevent killing spitz-en
Hi!
This is wrong solution, but it prevents breaking flashing mechanism on spitz with too big kernel. It may be handy to someone...
Pavel
arch/arm/boot/Makefile +6 -0
@@ -53,6 +53,12 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(call if_changed,objcopy) @echo ' Kernel: $@ is ready' + @ls -al $@ + @wc -c $@ | ( read SIZE Y; \ + if [ $$SIZE -gt 1294336 ]; then \ + echo ' Kernel is too big, would kill spitz'; \ + rm $@; \ + fi ) endif
Signature · 1 line
Thanks, Sharp!
Quoted 11 lines · Pavel Machek
Hi!
This is wrong solution, but it prevents breaking flashing mechanism on spitz with too big kernel. It may be handy to someone...
Pavel
arch/arm/boot/Makefile +0
-0@@ -53,6 +53,12 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
arch/arm/boot/Makefile line 63
Quoted 10 lines
arch/arm/boot/Makefile +6
-0$(call if_changed,objcopy) @echo ' Kernel: $@ is ready' + @ls -al $@ + @wc -c $@ | ( read SIZE Y; \ + if [ $$SIZE -gt 1294336 ]; then \ + echo ' Kernel is too big, would kill spitz'; \ + rm $@; \ + fi ) endif
It would be better for each machine to export an config option from the Kconfig to specify if they have a maximum size.
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/) 'a smiley only costs 4 bytes'
Hi!
Quoted 18 lines
Quoted 18 lines
This is wrong solution, but it prevents breaking flashing mechanism on spitz with too big kernel. It may be handy to someone...
Pavel
arch/arm/boot/Makefile +6
-0@@ -53,6 +53,12 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(call if_changed,objcopy) @echo ' Kernel: $@ is ready' + @ls -al $@ + @wc -c $@ | ( read SIZE Y; \ + if [ $$SIZE -gt 1294336 ]; then \ + echo ' Kernel is too big, would kill spitz'; \ + rm $@; \ + fi )
Quoted 4 lines
arch/arm/boot/Makefile line 63
Quoted 1 line
arch/arm/boot/Makefile +0
-0endifIt would be better for each machine to export an config option from the
Kconfigto specify if they have a maximum size.
It is probably best to stop it at the flasher script, but ... this was quite a quick hack.
Pavel
Signature · 1 line
Thanks, Sharp!
Quoted 3 lines · Ben Dooks
It would be better for each machine to export an config option from the
Kconfigto specify if they have a maximum size.
Isn't the maximum size a property of the bootloader/other firmware? i.e., something the kernel build system knows nothing about.
David Vrabel
Quoted 6 lines · David Vrabel
Quoted 2 lines · Ben Dooks
It would be better for each machine to export an config option from the
Kconfigto specify if they have a maximum size.Isn't the maximum size a property of the bootloader/other firmware? i.e., something the kernel build system knows nothing about.
Yes. blob, for instance, aborts an xmodem download if it's too large. The kernel has no knowledge of what blob classifies as "too large" which may indeed be different from uboot, bootldr, redboot, or ...
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core