WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Picore-3.14.4+ ----> UINPUT / EVDEV as modules  (Read 6685 times)

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« on: September 06, 2014, 12:43:11 AM »
Hi RPI Forum.

Is there any possibility to have a working piCore, with kernel modules EVDEV and UINPUT, instead of buildin ?

My kernel 3.14.4, the EVDEV / UINPUT is buildin, and i "think" i need them as modules for a LIRC project!

I use piCore5.3.1-SSH with kernel 3.14.4, but thats not a must, other kernels will do also, just need modules EVDEV / UINPUT

Quote
.config - Linux/arm 3.14.6 Kernel Configuration
 → Device Drivers → Input device support → Miscellaneous devices

<M>   Event interface

CONFIG_INPUT_UINPUT:                                                                                                                           │ 
  │                                                                                                                                                │ 
  │ Say Y here if you want to support user level drivers for input                                                                                 │ 
  │ subsystem accessible under char device 10:223 - /dev/input/uinput.                                                                             │ 
  │                                                                                                                                                │ 
  │ To compile this driver as a module, choose M here: the                                                                                         │ 
  │ module will be called uinput.


Quote
.config - Linux/arm 3.14.6 Kernel Configuration
 → Device Drivers → Input device support

<M>   Event interface

CONFIG_INPUT_EVDEV:                                                                                                                            │ 
  │                                                                                                                                                │ 
  │ Say Y here if you want your input device events be accessible                                                                                  │ 
  │ under char device 13:64+ - /dev/input/eventX in a generic way.                                                                                 │ 
  │                                                                                                                                                │ 
  │ To compile this driver as a module, choose M here: the                                                                                         │ 
  │ module will be called evdev.


Thanx a lot here - Best regards Jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #1 on: September 06, 2014, 01:57:56 AM »
Jesper,

you can create your own custom kernel, see

http://elinux.org/Raspberry_Pi_Kernel_Compilation

It is not so complicated. You need remaster initrd also as well as to make nem kernel module tcz's with your custom kernel modules (or add them to initrd).

Are you sure it is the real problem?

Bela
« Last Edit: September 06, 2014, 02:06:02 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #2 on: September 06, 2014, 08:50:54 AM »
Hi BM.

I am not absolutly sure, the problem is EVDEV / UINPUT, which causes me problems.

Funny thing is, i had the LIRC working past, but in another piCore number (Can't remember).
Can you remember, if those two modules, used to be - yes modules before. ?

About building kernel.
I can build the kernel an modules on my ubuntu box. -Using e.g. linux-3.14.y from rpi-github, with a grabbed .config from you're kernel.
I allready did that, and changed the EVDEV / UINPUT from buildin to <M> as is :)

I have been reading a lot, about Tiny/Pi -Core, but  there are so many discussions about howto create a custom kernel.

"Normally", one just have to copy the kernel.img, and modules over to the Rpi, and then reboot. (Actually i tried a Gentoo install, and build my own kernel without problems last week!), just to see if i could make it.

Well TC/PiCore, is sort of very different, as one have to make initrd / kernel.img / modules.tcz or ??
Seems a lot i dont quite understand  :o - I wish there would be a "HOWTO" for piCore, and if i could -I surely would write one myself.

I need a guidiance, of what to do next.

1. I got kernel.img
2. I got modules.gz
3. ?
4. ??
5. ???

6.  ;)

Jesper.




Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #3 on: September 07, 2014, 12:37:53 AM »
Okay then  :)

I have now crosscompiled kernel.img, and modules.gz as instructed.

Reading through the net, with google as my right handed pal, tells me that i somehow have to make an initrd (eg. 070914.gz), which must be placed in the
/boot (dev/mmcblk0p1) partition, along with my new kernel.

1. I can understand, that initrd is a compressed image of the entire / (root) filesystem ? or plz. correct me if i am wrong!
2. How do i actually make this initrd ? - Can't find any documentation - And belive me i tried  :)

This must be my next step, and when i have figured it out, i will go further.
Help would be really appreciated.

Jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #4 on: September 07, 2014, 01:44:02 AM »
Read the remastering section in the WIKI.

First teke original working initrd and decompress. Create a temporary folder and copy old image to it.

Code: [Select]
mkdir /tmp/myinitrd
cd /tmp/myinitrd
zcat <oldimage> | cpio -i -d
rm <oldimage>

Make chenges you want then create new initrd:

Code: [Select]
cd /tmp/myinitrd
find | cpio -o -H newc | gzip -9 > ../newimage.gz

Now new initrd is ready in /tmp
« Last Edit: September 07, 2014, 01:46:37 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #5 on: September 07, 2014, 02:21:39 AM »
Cool thanks!

I did
Quote
tc@box:/tmp/myinitrd$ sudo su
root@box:/tmp/myinitrd# zcat 140601.gz | cpio -i -d
13503 blocks
root@box:/tmp/myinitrd# ls
140601.gz  dev        home       lib        mnt        proc       run        sys        usr
bin        etc        init       linuxrc    opt        root       sbin       tmp        var
root@box:/tmp/myinitrd# rm 140601.gz
root@box:/tmp/myinitrd# ls
bin      etc      init     linuxrc  opt      root     sbin     tmp      var
dev      home     lib      mnt      proc     run      sys      usr

So after reading http://wiki.tinycorelinux.net/wiki:remastering, it leaves me with the answer / quistion :

Quote
Now, the full filesystem is in /tmp/extract. Feel free to add, remove, or edit anything you like.

? i cant understand, no matter how hard i tried, what to do now ???

Jesper  :o



Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11229
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #6 on: September 07, 2014, 08:04:06 AM »
Hi lykkedk
Quote
Now, the full filesystem is in /tmp/extract. Feel free to add, remove, or edit anything you like.

? i cant understand, no matter how hard i tried, what to do now ???
Not quite sure what your question is, but, the full filesystem is now in  /tmp/myinitrd. Modules are under  /tmp/myinitrd/lib/modules/.....

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #7 on: September 07, 2014, 09:00:04 AM »
Hi.

Quote
Not quite sure what your question is, but, the full filesystem is now in  /tmp/myinitrd. Modules are under  /tmp/myinitrd/lib/modules/.....

I need to use a kernel + modules, that i have build (crosscompiled) on my ubuntubox.

What i can read, is that i now have to replace the /lib/modules inside the initrd image, i have extracted in my /tmp/myinitrd.
If i use MC, and find files, i see, that there are excatly 109 modules.ko.gz inside that.

Example :
Quote
root@box:/tmp/myinitrd# ls -all /lib/modules/3.14*/kernel/dri*/base/regmap
total 12
drwxr-xr-x    2 root     root             0 Sep  7 10:16 .
drwxr-xr-x    3 root     root             0 Sep  7 10:16 ..
-rw-r--r--    1 root     root          1384 Sep  7 10:16 regmap-i2c.ko.gz
-rw-r--r--    1 root     root          1985 Sep  7 10:16 regmap-mmio.ko.gz
-rw-r--r--    1 root     root          1609 Sep  7 10:16 regmap-spi.ko.gz

I will then have to replace all of them by hand, with my own build ones ?

Is there a way to do that automatic, or do i have to do it manually ?

Jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #8 on: September 07, 2014, 01:11:52 PM »
I will then have to replace all of them by hand, with my own build ones ?

Yes, need to replace them with you own. Also use your own alsa modules, wireless, etc. not in initrd but installed from repo.

Is there a way to do that automatic, or do i have to do it manually ?

You can script it, but better to do it manually at first time to bevame familiar with the modules. It will help for later scripting too.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #9 on: September 08, 2014, 02:05:23 AM »
Hi / morning forum.

Quote
BM wrote ::
Yes, need to replace them with you own. Also use your own alsa modules, wireless, etc. not in initrd but installed from repo.
I have now replaced the 109 .ko.gz modules inside the initrd (/tmp/myinitrd) - Actually, using MC it does not take more than 10minutes to fullfill  :)

So now i must do :

1. cd /tmp/myinitrd
    find | cpio -o -H newc | gzip -9 > ../newimage.gz

2.  And copy that to /boot  (when mounted offcause to /mnt/mmcblk0p1)

I understand, that i have to make my own alsa-modules-piCore-3.14.6+.tcz (will do that later)
So i have my newly build kernel.img which is size = 3604608 big.
I just wunder, why the original kernel image (140513.img) is size = 7062700 - Is allmost twice the size ?  ::)

3. Well i have to copy my newly build kernel to /boot
4. Edit the config.txt to the right kernel-"name".img
5. Edit the name of the new initrd in config.txt (Eg. myinit.gz)
6. Edit the size of myinit.gz in cmdline.txt (eg. initrd=0xa00000,3527553)

Am i at this point missing something (modules.dep or like ???)
-Or can i make a reboot, after i did point 1 ---> 6 or ?  :o  8)

Jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #10 on: September 08, 2014, 02:32:15 AM »
Jesper,

the 7MB size kernel is uncompressed, while the 3.6MB is a compressed kernel. You can use whatever you want. To get compressed kernel use 'make bzImage' when building the kernel.

Use depmod to create these module support files updated in initrd. However it is not a must have during tests, depmod is executed during startup and they are automatically updated based on initrs plus installed modules.

When you are ready, try it. You need a monitor connected to RPi to see messages if it goes wrong.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #11 on: September 08, 2014, 07:51:02 AM »
Thanks for supporting  :)

While moving along, i started all over, with a freshly build NG-Cross compiler (As poposed in another picore thread)
-My machine is just done compiling modules right now.

I have the following files, after "make"

-rw-rw-r--  1 jesper jesper   3595664 Sep  8 15:25 kernel.img <--- This is created with the ./imagetool-uncompressed.py ../../linux/arch/arm/boot/zImage command

-rwxrwxr-x  1 jesper jesper   7003468 Sep  8 15:12 Image <--- From /arch/arm/boot
-rwxrwxr-x  1 jesper jesper   9385599 Sep  8 15:12 vmlinux <--- Lies in / (root folder)
-rwxrwxr-x  1 jesper jesper   3562896 Sep  8 15:12 zImage <--- From /arch/arm/boot

1. Can i use both 3595664 Sep  8 15:25 kernel.img, or 3562896 Sep  8 15:12 zImage ?

I also have a folder modules now.

Inside the modules folder, there are a directory three, as usual, but all the modules are with extension .ko
The extensions on my RPI in the initrd is .ko.gz

2. So i assume, its okay to do a gzip -r kernel (When cd in directore linux-3.14.y/lib...bla.../piCore-3.14.6/
If i do, all newly build modules will have the .ko.gz extension.

Jesper.



Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #12 on: September 08, 2014, 11:00:54 AM »
Well. /Thanks Bela'  :)

I did what i thought was right, and actually made my new kernel boot  8)

-There is a hole story here in between, about moving modules, renaming dir's etc...

My kernel name is 3.14.6-piCore, and ofcause there is a hole lot of startup problems :

Quote
[   28.292041] snd: version magic '3.14.4-piCore+ preempt mod_unload ARMv6 p2v8 ' should be '3.14.6-piCore preempt mod_unload ARMv6 p2v8 '
[   28.871983] snd: version magic '3.14.4-piCore+ preempt mod_unload ARMv6 p2v8 ' should be '3.14.6-piCore preempt mod_unload ARMv6 p2v8 '
[   28.955224] snd: version magic '3.14.4-piCore+ preempt mod_unload ARMv6 p2v8 ' should be '3.14.6-piCore preempt mod_unload ARMv6 p2v8 '
[   29.259851] snd: version magic '3.14.4-piCore+ preempt mod_unload ARMv6 p2v8 ' should be '3.14.6-piCore preempt mod_unload ARMv6 p2v8 '
[   32.869908] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   34.505684] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[   41.389132] snd: version magic '3.14.4-piCore+ preempt mod_unload ARMv6 p2v8 ' should be '3.14.6-piCore preempt mod_unload ARMv6 p2v8 '
[   41.411394] lirc_dev: version magic '3.14.4-piCore+ preempt mod_unload ARMv6 p2v8 ' should be '3.14.6-piCore preempt mod_unload ARMv6 p2v8 '
[   41.431027] lirc_dev: version magic '3.14.4-piCore+ preempt mod_unload ARMv6 p2v8 ' should be '3.14.6-piCore preempt mod_unload ARMv6 p2v8 '

Most important is that i now have EVDEV / UINPUT as modules :

root@box:/tmp# lsmod
Module                  Size  Used by    Not tainted
uinput                  6520  0
evdev                  10163  0
regmap_i2c              1518  0
regmap_spi              1786  0
regmap_mmio             2669  0
root@box:/tmp#


What to do next, is to make new .tcz extensions for what i need.

Or maybee figure out, if i can "reuse" some extensions from 3.14.4 repo. ???

Jesper.

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #13 on: September 08, 2014, 10:02:27 PM »
Hi Forum.

Any chance, that kernel 3.14.4, src. files, could be uploaded into :
Will build 3.14.4, instead of 3.14.6, to avoid remastering .tcz's  :)

Quote
Index of /5.x/armv6/releases/src/kernel/
Name    Last time modified    Size
../    04-Jan-2014 18:59    -
piCore-3.12.7+-kernel-modules.tar.xz    12-Jan-2014 11:17    8.5M
piCore-3.12.7+-kernel-src.tar.xz    12-Jan-2014 11:07    76.9M
piCore-3.12.7+.config    12-Mar-2014 12:14    97.9K
piCore-3.13.3+-kernel-modules.tar.xz    02-Mar-2014 10:02    10.3M
piCore-3.13.3+-kernel-src.tar.xz    02-Mar-2014 11:43    786.3M
piCore-3.13.3+.config    12-Mar-2014 12:16    99.4K
piCore-3.13.6+-kernel-modules.tar.xz    12-Mar-2014 08:27    8.7M
piCore-3.13.6+-kernel-src.tar.xz    12-Mar-2014 09:51    787.5M
piCore-3.13.6+.config    12-Mar-2014 12:19    100.0K

Jesper

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Picore-3.14.4+ ----> UINPUT / EVDEV as modules
« Reply #14 on: September 08, 2014, 10:56:00 PM »
For testing your new kernel no need to rebuild tcz's. You can add modules to initrd or to put all modules not in base to a single tcz. It is ok to see wether these modules solve your original issue or not. If we can confirm, I will move them to modules in 6.0 kernel.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."