This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling a Linux kernel using Cygwin


On Fri, 2007-07-27 at 16:43 +0200, Claudio Scordino wrote:
> Hi all,
> 
>    I have to compile a Linux kernel using Cygwin on Windows XP (I know, it's a 
> very silly thing, but it does not depend on me, unfortunately...).
> 
> I already have a gcc cross-compile toolchain for my target (arm) installed on 
> Windows.

I'm going to assume that this is a Cygwin based toolchain.  If this is
not the case, then you want to be talking about your build environment
with whoever built your toolchain, not the Cygwin mailing lists.

> I already installed gcc-core, gcc-g++, binutils, cpio, make, patch, tar, vim, 
> gettext, libintl and libncurses on cygwin (do I need something else?).

Did you install these using the Cygwin setup.exe, or did you get them
from some other source?  If you try to mix and match, say, mingw or
Microsoft Services For Unix utilities with Cygwin, you're going to run
into problems.

> Since I assume that I need symbolic links, I use an ext2 filesystem on a USB 
> PenDrive, using the ext2fsd driver for Windows.

You shouldn't need to do this - Cygwin supports symbolic links just
fine.

> However, I'm receiving a lot of errors, everywhere.
> 
> Some of them:
> 
> 1) Sometimes when compiling, I receive the error "cannot mv file A to B: invalid 
> request code".
> 
> However, the system allows me to manually copy file A on B and then remove file 
> A (which is almost the same thing, so I wonder why the mv command does not work).

I suspect this is a symptom of using the ext2fsd and the PenDrive.  As I
mentioned, you shouldn't need to do this - Cygwin will handle symbolic
links perfectly well.

For cross-compiling a kernel, though, you may want to use a managed
mount; this will help you avoid some file name case-sensitivity issues
that crop up in the kernel source code (ex, the netfiler code uses file
names that differ only in case).  Read up on managed mounts in the the
Cygwin FAQ:

  http://cygwin.com/faq/faq.using.html

Short instructions for using a managed mount

  1. Create a new, empty directory:
     $ mkdir -p /usr/src/kernel

  2. Mount it as a managed directory:
     $ mount -o managed c:/cygwin/usr/src/kernel /usr/src/kernel

  3. Change into the managed mount directory:
     $ cd /usr/src/kernel

  4. Extract the kernel source in the managed mount directory:
     $ tar -xzf <path-to-kernel-src-archive>

> 2) I'm not able of doing a "make menuconfig" even using the host gcc.
> 
> The system does not find ncurses libraries. But I've installed them!

IIRC, you'll need to patch menuconfig to build properly under Cygwin...
though the problems that I can remember dealt with libintl, not with
ncurses.

What errors do you see when you do "make menuconfig"?

> Does anybody know how to solve these problems ?

Possibly :-)  We will probably need a bit more information (as I've
asked for above) in order to help you, though.

> More general question: did anybody build succesfully a Linux kernel under cygwin?

I used to work for a company (http://www.timesys.com) that did (and
still does) support cross-compiling Linux under Cygwin.  So yes, it is
indeed possible - and, frankly, not all that difficult, either.

-Samrobb



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]