delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/27/11:20:31

X-Spam-Check-By: sourceware.org
Subject: Re: Compiling a Linux kernel using Cygwin
From: Samuel Robb <sam AT oneparticularharbor DOT net>
To: cygwin AT cygwin DOT com
In-Reply-To: <46AA047E.3060902@gmail.com>
References: <46AA047E DOT 3060902 AT gmail DOT com>
Date: Fri, 27 Jul 2007 11:20:08 -0400
Message-Id: <1185549608.25687.40.camel@samuelr.hq.netapp.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019