iboguslavsky / pwm-sunxi-opi0

PWM driver for H2+ Sunxi SoC
15 stars 7 forks source link

Make fails #5

Open Hengy opened 6 years ago

Hengy commented 6 years ago

I know it's been a few years, however, I just tried to install this on a Orange Pi Zero on Armbian 3.4.113, and I get this error: make -C /lib/modules/3.4.113-sun8i/build/ M=/home/reflow/pwm-sunxi-opi0 modules make[1]: Entering directory '/lib/modules/3.4.113-sun8i/build' make[1]: *** No rule to make target 'modules'. Stop. make[1]: Leaving directory '/lib/modules/3.4.113-sun8i/build' Makefile:4: recipe for target 'all' failed make: *** [all] Error 2

I tried installing linux headers with apt-get install linux-headers-$(uname -r) but that didn't solve it.

I'd appreciate any help.

iboguslavsky commented 6 years ago

I think you might need the entire kernel source, not just headers...

ELDJAZAERY commented 5 years ago

@Hengy did you find a solution to your problem?

iboguslavsky commented 5 years ago

You will likely also need you kernel sources (on top of just headers) either from thekernel.org http://kernel.org network or your distributor's kernel source package.

On Sun, Jun 30, 2019 at 10:37 AM ELDJAZAERY notifications@github.com wrote:

@Hengy https://github.com/Hengy did you find a solution to your problem?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/iboguslavsky/pwm-sunxi-opi0/issues/5?email_source=notifications&email_token=AF2Z242GJ2JO7NNUOFDNMZDP5DAK7A5CNFSM4FCX5H3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4NOFQ#issuecomment-507041558, or mute the thread https://github.com/notifications/unsubscribe-auth/AF2Z24ZVKADPJK6GOMJ6533P5DAK7ANCNFSM4FCX5H3A .

ELDJAZAERY commented 5 years ago

kernel sources (on top of just headers)

Sir, I have no idea how to use the kernel and the headers to build this code, I am using orange pi one with ARMBIAN 5.83 stable Ubuntu 16.04.6 LTS 3.4.113-sun8i. if you could guide me how to do it...! I'd really appreciate your help.

joek85 commented 5 years ago

You need to compile it inside the kernel source tree, just copy the "pwm-sunxi-opi0.c" to "linux kernel source tree/drivers/pwm" then add "obj-m+=pwm-sunxi-opi0.o" to the make file inside that folder and compile the kernel, you should see the ko file in the modules directory. Hope this helps.