----------------------------------------
> From: john_burr...@hotmail.com
> To: lfs-dev@linuxfromscratch.org
> Date: Wed, 18 Dec 2013 17:49:31 +0000
> Subject: Re: [lfs-dev] Updating the dynamic linker
>
>>>> (And you really want to "replace" them with an unlink() and copy, or copy
>>>> to a temp file and unlink()/link(), sequence.)
>>>
>>> So the sequence I should follow is:
>>>
>>> -rwxr-xr-x 1 root root 156051 Dec 11 08:40 ld-2.18.so
>>> lrwxrwxrwx 1 root root 10 Dec 11 08:40 ld-linux-x86-64.so.2 -> ld-2.18.so
>>>
>>> 1) delete ld-linux-x86-64.so.2
>>> 2) update ld-2.18.so
>>
>>No. You need to unlink *this* file, since it's mapped into several other
>>processes on the system. But this file's name is inconsistent across systems;
>>the symlink name is consistent, which is why I use it.
>>
>>Of course, you also need to restart every process that's using these files
>>after you replace them.
>>
>>It would be *far, far, FAR* safer, and much less error prone, to simply not
>>run any process that's mapping in any of the files you're replacing when you
>>replace the files. Yes, that means you can't do it from inside chroot, or
>>alternately you have to be running the binaries and libs from /tools. But if
>>you do it this way you won't have any of the problems you're having.
>
> Thanks for that - I'm clearly out of my depth here, but learning fast by my 
> mistakes.
>
> Before I decide how best to proceed with is, would you tell me please how the 
> distros update the file ld-2.18.so and the symlink ld-linux-x86-64.so.2, 
> without crashing the system. They don't appear to use a /tools dir so do they 
> tar the files into the directories?

To complete this thread I should present my understanding of how the distros 
update glibc:

1) untar the archive and cp -av the glibc libraries from the archive file to 
the location on the distro. Name the files ${filename}.incoming or some such 
unique name.

The location on the archive is /lib64 and also usually on the distro but on 
Arch Linux the files are in /usr/lib because /lib64 is a symlink.
The libraries on the archive that are cp'd are just the library files 
themselves that sit in /lib64, not the symlinks or the .a or .o files or any 
library that doesn't have a symlink, such as libc.so and libSegFault.so and 
libpthread.so and may be some others.

2) run ldconfig to remake the symlinks to the new *.incoming files.

3) delete the original library files on the distro.

4) cp the *.incoming files to the new library names on /lib64

5) run ldconfig to remake the symlinks to the new libraries

6) delete the *.incoming files.

7) the symlinks will be owned by root so adjust these if you use the package 
user system.

This is what I gleened from reading the slackware install script that akhieser 
pointed me to. I followed this scheme and it appears to work without a problem.

Any comments, additions, corrections and almost anything else are welcome, 
particularly if it makes the above more accurate or clearer or both.

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

Reply via email to