Skip to contentSkip to conversation

KVM external module: Fix 'make sync'

PATCH In review Amit Shah 2 participants 2 messages Nov 28, 2007 – Nov 30, 2007 1 message not in the archive KVM

lore
Share & tools
lore

Amit Shah

author
#0 lore raw

PATCH 1/1 KVM external module: Fix 'make sync'

Quoted 1 line

From a60dc9bddf8741743077db07f87dd1cec51bccb5 Mon Sep 17 00:00:00 2001

From: Amit Shah <amit.shah-atKUWr5tajBWk0Htik3J/[email protected]>
Date: Thu, 29 Nov 2007 03:11:15 +0530
Subject: [PATCH] KVM external module: Fix 'make sync'

bash syntax didn't work for me (3.2.25 on Kubuntu)

---
 kernel/Makefile |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
kernel/Makefile +3 -2
index 22326b2..b71149e 100644
@@ -18,9 +18,10 @@ hack = 	mv $1 $1.orig && \
 	    | sed 's/\blapic\b/l_apic/g' > $1 && rm $1.orig
 
 unifdef = mv $1 $1.orig && \
-	  unifdef -DCONFIG_X86 $1.orig > $1; (( $$? <= 1 )) && rm $1.orig
+	  unifdef -DCONFIG_X86 $1.orig > $1; \
+	if [ $$? -lt 2 ]; then rm $1.orig; fi;
 
-all::
+all:
 	$(MAKE) -C $(KERNELDIR) M=`pwd` "$$@"
 
 sync:
Signature · 8 lines
1.5.2.5


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · Amit Shah

From a60dc9bddf8741743077db07f87dd1cec51bccb5 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah-atKUWr5tajBWk0Htik3J/[email protected]>
Date: Thu, 29 Nov 2007 03:11:15 +0530
Subject: [PATCH] KVM external module: Fix 'make sync'

bash syntax didn't work for me (3.2.25 on Kubuntu)

Ah, bash isn't the default shell there.

kernel/Makefile hack = mv $1 $1.orig && \ · line 22

Quoted 8 lines

ic/g' > $1 && rm $1.orig

unifdef = mv $1 $1.orig && \

kernel/Makefile +2 -1
-	  unifdef -DCONFIG_X86 $1.orig > $1; (( $$? <= 1 )) && rm $1.orig
+	  unifdef -DCONFIG_X86 $1.orig > $1; \
+	if [ $$? -lt 2 ]; then rm $1.orig; fi;

The intent of the original code was to fail unifdef was not present, not to conditionalize removal (unifdef returns 1 on no change, so we need to test the error code explicitly).

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4