Skip to contentSkip to conversation

Fix kvm-79 userland for separate kernel objdir

PATCH In review Andi Kleen 2 participants 5 messages Nov 20, 2008

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Fix kvm-79 userland for separate kernel objdir

I needed this patch to make kvm-79 build (with --with-patched-kernel) with separate kernel objdir and 2.6.28-rc5

-Andi

Makefile renamed from Makefile~ +1 -1
@@ -33,7 +33,7 @@
 header-sync-n:
 
 header-sync-y:
-	make -C kernel LINUX=$(KERNELDIR) header-sync
+	make -C kernel LINUX=$(KERNELSOURCEDIR) header-sync
 	rm -f kernel/include/asm
 	ln -sf asm-$(sane-arch) kernel/include/asm
 
Signature · 1 line
[email protected]
#1 lore raw

Am Donnerstag, 20. November 2008 schrieb Andi Kleen:

Makefile line 38

Quoted 10 lines
Makefile renamed from Makefile~ +1 -1
@@ -33,7 +33,7 @@
 header-sync-n:
 
 header-sync-y:
-	make -C kernel LINUX=$(KERNELDIR) header-sync
+	make -C kernel LINUX=$(KERNELSOURCEDIR) header-sync
 	rm -f kernel/include/asm
 	ln -sf asm-$(sane-arch) kernel/include/asm

Hmm. In my config.mak KERNELSOURCEDIR is empty. Looks like this patch would break headers_sync on kernels without a separate objdirs or builds with configure --kerneldir=blah.

Christian

author
#2 lore raw
Quoted 6 lines · Christian Borntraeger

Am Donnerstag, 20. November 2008 schrieb Andi Kleen:

Quoted 5 lines
Makefile renamed from Makefile~ +0 -0
@@ -33,7 +33,7 @@
 header-sync-n:
 
Quoted 9 lines

Makefile line 38

Quoted 5 lines
Makefile renamed from Makefile~ +1 -1
 header-sync-y:
-	make -C kernel LINUX=$(KERNELDIR) header-sync
+	make -C kernel LINUX=$(KERNELSOURCEDIR) header-sync
 	rm -f kernel/include/asm
 	ln -sf asm-$(sane-arch) kernel/include/asm

Hmm. In my config.mak KERNELSOURCEDIR is empty. Looks like this patch would break headers_sync on kernels without a separate objdirs or builds with configure --kerneldir=blah.

How about this variant? Does it work for you?

-Andi

Makefile renamed from Makefile~ +3 -1
@@ -33,7 +33,9 @@
 header-sync-n:
 
 header-sync-y:
-	make -C kernel LINUX=$(KERNELDIR) header-sync
+	make -C kernel \
+	LINUX=$(if "$(KERNELSOURCEDIR)",$(KERNELSOURCEDIR),$(KERNELDIR)) \
+	header-sync
 	rm -f kernel/include/asm
 	ln -sf asm-$(sane-arch) kernel/include/asm
 
#3 lore raw

Am Donnerstag, 20. November 2008 schrieb Andi Kleen:

Quoted 7 lines

How about this variant? Does it work for you?

(quoted diff) +0 -1
-Andi

Makefile line 38

Quoted 7 lines
Makefile renamed from Makefile~ +3 -1
@@ -33,7 +33,9 @@
 header-sync-n:
 
 header-sync-y:
-	make -C kernel LINUX=$(KERNELDIR) header-sync
+	make -C kernel \
+	LINUX=$(if "$(KERNELSOURCEDIR)",$(KERNELSOURCEDIR),$(KERNELDIR)) \
+	header-sync

Nope.

cborntra@cborntra:/space/kvm-userspace$ make
make -C kernel \
        LINUX= \
        header-sync
fatal: Not a git repository
make[1]: Entering directory `/space/kvm-userspace/kernel'
rm -rf header-tmp
rsync -R \
             ""/./include/linux/kvm*.h \
              \
             header-tmp/
rsync: link_stat "/include/linux/kvm*.h" failed: No such file or directory (2)
rsync error: some files could not be transferred (code 23) at main.c(1058) 
[sender=3.0.3]
make[1]: *** [header-sync] Fehler 23
make[1]: Leaving directory `/space/kvm-userspace/kernel'
make: *** [header-sync-y] Fehler 2

But

	LINUX=$(if $(KERNELSOURCEDIR),$(KERNELSOURCEDIR),$(KERNELDIR)) \

(without the " )

seems to work.

author
#4 lore raw
Quoted 6 lines

But

	LINUX=$(if $(KERNELSOURCEDIR),$(KERNELSOURCEDIR),$(KERNELDIR)) \

(without the " )

seems to work.

Ok. I've never been very good at writing Makefiles. Looks good with that too.

-Andi

Signature · 1 line
[email protected]