Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Genkernel fails to compile on PIII
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
somnius
n00b
n00b


Joined: 07 Apr 2016
Posts: 6

PostPosted: Thu Apr 07, 2016 2:56 am    Post subject: [SOLVED] Genkernel fails to compile on PIII Reply with quote

Hi everyone!
I have had Gentoo running on a system since 2007 with no issues (never updated). Following a need to install some new software I had to resort to a newer installation.

Might be useful to know that the previous working Gentoo installation on the same machine had the following outputs:
Code:
xxxx@Zeus ~ $ cat /etc/gentoo-release
Gentoo Base System release 1.12.9

xxxx@Zeus ~ $ uname -a
Linux Zeus 2.6.19-gentoo-r5 #1 SMP Wed Apr 4 05:44:43 UTC 2007 i686 Pentium III (Katmai) GenuineIntel GNU/Linux




I'm following the steps of the Handbook for x86 with the genkernel option, but it is not being able to compile.

The last lines of the output after running "genkernel all" is as follows:
Code:
*kernel/bounds.c:1:0: error: CPU you selected does not support x86-64 instruction set
* /*
* ^
*Kbuild:43: recipe for target 'kernel/bounds.s' failed
*make[1]: *** [kernel/bounds.s] Error 1
*Makefile:990: recipe for target 'prepare0' failed
*make: *** [prepare0] Error 2
*--
* Running with options: all
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86/modules_load ..
*
* ERROR: Failed to compile the "prepare" target...



Some more useful info:
Code:
(chroot) livecd / # eselect kernel list
Available kernel symlink targets:
  [1]   linux-4.1.15-gentoo-r1 *


Code:
(chroot) livecd / # cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 7
model name      : Pentium III (Katmai)
stepping        : 3
microcode       : 0xa
cpu MHz         : 547.580
cache size      : 512 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pse36 mmx fxsr sse
bugs            :
bogomips        : 1095.16
clflush size    : 32
cache_alignment : 32
address sizes   : 36 bits physical, 32 bits virtual
power management:


Code:

(chroot) livecd / # emerge --info
Portage 2.2.26 (python 2.7.10-final-0, default/linux/x86/13.0, gcc-4.9.3, glibc-2.21-r2, 4.1.15-gentoo-r1 i686)
=================================================================
System uname: Linux-4.1.15-gentoo-r1-i686-Pentium_III_-Katmai-with-gentoo-2.2
KiB Mem:      317972 total,     98228 free
KiB Swap:    1048572 total,    981392 free
Timestamp of repository gentoo: Tue, 05 Apr 2016 00:45:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
...


Following a suggestion in another thread in the forum for a similar case I ran genkernel with the --menuconfig flag. I excluded the "64-bit kernel" option (which was marked with a * by default, meaning "built-in") and continued to compilation, but it gets stuck at the following output:
Code:
(chroot) livecd / # genkernel --menuconfig all
* Gentoo Linux Genkernel; Version 3.4.52.3
* Running with options: --menuconfig all

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86/modules_load ..

* Linux Kernel 4.1.15-gentoo-r1 for x86...
* .. with config file /usr/share/genkernel/arch/x86/generated-config
* kernel: Using config from /usr/share/genkernel/arch/x86/generated-config
*         Previous config backed up to .config--2016-04-06--20-46-46.bak
* kernel: >> Running mrproper...
*         >> Running oldconfig...
* kernel: >> Cleaning...
* kernel: >> Invoking menuconfig...
*         >> Compiling 4.1.15-gentoo-r1 bzImage...


Nothing happens after above mentioned line...

Any help will be much appreciated.

Thanks in advance!


Last edited by somnius on Sun Apr 17, 2016 3:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 515
Location: Italia

PostPosted: Thu Apr 07, 2016 7:03 am    Post subject: Reply with quote

The rest of the kernel parameters are ok?
Have you compiled the kernel with essential parameters, or have you only excluded "64-bit kernel" option and keep the other options of genkernel?
Back to top
View user's profile Send private message
somnius
n00b
n00b


Joined: 07 Apr 2016
Posts: 6

PostPosted: Thu Apr 07, 2016 11:19 am    Post subject: Reply with quote

Hello Maxxx

The only option I have changed from the default ones is the one mentioned: "64-bit kernel". The rest are default values. I am not familiar with most of them, so I didn't want to tweak around. Actually not being familiar with compiling options and flags is the main reason I chose genkernel. Otherwise I would have gone by manual compilation, but it will take me days to learn and check about the flags.

By the way, in case someone asks himself if it is a matter of time and patience...I left the console open all night and it is still stuck at the same point mentioned above.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Thu Apr 07, 2016 11:35 am    Post subject: Reply with quote

P3 is not 64 bit.
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Thu Apr 07, 2016 1:14 pm    Post subject: Reply with quote

The first error shows that gcc is trying to generate 64-bt code. Can you compile anything at all?
Code:
$ gcc -dumpmachine
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 515
Location: Italia

PostPosted: Thu Apr 07, 2016 1:19 pm    Post subject: Reply with quote

But he has removed 64-bit code.
Now, when genkernel compile without 64-bit code, it blocked.
It could be another problem of kernel configuration.
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Thu Apr 07, 2016 1:36 pm    Post subject: Reply with quote

Possibly, but both genkernel and linux src check the ARCH. The mention of 64 is on compiling bound.c.
Back to top
View user's profile Send private message
somnius
n00b
n00b


Joined: 07 Apr 2016
Posts: 6

PostPosted: Thu Apr 07, 2016 9:45 pm    Post subject: Reply with quote

Thanks for all your answers.
After almost 16 hours running, there is some activity. The genkernel command I ran yesterday night (disabling "64-bit kernel" in menuconfig) is still running. I guess I'll have to wait and see. At least, this is the farthest I have got so far. It might be promising.

Code:

(chroot) livecd / # genkernel --menuconfig all
* Gentoo Linux Genkernel; Version 3.4.52.3
* Running with options: --menuconfig all

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86/modules_load ..

* Linux Kernel 4.1.15-gentoo-r1 for x86...
* .. with config file /usr/share/genkernel/arch/x86/generated-config
* kernel: Using config from /usr/share/genkernel/arch/x86/generated-config
*         Previous config backed up to .config--2016-04-06--20-46-46.bak
* kernel: >> Running mrproper...
*         >> Running oldconfig...
* kernel: >> Cleaning...
* kernel: >> Invoking menuconfig...
*         >> Compiling 4.1.15-gentoo-r1 bzImage...
*         >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y...
*         >> Compiling 4.1.15-gentoo-r1 modules...
*         >> Generating module dependency data...
* Copying config for successful build to /etc/kernels/kernel-config-x86-4.1.15-gentoo-r1
* busybox: >> Applying patches...
*           - 1.18.1-openvt.diff
*           - busybox-1.20.1-mdstart.patch
*           - busybox-1.20.2-bunzip2.patch
*           - busybox-1.20.2-glibc-sys-resource.patch
*           - busybox-1.20.2-modprobe.patch
*           - busybox-1.7.4-signal-hack.patch
* busybox: >> Configuring...
* busybox: >> Compiling...
* busybox: >> Copying to cache...
* initramfs: >> Initializing...
*         >> Appending base_layout cpio data...
*         >> Appending auxilary cpio data...
*         >> Copying keymaps
*         >> Appending busybox cpio data...
*         >> Appending modules cpio data...
*         >> Appending blkid cpio data...
*         >> Appending modprobed cpio data...
*         >> Appending linker cpio data...
*         >> Finalizing cpio...
*         >> Compressing cpio data (.xz)...


I'll comment if there is anything new.
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 515
Location: Italia

PostPosted: Fri Apr 08, 2016 7:08 am    Post subject: Reply with quote

Ok, there are steps that it had to do... but in a very long time.
My pc (an old pc of the year 2006), to compile the kernel it took at max 2,5 hours.
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7972
Location: ~Brussels - Belgique

PostPosted: Fri Apr 08, 2016 7:19 am    Post subject: Reply with quote

If you have an other Gentoo instance, you can use distcc to help the compilation ;)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
somnius
n00b
n00b


Joined: 07 Apr 2016
Posts: 6

PostPosted: Sun Apr 10, 2016 1:47 pm    Post subject: Reply with quote

Well, I'm back.
After waiting for several hours system was still stuck at "Compressing cpio data (.xz)".
I cancelled the process and restarted the machine, and started all the process over, this time with manual kernel compilation. It happens that I get stuck at the very same spot.
As can be seen in the top command output, xz has been running for 8:50 hours.

Code:
top - 10:39:13 up 1 day, 16:58,  7 users,  load average: 1.25, 1.64, 1.70
Tasks:  96 total,   1 running,  95 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.7 us,  2.3 sy,  0.0 ni,  0.0 id, 96.4 wa,  0.0 hi,  0.7 si,  0.0 st
KiB Mem :   317972 total,     4560 free,   290664 used,    22748 buff/cache
KiB Swap:  1048572 total,   767600 free,   280972 used.     9936 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
23388 root      20   0  693492 277312    212 D  2.0 87.2   8:52.92 xz
23994 root      20   0    3396   2204   1876 R  0.7  0.7   0:00.29 top


CPU usage is almost null, while memory usage is almost full. I guess it's a matter of memory shortage, but the swap seems to be big enough. And I have set CFLAGS as suggested in the Handbook for low-memory systems, i.e. remove -pipe flag.

Code:

livecd ~ # cat /mnt/gentoo/etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=native"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="bindist"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
# As indicated in Gentoo Handbook:x86 Full Installation
MAKEOPTS="-j2"


Any clues on what I could do?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43175
Location: 56N 3W

PostPosted: Sun Apr 10, 2016 2:28 pm    Post subject: Reply with quote

somnius,

You CPU is mostly waiting ...
Code:
%Cpu(s):  0.7 us,  2.3 sy,  0.0 ni,  0.0 id, 96.4 wa,  0.0 hi,  0.7 si,  0.0 st
96.4% waiting in fact.

xz is either decompressing something before the build or compressing documentation.

From your
Code:
*         >> Finalizing cpio...
*         >> Compressing cpio data (.xz)..
I'm guessing its compressing the initrd, which is that last stage before installing it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
somnius
n00b
n00b


Joined: 07 Apr 2016
Posts: 6

PostPosted: Sun Apr 10, 2016 2:53 pm    Post subject: Reply with quote

Hi NeddySeagoon

Thanks for your reply.
What confuses me is that top says:

Code:
Tasks:  96 total,   1 running,  95 sleeping,   0 stopped,   0 zombie


The signle running task should be actually top, right? I think xz is sleeping.

Code:

livecd ~ # cat /proc/23388/task/23388/status
Name:   xz
State:  D (disk sleep)
Tgid:   23388
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43175
Location: 56N 3W

PostPosted: Sun Apr 10, 2016 4:36 pm    Post subject: Reply with quote

somnius,

Your console (probabbly bash) is your one running task. xz is probably waiting for swap.
Top wakes up every 5 seconds for a few milliseconds. It will appear every now and again.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Sun Apr 10, 2016 5:45 pm    Post subject: Reply with quote

Pentium III! How much memory do you have?

When you get the generic kernel done, I can pastebin my K6-3 kernel and you try that as an alternate. A lot of stuff you don't need is removed. But that's for later.

The compression takes a lot of time. And these old slow low-memory machines are slow to build. "emerge -e world" takes for days on my machine. A second modern machine running distcc will do 90% of the work. I don't think it works for the kernel. I made a separate 32-bit partition on a 64-bit machine to build kernels at 3.2GHz instead of 450MHz. And 8G memory instead of .5G

But you CAN get there. I updated an old installion which, although difficult, is maybe better than fresh installation, although the majority opinion is not with me.

Four days. You must be patient.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Apr 10, 2016 5:47 pm    Post subject: Reply with quote

Building genkernel takes time, think of all those useless modules being built. But then again, my first custom kernel build took 14 hours. TBH it was on 40 MHz i486 ...
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13830

PostPosted: Sun Apr 10, 2016 6:38 pm    Post subject: Reply with quote

Even with a modern hard disk, swap is much slower than main memory. If your actively used memory cannot all fit within RAM, you will be paging very frequently. This can cause a huge slowdown. The usual recommendation is to add more RAM, but for a machine of this age, even finding compatible RAM could be difficult, and that assumes you have spare motherboard slots in which to put it. You may be able to change to a different compression algorithm that is less memory intensive, but you will likely pay for that in decreased compression, increased CPU runtime, or both. In your case, with the huge penalty caused by excessive swapping, I think the tradeoff would be worth it.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43175
Location: 56N 3W

PostPosted: Sun Apr 10, 2016 6:40 pm    Post subject: Reply with quote

somnius,

You don't actually need an initrd to boot unless you are doing something out of the ordinary. On a P3, you shouldn't be.

With a hand rolled kernel, you don't need to build all the user space things that go into the initrd. You don't compress the initrd and as Buffoon says you don't build almost every module known to Linus. This saves a lot of build time.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Tue Apr 12, 2016 6:08 pm    Post subject: Reply with quote

I've run Gentoo on PIII Thinkpad 23s for quite a while; even with 512MB of RAM
you should be ok. However, if it's started swapping, all bets are off - swapping
is horrendously slow at least on these machines with their elderly PATA drives.

(The thing that cripples the T23 is its lack of video memory - you can't really
run much after Ubuntu 10.04 or Gentoo circa 2012. Nor do they generally
have built-in wireless. But they are very, very nice machines.)

Will
Back to top
View user's profile Send private message
somnius
n00b
n00b


Joined: 07 Apr 2016
Posts: 6

PostPosted: Sun Apr 17, 2016 3:03 pm    Post subject: Reply with quote

Hi Everyone

Thanks for your kind answers and suggestions.
I finally decided to let it run, as I was not in a rush. After a hole WEEK of processing, the task finished successfully and now the Kernel is compiled.
So, it turns out, it was indeed a matter of memory shortage and SWAP being horrendously slow as cwr mentioned.
I have found some lost RAM modules. I'll check if they work in my system.
For the record, current system parameters are:

Model name: Pentium III (Katmai)
Architecture: i686
Cpu freq: 548 MHz
RAM: 318MB
SWAP: 1GB

Thanks again to everyone. I'll mark the thread SOLVED.

Kind regards!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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