View previous topic :: View next topic |
Author |
Message |
idella4 Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Sephiroth.gif)
Joined: 09 Jun 2006 Posts: 1600 Location: Australia, Perth
|
Posted: Wed Aug 06, 2008 11:05 am Post subject: kernel draws error at early stage[SOLVED] |
|
|
I've looked through some previous posts re this error and I can't find ant record of the same one.
The kernel is the 2.6.21-xen kernel. The previous posts refer to some erroneous compiling outcomes, but at least they got started and compiled an initial host kernel.
This is a brand new instance of gentoo. I've unmasked the xen sources and other apps just like many others before me, but at compiling the kernel, it lasts about 2 seconds before it aborts at an internal error. Here is the current ground it covers
Code: |
idella@HOSTNAME="Gentoo" /usr/src/linux-2.6.21-xen $ sudo make
Password:
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CHK include/linux/compile.h
dnsdomainname: Unknown host
CC init/version.o
init/version.c:39: error: expected ',' or ';' before 'Gentoo'
init/version.c:43: error: expected ',' or ';' before 'Gentoo'
make[1]: *** [init/version.o] Error 1
make: *** [init] Error 2
|
The
I barely begins before claiming a syntax error in a kernel file at /init.version.c. The above code clearly states its findings. What is going on?
The compiler is standard gentoo issue, the xen-sources unmasked as they are are standard gentoo issue, so why has this error not occured for anyone else in the identical scenario??? I cannot compile this kernel.
To begin with, the finding of the syntax error ih the file version.c seems to me to be false in the first place.
Here is the file, only 44 lines long
Code: |
/*
* linux/init/version.c
*
* Copyright (C) 1992 Theodore Ts'o
*
* May be freely distributed as part of Linux.
*/
#include <linux/compile.h>
#include <linux/module.h>
#include <linux/uts.h>
#include <linux/utsname.h>
#include <linux/utsrelease.h>
#include <linux/version.h>
#define version(a) Version_ ## a
#define version_string(a) version(a)
int version_string(LINUX_VERSION_CODE);
struct uts_namespace init_uts_ns = {
.kref = {
.refcount = ATOMIC_INIT(2),
},
.name = {
.sysname = UTS_SYSNAME,
.nodename = UTS_NODENAME,
.release = UTS_RELEASE,
.version = UTS_VERSION,
.machine = UTS_MACHINE,
.domainname = UTS_DOMAINNAME,
},
};
EXPORT_SYMBOL_GPL(init_uts_ns);
/* FIXED STRINGS! Don't touch! */
const char linux_banner[] =
"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
const char linux_proc_banner[] =
"%s version %s"
" (" LINUX_COMPILE_BY "@" ") ("LINUX_COMPILE_HOST ")"
" (" LINUX_COMPILER ") %s\n";
|
The parameter LINUX_COMPILE_HOST appears to hold the value 'Gentoo', so it's claiming to need a , or ; positioned before it, which appears nonsense. If you oblige. it just contaminates it in a different way and draws more errors.
Is it the compiler being over zealous, causing trouble where there is none?
How does one get around this? _________________ idella4@aus
Last edited by idella4 on Fri Aug 08, 2008 6:27 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
avendesora Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/145532818948a1d101a1b5b.gif)
Joined: 16 Aug 2002 Posts: 1739 Location: Betelgeuse vicinity
|
Posted: Wed Aug 06, 2008 7:55 pm Post subject: |
|
|
Something seems to be wrong with your hostname setup.
Could you post the contents of the following files:
include/linux/uts.h
include/linux/utsrelease.h
include/linux/compile.h
One of these (autogenerated files) probably has an error. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
idella4 Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Sephiroth.gif)
Joined: 09 Jun 2006 Posts: 1600 Location: Australia, Perth
|
Posted: Thu Aug 07, 2008 1:18 am Post subject: |
|
|
yep ok. Here's include/compile.h
Code: |
/* This file is auto generated, version 1 */
/* SMP */
#define UTS_MACHINE "i386"
#define UTS_VERSION "#1 SMP Wed Aug 6 16:00:56 Local time zone must be set--see zic m"
#define LINUX_COMPILE_TIME "16:00:56"
#define LINUX_COMPILE_BY "root"
#define LINUX_COMPILE_HOST "HOSTNAME="Gentoo""
#define LINUX_COMPILE_DOMAIN ""
#define LINUX_COMPILER "gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)"
|
and include/uts.h
Code: |
#ifndef _LINUX_UTS_H
#define _LINUX_UTS_H
/*
* Defines for what uname() should return
*/
#ifndef UTS_SYSNAME
#define UTS_SYSNAME "Linux"
#endif
#ifndef UTS_NODENAME
#define UTS_NODENAME "(none)" /* set by sethostname() */
#endif
#ifndef UTS_DOMAINNAME
#define UTS_DOMAINNAME "(none)" /* set by setdomainname() */
#endif
#endif
|
and include/utsrelease.h
Code: |
#define UTS_RELEASE "2.6.21-xen"
|
_________________ idella4@aus |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
avendesora Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/145532818948a1d101a1b5b.gif)
Joined: 16 Aug 2002 Posts: 1739 Location: Betelgeuse vicinity
|
Posted: Thu Aug 07, 2008 5:27 pm Post subject: |
|
|
In compile.h
Code: | #define LINUX_COMPILE_HOST "HOSTNAME="Gentoo"" |
That is wrong. Either your environment is wrong or you haven't configured your hostname
correctly. That's explained in the install guide.
You should also set your timezone properly. Fix those two things and it should
work out (maybe backup your .config and do a make clean before you recompile). |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
idella4 Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Sephiroth.gif)
Joined: 09 Jun 2006 Posts: 1600 Location: Australia, Perth
|
Posted: Fri Aug 08, 2008 6:26 am Post subject: |
|
|
ok that looks good. I've verified that you are correct by removing that offending entry from the file version.c.
It then began to correctly compile. Thanks.
I thought I had set the hostname according to the manual. There are two entry points for hostname, and I've done both, but it's obviously worth double checking.
The timezone one I don't understand. I had trouble with that before, but I do end up with the clock set to correct time.
On bootup, it reports permission denied to set up the clock at one early point, then it seems to get past it repeating the script at a later level. Oh well. _________________ idella4@aus |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
idella4 Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Sephiroth.gif)
Joined: 09 Jun 2006 Posts: 1600 Location: Australia, Perth
|
Posted: Fri Aug 08, 2008 10:08 am Post subject: |
|
|
One more entry to finish this off. It appears that this whole episode has been caused by an erroneous setting of the system's hostname. What is alarming about this is that I did it by the manual.
The manual says
Quote: |
One of the choices the user has to make is name his/her PC. This seems to be quite easy, but lots of users are having difficulties finding the appropriate name for their Linux-pc. To speed things up, know that any name you choose can be changed afterwards. For all we care, you can just call your system tux and domain homenetwork.
Code Listing 2.1: Setting the host name
# nano -w /etc/conf.d/hostname
(Set the HOSTNAME variable to your host name)
HOSTNAME="tux"
|
As best as I can figure this is the cause of the misfiring compiling of the kernel
File /init/version.c looks for defined terms for the uts version, for root, and for the hostname in the form of COMPILE_HOST (I think it was). When it goes to the system for this, it found
HOSTNAME="Gentoo". As the above quote proves, the hostname was set by the manual. It appears to be causing this trouble.
I suspect that the content of the file /etc/conf.d/hostname ought be
and nothing else. The host name of the system under this setting became
rather than plain Gentoo. The double use of the quotation [""] is I suspect what created a syntax error.
This means that the installation manual is setting up this compiling error of any kernel and needs to be CORRECTED.
Moderators please take note.
That's all from me. _________________ idella4@aus |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
avendesora Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/145532818948a1d101a1b5b.gif)
Joined: 16 Aug 2002 Posts: 1739 Location: Betelgeuse vicinity
|
Posted: Sat Aug 09, 2008 9:47 am Post subject: |
|
|
No, the manual is correct.
/etc/conf.d/hostname should contain hostname="yourhost". |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|