On Feb 5, 2006, at 12:16 PM, Dimitry Naldayev wrote:

Hi all,

I am looking for a way to build a clean production system. ie system
without development parts.

RATIONALE: I do not need binutils or gcc or something like this on my
router. (if I realy need binutils --- corect me please)

The main idea is to use the development tools from toolchain to build
needed software and do not install them in production system.

So I have a couple questions:

1) What software from LFS book are needed only at compile time and can be omitted from production system. The first canditates are binutils, gcc,
autoconf, flex, bison, what esle?

2) how to tune (or adjust) gcc and binutils in toolchain to build right
binares in end system without hardcoded dependences to toolchain? What
other parts of toolchain need to be tuned?

I had brief look at available lfs hints but have found nothing
useful/related :( what I need to read?

And... a minor quaestion: How to deal with /usr/include? I probably do not
need it on end system too...


Here's what you should do. Follow Matthew Burgess' suggestions, but also backup the toolchain so that when you NEED to build something for upgrades you will be able to compile the system. Here's what you could do, first back up all your headers! Now you can go about this a couple ways:

1) Back up the toolchain and when ya need to build, extract the archive and everything would fall back to where it was before.

2) Archive all your headers in an archive and compress it and save them somewhere. Build a new toolchain except build it so it goes into home that way when you extract the toolchain it'll always be in home, or you could keep the toolchain on another machine and build packages that way then transfer them over. You could fix the gcc source to one, either search for headers in home or always extract the kernels you backed up in /usr. Trust me, there are times on a server when you want to build a package for an upgrade.

3) Touch a file somewhere like in /var/tmp then after a while of using the system without building anything use find to compare the dates to get a list of files accessed after the date of the file in / var/tmp. Those files you might want to consider keeping on the system and removing the rest. I'd say after a month of use. Maybe even weeks if you definitely use everything you'll need with that system. If not sure, make a whole backup of the system before you delete anything! Here is a script to find out what libs are required for your binaries:

ldd $*|sed -n 's/.*=> \|(.*)\|\t\| //g;/\//p'

Throw it in a file for bash script and then you can give it a huge list of all the binaries you want or just do them all separately. ie. ./whatlibs /usr/bin/* /usr/sbin/* /bin/* /sbin/*
./whatlibs /usr/bin/grep /usr/bin/less /usr/bin/whatever

use it on libs, too

./whatlibs /usr/lib/*.so.?.?

Or do this script will just give you a file of what libs to copy. Might be helpful.

find $* -type f -name "*.so*" > /var/tmp/libs
exec 6</var/tmp/libs

while read -u 6 dta
do
ldd $dta | sed -n "s/.*=> \|(.*)\|\t\| //g;/\//p" >> /var/tmp/ needed_libs
done

exec 6<&-

sort /var/tmp/needed_libs -o /var/tmp/needed_libs_sorted
uniq /var/tmp/needed_libs_sorted /var/tmp/copy_these_libs

These are just a couple things that I think you should think through. I hope this helps some.

Sincerely,
William


--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to