On 17.12.2012, at 15:51, Bhushan Bharat-R65777 wrote: > > >> -----Original Message----- >> From: Alexander Graf [mailto:ag...@suse.de] >> Sent: Monday, December 17, 2012 7:45 PM >> To: Bhushan Bharat-R65777 >> Cc: qemu-devel qemu-devel; qemu-...@nongnu.org List; Bhushan Bharat-R65777; >> Jan >> Kiszka; Peter Maydell >> Subject: Re: [PATCH] Added uapi directory into linux-header >> >> >> On 17.12.2012, at 05:08, Bharat Bhushan wrote: >> >>> 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.bhus...@freescale.com> >> >> Please include people who were participating in the discussion previously in >> CC >> when you post a new version. >> >>> --- >>> configure | 1 + >>> scripts/update-linux-headers.sh | 10 ++++++++++ >>> 2 files changed, 11 insertions(+), 0 deletions(-) >>> >>> diff --git a/configure b/configure >>> index 38b1cc6..51cce6b 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -3724,6 +3724,7 @@ if test "$linux" = "yes" ; then >>> # For non-KVM architectures we will not have asm headers >>> if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then >>> symlink "$source_path/linux-headers/asm-$linux_arch" >>> linux-headers/asm >>> + symlink "$source_path/linux-headers/uapi/asm-$linux_arch" >>> + linux-headers/uapi/asm >> >> This is still wrong. You want this guarded by another if [ -e ]. > > This is not wrong because .... > >> >>> fi >>> fi >>> >>> diff --git a/scripts/update-linux-headers.sh >>> b/scripts/update-linux-headers.sh index 4c7b566..d40f9c4 100755 >>> --- a/scripts/update-linux-headers.sh >>> +++ b/scripts/update-linux-headers.sh >>> @@ -46,14 +46,24 @@ for arch in $ARCHLIST; do >>> >>> make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch >>> headers_install >>> >>> + if ! [ -e "$output/linux-headers/uapi" ] ; then >>> + mkdir "$output/linux-headers/uapi" >>> + fi >> >> ... which would mean you don't need this bit. > > ... because here we ensure that the directory exists.
But that means we create a uapi directory for archs that don't have one, right? > >> >>> + >>> rm -rf "$output/linux-headers/asm-$arch" >>> mkdir -p "$output/linux-headers/asm-$arch" >>> + rm -rf "$output/linux-headers/uapi/asm-$arch" >>> + mkdir -p "$output/linux-headers/uapi/asm-$arch" >> >> Only if it exists, no? > > Above it is ensured that the directory always exists .. > >> >>> + >>> 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 "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h" >> "$output/linux-headers/uapi/asm-$arch/" >>> + fi >> >> Why is this pointing at $linux and not $tmpdir? > > Because I found that $tmpdir does not have epapr_haclls.h, though I do not > know why ? any idea why ? Smells like a kernel bug :). In fact, I remember that we used to forget uapi/asm/epapr_hcalls.h in the header list a while ago. Are you sure you're basing on the latest kvm code? Alex > >> Also, no need for $arch - be >> explicit and make it "powerpc". > > Ok. > > -Bharat > >> >> >> Alex >> >>> done >>> >>> rm -rf "$output/linux-headers/linux" >>> -- >>> 1.7.0.4 >>> >>> >> > >