mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: changbin.du@intel.com
To: hpa@zytor.com, tglx@linutronix.de
Cc: mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	Changbin Du <changbin.du@intel.com>
Subject: [PATCH]  x86, build: Improve the isolinux searching of isoimage generation
Date: Tue, 31 Oct 2017 12:45:31 +0800	[thread overview]
Message-ID: <1509425132-31514-1-git-send-email-changbin.du@intel.com> (raw)

From: Changbin Du <changbin.du@intel.com>

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 <changbin.du@intel.com>
---
 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

             reply	other threads:[~2017-10-31  4:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31  4:45 changbin.du [this message]
2017-10-31  9:39 ` Ingo Molnar
2017-11-01  3:17   ` Masahiro Yamada
2017-11-01 14:28     ` Du, Changbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509425132-31514-1-git-send-email-changbin.du@intel.com \
    --to=changbin.du@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome