Re: [PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-11-01 Thread Du, Changbin
Hi Ingo and Yamada,
Thanks for your suggestions. I'll have a try though I am not familiar with 
kbuild system.

On Wed, Nov 01, 2017 at 12:17:50PM +0900, Masahiro Yamada wrote:
> 2017-10-31 18:39 GMT+09:00 Ingo Molnar :
> >
> > * changbin...@intel.com  wrote:
> >
> >> From: Changbin Du 
> >>
> >> Recently I failed to build isoimage target, because the path of 
> >> isolinux.bin
> >> changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
> >> changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.
> >>
> >> This patch has a improvement of the file search:
> >>   - Don't print the raw shell commands. It doesn't make sense to show the
> >> entire big block.
> >>   - Show a error message instead of silent fail.
> >>   - Add above new paths.
> >>
> >> Now it becomes:
> >> Kernel: arch/x86/boot/bzImage is ready  (#62)
> >> rm -rf arch/x86/boot/isoimage
> >> mkdir arch/x86/boot/isoimage
> >> Using /usr/lib/ISOLINUX/isolinux.bin
> >> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> >> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
> >> ...
> >>
> >> 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
> >> arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
> >> make[1]: *** [isoimage] Error 1
> >
> > I like these changes. Could we please further improve it: for example the 
> > boot
> > image build messages are still pretty unstructured, while regular build 
> > system
> > messages come in the following format:
> >
> >   CC  arch/x86/events/msr.o
> >   RELOCS  arch/x86/realmode/rm/realmode.relocs
> >   OBJCOPY arch/x86/realmode/rm/realmode.bin
> >   CC  arch/x86/kernel/signal.o
> >   AS  arch/x86/realmode/rmpiggy.o
> >   CC  ipc/msg.o
> >   AR  arch/x86/ia32/built-in.o
> >   CC  arch/x86/events/amd/iommu.o
> >   CC  init/do_mounts.o
> >   AR  arch/x86/realmode/built-in.o
> >
> > So instead of:
> >
> >> Kernel: arch/x86/boot/bzImage is ready  (#62)
> >> rm -rf arch/x86/boot/isoimage
> >> mkdir arch/x86/boot/isoimage
> >> Using /usr/lib/ISOLINUX/isolinux.bin
> >> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> >> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
> >
> > Could we make it something more streamlined and similar to the rest of the 
> > build
> > as well, like:
> >
> >   GEN arch/x86/boot/bzImage
> >   GEN arch/x86/boot/isoimage
> >   GEN arch/x86/boot/isoimage/linux
> >
> > I.e. only mention the new files built, with an appropriate prefix.
> >
> > I've Cc:-ed the kbuild maintainers, maybe they have a better suggestion 
> > instead of
> > the 'GEN' abbreviation?
> >
> 
> Generally, the abbreviation is the tool that has processed the target,
> but if you do not find an appropriate one, 'GEN' is fine.
> 
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

-- 
Thanks,
Changbin Du


signature.asc
Description: PGP signature


Re: [PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-11-01 Thread Du, Changbin
Hi Ingo and Yamada,
Thanks for your suggestions. I'll have a try though I am not familiar with 
kbuild system.

On Wed, Nov 01, 2017 at 12:17:50PM +0900, Masahiro Yamada wrote:
> 2017-10-31 18:39 GMT+09:00 Ingo Molnar :
> >
> > * changbin...@intel.com  wrote:
> >
> >> From: Changbin Du 
> >>
> >> Recently I failed to build isoimage target, because the path of 
> >> isolinux.bin
> >> changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
> >> changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.
> >>
> >> This patch has a improvement of the file search:
> >>   - Don't print the raw shell commands. It doesn't make sense to show the
> >> entire big block.
> >>   - Show a error message instead of silent fail.
> >>   - Add above new paths.
> >>
> >> Now it becomes:
> >> Kernel: arch/x86/boot/bzImage is ready  (#62)
> >> rm -rf arch/x86/boot/isoimage
> >> mkdir arch/x86/boot/isoimage
> >> Using /usr/lib/ISOLINUX/isolinux.bin
> >> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> >> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
> >> ...
> >>
> >> 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
> >> arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
> >> make[1]: *** [isoimage] Error 1
> >
> > I like these changes. Could we please further improve it: for example the 
> > boot
> > image build messages are still pretty unstructured, while regular build 
> > system
> > messages come in the following format:
> >
> >   CC  arch/x86/events/msr.o
> >   RELOCS  arch/x86/realmode/rm/realmode.relocs
> >   OBJCOPY arch/x86/realmode/rm/realmode.bin
> >   CC  arch/x86/kernel/signal.o
> >   AS  arch/x86/realmode/rmpiggy.o
> >   CC  ipc/msg.o
> >   AR  arch/x86/ia32/built-in.o
> >   CC  arch/x86/events/amd/iommu.o
> >   CC  init/do_mounts.o
> >   AR  arch/x86/realmode/built-in.o
> >
> > So instead of:
> >
> >> Kernel: arch/x86/boot/bzImage is ready  (#62)
> >> rm -rf arch/x86/boot/isoimage
> >> mkdir arch/x86/boot/isoimage
> >> Using /usr/lib/ISOLINUX/isolinux.bin
> >> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> >> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
> >
> > Could we make it something more streamlined and similar to the rest of the 
> > build
> > as well, like:
> >
> >   GEN arch/x86/boot/bzImage
> >   GEN arch/x86/boot/isoimage
> >   GEN arch/x86/boot/isoimage/linux
> >
> > I.e. only mention the new files built, with an appropriate prefix.
> >
> > I've Cc:-ed the kbuild maintainers, maybe they have a better suggestion 
> > instead of
> > the 'GEN' abbreviation?
> >
> 
> Generally, the abbreviation is the tool that has processed the target,
> but if you do not find an appropriate one, 'GEN' is fine.
> 
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

-- 
Thanks,
Changbin Du


signature.asc
Description: PGP signature


Re: [PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-10-31 Thread Masahiro Yamada
2017-10-31 18:39 GMT+09:00 Ingo Molnar :
>
> * changbin...@intel.com  wrote:
>
>> From: Changbin Du 
>>
>> Recently I failed to build isoimage target, because the path of isolinux.bin
>> changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
>> changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.
>>
>> This patch has a improvement of the file search:
>>   - Don't print the raw shell commands. It doesn't make sense to show the
>> entire big block.
>>   - Show a error message instead of silent fail.
>>   - Add above new paths.
>>
>> Now it becomes:
>> Kernel: arch/x86/boot/bzImage is ready  (#62)
>> rm -rf arch/x86/boot/isoimage
>> mkdir arch/x86/boot/isoimage
>> Using /usr/lib/ISOLINUX/isolinux.bin
>> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
>> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
>> ...
>>
>> 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
>> arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
>> make[1]: *** [isoimage] Error 1
>
> I like these changes. Could we please further improve it: for example the boot
> image build messages are still pretty unstructured, while regular build system
> messages come in the following format:
>
>   CC  arch/x86/events/msr.o
>   RELOCS  arch/x86/realmode/rm/realmode.relocs
>   OBJCOPY arch/x86/realmode/rm/realmode.bin
>   CC  arch/x86/kernel/signal.o
>   AS  arch/x86/realmode/rmpiggy.o
>   CC  ipc/msg.o
>   AR  arch/x86/ia32/built-in.o
>   CC  arch/x86/events/amd/iommu.o
>   CC  init/do_mounts.o
>   AR  arch/x86/realmode/built-in.o
>
> So instead of:
>
>> Kernel: arch/x86/boot/bzImage is ready  (#62)
>> rm -rf arch/x86/boot/isoimage
>> mkdir arch/x86/boot/isoimage
>> Using /usr/lib/ISOLINUX/isolinux.bin
>> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
>> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
>
> Could we make it something more streamlined and similar to the rest of the 
> build
> as well, like:
>
>   GEN arch/x86/boot/bzImage
>   GEN arch/x86/boot/isoimage
>   GEN arch/x86/boot/isoimage/linux
>
> I.e. only mention the new files built, with an appropriate prefix.
>
> I've Cc:-ed the kbuild maintainers, maybe they have a better suggestion 
> instead of
> the 'GEN' abbreviation?
>

Generally, the abbreviation is the tool that has processed the target,
but if you do not find an appropriate one, 'GEN' is fine.




-- 
Best Regards
Masahiro Yamada


Re: [PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-10-31 Thread Masahiro Yamada
2017-10-31 18:39 GMT+09:00 Ingo Molnar :
>
> * changbin...@intel.com  wrote:
>
>> From: Changbin Du 
>>
>> Recently I failed to build isoimage target, because the path of isolinux.bin
>> changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
>> changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.
>>
>> This patch has a improvement of the file search:
>>   - Don't print the raw shell commands. It doesn't make sense to show the
>> entire big block.
>>   - Show a error message instead of silent fail.
>>   - Add above new paths.
>>
>> Now it becomes:
>> Kernel: arch/x86/boot/bzImage is ready  (#62)
>> rm -rf arch/x86/boot/isoimage
>> mkdir arch/x86/boot/isoimage
>> Using /usr/lib/ISOLINUX/isolinux.bin
>> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
>> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
>> ...
>>
>> 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
>> arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
>> make[1]: *** [isoimage] Error 1
>
> I like these changes. Could we please further improve it: for example the boot
> image build messages are still pretty unstructured, while regular build system
> messages come in the following format:
>
>   CC  arch/x86/events/msr.o
>   RELOCS  arch/x86/realmode/rm/realmode.relocs
>   OBJCOPY arch/x86/realmode/rm/realmode.bin
>   CC  arch/x86/kernel/signal.o
>   AS  arch/x86/realmode/rmpiggy.o
>   CC  ipc/msg.o
>   AR  arch/x86/ia32/built-in.o
>   CC  arch/x86/events/amd/iommu.o
>   CC  init/do_mounts.o
>   AR  arch/x86/realmode/built-in.o
>
> So instead of:
>
>> Kernel: arch/x86/boot/bzImage is ready  (#62)
>> rm -rf arch/x86/boot/isoimage
>> mkdir arch/x86/boot/isoimage
>> Using /usr/lib/ISOLINUX/isolinux.bin
>> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
>> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
>
> Could we make it something more streamlined and similar to the rest of the 
> build
> as well, like:
>
>   GEN arch/x86/boot/bzImage
>   GEN arch/x86/boot/isoimage
>   GEN arch/x86/boot/isoimage/linux
>
> I.e. only mention the new files built, with an appropriate prefix.
>
> I've Cc:-ed the kbuild maintainers, maybe they have a better suggestion 
> instead of
> the 'GEN' abbreviation?
>

Generally, the abbreviation is the tool that has processed the target,
but if you do not find an appropriate one, 'GEN' is fine.




-- 
Best Regards
Masahiro Yamada


Re: [PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-10-31 Thread Ingo Molnar

* changbin...@intel.com  wrote:

> From: Changbin Du 
> 
> Recently I failed to build isoimage target, because the path of isolinux.bin
> changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
> changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.
> 
> This patch has a improvement of the file search:
>   - Don't print the raw shell commands. It doesn't make sense to show the
> entire big block.
>   - Show a error message instead of silent fail.
>   - Add above new paths.
> 
> Now it becomes:
> Kernel: arch/x86/boot/bzImage is ready  (#62)
> rm -rf arch/x86/boot/isoimage
> mkdir arch/x86/boot/isoimage
> Using /usr/lib/ISOLINUX/isolinux.bin
> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
> ...
> 
> 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
> arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
> make[1]: *** [isoimage] Error 1

I like these changes. Could we please further improve it: for example the boot 
image build messages are still pretty unstructured, while regular build system 
messages come in the following format:

  CC  arch/x86/events/msr.o
  RELOCS  arch/x86/realmode/rm/realmode.relocs
  OBJCOPY arch/x86/realmode/rm/realmode.bin
  CC  arch/x86/kernel/signal.o
  AS  arch/x86/realmode/rmpiggy.o
  CC  ipc/msg.o
  AR  arch/x86/ia32/built-in.o
  CC  arch/x86/events/amd/iommu.o
  CC  init/do_mounts.o
  AR  arch/x86/realmode/built-in.o

So instead of:

> Kernel: arch/x86/boot/bzImage is ready  (#62)
> rm -rf arch/x86/boot/isoimage
> mkdir arch/x86/boot/isoimage
> Using /usr/lib/ISOLINUX/isolinux.bin
> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux

Could we make it something more streamlined and similar to the rest of the 
build 
as well, like:

  GEN arch/x86/boot/bzImage
  GEN arch/x86/boot/isoimage
  GEN arch/x86/boot/isoimage/linux

I.e. only mention the new files built, with an appropriate prefix.

I've Cc:-ed the kbuild maintainers, maybe they have a better suggestion instead 
of 
the 'GEN' abbreviation?

Thanks,

Ingo


Re: [PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-10-31 Thread Ingo Molnar

* changbin...@intel.com  wrote:

> From: Changbin Du 
> 
> Recently I failed to build isoimage target, because the path of isolinux.bin
> changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
> changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.
> 
> This patch has a improvement of the file search:
>   - Don't print the raw shell commands. It doesn't make sense to show the
> entire big block.
>   - Show a error message instead of silent fail.
>   - Add above new paths.
> 
> Now it becomes:
> Kernel: arch/x86/boot/bzImage is ready  (#62)
> rm -rf arch/x86/boot/isoimage
> mkdir arch/x86/boot/isoimage
> Using /usr/lib/ISOLINUX/isolinux.bin
> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
> ...
> 
> 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
> arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
> make[1]: *** [isoimage] Error 1

I like these changes. Could we please further improve it: for example the boot 
image build messages are still pretty unstructured, while regular build system 
messages come in the following format:

  CC  arch/x86/events/msr.o
  RELOCS  arch/x86/realmode/rm/realmode.relocs
  OBJCOPY arch/x86/realmode/rm/realmode.bin
  CC  arch/x86/kernel/signal.o
  AS  arch/x86/realmode/rmpiggy.o
  CC  ipc/msg.o
  AR  arch/x86/ia32/built-in.o
  CC  arch/x86/events/amd/iommu.o
  CC  init/do_mounts.o
  AR  arch/x86/realmode/built-in.o

So instead of:

> Kernel: arch/x86/boot/bzImage is ready  (#62)
> rm -rf arch/x86/boot/isoimage
> mkdir arch/x86/boot/isoimage
> Using /usr/lib/ISOLINUX/isolinux.bin
> Using /usr/lib/syslinux/modules/bios/ldlinux.c32
> cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux

Could we make it something more streamlined and similar to the rest of the 
build 
as well, like:

  GEN arch/x86/boot/bzImage
  GEN arch/x86/boot/isoimage
  GEN arch/x86/boot/isoimage/linux

I.e. only mention the new files built, with an appropriate prefix.

I've Cc:-ed the kbuild maintainers, maybe they have a better suggestion instead 
of 
the 'GEN' abbreviation?

Thanks,

Ingo


[PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-10-30 Thread changbin . du
From: Changbin Du 

Recently I failed to build isoimage target, because the path of isolinux.bin
changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.

This patch has a improvement of the file search:
  - Don't print the raw shell commands. It doesn't make sense to show the
entire big block.
  - Show a error message instead of silent fail.
  - Add above new paths.

Now it becomes:
Kernel: arch/x86/boot/bzImage is ready  (#62)
rm -rf arch/x86/boot/isoimage
mkdir arch/x86/boot/isoimage
Using /usr/lib/ISOLINUX/isolinux.bin
Using /usr/lib/syslinux/modules/bios/ldlinux.c32
cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
...

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
arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
make[1]: *** [isoimage] Error 1

Signed-off-by: Changbin Du 
---
 arch/x86/boot/Makefile | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index d88a2fd..8425c2f 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -160,15 +160,28 @@ fdimage288: $(obj)/bzImage $(obj)/mtools.conf
 isoimage: $(obj)/bzImage
-rm -rf $(obj)/isoimage
mkdir $(obj)/isoimage
-   for i in lib lib64 share end ; do \
-   if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \
-   cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \
-   if [ -f /usr/$$i/syslinux/ldlinux.c32 ]; then \
-   cp /usr/$$i/syslinux/ldlinux.c32 
$(obj)/isoimage ; \
+   @for i in lib lib64 share end ; do \
+   for j in syslinux ISOLINUX ; do \
+   if [ -f /usr/$$i/$$j/isolinux.bin ] ; then \
+   isolinux=/usr/$$i/$$j/isolinux.bin ; \
+   echo "Using $$isolinux" ; \
+   cp $$isolinux $(obj)/isoimage ; \
fi ; \
+   done ; \
+   for j in syslinux syslinux/modules/bios ; do \
+   if [ -f /usr/$$i/$$j/ldlinux.c32 ]; then \
+   ldlinux=/usr/$$i/$$j/ldlinux.c32 ; \
+   echo "Using $$ldlinux" ; \
+   cp $$ldlinux $(obj)/isoimage ; \
+   fi ; \
+   done ; \
+   if [ -n "$$isolinux" -a -n "$$ldlinux" ] ; then \
break ; \
fi ; \
-   if [ $$i = end ] ; then exit 1 ; fi ; \
+   if [ $$i = end -a -z "$$isolinux" ] ; then \
+   echo 'Need isolinux.bin, please install 
syslinux/isolinux' ; \
+   exit 1 ; \
+   fi ; \
done
cp $(obj)/bzImage $(obj)/isoimage/linux
echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
-- 
2.7.4



[PATCH] x86, build: Improve the isolinux searching of isoimage generation

2017-10-30 Thread changbin . du
From: Changbin Du 

Recently I failed to build isoimage target, because the path of isolinux.bin
changed to /usr/xxx/ISOLINUX/isolinux.bin, as well as ldlinux.c32 which
changed to /usr/xxx/syslinux/modules/bios/ldlinux.c32.

This patch has a improvement of the file search:
  - Don't print the raw shell commands. It doesn't make sense to show the
entire big block.
  - Show a error message instead of silent fail.
  - Add above new paths.

Now it becomes:
Kernel: arch/x86/boot/bzImage is ready  (#62)
rm -rf arch/x86/boot/isoimage
mkdir arch/x86/boot/isoimage
Using /usr/lib/ISOLINUX/isolinux.bin
Using /usr/lib/syslinux/modules/bios/ldlinux.c32
cp arch/x86/boot/bzImage arch/x86/boot/isoimage/linux
...

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
arch/x86/boot/Makefile:161: recipe for target 'isoimage' failed
make[1]: *** [isoimage] Error 1

Signed-off-by: Changbin Du 
---
 arch/x86/boot/Makefile | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index d88a2fd..8425c2f 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -160,15 +160,28 @@ fdimage288: $(obj)/bzImage $(obj)/mtools.conf
 isoimage: $(obj)/bzImage
-rm -rf $(obj)/isoimage
mkdir $(obj)/isoimage
-   for i in lib lib64 share end ; do \
-   if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \
-   cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \
-   if [ -f /usr/$$i/syslinux/ldlinux.c32 ]; then \
-   cp /usr/$$i/syslinux/ldlinux.c32 
$(obj)/isoimage ; \
+   @for i in lib lib64 share end ; do \
+   for j in syslinux ISOLINUX ; do \
+   if [ -f /usr/$$i/$$j/isolinux.bin ] ; then \
+   isolinux=/usr/$$i/$$j/isolinux.bin ; \
+   echo "Using $$isolinux" ; \
+   cp $$isolinux $(obj)/isoimage ; \
fi ; \
+   done ; \
+   for j in syslinux syslinux/modules/bios ; do \
+   if [ -f /usr/$$i/$$j/ldlinux.c32 ]; then \
+   ldlinux=/usr/$$i/$$j/ldlinux.c32 ; \
+   echo "Using $$ldlinux" ; \
+   cp $$ldlinux $(obj)/isoimage ; \
+   fi ; \
+   done ; \
+   if [ -n "$$isolinux" -a -n "$$ldlinux" ] ; then \
break ; \
fi ; \
-   if [ $$i = end ] ; then exit 1 ; fi ; \
+   if [ $$i = end -a -z "$$isolinux" ] ; then \
+   echo 'Need isolinux.bin, please install 
syslinux/isolinux' ; \
+   exit 1 ; \
+   fi ; \
done
cp $(obj)/bzImage $(obj)/isoimage/linux
echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
-- 
2.7.4