Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues compiling LiME for embedded Linux buildroot 4.15.7 kernel (armV71) #99

Open
mariya13-kirmani opened this issue Jan 24, 2022 · 0 comments

Comments

@mariya13-kirmani
Copy link

mariya13-kirmani commented Jan 24, 2022

I am trying to cross-compile the LiME for Linux 4.15.7 kernel, and I have cross-compiled LiME for the said kernel, but it won't recognize the kernel and the generated lime.ko.
I made some changes in the Makefile that is shown below, but the actual .ko file is not generated. Does the LiME support the 32-bit ARM architecture?

Here is the excerpt of the Makefile:
obj-m := lime.o

I added the following line to cross-compile it for the arm

export KERNEL_ROOT=$(BASE_INSTALL_DIR)/Step-3/linux-4.15.7

lime-objs := tcp.o disk.o main.o hash.o deflate.o

KVER ?= $(shell uname -r)

#KDIR ?= /lib/modules/$(KVER)/build

KDIR ?= $(KERNEL_ROOT)
PWD := $(shell pwd)
.PHONY: modules modules_install clean distclean debug

default:
$(MAKE) -C $(KDIR) M="$(PWD)" modules
strip --strip-unneeded lime.ko
mv lime.ko lime-$(KVER).ko

debug:
KCFLAGS="-DLIME_DEBUG" $(MAKE) CONFIG_DEBUG_SG=y -C $(KDIR) M="$(PWD)" modules
strip --strip-unneeded lime.ko
mv lime.ko lime-$(KVER).ko

symbols:
$(MAKE) -C $(KDIR) M="$(PWD)" modules
mv lime.ko lime-$(KVER).ko

modules: main.c disk.c tcp.c hash.c lime.h
$(MAKE) -C /lib/modules/$(KVER)/build M="$(PWD)" $@
strip --strip-unneeded lime.ko

modules_install: modules
$(MAKE) -C $(KDIR) M="$(PWD)" $@

clean:
rm -f .o .mod.c Module.symvers Module.markers modules.order ..o.cmd ..ko.cmd .*.o.d
rm -rf .tmp_versions

distclean: mrproper
mrproper: clean
rm -f *.ko


After I make the file, I get the following output:
machine2@machine2-VirtualBox:~/online/embedded-linux/Step-6/kernel_fun/LiME/src$ arm-make
make -C /home/machine2/online/embedded-linux/Step-3/linux-4.15.7 M="/home/machine2/online/embedded-linux/Step-6/kernel_fun/LiME/src" modules
make[1]: Entering directory '/home/machine2/online/embedded-linux/Step-3/linux-4.15.7'
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory '/home/machine2/online/embedded-linux/Step-3/linux-4.15.7'
strip --strip-unneeded lime.ko
strip: Unable to recognise the format of the input file `lime.ko'
Makefile:44: recipe for target 'default' failed
make: *** [default] Error 1


The lime.ko file is created:
machine2@machine2-VirtualBox:~/online/embedded-linux/Step-6/kernel_fun/LiME/src$ ls
deflate.c disk.c hash.c lime.h lime.mod.c lime.o main.o Makefile.sample Module.symvers tcp.o
deflate.o disk.o hash.o lime.ko lime.mod.o main.c Makefile modules.order tcp.c


Kindly please help me, I am new to this cross-compiling the kernel modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant