Package: linux-kernel-headers Version: 2.6.12+0rc5-1 Severity: wishlist The attached patch adds powerpc64 biarch support to l-k-h. Bastian -- Yes, it is written. Good shall always destroy evil. -- Sirah the Yang, "The Omega Glory", stardate unknown
diff -u linux-kernel-headers-2.6.12+0rc5/debian/changelog linux-kernel-headers-2.6.12+0rc5/debian/changelog
--- linux-kernel-headers-2.6.12+0rc5/debian/changelog
+++ linux-kernel-headers-2.6.12+0rc5/debian/changelog
@@ -1,3 +1,9 @@
+linux-kernel-headers (2.6.12+0rc5-1.0powerpc64.1) local; urgency=low
+
+ * Add powerpc64 support.
+
+ -- Bastian Blank <waldi@debian.org> Sat, 11 Jun 2005 09:56:56 +0200
+
linux-kernel-headers (2.6.12+0rc5-1) experimental; urgency=low
* GOTO Masanori <gotom@debian.org>
diff -u linux-kernel-headers-2.6.12+0rc5/debian/generate-asm.sh linux-kernel-headers-2.6.12+0rc5/debian/generate-asm.sh
--- linux-kernel-headers-2.6.12+0rc5/debian/generate-asm.sh
+++ linux-kernel-headers-2.6.12+0rc5/debian/generate-asm.sh
@@ -4,65 +4,85 @@
-if [ -n "$1" ]; then
- if [ ! -d "$1" ]; then
- echo "$1" does not exist, or is not a directory
- exit 1
- fi
- cd $1
-else
- cd /usr/include
+arch="$1"
+dir_in="$2"
+dir_out="$3"
+
+if [ ! -d "$dir_in" ]; then
+ echo "$dir_in" does not exist, or is not a directory
+ exit 1
fi
-if [ ! -d asm-sparc ] || [ ! -d asm-sparc64 ] ; then
- echo E: asm-sparc and asm-sparc64 must exist, or you will have problems
+case "$arch" in
+ powerpc)
+ define_biarch="__powerpc64__"
+ kernel_arch="ppc"
+ kernel_arch_biarch="ppc64"
+ ;;
+ sparc)
+ define_biarch="__arch64__"
+ kernel_arch="sparc"
+ kernel_arch_biarch="sparc64"
+ ;;
+ *)
+ echo Invalid architeture >&2
+ exit 1
+esac
+
+asm_dir="asm-$kernel_arch"
+asm_dir_biarch="asm-$kernel_arch_biarch"
+
+if [ ! -d "$dir_in/$asm_dir" ] || [ ! -d "$dir_in/$asm_dir_biarch" ] ; then
+ echo E: $asm_dir and $asm_dir_biarch must exist, or you will have problems
exit 1
fi
-rm -rf asm
-mkdir asm
+mkdir -p $dir_out/asm
+cp -a $dir_in/$asm_dir $dir_out/$asm_dir
+cp -a $dir_in/$asm_dir_biarch $dir_out/$asm_dir_biarch
+
+dirs=$((( cd "$dir_in/$asm_dir"; find . -type d ); ( cd "$dir_in/$asm_dir_biarch"; find . -type d )) | sort -u )
+files=$((( cd "$dir_in/$asm_dir"; find . -name "*.h" -type f ); ( cd "$dir_in/$asm_dir_biarch"; find . -name "*.h" -type f )) | sort -u )
-for h in `( ls asm-sparc; ls asm-sparc64 ) | grep '\.h$' | sort -u`; do
- name=`echo $h | tr a-z. A-Z_`
+for h in $dirs; do
+ mkdir -p "$dir_out/asm/$h"
+done
+
+for h in $files; do
+ name=$(echo $h | tr a-z. A-Z_)
+ file_out="$dir_out/asm/$h"
# common header
- cat > asm/$h << EOF
+ cat > $file_out << EOF
/* All asm/ files are generated and point to the corresponding
- * file in asm-sparc or asm-sparc64. To regenerate, run "generate-asm"
+ * file in $asm_dir or $asm_dir_biarch.
*/
-#ifndef __SPARCSTUB__${name}__
-#define __SPARCSTUB__${name}__
-
EOF
# common for sparc and sparc64
- if [ -f asm-sparc/$h ] && [ -f asm-sparc64/$h ]; then
- cat >> asm/$h <<EOF
-#ifdef __arch64__
-#include <asm-sparc64/$h>
+ if [ -f $dir_in/$asm_dir/$h ] && [ -f $dir_in/$asm_dir_biarch/$h ]; then
+ cat >> $file_out <<EOF
+#ifdef $define_biarch
+# include <$asm_dir_biarch/$h>
#else
-#include <asm-sparc/$h>
+# include <$asm_dir/$h>
#endif
EOF
- # sparc only
- elif [ -f asm-sparc/$h ]; then
- cat >> asm/$h <<EOF
-#ifndef __arch64__
-#include <asm-sparc/$h>
+ elif [ -f $dir_in/$asm_dir/$h ]; then
+ cat >> $file_out <<EOF
+#ifdef $define_biarch
+# error This header is not available for $kernel_arch_biarch
+#else
+# include <$asm_dir/$h>
#endif
EOF
- # sparc64 only
else
- cat >> asm/$h <<EOF
-#ifdef __arch64__
-#include <asm-sparc64/$h>
+ cat >> $file_out <<EOF
+#ifdef $define_biarch
+# include <$asm_dir_biarch/$h>
+#else
+# error This header is not available for $kernel_arch
#endif
EOF
fi
- # common footer
- cat >> asm/$h <<EOF
-
-#endif /* !__SPARCSTUB__${name}__ */
-EOF
-
done
diff -u linux-kernel-headers-2.6.12+0rc5/debian/rules linux-kernel-headers-2.6.12+0rc5/debian/rules
--- linux-kernel-headers-2.6.12+0rc5/debian/rules
+++ linux-kernel-headers-2.6.12+0rc5/debian/rules
@@ -27,17 +27,13 @@
lkh-install: stamp-lkh-install
stamp-lkh-install: build
+ rm -rf $(includedir)
install -d $(includedir)
install -d $(includedir)/linux
-ifeq ($(kernel_arch),sparc)
- # Sparc and Sparc64 have separate headers. Generate wrappers.
- cp -a include/asm-sparc $(includedir)/asm-sparc
- cp -a include/asm-sparc64 $(includedir)/asm-sparc64
- mkdir include/asm
- sh debian/generate-asm.sh $(includedir)
+ifneq (,$(findstring $(DEB_HOST_ARCH), powerpc sparc))
+ sh debian/generate-asm.sh $(DEB_HOST_ARCH) include $(includedir)
else
- rm -rf $(includedir)/asm
cp -a include/asm-$(kernel_arch) $(includedir)/asm
endif
Attachment:
signature.asc
Description: Digital signature