Menu

Building CoLinux for Linux as host

Help
antares
2010-11-24
2013-05-09
  • antares

    antares - 2010-11-24

    Hey there

    I've been sitting on this for a couple days now, and it seems I cannot get it working.
    Has anyone lately been able to compile colinux for linux as host? I have been able to do it for a windows host, however this is what I tried:

    1. invoke the configure script with the suggested values as returned by ./configure -help (only adding colinux-os=linux switch)
    2. I was using my own kernel as host kernel. I soon figured that despite what I read colinux does not download and build the guest kernel when invoking make after having guest kernel dir switch empty in configure.
    3. I then invoked build-kernel.sh from the bin directory which downloaded and built the kernel.
    4. following the building for linux section in the src/building file, I tried a blank make, which would fail because the makefile did not find the correct target.
    5. I then invoked the make.py in the bin folder. unfortunately I do not have it's output here, (I'm at work here) but I will add that once I'm at home.
    6. My host kernel was originally 2.6.36 - I am pretty sure this one would not work with CoLinux(note: location of asm/semaphore.h changed to linux/semaphore.h btw), so I downloaded 2.6.22 which according to the doc/building file was tested to work. I was not running this version, as my S-ATA controller is being unsupported in kernels before 2.6.32. However the machine I intend to use colinux on would support 2.6.22.

    Has anyone got a working linux build, can anyone help me building coLinux for Linux, or would anyone share his kernel(source) along with module for colinux and the daemons?

     
  • Henry N.

    Henry N. - 2010-11-24

    1. invoke the configure script with the suggested values as returned by ./configure -help (only adding colinux-os=linux switch)

    You need to use "./configure -target=i686-pc-linux … -hostkerneldir=…", that is what ./configure says, and that should work.
    hostkerneldir and targetkerneldir you can drop, if the viewed defaults are ok for you.

    2. I was using my own kernel as host kernel. I soon figured that despite what I read colinux does not download and build the guest kernel when invoking make after having guest kernel dir switch empty in configure.

    Without right setting under 1, you cant use "make" in base directory (where "configure" exist).

    3. I then invoked build-kernel.sh from the bin directory which downloaded and built the kernel.

    Works only with right settings on 1.
    Without the script would use any defaults, that can be wrong, and this script does only build the guest kernel, this is mostly not a problem.

    5. I then invoked the make.py in the bin folder. unfortunately I do not have it's output here

    For make.py you needs to set some more environments variables. They are described in the doc/building in section "5.3. For Linux as host". Please read src/intro, if you wants to start this (hardly) way.

    Better you should read exactly the steps under section "5.3.1 For Linux as host with different libraries (patched FLTK) in file doc/building. This way works. This uses the Makefile in main directory with some wrapper to set all environments variables for the Python scripts.

    6. My host kernel was originally 2.6.36 …

    Only the listed kernels are tested, and 2.6.22 was the las working kernel. All more recent kernels does not work - mostly fill fail with build errors, because nobody has adjusted the interface to the new kernels interface (function names, struct types and so far).

    You must have kernel 2.6.22 source and you must have the "build" directory with headers and so for this kernel on your host. Than you can build module colinux.ko for this host kernel. This step is included if you starts "make colinux" (after it was configured).

    Nobody can send you the a working module colinux.ko, because you must build it self with your kernel config from running host kernel. Last I must remember you, that coLinux only runs on 32 bit host systems (not under 64 bit).

    I suggest you: Use user mode Linux (UML) if you wish to run Linux under Linux. Or run VirtualBox, or simple mount the coLinux filesystem image as loop and run it via "chroot".

     
  • antares

    antares - 2010-11-24

    Hi henryn,

    thank you for your fast reply.

    First of all, all my further steps included either following the building document/information I gathered via Google/wiki/mailinglist. Usually I had the configure script invoked correctly.  so my steps 2 and 3 included the configure script, while both of them needed a manual build-kernel.sh invocation (as linux/cooperative.h does only exist with a patched target kernel). Still I cannot build the module for the host kernel.

    however, I am just building colinux on my machine here(it´s an old 2.0Ghz Celeron, so it will take one or two hours to get the two kernels ready) so I can provide you with some outputs properly.

    As of (6) I am aware of that, as I stated I already considered the build process not to work with a newer kernel. Given that I use an old Celeron based machine, 64bit error falls out(I do generally have some disapproval with 64bit Operating systems, don´t blame me for that).

    As of your suggestions - UML falls out for me as I would like to use some of my images with my windows XP system on the go.
    VirtualBox is ruled out because the memory of my linux host would not stand multiple instances(the system has only gotten 512 MB RAM). I chose CoLinux as my preferred solution because of its unique properties, being a high-performance, low memory-footprint solution whilst being flexible enough to serve my needs.

    Well, my target kernel just started building the modules, so it will be soon that I can provide you guys here with some output.
    have a nice evening :-)

     
  • Henry N.

    Henry N. - 2010-11-26

    Ok, includes for linux/semathore.h and asm/cooperative.h fixed.
    Please pick changes from SVN revisions 1548, 1549 and 1550.

    But this is not all. Build will fail with missing label "proc_root".

     

Log in to post a comment.