[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Compiling User-Mode-Linux kernel



On Thursday 04 January 2007 05:13, Mattia Dongili wrote:
> On Wed, Jan 03, 2007 at 05:13:59PM -0700, Gordon Haverland 
wrote:
> > Hello.
> >
> > I've almost always compiled my own kernels, across a bunch of
> > things for quite a while (UN*X experience back to 1984, Linux
> > to 1997?).  Some shortcomings of using chroot to isolate
> > things has lead me to wanting to try UML.
> >
> > So, I did a little reading, and figured I should use the skas
> > patch that Debian has available.  Compiling a new 2.6.18
> > kernel (and nvidia module) making use of the patch went well.
> >  But, adding a --arch=um line to the make-kpkg command line
> > to compile a UML kernel has generated a few errors.  I've
> > manually patched
>
> the UML kernel can't share the same .config as the host kernel,
> I suppose a curious combination of CONFIG_ options can generate
> the errors you're reporting.
> So basically here's a few hints:
>
> - When building the UML kernel start with a "defconfig"[1] and
> then add options ontop of it.
>
> - Try the user-mode-linux package, rootstrap and friends, they
> should ease things to get started.
>
> [1]: make defconfig ARCH=um (I don't remember how to obtain the
> same with make-kpkg)

I can see lots of mention of the defconfig file, but no mention 
anywhere as to what it is about.  By name, I would guess some 
kind of default config file.  Anyway, the make-kpkg command line 
I am now trying is:

PATCH_THE_KERNEL=AUTO 
make-kpkg --revision=newmain.2 --config=defconfig --arch=um --arch_in_name 
kernel_image

Since I am not patching anything the PATH_THE_KERNEL=AUTO 
environment variable setting really shouldn't do anything (it 
came from the compile line I used for a host kernel with skas 
(yes, I seen it was recommended NOT to uset he skas patch)).

I am still getting errors in trying to compile things.  Editing 
the make output, ...

This is kernel package version 10.065.
/usr/bin/make    ARCH=um \
                             vmlinux
make[1]: Entering directory `/usr/src/linux-source-2.6.18'
  SYMLINK arch/um/include/kern_constants.h
  SYMLINK arch/um/include/sysdep
make[2]: `arch/um/sys-i386/user-offsets.s' is up to date.
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CC      arch/um/kernel/asm-offsets.s
In file included from include/asm/smp.h:17,
                 from include/linux/smp.h:18,
                 from include/linux/sched.h:63,
                 from arch/um/include/sysdep/kernel-offsets.h:2,
                 from arch/um/kernel/asm-offsets.c:1:
include/asm/mpspec.h:6:25: error: mach_mpspec.h: No such file or 
directory
In file included from include/asm/smp.h:17,
                 from include/linux/smp.h:18,
                 from include/linux/sched.h:63,
                 from arch/um/include/sysdep/kernel-offsets.h:2,
                 from arch/um/kernel/asm-offsets.c:1:
include/asm/mpspec.h:8: error: 'MAX_MP_BUSSES' undeclared here 
(not in a function)
include/asm/mpspec.h:22: error: 'MAX_IRQ_SOURCES' undeclared here 
(not in a function)
In file included from include/linux/smp.h:18,
                 from include/linux/sched.h:63,
                 from arch/um/include/sysdep/kernel-offsets.h:2,
                 from arch/um/kernel/asm-offsets.c:1:
include/asm/smp.h:76:26: error: mach_apicdef.h: No such file or 
directory
In file included from include/linux/smp.h:18,
                 from include/linux/sched.h:63,
                 from arch/um/include/sysdep/kernel-offsets.h:2,
                 from arch/um/kernel/asm-offsets.c:1:
include/asm/smp.h: In function 'hard_smp_processor_id':
include/asm/smp.h:80: warning: implicit declaration of 
function 'GET_APIC_ID'
In file included from arch/um/kernel/asm-offsets.c:1:
arch/um/include/sysdep/kernel-offsets.h: In function 'foo':
arch/um/include/sysdep/kernel-offsets.h:20: error: 'struct 
thread_struct' has no member named 'arch'
In file included from arch/um/include/sysdep/kernel-offsets.h:25,
                 from arch/um/kernel/asm-offsets.c:1:
arch/um/include/common-offsets.h:3: error: 'struct thread_struct' 
has no member named 'regs'

I am guessing that there is some kind of missing symlink from 
comments others have had with mach_mpspec.h.

I'll continue to plug away at this (waiting for drywall compound 
to dry) for a while, but if someone has a pointer, I would be 
glad to see it.  :-)

Gord



Reply to: