Patchwork [v2] Added uapi directory into linux-header

login
register
mail settings
Submitter Bharat Bhushan
Date Dec. 17, 2012, 4:01 p.m.
Message ID <1355760067-12087-1-git-send-email-bharat.bhushan@freescale.com>
Download mbox | patch
Permalink /patch/206908/
State New
Headers show

Comments

Bharat Bhushan - Dec. 17, 2012, 4:01 p.m.
Linux ARCH specific header files are now in uapi/ directory also.
These header files (epapr_hcalls.h on powerpc) are needed in qemu
in linux-headers/uapi/asm/ directory as these are referenced by
other header files in linux-headers/asm/.

This patch is about changing the scripts for same.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
v2:
 - remove symlink on distclean
 - review comments on v1

 Makefile                        |    1 +
 configure                       |    4 ++++
 scripts/update-linux-headers.sh |   12 ++++++++++++
 3 files changed, 17 insertions(+), 0 deletions(-)

Patch

diff --git a/Makefile b/Makefile
index 9ecbcbb..ed320ea 100644
--- a/Makefile
+++ b/Makefile
@@ -282,6 +282,7 @@  distclean: clean
 	rm -f qemu-doc.vr
 	rm -f config.log
 	rm -f linux-headers/asm
+	rm -f linux-headers/uapi/asm
 	rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
 	for d in $(TARGET_DIRS) $(QEMULIBS); do \
 	rm -rf $$d || exit 1 ; \
diff --git a/configure b/configure
index 38b1cc6..4c11e3d 100755
--- a/configure
+++ b/configure
@@ -3725,6 +3725,10 @@  if test "$linux" = "yes" ; then
     if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
       symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
     fi
+    if [ -e "$source_path/linux-headers/uapi/asm-$linux_arch" ]; then
+      symlink "$source_path/linux-headers/uapi/asm-$linux_arch" linux-headers/uapi/asm
+    fi
+
 fi
 
 for target in $target_list; do
diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 4c7b566..44e6cad 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -46,14 +46,26 @@  for arch in $ARCHLIST; do
 
     make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch headers_install
 
+    if [ -e "$linux/arch/$arch/include/uapi" ] &&
+        ! [ -e "$output/linux-headers/uapi" ] ; then
+        mkdir "$output/linux-headers/uapi"
+    fi
+
     rm -rf "$output/linux-headers/asm-$arch"
     mkdir -p "$output/linux-headers/asm-$arch"
+    if [ -e "$linux/arch/$arch/include/uapi/asm" ] ; then
+        rm -rf "$output/linux-headers/uapi/asm-$arch"
+        mkdir -p "$output/linux-headers/uapi/asm-$arch"
+    fi
     for header in kvm.h kvm_para.h; do
         cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
     done
     if [ $arch = x86 ]; then
         cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
     fi
+    if [ $arch = powerpc ]; then
+        cp "$tmpdir/include/asm/epapr_hcalls.h" "$output/linux-headers/uapi/asm-powerpc/"
+    fi
 done
 
 rm -rf "$output/linux-headers/linux"