• # .

    Posté par . En réponse au message creer son propre module. Évalué à 1.

    La derniere fois que j'ai essayé, ce truc là fonctionnait :




    $ cat Makefile


    MODULE_SRC=$(shell pwd)
    KERNEL_REL=$(shell uname -r)
    KERNEL_PATH=/lib/modules/$(KERNEL_REL)/build
    KERNEL_INSTALL=/lib/modules/$(KERNEL_REL)
    CC=gcc

    all: mymodule

    mymodule:
    make -C $(KERNEL_PATH) SUBDIRS=$(MODULE_SRC) modules

    install:
    mkdir -p $(KERNEL_INSTALL)/misc
    cp lboc.ko $(KERNEL_INSTALL)/misc
    /sbin/depmod -a

    showconf:
    @echo $(KERNEL_PATH)
    @echo $(MODULE_SRC)

    obj-m := lboc.o

    clean:
    rm -rf *.o \
    rm -rf *.ko \
    rm -f lboc.mod.c \
    rm -f Modules.symvers

    mrproper: clean
    rm -rf *~


    Et si tu veux le .c et le .h qui vont avec, va voir :
    http://pastebin.com/824852
    http://pastebin.com/824853

    Ca compile un module qui permet de tracer les ouvertures de fichiers depuis le boot. Ca me servait a generer des listes pour readahead. "chez moi ça marche" mais je garantis rien.