• Changbin Du's avatar
    x86/build: Factor out fdimage/isoimage generation commands to standalone script · 4366d57a
    Changbin Du authored
    The build messages for fdimage/isoimage generation are pretty unstructured,
    just the raw shell command blocks are printed.
    
    Emit shortened messages similar to existing kbuild messages, and move
    the Makefile commands into a separate shell script - which is much
    easier to handle.
    
    This patch factors out the commands used for fdimage/isoimage generation
    from arch/x86/boot/Makefile to a new script arch/x86/boot/genimage.sh.
    Then it adds the new kbuild command 'genimage' which invokes the new script.
    All fdimages/isoimage files are now generated by a call to 'genimage' with
    different parameters.
    
    Now 'make isoimage' becomes:
    
    	...
    	Kernel: arch/x86/boot/bzImage is ready  (#30)
    	  GENIMAGE arch/x86/boot/image.iso
    	Size of boot image is 4 sectors -> No emulation
    	 15.37% done, estimate finish Sun Nov  5 23:36:57 2017
    	 30.68% done, estimate finish Sun Nov  5 23:36:57 2017
    	 46.04% done, estimate finish Sun Nov  5 23:36:57 2017
    	 61.35% done, estimate finish Sun Nov  5 23:36:57 2017
    	 76.69% done, estimate finish Sun Nov  5 23:36:57 2017
    	 92.00% done, estimate finish Sun Nov  5 23:36:57 2017
    	Total translation table size: 2048
    	Total rockridge attributes bytes: 659
    	Total directory bytes: 0
    	Path table size(bytes): 10
    	Max brk space used 0
    	32608 extents written (63 MB)
    	Kernel: arch/x86/boot/image.iso is ready
    
    Before:
    
    	Kernel: arch/x86/boot/bzImage is ready  (#63)
    	rm -rf arch/x86/boot/isoimage
    	mkdir arch/x86/boot/isoimage
    	for i in lib lib64 share end ; do \
    		if [ -f /usr/$i/syslinux/isolinux.bin ] ; then \
    			cp /usr/$i/syslinux/isolinux.bin arch/x86/boot/isoimage ; \
    			if [ -f /usr/$i/syslinux/ldlinux.c32 ]; then \
    				cp /usr/$i/syslinux/ldlinux.c32 arch/x86/boot/isoimage ; \
    			fi ; \
    			break ; \
    		fi ; \
    		if [ $i = end ] ; then exit 1 ; fi ; \
    	done
    	...
    Suggested-by: default avatarIngo Molnar <mingo@kernel.org>
    Signed-off-by: default avatarChangbin Du <changbin.du@intel.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/1509939179-7556-2-git-send-email-changbin.du@intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    4366d57a
Makefile 5.23 KB