Author: alexander
Date: 2007-09-20 23:47:45 -0600 (Thu, 20 Sep 2007)
New Revision: 2066

Added:
   trunk/packages/linux64/debian-style-headers.sh
Modified:
   trunk/packages/linux/Makefile
   trunk/packages/linux/debian-style-headers.sh
   trunk/packages/linux64/Makefile
Log:
Removed installation of kernel source parts (aka debian-style headers)
irrelevant to the target platform.

Added installation of debian-style headers for x86_64 build.


Modified: trunk/packages/linux/Makefile
===================================================================
--- trunk/packages/linux/Makefile       2007-09-17 12:43:01 UTC (rev 2065)
+++ trunk/packages/linux/Makefile       2007-09-21 05:47:45 UTC (rev 2066)
@@ -108,8 +108,9 @@
            make BINDIR=/usr/bin MANDIR=/usr/share/man KERNELPATH=`pwd`/.. 
DESTDIR=`pwd`/DESTDIR-tools install-tools ; \
            cd DESTDIR-modules ; tar zcvf ../../$(DIR8)-kernel-$(VRS).tgz . ; 
cd .. ; \
            cd DESTDIR-tools ; tar zcvf ../../$(DIR8)-tools.tgz .
+       rm -rf $(DIR2) $(DIR3) $(DIR4) $(DIR5) $(DIR6) $(DIR7) $(DIR8) $(DIR9)
+       cd .. ; ./debian-style-headers.sh $(DIR)
        mv *.tgz /drivers
-       cd .. ; ./debian-style-headers.sh $(DIR)
 
 clean:
        -rm -rf $(DIR)

Modified: trunk/packages/linux/debian-style-headers.sh
===================================================================
--- trunk/packages/linux/debian-style-headers.sh        2007-09-17 12:43:01 UTC 
(rev 2065)
+++ trunk/packages/linux/debian-style-headers.sh        2007-09-21 05:47:45 UTC 
(rev 2066)
@@ -1,25 +1,31 @@
 #!/bin/sh
 
-SRCDIR="$1"
-KVERSION=`grep UTS_RELEASE "$SRCDIR/include/linux/utsrelease.h" | cut -d '"' 
-f 2`
+cd "$1"
+
+KVERSION=`grep UTS_RELEASE include/linux/utsrelease.h | cut -d '"' -f 2`
 DSTDIR=/usr/src/linux-$KVERSION
 
-echo $SRCDIR $DSTDIR
-
 rm -rf "$DSTDIR"
 mkdir "$DSTDIR"
-cp -rv "$SRCDIR/.config" "$SRCDIR/Makefile" "$SRCDIR/Module.symvers" "$DSTDIR"
-cp -rv "$SRCDIR/.kconfig.d" "$SRCDIR/.version" "$SRCDIR/.kernelrelease" 
"$DSTDIR"
-cp -rv "$SRCDIR/include" "$SRCDIR/scripts" "$DSTDIR"
-( cd "$SRCDIR" ; find -type d ) | (
-       while read dir ; do
-           mkdir -p "$DSTDIR/$dir"
-       done )
-( cd "$SRCDIR" ; find -type f -a '(' -name Kconfig\* \
-    -o -name Makefile\* -o -name \*.s ')' ) | (
-       cd "$SRCDIR"
+cp -r .config Makefile Module.symvers .kconfig.d .version .kernelrelease 
scripts "$DSTDIR"
+mkdir -p "$DSTDIR/include"
+find include -maxdepth 1 | grep -v asm- | xargs '-I{}' cp -r '{}' 
"$DSTDIR/include"
+cp -r include/asm-{i386,x86_64,generic} "$DSTDIR/include"
+find . -type f -a '(' -name Kconfig\* \
+    -o -name Makefile\* -o -name \*.s ')' | (
        while read file ; do
-           cp -v "$file" "$DSTDIR/$file"
+           case "$file" in
+               
./arch/i386*|./include/asm-generic*|./include/asm-i386*|./include/asm-x86_64*)
+                   mkdir -p "$DSTDIR/`dirname $file`"
+                   cp "$file" "$DSTDIR/$file"
+                   ;;
+               ./arch/*|./include/asm-*)
+                   ;;
+               *)
+                   mkdir -p "$DSTDIR/`dirname $file`"
+                   cp "$file" "$DSTDIR/$file"
+                   ;;
+           esac
        done )
 ln -nsf "$DSTDIR" "/lib/modules/$KVERSION/source"
 ln -nsf "$DSTDIR" "/lib/modules/$KVERSION/build"

Modified: trunk/packages/linux64/Makefile
===================================================================
--- trunk/packages/linux64/Makefile     2007-09-17 12:43:01 UTC (rev 2065)
+++ trunk/packages/linux64/Makefile     2007-09-21 05:47:45 UTC (rev 2066)
@@ -134,9 +134,12 @@
            cd DESTDIR-modules ; tar zcvf ../../$(DIR8)-kernel-$(VRS).tgz . ; 
cd .. ; \
            cd DESTDIR-tools ; tar zcvf ../../$(DIR8)-tools.tgz .
        cp -v arch/x86_64/boot/bzImage /boot/isolinux/linux
+       rm -rf $(DIR2) $(DIR3) $(DIR4) $(DIR5) $(DIR6) $(DIR7) $(DIR8) $(DIR9)
+       cd .. ; ./debian-style-headers.sh $(DIR)
 endif
        mv *.tgz /drivers
 
+
 clean:
        -rm -rf $(DIR)
        -rm -f fakes-for-fglrx/{uname,cat}

Added: trunk/packages/linux64/debian-style-headers.sh
===================================================================
--- trunk/packages/linux64/debian-style-headers.sh                              
(rev 0)
+++ trunk/packages/linux64/debian-style-headers.sh      2007-09-21 05:47:45 UTC 
(rev 2066)
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+cd "$1"
+
+KVERSION=`grep UTS_RELEASE include/linux/utsrelease.h | cut -d '"' -f 2`
+DSTDIR=/usr/src/linux-$KVERSION
+
+rm -rf "$DSTDIR"
+mkdir "$DSTDIR"
+cp -r .config Makefile Module.symvers .kconfig.d .version .kernelrelease 
scripts "$DSTDIR"
+mkdir -p "$DSTDIR/include"
+find include -maxdepth 1 | grep -v asm- | xargs '-I{}' cp -r '{}' 
"$DSTDIR/include"
+cp -r include/asm-{i386,x86_64,generic} "$DSTDIR/include"
+find . -type f -a '(' -name Kconfig\* \
+    -o -name Makefile\* -o -name \*.s ')' | (
+       while read file ; do
+           case "$file" in
+               
./arch/x86_64*|./include/asm-generic*|./include/asm-i386*|./include/asm-x86_64*)
+                   mkdir -p "$DSTDIR/`dirname $file`"
+                   cp "$file" "$DSTDIR/$file"
+                   ;;
+               ./arch/*|./include/asm-*)
+                   ;;
+               *)
+                   mkdir -p "$DSTDIR/`dirname $file`"
+                   cp "$file" "$DSTDIR/$file"
+                   ;;
+           esac
+       done )
+ln -nsf "$DSTDIR" "/lib/modules/$KVERSION/source"
+ln -nsf "$DSTDIR" "/lib/modules/$KVERSION/build"


Property changes on: trunk/packages/linux64/debian-style-headers.sh
___________________________________________________________________
Name: svn:executable
   + *

-- 
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to