LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How can I compile stuff on one computer, and move it to another? (http://www.linuxquestions.org/questions/slackware-14/how-can-i-compile-stuff-on-one-computer-and-move-it-to-another-80532/)

kleptophobiac 08-09-2003 09:05 PM

How can I compile stuff on one computer, and move it to another?
 
I want to compile kernel and kismet on a good computer, then stop at the "make install" part of both of them, then move it over onto a laptop, then install it.

What can I do to make this happen?

contrasutra 08-09-2003 09:45 PM

just make sure your compiler settings are generic enough.

For example:

march=i386 mcpu=i686.


And if both computers use the same distro, you can make a package out of the binary and transfer it that way.

Tinkster 08-09-2003 09:48 PM

I'd recommend using checkinstall for
"normal" programs ... for the kernel,
tar up the directory and copy it onto
the other machine :)

Cheers,
Tink

kleptophobiac 08-09-2003 09:52 PM

Tar up which directory? How do I make packages? This is all rather foreign to me.

I compiled the kernel just now, and neglected to do make install and make modules_install

anyway, I'm a newbie, and I'll take all the help I can get. :p

How would I pass those compiler options to kismet and pcmcia-cs?

bender647 08-10-2003 09:05 AM

The kernel should be in the top of your src directory, or if you did make
bzImage, in arch/i386/boot/bzImage. Grab the System.map and
.config from your top level too. You can package them but
since fiddling with your bootloader is usually required I'd install
them by hand.

To collect the modules, I would try making a directory
/tmp/root/lib/modules/2.4.21/ and run
make modules_install INSTALL_MOD_PATH=/tmp/root
Then cd to /tmp/root and type
makepkg ../kernel-modules-2.4.21-i386-1.tgz to make
a package. Take the package to your other machine and
do upgradepkg --reinstall kernel-modules-2.4.21-i386-1.tgz
(or just "installpkg" if you don't already have modules).

kleptophobiac 08-10-2003 10:15 PM

Quote:

Originally posted by bender647
The kernel should be in the top of your src directory, or if you did make
bzImage, in arch/i386/boot/bzImage. Grab the System.map and
.config from your top level too. You can package them but
since fiddling with your bootloader is usually required I'd install
them by hand.

To collect the modules, I would try making a directory
/tmp/root/lib/modules/2.4.21/ and run
make modules_install INSTALL_MOD_PATH=/tmp/root
Then cd to /tmp/root and type
makepkg ../kernel-modules-2.4.21-i386-1.tgz to make
a package. Take the package to your other machine and
do upgradepkg --reinstall kernel-modules-2.4.21-i386-1.tgz
(or just "installpkg" if you don't already have modules).

brilliant, thank you! Worked perfectly!

Can I do the package thing with other programs, like Kismet? Can I give it any name I want?

bender647 09-07-2003 10:08 AM

Quote:

Originally posted by kleptophobiac
brilliant, thank you! Worked perfectly!

Can I do the package thing with other programs, like Kismet? Can I give it any name I want?

Sorry for the late reply, but yes, you can package anything with
varying amounts of work. Most programs DONT have a way of
building for one prefix but installing into a second /tmp location
for packaging. Look in the Makefiles for INSTALLDIR or such.
If no library paths are coded into the executables or config files,
you can often do ./configure --prefix=/tmp/root, then make,
make install; then go to /tmp/root and make the package and
it will work. If the linker wants to look for the libraries in /tmp/root,
I'll go and make the package again with configure --prefix=/usr/local
and manually copy the changed executables into /tmp/root. This
has pitfalls too... sometimes the executables aren't linked until
you type make install. You have to get clever about it sometimes.

As for the package names, they are usually
name-version-arch-rev.tgz but you can call them anything.
No '-' allowed except in the name prefix (none in version).
You may want to make a description file too and put it in
installl/slack-desc -- take a look at the disti packages to see how
it's done.

One of the things I hated about Windows was the way you ended
up with obsolete garbage all over your filesystem. So I make an
effort to never install anything on my linux boxes without first
packaging it. Even though it more than doubles the work, it
pays off later when you want to remove something, or even just
grep /var/log/packages for a filename.
___
Ken


All times are GMT -5. The time now is 05:24 AM.