LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Patch Coreutils? (https://www.linuxquestions.org/questions/linux-from-scratch-13/patch-coreutils-678906/)

moonfrog 10-24-2008 07:36 PM

Patch Coreutils?
 
In SVN there's a new patch for Coreutils that replaces an old patch.
I'm a source code newbie so these may be dumb questions but...

Is there a way to install the patch to my system, and if so should the old one be removed first?

If I have to recompile Coreutils can I do it inside the running system, or should I replace the tools directory and chroot in from another Linux like when I built it?
Also, should I uninstall the original Coreutils first to get rid of the old patch?

ProtoformX 10-24-2008 11:23 PM

Well you can recompile things in a running system, but keep in mind that anything compiled against coreutils should be / has to be recompiled

moonfrog 10-25-2008 12:08 AM

Thanks ProtoformX, in one sentence you answered alot of questions I had.

Looking at the LFS build list Coreutils is near the beginning of the install order, which (to me) means that any number of packages could be compiled against it.
Plus I've already added a full KDE, Amarok, and Firefox that I'm guessing could be problems as well.

At my skill level it sounds like it would be easier to build another LFS.

jschiwal 10-25-2008 02:02 AM

I think you are confusing coreutils with binutils or glibc. Coreutils contains the core utilities such as cp, ls, mkdir, cut, cat, etc. It doesn't contain libraries or headers that you use to build other packages with. You would have a lot of work ahead of you if you updated glibc. It is at the beginning of the list because you need these programs to run scripts. Imagine trying to do without the "cp" or "mv" command.

You asked about patches but didn't provide version information. You apply patches sequenctially. If you started with version 6.09 and patched to 6.10. The more recent patch is probably from 6.10 to 6.11 instead of 6.09 to 6.11. If this is the case you would apply the 6.11 patch. There should be a README to consult. If you are starting with a 6.09 tarball, you will most likely need to apply the 6.10 patch and then the 6.11 patch.

You won't need to (or want to) uninstall the original version, but you will want to run "make distclean" in the source directory. This will remove the old object files.

ProtoformX 10-25-2008 12:31 PM

Quote:

Originally Posted by jschiwal (Post 3321465)
I think you are confusing coreutils with binutils or glibc. Coreutils contains the core utilities such as cp, ls, mkdir, cut, cat, etc. It doesn't contain libraries or headers that you use to build other packages with. You would have a lot of work ahead of you if you updated glibc. It is at the beginning of the list because you need these programs to run scripts. Imagine trying to do without the "cp" or "mv" command.


The only problem with doing that is if a newer coreutils adds or takes away any parameter switches some older software that depends on coreutils might not work anymore, this is determined at compile time of the software and probly has a work around if your version of coreutils doesn't support a certain switch, thus it is imporantant in order to insure you have a working stable environment you wouldn't recompile single package that is part of the core.

moonfrog 10-25-2008 08:15 PM

This isn't like a patch meant to be applied to an existing distro, this patch modifies coreutils before it's initial build. It also changes the LFS build version, so the patch it replaces is treated as if it never existed.

If coreutils contains cp and mkdir and I recompile from the running system wouldn't it "short circuit" during the make install?

I don't really care about the patch itself, I just thought this would be a good chance to learn how to update my LFS's. It looks like the safe way to update a package can vary wildly depending on which one, anywhere from "just do it" to "don't touch it". I think I'm trying to leap way too far forward for now.

Thanks for your responses.

ProtoformX 10-25-2008 11:36 PM

No it won't shortcircut, when linux runs a program it puts it into memory first, it will not try to run it off the disk, since cp or mkdir are already in memory nothing will happen, in any mediaplayer play a song and quickly delete the file it's playing.. you will notice something.. it plays until the very end of the song... this is because it's small enough to be cached in memory, the same thing works for small commands, you can copy a different version of cp with cp, it will over write itself without question because the cp you executing is already in memory, so when it is over written nothing happends because that command is still there.

Keep in mind you can't "make uninstall" because the makefile may use coreutils in the script, this is where package management comes into play, creating a fake root compiling the packages and installing it in a fake root fixes this problem, because now i can build the package, uninstall the old one and reinstall the new one because I have already built the new one, all i need to do is install it now.


All times are GMT -5. The time now is 06:56 PM.