Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

installing 32bit kernel from 64bit system

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
16 posts • Page 1 of 1
Author
Message
1veedo
Apprentice
Apprentice
Posts: 152
Joined: Mon Dec 19, 2005 12:16 am

installing 32bit kernel from 64bit system

  • Quote

Post by 1veedo » Fri Jun 30, 2006 7:10 pm

I want to use a 32bit version of gentoo as a way to chroot and run 32bit apps better. I know about all the "bin" stuff, firefox-bin, mplayer-bein, etc, but I still need to be abel to chroot a 32bit system.

So I've unpacked stage3-i686, portage-lattest/emerge sync/update portage, and I've downloaded and configured the kernel. The problem is when I run make && make modules_install, I get this error:

Code: Select all

  CHK     include/linux/version.h
  UPD     include/linux/version.h
  SYMLINK include/asm -> include/asm-x86_64
  SPLIT   include/linux/autoconf.h -> include/config/*
  CC      arch/x86_64/kernel/asm-offsets.s
arch/x86_64/kernel/asm-offsets.c:1: error: code model `kernel' not supported in the 32 bit mode
arch/x86_64/kernel/asm-offsets.c:1: sorry, unimplemented: 64-bit mode not compiled in
make[1]: *** [arch/x86_64/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
I havn't mounted proc/dev or anything, I'm just in the chroot and I want to build the kernel. I don't see why this is a problem cause I should have 32bit gcc and everything, right?
Top
Kaddy
n00b
n00b
Posts: 29
Joined: Thu Jan 27, 2005 2:43 pm
Contact:
Contact Kaddy
Website

  • Quote

Post by Kaddy » Fri Jun 30, 2006 7:19 pm

I think that to get that to work, you are going to have to specify the ACRH type in the kernel when you are building it.
I am not sure that that will work 100% but I know that I had some problems like that before.
Try this:

Code: Select all

make ARCH=i386 menuconfig && make ARCH=i386 && make ARCH=i386 modules_install
you just have to force the kernel to build a different arch type.
Top
1veedo
Apprentice
Apprentice
Posts: 152
Joined: Mon Dec 19, 2005 12:16 am

  • Quote

Post by 1veedo » Fri Jun 30, 2006 7:26 pm

That didn't work, either.

Code: Select all

make ARCH=i386 menuconfig && make ARCH=i386 && make ARCH=i386 modules_install
scripts/kconfig/mconf arch/i386/Kconfig
#
# using defaults found in .config
#
.config:98:warning: trying to assign nonexistent symbol X86_VSMP
.config:100:warning: trying to assign nonexistent symbol MPSC
.config:101:warning: trying to assign nonexistent symbol GENERIC_CPU
.config:102:warning: trying to assign nonexistent symbol X86_L1_CACHE_BYTES
.config:129:warning: trying to assign nonexistent symbol SWIOTLB
.config:131:warning: trying to assign nonexistent symbol X86_MCE_INTEL
.config:132:warning: trying to assign nonexistent symbol X86_MCE_AMD
.config:216:warning: trying to assign nonexistent symbol UNORDERED_IO
.config:244:warning: trying to assign nonexistent symbol IA32_AOUT
.config:245:warning: trying to assign nonexistent symbol COMPAT
.config:246:warning: trying to assign nonexistent symbol SYSVIPC_COMPAT
.config:1468:warning: trying to assign nonexistent symbol IOMMU_DEBUG


*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.

  CHK     include/linux/version.h
  SPLIT   include/linux/autoconf.h -> include/config/*
  CC      arch/i386/kernel/asm-offsets.s
In file included from include/linux/thread_info.h:20,
                 from include/linux/preempt.h:10,
                 from include/linux/spinlock.h:50,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from arch/i386/kernel/asm-offsets.c:7:
include/linux/bitops.h: In function `generic_hweight64':
include/linux/bitops.h:142: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:142: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:143: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:143: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:144: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:144: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:145: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:145: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:146: warning: integer constant is too large for "unsigned long" type
include/linux/bitops.h:146: warning: integer constant is too large for "unsigned long" type
In file included from include/linux/timex.h:61,
                 from include/linux/sched.h:11,
                 from arch/i386/kernel/asm-offsets.c:7:
include/asm/timex.h: In function `get_cycles':
include/asm/timex.h:25: warning: left shift count >= width of type
include/asm/timex.h: In function `get_cycles_sync':
include/asm/timex.h:38: warning: left shift count >= width of type
In file included from include/asm/semaphore.h:43,
                 from include/linux/sched.h:20,
                 from arch/i386/kernel/asm-offsets.c:7:
include/linux/rwsem.h:27:65: asm/rwsem.h: No such file or directory
In file included from include/asm/semaphore.h:43,
                 from include/linux/sched.h:20,
                 from arch/i386/kernel/asm-offsets.c:7:
include/linux/rwsem.h: In function `down_read':
include/linux/rwsem.h:45: warning: implicit declaration of function `__down_read'
include/linux/rwsem.h: In function `down_read_trylock':
include/linux/rwsem.h:56: warning: implicit declaration of function `__down_read_trylock'
include/linux/rwsem.h: In function `down_write':
include/linux/rwsem.h:68: warning: implicit declaration of function `__down_write'
include/linux/rwsem.h: In function `down_write_trylock':
include/linux/rwsem.h:79: warning: implicit declaration of function `__down_write_trylock'
include/linux/rwsem.h: In function `up_read':
include/linux/rwsem.h:90: warning: implicit declaration of function `__up_read'
include/linux/rwsem.h: In function `up_write':
include/linux/rwsem.h:100: warning: implicit declaration of function `__up_write'
include/linux/rwsem.h: In function `downgrade_write':
include/linux/rwsem.h:110: warning: implicit declaration of function `__downgrade_write'
In file included from arch/i386/kernel/asm-offsets.c:7:
include/linux/sched.h: At top level:
include/linux/sched.h:309: error: field `mmap_sem' has incomplete type
In file included from include/asm/suspend.h:6,
                 from include/linux/suspend.h:5,
                 from arch/i386/kernel/asm-offsets.c:10:
include/asm/desc.h: In function `_set_gate':
include/asm/desc.h:97: warning: right shift count >= width of type
include/asm/desc.h: In function `set_tssldt_descriptor':
include/asm/desc.h:137: warning: right shift count >= width of type
include/asm/desc.h: In function `set_seg_base':
include/asm/desc.h:164: warning: cast from pointer to integer of different size
include/asm/desc.h:165: warning: cast from pointer to integer of different size
arch/i386/kernel/asm-offsets.c: In function `foo':
arch/i386/kernel/asm-offsets.c:27: error: structure has no member named `eax'
arch/i386/kernel/asm-offsets.c:28: error: structure has no member named `ebx'
arch/i386/kernel/asm-offsets.c:29: error: structure has no member named `ecx'
arch/i386/kernel/asm-offsets.c:30: error: structure has no member named `edx'
arch/i386/kernel/asm-offsets.c:31: error: structure has no member named `esi'
arch/i386/kernel/asm-offsets.c:32: error: structure has no member named `edi'
arch/i386/kernel/asm-offsets.c:33: error: structure has no member named `ebp'
arch/i386/kernel/asm-offsets.c:34: error: structure has no member named `esp'
arch/i386/kernel/asm-offsets.c:35: error: structure has no member named `eip'
arch/i386/kernel/asm-offsets.c:42: error: structure has no member named `hard_math'
arch/i386/kernel/asm-offsets.c:67: error: structure has no member named `esp0'
arch/i386/kernel/asm-offsets.c:71: error: `FIX_VSYSCALL' undeclared (first use in this function)
arch/i386/kernel/asm-offsets.c:71: error: (Each undeclared identifier is reported only once
arch/i386/kernel/asm-offsets.c:71: error: for each function it appears in.)
make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
Latter I might try booting a 32bit liveCD and seeing if that works.
Top
Kaddy
n00b
n00b
Posts: 29
Joined: Thu Jan 27, 2005 2:43 pm
Contact:
Contact Kaddy
Website

  • Quote

Post by Kaddy » Fri Jun 30, 2006 7:53 pm

k, try this then

Code: Select all

make mrproper ARCH=i386 && make ARCH=i386  oldconfig && make ARCH=i386 menuconfig && make ARCH=i386 && make ARCH=i386 modules_install
that SHOULD work

if not, there is one more option
Top
Shan
Guru
Guru
User avatar
Posts: 558
Joined: Tue Nov 04, 2003 7:16 pm
Location: /dev/null

  • Quote

Post by Shan » Fri Jun 30, 2006 8:30 pm

I had similar issues trying to compile a 32bit kernel for my server on my AMD64 machine that I was using to pre-compile packages for a fresh install on the server. Everything was being done in a chroot setup for this particular 32-bit system but nothing I could do would get the kernel to compile properly; in the end I just booted the system in question with the live CD; used the other pre-compiled packages (a la a GRP setup) and built the kernel locally. I'm not even sure how it detected I was on a 64-bit system unless it pulled it from a uname -a.
{ NO -U } { STRIP }
{ TINY }
Top
Kaddy
n00b
n00b
Posts: 29
Joined: Thu Jan 27, 2005 2:43 pm
Contact:
Contact Kaddy
Website

  • Quote

Post by Kaddy » Fri Jun 30, 2006 8:37 pm

Shan, it is a make thing, not quite sure HOW it does it, only that it does
you can do the whole 'force the arch' thing
OR, if you prefer to mess around with the Makefile, there is a line that looks like this

Code: Select all

ARCH                      ?= $(SUBARCH)
take that out somehow, commenting works nice. and change it to this:

Code: Select all

ARCH                      := i386
Top
1veedo
Apprentice
Apprentice
Posts: 152
Joined: Mon Dec 19, 2005 12:16 am

  • Quote

Post by 1veedo » Fri Jun 30, 2006 8:55 pm

Man I spent all that time reconfiguring the kernel and in the end it doesn't work :x

I think it;s an error with the kernel this time though and unrelated to the 64bit problem.

Code: Select all

  /usr/src/linux-2.6.16-gentoo-r9/scripts/gen_initramfs_list.sh: Cannot open 'Y'make[1]: *** [usr/initramfs_list] Error 1
I tried turning initramfs to "n" but then it says "Cannot open 'n.'"

There's some stuff about this on google and it seems to be related to a patch. I edited the script to not "exit 1" and moved the "failsafe" it mentions down to that condition so hopefully it'll work. I'm not planning on booting this any time soon, anyway.

Code: Select all

        else
                echo "  $0: failsafe edited Cannot open '$cpio_source'" >&2
                default_initramfs
#               exit 1
        fi
It's building right now w/o any issues so hopefully everything's working. Thanks.

Oh, after running the original make stuff, you can backup .config and run

Code: Select all

make mrproper ARCH=i386 && make ARCH=i386 menuconfig && make ARCH=i386 && make ARCH=i386 modules_install
Load your .config again and you don't have to go through the text qustionare and reconfigure the kernel, you can just get back to where you were.
Top
Kaddy
n00b
n00b
Posts: 29
Joined: Thu Jan 27, 2005 2:43 pm
Contact:
Contact Kaddy
Website

  • Quote

Post by Kaddy » Fri Jun 30, 2006 9:23 pm

intramfs is a string not a boolean, you just have to comment it out and it should work for that part
also, instead of having to worry about rebuilding the kernel again and again, try this:

Code: Select all

make mrproper ARCH=i386 && make ARCH=i386 oldconfig && make ARCH=i386 && make ARCH=i386 modules_install
something like that
Top
1veedo
Apprentice
Apprentice
Posts: 152
Joined: Mon Dec 19, 2005 12:16 am

  • Quote

Post by 1veedo » Tue Jul 04, 2006 2:23 pm

Ok new question.

I'm getting some errors whilist installing firefox that have the string x86_64 all over the place.

How do you emerge stuff and make sure it's emering 32bit?

Code: Select all

xptcinvoke_x86_64_linux.cpp: In function `nsresult XPTC_InvokeByIndex(nsISupports*, PRUint32, PRUint32, nsXPTCVariant*)':
xptcinvoke_x86_64_linux.cpp:153: error: register specified for 'd0' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:153: error: register name given for non-register variable 'd0'
xptcinvoke_x86_64_linux.cpp:154: error: register specified for 'd1' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:154: error: register name given for non-register variable 'd1'
xptcinvoke_x86_64_linux.cpp:155: error: register specified for 'd2' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:155: error: register name given for non-register variable 'd2'
xptcinvoke_x86_64_linux.cpp:156: error: register specified for 'd3' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:156: error: register name given for non-register variable 'd3'
xptcinvoke_x86_64_linux.cpp:157: error: register specified for 'd4' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:157: error: register name given for non-register variable 'd4'
xptcinvoke_x86_64_linux.cpp:158: error: register specified for 'd5' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:158: error: register name given for non-register variable 'd5'
xptcinvoke_x86_64_linux.cpp:159: error: register specified for 'd6' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:159: error: register name given for non-register variable 'd6'
xptcinvoke_x86_64_linux.cpp:160: error: register specified for 'd7' isn't suitable for data type
xptcinvoke_x86_64_linux.cpp:160: error: register name given for non-register variable 'd7'
gmake[7]: *** [xptcinvoke_x86_64_linux.o] Error 1
gmake[7]: *** Waiting for unfinished jobs....
{standard input}: Assembler messages:
{standard input}:7: Error: bad register name `%rbp'
{standard input}:8: Error: bad register name `%rsp'
{standard input}:9: Error: bad register name `%rsp'
{standard input}:10: Error: bad register name `%rdi'
{standard input}:11: Error: bad register name `%rsi'
{standard input}:12: Error: bad register name `%rdx'
{standard input}:13: Error: bad register name `%rcx'
{standard input}:14: Error: bad register name `%r8'
{standard input}:15: Error: bad register name `%r9'
{standard input}:16: Error: bad register name `%rbp)'
{standard input}:17: Error: bad register name `%rbp)'
{standard input}:18: Error: bad register name `%rbp)'
{standard input}:19: Error: bad register name `%rbp)'
{standard input}:20: Error: bad register name `%rbp)'
{standard input}:21: Error: bad register name `%rbp)'
{standard input}:22: Error: bad register name `%rbp)'
{standard input}:23: Error: bad register name `%rbp)'
{standard input}:24: Error: bad register name `%rbp)'
{standard input}:25: Error: bad register name `%rbp)'
{standard input}:27: Error: bad register name `%rbp)'
gmake[7]: *** [xptcstubs_x86_64_linux.o] Error 1
gmake[7]: Leaving directory `/var/tmp/portage/mozilla-firefox-1.5.0.4/work/mozilla/xpcom/reflect/xptcall/src/md/unix'
gmake[6]: *** [libs] Error 2
gmake[6]: Leaving directory `/var/tmp/portage/mozilla-firefox-1.5.0.4/work/mozilla/xpcom/reflect/xptcall/src/md'
gmake[5]: *** [libs] Error 2
gmake[5]: Leaving directory `/var/tmp/portage/mozilla-firefox-1.5.0.4/work/mozilla/xpcom/reflect/xptcall/src'
gmake[4]: *** [libs] Error 2
gmake[4]: Leaving directory `/var/tmp/portage/mozilla-firefox-1.5.0.4/work/mozilla/xpcom/reflect/xptcall'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/var/tmp/portage/mozilla-firefox-1.5.0.4/work/mozilla/xpcom/reflect'
gmake[2]: *** [libs] Error 2
gmake[2]: Leaving directory `/var/tmp/portage/mozilla-firefox-1.5.0.4/work/mozilla/xpcom'
gmake[1]: *** [tier_2] Error 2
gmake[1]: Leaving directory `/var/tmp/portage/mozilla-firefox-1.5.0.4/work/mozilla'
make: *** [default] Error 2

!!! ERROR: www-client/mozilla-firefox-1.5.0.4 failed.
Call stack:
  ebuild.sh, line 1539:   Called dyn_compile
  ebuild.sh, line 939:   Called src_compile
  mozilla-firefox-1.5.0.4.ebuild, line 176:   Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if relevant.
This kind of scares me cause I've emerged a lot of stuff for it and I cant have half the system 64 bit...
Top
Kaddy
n00b
n00b
Posts: 29
Joined: Thu Jan 27, 2005 2:43 pm
Contact:
Contact Kaddy
Website

  • Quote

Post by Kaddy » Wed Jul 05, 2006 6:30 pm

make sure that you specify that it is a 32-bin install, once again, I think that this is an issue with 'make' itself.
what you will have to do is specify it in the package.keywords then general syntax is like this:

Code: Select all

package-group/package archtype
so, for you to do that, you'd have to then add it with a line similar to this:

Code: Select all

echo "www-client/mozilla-firefox x86" >> /etc/portage/package.keywords
something like that. It should work.
the other option is that you could just change the keyword in your make.conf file, it should look something like this:

Code: Select all

ACCEPT_KEYWORDS="x86_64"
you'd just have to change it to something like this:

Code: Select all

ACCEPT_KEYWORDS="x86"
either of those should do the trick. Keep in mind that if you change the keyword, you will have to do a emerge -e world for it to work.
Top
gaga
Apprentice
Apprentice
Posts: 288
Joined: Wed Apr 27, 2005 6:45 pm

  • Quote

Post by gaga » Thu Jul 06, 2006 9:49 am

I have the same problem to compile a 32 bit kernel for a USB stick...

new suggestion : GCC has been compiled for a 64 bit system, and now, we want to compile a 32 bit kernel.... so I think we must install GCC to be abble to compile a 32 bit software.... ( cross-compile ? )


excuse-me if I write with a lot of error, I 'm French ! I try to learn English :)
Top
Kaddy
n00b
n00b
Posts: 29
Joined: Thu Jan 27, 2005 2:43 pm
Contact:
Contact Kaddy
Website

  • Quote

Post by Kaddy » Thu Jul 06, 2006 5:48 pm

gaga, as far as I know, you just have to force the arch type for the kernel itself making sure that you add "ARCH=i386" to every command for building the kernel.
Other than that, I think that it will work.
I was just playing around with my 64-bit machine and I realised that there is IA32 emulation in the kernel as well called CONFIG_IA32_EMULATION in the kernel, you should try and build that into your host system as well.
Top
shickapooka800
Guru
Guru
User avatar
Posts: 304
Joined: Sun Dec 05, 2004 11:13 pm
Location: no

  • Quote

Post by shickapooka800 » Thu Jul 06, 2006 5:54 pm

make sure you chroot with the "setarch" utility.

Code: Select all

emerge setarch
then use this to chroot into 32bit from 64bit,

Code: Select all

linux32 chroot /path/to/chroot /bin/bash
then your uname -m will say i686 in the chroot.

and yes check your 32bit compatibility in kernel (although this was already set for me, and I did a generic install on amd64)

EDIT: check the docs -- there is a whole guide (maybe in the gentoo-wiki?) for 32bit chroot on amd64 arch.
Top
gaga
Apprentice
Apprentice
Posts: 288
Joined: Wed Apr 27, 2005 6:45 pm

  • Quote

Post by gaga » Thu Jul 06, 2006 6:36 pm

Ok, I will try to do this.

I have never use setarch to go in a chroot, and that probably the reason....

thank you
Top
gaga
Apprentice
Apprentice
Posts: 288
Joined: Wed Apr 27, 2005 6:45 pm

  • Quote

Post by gaga » Fri Jul 07, 2006 11:08 am

OK, it's good :D

( but I've a kernel panic lol )
Top
1veedo
Apprentice
Apprentice
Posts: 152
Joined: Mon Dec 19, 2005 12:16 am

  • Quote

Post by 1veedo » Fri Jul 07, 2006 4:23 pm

The firefox thing went away when I booted into gentoo.

Btw I always back up uname and tell it to echo whatever the proper kernel is. Never knew there was a program that fixed the little problem for you. That was always a big issue with slax tools cause it takes modules from /lib/modules/kernel version and you can simlink the one your chrooting from but then the liveCD looks for modules in the correct place and 404s modules.dep.
Top
Post Reply

16 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic