Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

add kernel modules, am I doing it right?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    add kernel modules, am I doing it right?

    Guys,

    I have the EM543 tablet, I installed OpenVPN, setup for TUN, I found the tun.ko for the tablet. Does the right way to install it is:

    copy the file to /system/vendor/module

    modify the init.sun5i.rc file to add an "insmod /system/vendor/modules/tun.ko" somewhere in the file.

    Is this ok?

    #2
    Re: add kernel modules, am I doing it right?

    I'm probably reading this wrong, but you are talking about replacing the files prior to compiling your kernel? I may be wrong, but to add a module, you have to compile a new kernel.

    Sent from my Polaroid 701c tablet running Cm10

    Comment


      #3
      Originally posted by Magister View Post
      I have the EM543 tablet, I installed OpenVPN, setup for TUN, I found the tun.ko for the tablet. Does the right way to install it is:

      copy the file to /system/vendor/module
      modify the init.sun5i.rc file to add an "insmod /system/vendor/modules/tun.ko" somewhere in the file.
      Is this ok?
      No. Copying the file to /system/vendor/modules is OK but any changes you make to init.sun5i.rc will disappear when you shut down. The files in the boot partition are stored in compressed format on the disk/nand, then expanded at boot time into a ram disk.

      To make permanent changes to any of those files, you have to get a copy of the boot partition image, split it into the kernel and the ramdisk file, then decompress it. There are tools to do all that - but only on Linux, not Windows. The fact that it's a real pain is why people get excited about 'init.d' support. This is really nothing more than a set of scripts stored in an /etc/init.d directory that get run during startup. They allow you to load kernel modules (among other things) without having to modify init.*.rc. Once I build a (working) CM10 ROM for the 543, you'll have init.d support (within the next few days).

      One other thing... the version info in tun.ko has to match the kernel's version - if not, it won't load. We can patch the file to make the version info match but it has to be genuinely compatible for it to do anything useful. If you can post the file, I'll see if it's OK and include it in the ROM.

      Comment


        #4
        Hi dolores, thanks for the info, so there is no way to easily modify an init script for it to do custom thing, without modifying the boot image? I know linux pretty well on the desktop so I don't fear it, I also develop on it for years If you have some pointer for the tools, please refer to them. I know about nothing about android.

        Also I took the tun.ko module from here
        Download and Install tun modules for your android phone or android tablets.


        I tested it and it works, it inserts fine and I can use OpenVPN to create a VPN between the tablet and my router (running TomatoUSB), pretty cool for privacy and security, everywhere I go I have a secure tunnel for my data.

        Comment


          #5
          Originally posted by Magister View Post
          If you have some pointer for the tools, please refer to them.
          There are a few ways you can do this:
          • pull apart the LiveSuite image, modify it, then reconstruct it
          • copy the contents of 'nandc' from the tablet, modify it, then put it back
          • use a hybrid method: get the image from LiveSuite but reapply it directly from ADB
          Getting it from LiveSuite gives you a file containing just the kernel and the ramdisk contents but requires both Windows and Linux, and it's a pain. Getting it directly from 'nandc' is easier but you get the entire 32mb partition including a lot of random junk. If the tools know where to stop reading, then this is much easier.

          There's a very good, illustrated tutorial at miniand.com for modifying the main partitions, and a zip with the tools needed to split the kernel from the ramdisk. However, the tutorial falls short on recreating a LiveSuite image: they fail to tell you what to do to recreate the bootloader partition.

          My suggestion: get the image from nandc (cat /dev/block/nandc > boot.img), then use the tools to break it up. If that works, modify it, recreate it, then reverse the process (cat new-boot.img > /dev/block/nandc). The source file will be 32mb, the final product should be about 10mb.

          Comment


            #6
            Thanks a lot! here comes my long winter hours

            Comment

            Working...
            X