Why we need redhat_lsb_trigger.c in redhat-lsb package?
Niels de Vos
devos at fedoraproject.org
Wed Mar 14 09:08:32 UTC 2012
On 03/13/2012 07:04 AM, Xibo Ning wrote:
> Hi,
> Do we really need a fineness c program to make symbol link? In
> redhat-lsb.spec, we can see:
<snip>
>
> %triggerpostun -- glibc
> if [ -x /usr/sbin/redhat_lsb_trigger.%{_target_cpu} ]; then
> /usr/sbin/redhat_lsb_trigger.%{_target_cpu}
> fi
>
> And in redhat_lsb_trigger.c, the main function is as follows:
<snip>
> if (is_ia64 ())
> INTERNAL_SYSCALL (symlink, err, 2, "/emul/ia32-linux/lib/" LDSO, buf);
> else
> INTERNAL_SYSCALL (symlink, err, 2, LDSO, buf);
<snip>
> Why need we use a manually c program, not sln command? We can copy a
> copy of sln, so we can use it even when glibc is removed.
Probably the trigger can be executed at a critical time when no
libraries are available, hence the static binary. I guess sln would be
an alternative.
The best solution would probably be to replace the %triggerpostun with a
lua scriptlet, something like this (totally untested and you'll need to
add the LSB-version somewhere too):
%triggerpostun -p <lua> -- glibc
LDSO = "/usr/lib/ld.so"
LSBLDSO = "/usr/lib/ld." + LSB_VERSION + ".so"
%ifarch ia64
LDSO = "/emul/ia32-linux/lib" + LSBLDSO
%fi
posix.symlink(LDSO, LSBLDSO)
Cheers,
Niels
More information about the devel
mailing list