Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 07-02-2011, 08:55 PM   #1
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Rep: Reputation: 138Reputation: 138
Cross-compile a kernel for Slackware from Slackware64 multilib

I have a low power netbook running Slackware 13.37 and a much faster desktop running Slackware64 13.37.

The netbook takes about 30 minutes to build a minimal Linux kernel, while the desktop can build the same kernel in only a few minutes.
So I'd like to do my kernel builds on the faster desktop.

If I went multilib on the Slackware64 desktop, would I be able to build a kernel for Slackware32?
Or is a slack32 chroot/VM my only option?

Old 07-03-2011, 05:05 AM   #2
LQ Newbie
Registered: Sep 2004
Distribution: Slackware
Posts: 17

Rep: Reputation: 7
This is amazing, but I was looking precisely for the same answer! I've got a 901 EEE-PC (ATOM 32bit) and slack 13.37 64bit in all my computers but this one (which, of course, is now running slack 13.37 32bit). So, seeing this post I decided to go ahead and try cross-compilation. After a few tries, this is how I got my 901 running a trimmed and 'tailor-made' kernel.

IMPORTANT NOTE: this worked in a multilib Slackware 64bit system. It may or may not work on pure Slackware 64 bit systems.

As root (obviously) do


and then

#make menuconfig ARCH=i386

The ARCH=1386 is important . Make sure that in the kernel's configuration menu "Executable file formats / Emulations --->" there is no option "IA32 Emulation (NEW)". This means that everything is OK. You probably know this already, but just go to "General setup --->" and fill something like "eee-pc" in "Local version - append to kernel release". This way the modules tree will not be overwritten in the host machine.

Now do (the -j 8 is optional, just to take advantage of a 4 core CPU)

#make all ARCH=i386 -j 8


#make modules_install ARCH=i386

Then just copy the image (called bzImage) in /usr/src/linux- to somewhere safe (mine goes to the USB Pen directly).

cp /usr/src/linux- /media/USB-DISK

To be sure that the image is a 32bit executable go to /usr/src/linux- and do

#file bzImage

The result should look like this (note the 'x86 boot executable')

bzImage: Linux kernel x86 boot executable bzImage, version (root@calypso) #8 SMP PREEMPT Sun Jul 3 10:33:16, RO-rootFS, root_dev 0x801, swap_dev 0x1, Normal VGA


#tar zcf eee-pc.tgz /lib/modules/

Copy that to the USB and proceed with the install. I suppose you know what to do on the Notebook!

Mine is now working flawlessly with a costumed kernel cross-compiled ina 64bit machine


Last edited by sairum; 07-03-2011 at 05:07 AM.
1 members found this post helpful.
Old 07-03-2011, 06:07 AM   #3
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Original Poster
Rep: Reputation: 138Reputation: 138
Awesome! Thanks.

I'll install the multilib packages and give it a try now.
Old 07-03-2011, 07:18 AM   #4
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Original Poster
Rep: Reputation: 138Reputation: 138
It works

I just did:
$ i386
$ uname -m # should output "i686" now
$ . /etc/profile.d/
And then built the kernel just like I normally would.


cross-compile, kernel, linux, slackware

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware64 multilib compile error Breeze Slackware 7 05-22-2011 02:56 AM
upgrading slackware64 13.1 multilib to slackware64 -current multilib Cultist Slackware 4 03-12-2011 09:04 AM
Compile SDL app in Slackware64 w Eric's Multilib installed lightkuragari Slackware 4 07-06-2010 08:54 AM
[SOLVED] Slackware64 multilib, can't compile 32-bit apps. RajahBrooke Slackware 19 06-05-2010 12:02 PM
[SOLVED] Transcode will not compile in Slackware64-13.0, Multilib TSquaredF Slackware 9 04-07-2010 10:39 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration