mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
meta: use ln -rs instead of lnr
lnr is a script in oe-core that creates relative symlinks, with the same behaviour as `ln --relative --symlink`. It was added back in 2014[1] as not all of the supported host distributions at the time shipped coreutils 8.16, the first release with --relative. However the oldest coreutils release in the supported distributions is now 8.22 in CentOS 7, so lnr can be deprecated and users switched to ln. [1] 6ae3b85eaffd1b0b6914422e8de7c1230723157d (From OE-Core rev: 1ca455a98de4c713f58df0a537d4c982d256cd68) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
974df2f61c
commit
c0583c6bfc
@@ -622,20 +622,20 @@ deltask do_package_write_rpm
|
||||
create_merged_usr_symlinks() {
|
||||
root="$1"
|
||||
install -d $root${base_bindir} $root${base_sbindir} $root${base_libdir}
|
||||
lnr $root${base_bindir} $root/bin
|
||||
lnr $root${base_sbindir} $root/sbin
|
||||
lnr $root${base_libdir} $root/${baselib}
|
||||
ln -rs $root${base_bindir} $root/bin
|
||||
ln -rs $root${base_sbindir} $root/sbin
|
||||
ln -rs $root${base_libdir} $root/${baselib}
|
||||
|
||||
if [ "${nonarch_base_libdir}" != "${base_libdir}" ]; then
|
||||
install -d $root${nonarch_base_libdir}
|
||||
lnr $root${nonarch_base_libdir} $root/lib
|
||||
ln -rs $root${nonarch_base_libdir} $root/lib
|
||||
fi
|
||||
|
||||
# create base links for multilibs
|
||||
multi_libdirs="${@d.getVar('MULTILIB_VARIANTS')}"
|
||||
for d in $multi_libdirs; do
|
||||
install -d $root${exec_prefix}/$d
|
||||
lnr $root${exec_prefix}/$d $root/$d
|
||||
ln -rs $root${exec_prefix}/$d $root/$d
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@@ -626,7 +626,7 @@ install_tools() {
|
||||
for script in $scripts; do
|
||||
for scriptfn in `find ${SDK_OUTPUT}/${SDKPATH}/${scriptrelpath} -maxdepth 1 -executable -name "$script"`; do
|
||||
targetscriptfn="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/$(basename $scriptfn)"
|
||||
test -e ${targetscriptfn} || lnr ${scriptfn} ${targetscriptfn}
|
||||
test -e ${targetscriptfn} || ln -rs ${scriptfn} ${targetscriptfn}
|
||||
done
|
||||
done
|
||||
# We can't use the same method as above because files in the sysroot won't exist at this point
|
||||
@@ -634,7 +634,7 @@ install_tools() {
|
||||
unfsd_path="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/unfsd"
|
||||
if [ "${SDK_INCLUDE_TOOLCHAIN}" = "1" -a ! -e $unfsd_path ] ; then
|
||||
binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TMPDIR'))}
|
||||
lnr ${SDK_OUTPUT}/${SDKPATH}/tmp/$binrelpath/unfsd $unfsd_path
|
||||
ln -rs ${SDK_OUTPUT}/${SDKPATH}/tmp/$binrelpath/unfsd $unfsd_path
|
||||
fi
|
||||
touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
|
||||
|
||||
|
||||
@@ -119,8 +119,8 @@ do_install() {
|
||||
ln -s ${@oe.path.relative('${root_prefix}/lib', '${base_libdir}')}/${ARCH_DYNAMIC_LOADER} \
|
||||
${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}
|
||||
fi
|
||||
lnr ${D}${base_libdir}/libpthread.so.0 ${D}${libdir}/libpthread.so
|
||||
lnr ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so
|
||||
ln -rs ${D}${base_libdir}/libpthread.so.0 ${D}${libdir}/libpthread.so
|
||||
ln -rs ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so
|
||||
}
|
||||
|
||||
def get_libc_fpu_setting(bb, d):
|
||||
|
||||
@@ -87,7 +87,7 @@ fakeroot do_populate_poky_src () {
|
||||
|
||||
# Load tap/tun at startup
|
||||
rm -f ${IMAGE_ROOTFS}/sbin/iptables
|
||||
lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables
|
||||
ln -rs ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables
|
||||
echo "tun" >> ${IMAGE_ROOTFS}/etc/modules
|
||||
|
||||
# Use Clearlooks GTK+ theme
|
||||
|
||||
@@ -37,7 +37,7 @@ do_install () {
|
||||
oe_runmake install 'DESTDIR=${D}'
|
||||
if [ "${SITEINFO_BITS}" = "64" ]; then
|
||||
install -d ${D}/lib64
|
||||
lnr ${D}${GLIBC_LDSO} ${D}/lib64/`basename ${GLIBC_LDSO}`
|
||||
ln -rs ${D}${GLIBC_LDSO} ${D}/lib64/`basename ${GLIBC_LDSO}`
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ do_install() {
|
||||
echo "${base_libdir}" > ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path
|
||||
echo "${libdir}" >> ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path
|
||||
rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}
|
||||
lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
|
||||
ln -rs ${D}${libdir}/libc.so ${D}${bindir}/ldd
|
||||
}
|
||||
|
||||
FILES:${PN} += "/lib/ld-musl-${MUSL_LDSO_ARCH}.so.1 ${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path"
|
||||
|
||||
@@ -242,10 +242,10 @@ do_install() {
|
||||
mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir}
|
||||
rm ${D}${libdir}/libtinfo.so
|
||||
|
||||
# Use lnr to ensure this is a relative link despite absolute paths
|
||||
# Use ln -rs to ensure this is a relative link despite absolute paths
|
||||
# (as we can't know the relationship between base_libdir and libdir).
|
||||
# At some point we can rely on coreutils 8.16 which has ln -r.
|
||||
lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
|
||||
ln -rs ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
|
||||
fi
|
||||
if [ -d "${D}${includedir}/ncurses" ]; then
|
||||
for f in `find ${D}${includedir}/ncurses -name "*.h"`
|
||||
|
||||
@@ -47,7 +47,7 @@ do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
|
||||
do_install () {
|
||||
install -d ${D}${nonarch_libdir} ${D}${sysconfdir}
|
||||
install -m 0644 os-release ${D}${nonarch_libdir}/
|
||||
lnr ${D}${nonarch_libdir}/os-release ${D}${sysconfdir}/os-release
|
||||
ln -rs ${D}${nonarch_libdir}/os-release ${D}${sysconfdir}/os-release
|
||||
}
|
||||
|
||||
FILES:${PN} += "${nonarch_libdir}/os-release"
|
||||
|
||||
@@ -63,8 +63,8 @@ RRECOMMENDS:${PN}:class-target += "gnupg"
|
||||
# .spec file in dnf source tree does (and then Fedora and dnf documentation
|
||||
# says that dnf binary is plain 'dnf').
|
||||
do_install:append() {
|
||||
lnr ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf
|
||||
lnr ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic
|
||||
ln -rs ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf
|
||||
ln -rs ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic
|
||||
}
|
||||
|
||||
# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in
|
||||
|
||||
@@ -59,7 +59,7 @@ pkgconf_sstate_fixup_esdk () {
|
||||
if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" -a "${WITHIN_EXT_SDK}" = "1" ] ; then
|
||||
pkgconfdir="${SSTATE_INSTDIR}/recipe-sysroot-native/${bindir_native}"
|
||||
mv $pkgconfdir/pkg-config $pkgconfdir/pkg-config.real
|
||||
lnr $pkgconfdir/pkg-config-esdk $pkgconfdir/pkg-config
|
||||
ln -rs $pkgconfdir/pkg-config-esdk $pkgconfdir/pkg-config
|
||||
sed -i -e "s|^pkg-config|pkg-config.real|" $pkgconfdir/pkg-config-native
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ pkgconfig_sstate_fixup_esdk () {
|
||||
if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" -a "${WITHIN_EXT_SDK}" = "1" ] ; then
|
||||
pkgconfdir="${SSTATE_INSTDIR}/recipe-sysroot-native/${bindir_native}"
|
||||
mv $pkgconfdir/pkg-config $pkgconfdir/pkg-config.real
|
||||
lnr $pkgconfdir/pkg-config-esdk $pkgconfdir/pkg-config
|
||||
ln -rs $pkgconfdir/pkg-config-esdk $pkgconfdir/pkg-config
|
||||
sed -i -e "s|^pkg-config|pkg-config.real|" $pkgconfdir/pkg-config-native
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ do_install:append () {
|
||||
install -dm755 ${D}${base_bindir}
|
||||
install -dm755 ${D}${base_sbindir}
|
||||
# add symlinks to kmod
|
||||
lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
|
||||
ln -rs ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
|
||||
for tool in insmod rmmod depmod modinfo modprobe; do
|
||||
lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
|
||||
ln -rs ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
|
||||
done
|
||||
# configuration directories
|
||||
install -dm755 ${D}${nonarch_base_libdir}/depmod.d
|
||||
|
||||
@@ -48,7 +48,7 @@ do_install() {
|
||||
mkdir -p ${D}/usr/src
|
||||
(
|
||||
cd ${D}/usr/src
|
||||
lnr ${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel
|
||||
ln -rs ${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel
|
||||
)
|
||||
|
||||
# for on target purposes, we unify build and source
|
||||
|
||||
Reference in New Issue
Block a user