]> code.ossystems Code Review - openembedded-core.git/commitdiff
busybox: ship a symlink farm for ptest
authorRoss Burton <ross.burton@intel.com>
Fri, 23 Nov 2018 02:16:31 +0000 (10:16 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Nov 2018 23:32:10 +0000 (23:32 +0000)
Ship a symlink farm for busybox, which correctly considers SUID
split. This ensures that all utilities used in busybox's test cases
will first use that ones that are provided by busybox.

Modify run-ptest to prepend the directory to PATH, and also change
variable name from current_dir to current_path, as the former is
a little misleading. `readlink -f $0' gets a path to the current
script instead of the current directory.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/busybox/busybox.inc
meta/recipes-core/busybox/files/run-ptest

index 6abbb5492fda4590aca8132eb4824295df3d4a70..f7455d301f9449b748799695947f48214fbffda5 100644 (file)
@@ -349,6 +349,20 @@ do_install_ptest () {
        cp -r ${B}/testsuite ${D}${PTEST_PATH}/
        cp ${B}/.config      ${D}${PTEST_PATH}/
        ln -s /bin/busybox   ${D}${PTEST_PATH}/busybox
+
+       mkdir ${D}${PTEST_PATH}/bin
+       if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
+               while read link; do
+                       ln -s ${base_bindir}/busybox.suid ${D}${PTEST_PATH}/bin/$(basename $link)
+               done <${D}${sysconfdir}/busybox.links.suid
+               while read link; do
+                       ln -s ${base_bindir}/busybox.nosuid ${D}${PTEST_PATH}/bin/$(basename $link)
+               done <${D}${sysconfdir}/busybox.links.nosuid
+       else
+               while read link; do
+                       ln -s ${base_bindir}/busybox ${D}${PTEST_PATH}/bin/$(basename $link)
+               done <${D}${sysconfdir}/busybox.links
+       fi
 }
 
 inherit update-alternatives
index 8b99bedc06ac357b3f6a0c9ba785e309bfdff83e..b19e5b5343f29060ad8f308fe86be1834c72e8e8 100644 (file)
@@ -1,7 +1,8 @@
 #!/bin/sh
 
-current_dir=$(readlink -f $0)
-export bindir=$(dirname $current_dir)
+current_path=$(readlink -f $0)
+export bindir=$(dirname $current_path)
+export PATH=$bindir/bin:$PATH
 export SKIP_KNOWN_BUGS=1
 
 cd testsuite || exit 1