Re: Why we need redhat_lsb_trigger.c in redhat-lsb package?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux