From afd2e8d2550fb65cd2a72cb32b55e71261785413 Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Fri, 13 Feb 2015 17:03:16 -0600
Subject: [PATCH] chroot: permissions check /opt/scripts/

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
 scripts/chroot.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/chroot.sh b/scripts/chroot.sh
index 593fbeee4..d03f253dd 100755
--- a/scripts/chroot.sh
+++ b/scripts/chroot.sh
@@ -722,9 +722,9 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__
 		esac
 
 		if [ ! "x${rfs_opt_scripts}" = "x" ] ; then
+			mkdir -p /opt/scripts/ || true
 
 			if [ -f /usr/bin/git ] ; then
-				mkdir -p /opt/scripts/ || true
 				qemu_command="git clone ${rfs_opt_scripts} /opt/scripts/ --depth 1"
 				qemu_warning
 				git clone -v ${rfs_opt_scripts} /opt/scripts/ --depth 1
@@ -943,7 +943,7 @@ fi
 #usually a qemu failure...
 if [ ! "x${rfs_opt_scripts}" = "x" ] ; then
 	#we might not have read permissions:
-	if [ -r ${tempdir}/ ] ; then
+	if [ -r ${tempdir}/opt/scripts/ ] ; then
 		if [ ! -f ${tempdir}/opt/scripts/.git/config ] ; then
 			echo "Log: ERROR: git clone of ${rfs_opt_scripts} failed.."
 			exit 1
-- 
GitLab