From 7928dd20b88207a7365cc2807b12f4ec891cddfe Mon Sep 17 00:00:00 2001 From: Changming Liu Date: Fri, 30 Oct 2020 19:27:06 -0400 Subject: tools/create-image.sh: use the basename instead of hard-coded linux to point to the $KERNEL src current script hard-coded the basename for the path of kernel source if the basename of the path for the kernel source code is not "linux", this script will just abort. Fix this by using the basename obtained by the basename utility. --- tools/create-image.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/create-image.sh b/tools/create-image.sh index 54c9685d9..5b92fd8f5 100755 --- a/tools/create-image.sh +++ b/tools/create-image.sh @@ -181,10 +181,11 @@ cat $RELEASE.id_rsa.pub | sudo tee $DIR/root/.ssh/authorized_keys # Add perf support if [ $PERF = "true" ]; then cp -r $KERNEL $DIR/tmp/ + BASENAME=$(basename $KERNEL) sudo chroot $DIR /bin/bash -c "apt-get update; apt-get install -y flex bison python-dev libelf-dev libunwind8-dev libaudit-dev libslang2-dev libperl-dev binutils-dev liblzma-dev libnuma-dev" - sudo chroot $DIR /bin/bash -c "cd /tmp/linux/tools/perf/; make" - sudo chroot $DIR /bin/bash -c "cp /tmp/linux/tools/perf/perf /usr/bin/" - rm -r $DIR/tmp/linux + sudo chroot $DIR /bin/bash -c "cd /tmp/$BASENAME/tools/perf/; make" + sudo chroot $DIR /bin/bash -c "cp /tmp/$BASENAME/tools/perf/perf /usr/bin/" + rm -r $DIR/tmp/$BASENAME fi # Add udev rules for custom drivers. -- cgit mrf-deployment