Commit 54120fd8 authored by Frederic Danis's avatar Frederic Danis

Fix script execution when bash is not available

For runtimes where bash is not available put-ld-config-path and
symlink-alternatives fail with error:
put-ldconfig-in-path | sh: 1: /tmp/script/put-ldconfig-in-path: not found

Running those script from outside of chroot fixes it.
Signed-off-by: Frederic Danis's avatarFrédéric Danis <frederic.danis@collabora.com>
parent 285e8097
......@@ -229,8 +229,8 @@ actions:
- action: run
label: put-ldconfig-in-path
chroot: true
script: put-ldconfig-in-path
chroot: false
command: 'echo; "$RECIPEDIR/put-ldconfig-in-path" "$ROOTDIR"'
- action: run
label: clean-up-before-pack
......@@ -279,8 +279,8 @@ actions:
- action: run
label: symlink-alternatives
chroot: true
script: symlink-alternatives
chroot: false
command: 'echo; "$RECIPEDIR/symlink-alternatives" "$ROOTDIR"'
{{ if $debug_symbols }}
- action: run
......
......@@ -30,16 +30,24 @@ set -o pipefail
me="$(basename "$0")"
if [ "$#" != 0 ] || [ "x$(id -u)" != x0 ]; then
if [ "$#" != 1 ] || [ "$1" = '--help' ] || [ "x$(id -u)" != x0 ] ||
! [ -d "$1" ]; then
echo "$me: Usage:" >&2
echo " $me" >&2
echo " $me SYSROOT" >&2
echo "" >&2
echo "Run this script as root, in the container." >&2
echo "Run this script as root." >&2
exit 2
fi
set -x
if ! test -e /bin/ldconfig; then
ln -s /sbin/ldconfig /bin/ldconfig
sysroot="$1"
cd "$sysroot"
in_chroot () {
chroot "$sysroot" "$@"
}
if ! test -e $sysroot/bin/ldconfig; then
in_chroot ln -s /sbin/ldconfig /bin/ldconfig
fi
......@@ -30,15 +30,23 @@ set -o pipefail
me="$(basename "$0")"
if [ "$#" != 0 ] || [ "x$(id -u)" != x0 ]; then
if [ "$#" != 1 ] || [ "$1" = '--help' ] || [ "x$(id -u)" != x0 ] ||
! [ -d "$1" ]; then
echo "$me: Usage:" >&2
echo " $me" >&2
echo " $me SYSROOT" >&2
echo "" >&2
echo "Run this script as root, in the container." >&2
echo "Run this script as root." >&2
exit 2
fi
find / -xdev '(' \
sysroot="$1"
cd "$sysroot"
in_chroot () {
chroot "$sysroot" "$@"
}
in_chroot find / -xdev '(' \
-lname '/etc/alternatives/*' -o \
-lname '/etc/locale.alias' \
')' -exec sh -euc '
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment