LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 06-01-2007, 04:27 PM   #1
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
If I were to recompile & arch-optimize Slackware, where to begin?


So, the thread title pretty much addresses the scenario; now I have 2 questions:

1 - What to re-recompile? EVERY last binary/every drop of code on my system? Or perhaps, everything in /bin /usr/bin /sbin and X and KDE? Or what-all?

2 - Is there an efficient way of going about this? This is going to take forEVER!!

Thanks!

PS - I'm on dialup-- and it's SLOW.
 
Old 06-01-2007, 04:29 PM   #2
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Well, if you have the Slackware install DVD or CDs 3-6, you'll have the source code for all the programs in Slackware. And, what's even cooler, is that every one of them (AFAIK) has a *.SlackBuild. Now that makes it quite easy to compile each one from source. Yeah, it'll take a while tho.
 
Old 06-01-2007, 04:34 PM   #3
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
One more thing: Why do you want to do this ?

It won't help as much as you think it will. Try compiling some large programs from source with whatever CFLAGS you think are best. Typically, if it's a game, I've gotten a 1-5 FPS difference. Really, considering the accuracy of the measurements ... this is negligible. Now the theory is, if you recompile everything, the speed gained in each will sum up to render everything much faster ... well it will be faster ... but negligibly so
 
Old 06-01-2007, 05:18 PM   #4
Crooksey
LQ Newbie
 
Registered: Mar 2006
Distribution: Gentoo
Posts: 25

Rep: Reputation: 15
Is your system that slow that you need to re-compile all of your packages?

If so, why are you using KDE and if your system is that slow then surely re-compiling all the packages will take a very long time.
 
Old 06-01-2007, 06:02 PM   #5
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
@ TexmeX - Yup, I do have the DVD, and it DOES have all the source and SlackBuilds to my delight, and that is exactly what I've been doing: adjusting the build scripts and sometimes the makefiles, and compiling it that way.

@ Crooksey - Why? Because I can . And no, my system is quite zippy as a matter of fact, @ 2.4 Ghz running Slackware; I just want to see how much zippier it can be with a fully optimized OS built on it, for it. I like trying to go for the utmost in performance, so running an i386-generic build on a i686 machine is not in line with this goal.
I prefer KDE over the others I have tried. And it runs perfectly fast.. Just not quite fast enough.
Again -- because I can, and I have the time, and I see the opportunity to learn a thing or two.. Also, as my kernel is already (long ago now) tuned to my CPU/Architecture, how better to take advantage of that than to run a matching system around it?

Thanks H_TeXMeX_H <__ Hey did I get that right finally?
 
Old 06-01-2007, 07:06 PM   #6
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
To make it faster, maybe you could write some master script for changing the SlackBuild scripts and then building them sequentially, then let it run for a couple days.
 
Old 06-01-2007, 08:23 PM   #7
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
@ Crooksey - Why? Because I can
Lol - you go for it girl !! As H_TeXMeX_H says - putting some prior planning to the time management of this should pay dividends. I've just been compiling parts of KDE in one terminal and watching "top" in another to see how processes and memory are used by the make process/compilation. Interesting stuff. The compiler appears to spawn more than one process as it goes. Maybe I should get out more !! Good luck with your project.
 
Old 06-01-2007, 08:31 PM   #8
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
@ bgeddy - me too, maybe I should get out more too!
Thank you for the encouragement, and to you both for the 'master-script' idea. That is a good one indeed, and I bet it's pretty simple; when I get so that I need a break from this I may just start that.
I'll admit, parsing, editing and re-saving files is not within my abilities yet, but I know enough pieces of the process to probably put that together. Thing is, some packages require more than edits of the build script, ie: I need to edit (multiple sometimes) Makefiles on occasion.

One thing I have been avoiding as yet, is dealing with glib/glibc/glib2 and GCC itself-- I understand that BIG problems can arise if/when trying to upgrade or re-install these things, and I'm not sure yet how to go about that.

For now, on with the show
Thanks fellas!
 
Old 06-02-2007, 01:20 AM   #9
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
glibc is about the only package where it can be semi-hazardous to upgrade on a running system. But, then again, Pat makes his glibc package, via doinst.sh, able to upgrade on a running system by way of deftly staging/moving stuff around during the install. Anything else isn't a problem to upgrade.

The master script idea is a good one. I'd do a find for loop or something similar to execute each script. Defining your CFLAGS in a ~/.bashrc file takes care of 99% of all packages being optimized. Alltho, you'd probably wan't to do a find/sed command to change the arch in all SlackBuilds since that's where they are supposed to be defined.

It'll take awhile either way, I'm sure.
 
Old 06-02-2007, 06:19 AM   #10
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
I recently rebuilt a basic system on top of a running system. Basically you need to create a statically-compiled toolchain and begin by compiling or configuring the kernel sources for the version you want to base on.
Then you compile glibc with the same toolchain.
Then compile binutils linking against the new libs.
Then compile the new compiler linking against the new libs and using the new binutils.
Then compile new libtermcap, bash, zlib, popt, gzip, gettext, sed, util-linux, make, awk, ncurses, readline, e2fs, bin, util-linux and so on. The order can be a little different but is extremely important. Once you get the above list working and system booting with those bins and libs, you can insure even better binary compatibility by recompiling it all under itself before proceeding with the rest of the packages.
Of course programs which depend on certain libraries should be compiled with the newly-compiled libraries installed first. A good way to find out the dependencies for every program and library on your system is to use slackdeptrack. The ouput should help you get things in the right order.
The approach outlined is pretty simplistic and won't work for creating a cross-compiled system where there is no binary compatibility between the running system and the new progs and libs. Most new Slackware versions are created with a similar approach -even simpler since they don't use a static toolchain.
Hopefully, this should give you an idea of the general strategy of creating a system from scratch, without going over the top of your head or mine either. A true cross-compiled system is considerably more complex and some programs must be recompiled several(3-5) times.
 
Old 06-02-2007, 06:43 AM   #11
erklaerbaer
Member
 
Registered: Mar 2006
Posts: 381

Rep: Reputation: 30
why not do the obvious?

read http://www.linuxfromscratch.org/
 
Old 06-02-2007, 07:55 AM   #12
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,807

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by GrapefruiTgirl
I just want to see how much zippier it can be with a fully optimized OS built on it, for it.
Probably nowhere near what you expect.

That said, Slackware makes a good choice for an experiment like this, since it comes with all the source code and build scripts.
Quote:
Originally Posted by GrapefruiTgirl
I like trying to go for the utmost in performance
Are you sure you're not a Gentoo user...?
 
Old 06-02-2007, 11:14 AM   #13
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
gnashley - your contribution(s) are always most helpful, and once again, you've hit the nail right on the head.
As is often the case, I dove in head first despite being unsure about a few things, and even though all is going well, I might have to take a step backwards: I should have started with a fresh statically compiled toolchain I guess! And I would like to 'upgrade' my running system rather than actually 'create a new OS aside from it'.
I'll have to look into the details of making a new toolchain first (after finding out exactly what a toolchain is comprised of) and go from there.
A few points:
1 - I'll go with the 2.6.20 kernel I am running now; I like it. Just need to get the headers.
2 - I'd like to use the latest stable glibc and GCC.
3 - I'm not cross-compiling.

I downloaded the text version of the first LFS stable book, and will likely find loads of good stuff in there, hopefully a concise list and order-of-construction of the things you mention above: the toolchain, the kernel, glibc, binutils, and the rest of the gadgets...

I also downloaded 'slackdeptrack' and it's pretty outdated and unmaintained, but maybe it will give me some useful basic info about the dependencies, indicating where the 'top' is and what trickles down from there.

@ erlaerbaer - thank you for pointing me towards LFS maybe when I'm done, I'll call it "Scratchware", it seems LFS is right up my alley, but I am now IMO a dedicated Slacker, so I hope I can adapt the principles of LFS to re-making my own Slack system.

@ rkelsen - perhaps 'not what I might expect' but then, I don't know what to expect really, except to have learned from my experience, and be happy in knowing 'I did it' -- It's something of the "I think, therefore I am.." argument; my system isn't slow, but I'll be happy to know I have built it from the ground up and that it is working as best as I can make it. Hard to believe a person like me (and surely MANY others) have remained complacent for so long by running that 'other' OS -- this is just so much cooler!
Finally, I 'did' try Gentoo a few times, though hardly gave it the 'full college try'. I have a Gentoo here on CD, and may try it out again and again, but so far, I'm just not attracted to it (the crowd chanting 'Slack--er!!...Slack--er!!....Slack--er!!')

Thanks everyone -- I'll be in touch!
 
Old 06-02-2007, 12:15 PM   #14
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Quote:
Originally Posted by GrapefruiTgirl
maybe when I'm done, I'll call it "Scratchware", it seems LFS is right up my alley, but I am now IMO a dedicated Slacker, so I hope I can adapt the principles of LFS to re-making my own Slack system.
I've been doing the same thing for quite a few years now, if you'll notice my sig... http://www.jaguarlinux.com/

It is much more rewarding than running a pre-compiled distro, tho I still dual boot with Slackware... I happen to prefer DIY linux over LFS tho... It ussually always results in a better system, plus it's package manager friendly whereas the LFS devs are insanely opposed to a package manager and scripting in general (following the discussion of modular X was quite entertaining to say the least). Even so much as mention the words package manager, script or even CFLAGS on the mailing lists and you'll see some very anti-social behavior. That same ridgid thinking can still be seen in the LFS book today... No thanks... But, it is a good starting point for people just getting into it...

Have fun with it and change some stuff around, otherwise your just running an i686 slackware...
 
Old 06-02-2007, 04:09 PM   #15
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
I highly recommend jong357's system for the most thorough rebuild. My notes are meant to give the broad overview which is usally lacking in discussions about re-compiling.
This method can work if you have enough statically-compiled tools to keep running as you install over existing files or bootstarp from an otherwise empty partition.
A toolcahin consists of of a compiler and binutils which are linked to the target glibc version. But you also need bash, sed, awk, make, tar, gzip and many of the util-linux tools. Most of these can be covered by using a statically-compiled busybox (except make).
You say you are not cross-compiling, but if you are upgrading to a major version of glibc you may encounter the some of the same problems. If your shell and other existing dynamically-linked tools will not run under the new libs then you have to do a lot of special linking using LD_LIBRARY_PATH and changing which binaries are being used by adjusting the PATH several times and/or using chroot.

jong357's documentation probably will give you a clearer idea of the concepts than the LinuxFromScratch docs.
BTW jong357, my recent releases of the src2pkg package-building software include easy compytibility with jaguarlinux desc files and can be used to bootstrap your system from sources and scripts on the network.
 
  


Reply

Tags
slackware from scratch


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
When does the next Slackware developement cycle begin? Old_Fogie Slackware 3 11-05-2006 05:58 AM
How to Optimize Slackware 10.2? zeroz52 Slackware 23 10-04-2005 07:42 PM
which SRPMs to recompile to optimize? Tomasfuego Fedora 2 12-28-2004 11:14 PM
optimize for size -- disk io & mem Ikebo Linux - General 2 12-11-2004 05:37 PM
How to fully optimize Slackware? Introx Slackware 4 05-30-2004 05:23 AM


All times are GMT -5. The time now is 11:42 AM.

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