diff -ur bollocks-1.2/bollocks.h bollocks-1.3/bollocks.h --- bollocks-1.2/bollocks.h 2003-10-09 06:11:20.000000000 -0400 +++ bollocks-1.3/bollocks.h 2007-10-26 13:13:39.000000000 -0400 @@ -18,3 +18,5 @@ char sent; char bollocks[BOLLOCKS_SIZE]; } balls_t; + +size_t mkbollocks(char *to,size_t size); diff -ur bollocks-1.2/bollocks_init.c bollocks-1.3/bollocks_init.c --- bollocks-1.2/bollocks_init.c 2003-10-09 06:18:18.000000000 -0400 +++ bollocks-1.3/bollocks_init.c 2007-10-26 13:01:05.000000000 -0400 @@ -33,7 +33,7 @@ #include "bollocks.h" int bollocks_major=BOLLOCKS_MAJOR; -MODULE_PARM(bollocks_major,"i"); +module_param(bollocks_major, int, 0444); MODULE_AUTHOR("Veghead"); MODULE_LICENSE("GPL"); @@ -55,18 +55,18 @@ }; -int init_module(void) +int bollocks_init(void) { int res; res=register_chrdev(bollocks_major,BOLLOCKS_NAME,&bollocks_fops); if (res<0) return(res); bollocks_major=res; - printk("bollocks.o: (c)Veghead 2001 - device %d\n",bollocks_major); + printk("bollocks.ko: (c)Veghead 2001 - device %d\n",bollocks_major); return(0); } -void cleanup_module(void) +void bollocks_exit(void) { int res; res=unregister_chrdev(bollocks_major,BOLLOCKS_NAME); @@ -76,7 +76,6 @@ static ssize_t bollocks_read(struct file *file, char * buf,size_t count, loff_t *ppos) { -size_t num; balls_t *bollocks; int toread; if (!(file->private_data)) return(0); @@ -109,7 +108,6 @@ bollocks_open(struct inode *inode, struct file *file) { balls_t *bollocks; - MOD_INC_USE_COUNT; if ((file->private_data=kmalloc(sizeof(balls_t),GFP_KERNEL))==NULL) return(-1); memset(file->private_data,'\0',BOLLOCKS_SIZE); @@ -122,10 +120,12 @@ int bollocks_release(struct inode *inode, struct file *file) { - MOD_DEC_USE_COUNT; if (file->private_data) { kfree(file->private_data); file->private_data=NULL; } return(0); } + +module_init(bollocks_init); +module_exit(bollocks_exit); Only in bollocks-1.2: bollocks_kernel26.patch diff -ur bollocks-1.2/Changelog bollocks-1.3/Changelog --- bollocks-1.2/Changelog 2001-08-21 07:34:18.000000000 -0400 +++ bollocks-1.3/Changelog 2007-10-26 13:01:38.000000000 -0400 @@ -1,3 +1,6 @@ +2007-10-27 Port to 2.6 +Probably broken. so what. + 2001-08-20 Security Fix - Really! Thanks to Matthew Clark for pointing out that kmalloc in bollocks_init.c was allocating 1024 bytes instead of 1025. diff -ur bollocks-1.2/install_bollocks bollocks-1.3/install_bollocks --- bollocks-1.2/install_bollocks 2001-02-01 04:10:18.000000000 -0500 +++ bollocks-1.3/install_bollocks 2007-10-26 12:59:48.000000000 -0400 @@ -17,7 +17,7 @@ MODULE=bollocks DEVICE=/dev/${MODULE} -/sbin/insmod -f ${MODULE}.o bollocks_major=$MAJOR || exit 1 +/sbin/insmod -f ${MODULE}.ko bollocks_major=$MAJOR || exit 1 [ -c $DEVICE ] && rm $DEVICE MAJOR=`awk '$2=="'${MODULE}'" {print $1;exit}'