Package-Name: linux
Compile-Requires: gcc binutils make
Homepage: http://www.kernel.org/
#FIXME: partial version directory stuff
Source: ftp://ftp.nara.wide.ad.jp/pub/Linux/kernel.org/linux/kernel/v2.6/linux-(\d+(.\d+)+).tar.bz2 $1
#Source: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-(\d+(.\d+)+).tar.bz2 $1
#Source: ftp://ftp.jp.kernel.org/pub/linux/kernel/v2.6/linux-(\d+(.\d+)+).tar.bz2 $1
#Source: http://www.jp.kernel.org/pub/linux/kernel/v2.6//(linux-(\d+(\.\d+)+)\.tar\.bz2)/[\0-\377]*?linux-(\d+(.\d+)+).tar.bz2 $1
Compile-In-Place: yes
Explicit-Only: yes
Repack:
	tar xjvfp "$(SOURCE)"
	if test -d linux; then mv linux linux-"$(VERSION)"; fi
Compile:
	if test ! -f .config; then \
		echo >&2 "*** .config missing; run make *config first"; \
		exit 1; \
	fi
	rm -f /usr/src/linux
	ln -s linux-"$(VERSION)" /usr/src/linux
	rm -f /usr/include/linux /usr/include/asm /usr/include/asm-generic
	ln -s /usr/src/linux/include/{linux,asm-generic} /usr/include/
	ln -s /usr/src/linux/include/asm-i386 /usr/include/asm
	$(MAKE) oldconfig
	chmod a+r include/linux/*.h include/asm*/*.h
# redirect to /dev/null to avoid confusing progress meter
	@$(MAKE) clean &>/dev/null
# FIXME: nostdinc stuff is broken (-iprefix/-iwithprefix behavior changed in gcc 3.2)
	if grep -q '^CONFIG_MODULES' .config; then MODULES=modules; else MODULES=; fi; \
	$(MAKE) bzImage $$MODULES NOSTDINC_FLAGS="-nostdinc -iprefix `gcc -print-search-dirs | grep '^install:' | sed 's/^install: *//'` -iwithprefix include"
	$(MAKE) -C /usr/src/linux headers_install INSTALL_HDR_PATH="$(PREFIX)"
Install:
	if test -d /lib/modules/"$(VERSION)"; then \
		rm -rf /lib/modules/"$(VERSION)"/kernel; \
	fi
	if grep -q '^CONFIG_MODULES' /usr/src/linux/.config; then \
		$(MAKE) -C /usr/src/linux modules_install; \
	fi
	mv -f /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-"$(VERSION)"
	mv -f /usr/src/linux/System.map /boot/System.map-"$(VERSION)"
	cp -pf /usr/src/linux/.config /boot/config-"$(VERSION)"
	if test -x /sbin/lilo; then /sbin/lilo; fi
	$(MAKE) -C /usr/src/linux clean
	$(MAKE) instinc INC="asm asm-generic linux mtd rdma scsi sound video"
Patch: <<EOT
######## begin linux/2.6.23/cylinder-overflow-warning.diff
diff -urN ../linux-2.6.23-orig/drivers/ide/ide-disk.c drivers/ide/ide-disk.c
--- ../linux-2.6.23-orig/drivers/ide/ide-disk.c	2007-10-10 05:31:38 +0900
+++ drivers/ide/ide-disk.c	2007-11-19 14:37:46 +0900
@@ -243,6 +243,11 @@
 		cyl   = track / drive->head;
 
 		pr_debug("%s: CHS=%u/%u/%u\n", drive->name, cyl, head, sect);
+		if (cyl > 65535) {
+			printk(KERN_ERR "ide-disk WARNING: %s: cylinder"
+			       " overflow in CHS access (sector %lX,"
+			       " cyl %u)\n", drive->name, block, cyl);
+		}
 
 		hwif->OUTB(0x00, IDE_FEATURE_REG);
 		hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG);
######## end linux/2.6.23/cylinder-overflow-warning.diff
######## begin linux/2.6.23/ext2_fs-header-fix.diff
--- ../linux-2.6.23-orig/include/linux/ext2_fs.h	2007-11-17 03:14:27 +0900
+++ include/linux/ext2_fs.h	2007-12-24 10:49:34 +0900
@@ -18,6 +18,7 @@
 
 #include <linux/types.h>
 #include <linux/magic.h>
+#include <linux/fs.h>
 
 /*
  * The second extended filesystem constants/structures
######## end linux/2.6.23/ext2_fs-header-fix.diff
######## begin linux/2.6.23/header-fix-for-vmware.diff
diff -urN ../linux-2.6.23-orig/include/linux/stddef.h include/linux/stddef.h
--- ../linux-2.6.23-orig/include/linux/stddef.h	2007-10-10 05:31:38 +0900
+++ include/linux/stddef.h	2007-11-19 14:40:20 +0900
@@ -12,10 +12,12 @@
 
 #ifdef __KERNEL__
 
+#ifndef __cplusplus
 enum {
 	false	= 0,
 	true	= 1
 };
+#endif
 
 #undef offsetof
 #ifdef __compiler_offsetof
diff -urN ../linux-2.6.23-orig/include/linux/types.h include/linux/types.h
--- ../linux-2.6.23-orig/include/linux/types.h	2007-10-10 05:31:38 +0900
+++ include/linux/types.h	2007-11-19 14:40:20 +0900
@@ -33,7 +33,9 @@
 typedef __kernel_mqd_t		mqd_t;
 
 #ifdef __KERNEL__
+#ifndef __cplusplus
 typedef _Bool			bool;
+#endif
 
 typedef __kernel_uid32_t	uid_t;
 typedef __kernel_gid32_t	gid_t;
######## end linux/2.6.23/header-fix-for-vmware.diff
######## begin linux/2.6.23/ieee1394-dump-full-packet.diff
diff -urN ../linux-2.6.23-orig/drivers/ieee1394/ieee1394_core.c drivers/ieee1394/ieee1394_core.c
--- ../linux-2.6.23-orig/drivers/ieee1394/ieee1394_core.c	2007-10-10 05:31:38 +0900
+++ drivers/ieee1394/ieee1394_core.c	2007-11-19 14:41:06 +0900
@@ -635,6 +635,8 @@
 			memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size);
 
 		dump_packet("send packet local", packet->header, packet->header_size, -1);
+		if (packet->data_size)
+			dump_packet("             data", packet->data, packet->data_size, -1);
 
 		hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE);
 		hpsb_packet_received(host, data, size, 0);
@@ -650,6 +652,8 @@
 			host->speed[NODEID_TO_NODE(packet->node_id)];
 
 	dump_packet("send packet", packet->header, packet->header_size, packet->speed_code);
+	if (packet->data_size)
+		dump_packet("       data", packet->data, packet->data_size, packet->speed_code);
 
 	return host->driver->transmit_packet(host, packet);
 }
######## end linux/2.6.23/ieee1394-dump-full-packet.diff
######## begin linux/2.6.23/loop-ioctl-fix.diff
diff -urN ../linux-2.6.23-orig/include/linux/loop.h include/linux/loop.h
--- ../linux-2.6.23-orig/include/linux/loop.h	2007-10-10 05:31:38 +0900
+++ include/linux/loop.h	2007-11-19 14:42:29 +0900
@@ -10,6 +10,8 @@
  * permitted under the GNU General Public License.
  */
 
+#include <linux/ioctl.h>
+
 #define LO_NAME_SIZE	64
 #define LO_KEY_SIZE	32
 
@@ -152,12 +154,12 @@
  * IOCTL commands --- we will commandeer 0x4C ('L')
  */
 
-#define LOOP_SET_FD		0x4C00
-#define LOOP_CLR_FD		0x4C01
-#define LOOP_SET_STATUS		0x4C02
-#define LOOP_GET_STATUS		0x4C03
-#define LOOP_SET_STATUS64	0x4C04
-#define LOOP_GET_STATUS64	0x4C05
-#define LOOP_CHANGE_FD		0x4C06
+#define LOOP_SET_FD		_IO('L',0)
+#define LOOP_CLR_FD		_IO('L',1)
+#define LOOP_SET_STATUS		_IO('L',2)
+#define LOOP_GET_STATUS		_IO('L',3)
+#define LOOP_SET_STATUS64	_IO('L',4)
+#define LOOP_GET_STATUS64	_IO('L',5)
+#define LOOP_CHANGE_FD		_IO('L',6)
 
 #endif
######## end linux/2.6.23/loop-ioctl-fix.diff
######## begin linux/2.6.23/proc-fd-file-position.diff
diff -urN ../linux-2.6.23-orig/fs/proc/base.c fs/proc/base.c
--- ../linux-2.6.23-orig/fs/proc/base.c	2007-10-10 05:31:38 +0900
+++ fs/proc/base.c	2007-11-19 14:42:53 +0900
@@ -1091,7 +1091,7 @@
  * due to the way we treat inodes.
  *
  * Rewrite the inode's ownerships here because the owning task may have
- * performed a setuid(), etc.
+ * performed a setuid(), etc.  Also update file position for FD entries.
  *
  * Before the /proc/pid/status file was created the only way to read
  * the effective uid of a /process was to stat /proc/pid.  Reading
@@ -1272,12 +1272,15 @@
 	struct task_struct *task = get_proc_task(inode);
 	int fd = proc_fd(inode);
 	struct files_struct *files;
+	struct file *file;
 
 	if (task) {
 		files = get_files_struct(task);
 		if (files) {
 			rcu_read_lock();
-			if (fcheck_files(files, fd)) {
+			file = fcheck_files(files, fd);
+			if (file) {
+				inode->i_size = file->f_pos;
 				rcu_read_unlock();
 				put_files_struct(files);
 				if (task_dumpable(task)) {
@@ -1343,7 +1346,7 @@
 	put_files_struct(files);
 
 	inode->i_op = &proc_pid_link_inode_operations;
-	inode->i_size = 64;
+	inode->i_size = file->f_pos;
 	ei->op.proc_get_link = proc_fd_link;
 	dentry->d_op = &tid_fd_dentry_operations;
 	d_add(dentry, inode);
######## end linux/2.6.23/proc-fd-file-position.diff
######## begin linux/2.6.23/tdfx-allow-256-pixel-modes.diff
diff -urN ../linux-2.6.23-orig/drivers/video/tdfxfb.c drivers/video/tdfxfb.c
--- ../linux-2.6.23-orig/drivers/video/tdfxfb.c	2007-10-10 05:31:38 +0900
+++ drivers/video/tdfxfb.c	2007-11-19 14:43:19 +0900
@@ -498,7 +498,7 @@
 	var->xres = (var->xres + 15) & ~15; /* could sometimes be 8 */
 	lpitch = var->xres * ((var->bits_per_pixel + 7)>>3);
   
-	if (var->xres < 320 || var->xres > 2048) {
+	if (var->xres < 256 || var->xres > 2048) {
 		DPRINTK("width not supported: %u\n", var->xres);
 		return -EINVAL;
 	}
######## end linux/2.6.23/tdfx-allow-256-pixel-modes.diff
######## begin no tainting for license patch
diff -urN ../linux-2.6.23.8-orig/kernel/module.c kernel/module.c
--- ../linux-2.6.23.8-orig/kernel/module.c	2006-11-30 06:57:37 +0900
+++ kernel/module.c	2006-12-05 01:19:12 +0900
@@ -1407,12 +1470,14 @@
 	if (!license)
 		license = "unspecified";
 
+#if 0
 	if (!license_is_gpl_compatible(license)) {
 		if (!(tainted & TAINT_PROPRIETARY_MODULE))
 			printk(KERN_WARNING "%s: module license '%s' taints "
 				"kernel.\n", mod->name, license);
 		add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
 	}
+#endif
 }
 
 /* Parse tag=value strings from .modinfo section */
######## end no tainting for license patch
EOT
NoPatch: <<EOT
######## begin linux/2.6.23/export-pgoff_t.diff
diff -urN ../linux-2.6.23-orig/include/linux/types.h include/linux/types.h
--- ../linux-2.6.23-orig/include/linux/types.h	2007-10-10 05:31:38 +0900
+++ include/linux/types.h	2007-11-19 14:39:06 +0900
@@ -152,6 +152,8 @@
 typedef unsigned long blkcnt_t;
 #endif
 
+#endif /* __KERNEL_STRICT_NAMES */
+
 /*
  * The type of an index into the pagecache.  Use a #define so asm/types.h
  * can override it.
@@ -160,8 +162,6 @@
 #define pgoff_t unsigned long
 #endif
 
-#endif /* __KERNEL_STRICT_NAMES */
-
 /*
  * Below are truly Linux-specific types that should never collide with
  * any application/library that wants linux/types.h.
######## end linux/2.6.23/export-pgoff_t.diff
EOT

/boot/System.map*
/boot/config-*
/boot/vmlinuz-*
/lib/modules/*
/lib/modules/*/build
/lib/modules/*/kernel/
/lib/modules/*/misc
/lib/modules/*/modules.*
/lib/modules/*/pcmcia
/pkg/linux/
/usr/include/asm
/usr/include/asm-generic
/usr/include/linux
/usr/include/mtd
/usr/include/rdma
/usr/include/scsi
/usr/include/sound
/usr/include/video
/usr/src/linux
