Le 23.12.2006, à 15:35:57, Ludovic Rousseau a écrit:
> Maybe the Debian package could contain insructions on how to build the
> applesmc kernel module for a Debian kernel? I will try to built it
> myself and comment in this bug report.

It is fact very easy to build a kernel module. I used the linux-uvc
Debian package as example for the Makefile.

$ curl 
http://svn.sourceforge.net/viewvc/*checkout*/mactel-linux/trunk/kernel/mactel-patches-2.6.18/applesmc.patch?revision=62
 -o applesmc.patch
$ patch < applesmc.patch
The patch for files linux/drivers/hwmon/Kconfig and
linux/drivers/hwmon/Makefile must be skiped.

You now have an applesmc.c file.
Note that the URL above may be update for newer versions.

Use the attached Makefile file and exacute:
$ make
$ sudo make install
$ sudo modprobe applesmc

You should have the lines (or similar):
  applesmc: Apple MacBook Pro detected:
  applesmc:  - Model with accelerometer
  applesmc:  - Model with light sensors and backlight
  applesmc:  - Model with 7 temperature sensors
  applesmc: device successfully initialized (0xe0, 0x00).
  applesmc: device successfully initialized.
  applesmc: 2 fans found.
  input: applesmc as /class/input/input7
  Registered led device: smc:kbd_backlight
  applesmc: driver successfully loaded.
in your dmesg output.

I do not think it is a good idea to provide a Debian package for such a
tiny module that should be included in a next Linux kernel.

Bye,

-- 
 Dr. Ludovic Rousseau                        [EMAIL PROTECTED]
 -- Normaliser Unix c'est comme pasteuriser le camembert, L.R. --
KERNEL_VERSION  := `uname -r`
KERNEL_DIR      := /lib/modules/$(KERNEL_VERSION)/build
INSTALL_MOD_DIR := drivers/hwmon

PWD             := $(shell pwd)

obj-m           := applesmc.o

%.o : %.c
        gcc $(TEST_CFLAGS) -c -o $@ $<

all: applesmc

applesmc:
        @echo "Building Apple SMC driver..."
        @(cd $(KERNEL_DIR) && make -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules)

install:
        @echo "Installing Apple SMC driver..."
        @(cd $(KERNEL_DIR) && make -C $(KERNEL_DIR) SUBDIRS=$(PWD) 
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install)
        depmod -ae

clean:
        -rm -f *.o *.ko .*.cmd .*.flags *.mod.c Modules.symvers
        -rm -rf .tmp_versions

Reply via email to