Comment 22 for bug 1892547

Revision history for this message
Witold Buczak (wbu3ak) wrote :

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mfd/lpc_ich.c

Makefile
-----------------------

KERNELRELEASE ?= $(shell uname -r)
KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build
PWD := $(shell pwd)

obj-m := lpc_ich.o

all:
 $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules

install:
 $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules_install

clean:
 $(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean

insmod:
 sudo insmod lpc_ich.ko

rmmod:
 sudo rmmod lpc_ich.ko

-----------------------

$ make
$ ls
lpc_ich.c lpc_ich.mod lpc_ich.mod.o Makefile Module.symvers
lpc_ich.ko lpc_ich.mod.c lpc_ich.o modules.order
$ sudo make install

https://www.kernel.org/doc/html/v4.18/process/applying-patches.html
https://askubuntu.com/questions/11249/correct-way-to-apply-patches-to-your-kernel

GNU patch command

$ patch --version
GNU patch 2.7.6
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Larry Wall and Paul Eggert

https://lore.kernel.org/patchwork/patch/736648/