Xbox360-ubuntu-8.10

From MythTV Official Wiki
Jump to: navigation, search

1. make a folder and get source (xpad.h, xpad.c) from sourceforge.net. Just like

  mkdir xpad
  cd xpad
  wget "http://xbox-linux.cvs.sourceforge.net/*checkout*/xbox-linux/kernel-2.6/drivers/usb/input/xpad.c"
  wget "http://xbox-linux.cvs.sourceforge.net/*checkout*/xbox-linux/kernel-2.6/drivers/usb/input/xpad.h"
  1.1 for ubuntu-8.10, you should modify xpad.c
     line 382: struct usb_xpad *xpad = dev->private;  ==> struct usb_xpad *xpad = input_get_drvdata(dev);
     line 408: struct usb_xpad *xpad = dev->private;  ==> struct usb_xpad *xpad = input_get_drvdata(dev);
     line 496: input_dev->cdev.dev = &intf->dev;      ==> input_dev->dev.parent = &intf->dev;
     line 497: input_dev->private = xpad;             ==> input_set_dvdata(input_dev, xpad);
      

2. make a file called 'Makefile'

  #
  # Makefile for the USB input drivers
  #
  #
  KERNEL_PATH?=/usr/src/linux-headers-$(shell uname -r)
  EXTRA_CFLAGS=-I$(shell pwd)
  obj-m:=xpad.o
  all:
       $(MAKE) modules -C $(KERNEL_PATH) SUBDIRS=$(shell pwd)
  install:
       cp -f xpad.ko /lib/modules/$(shell uname -r)/kernel/drivers/input/joystick

3. make a file called 'install.sh'

  #!/bin/sh
  make clean
  make
  make install
  modprobe -r xpad
  depmod -a
  modprobe -a xpad

4. set install.sh to be executed

  chmod +x install.sh

5. run ./install.sh