From 5baba05794b9ee1eb8732524b584821d59a1c93f Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Tue, 3 Jan 2017 15:50:16 -0600
Subject: [PATCH] sdcard: fix permissions on Debian Stretch

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
 tools/setup_sdcard.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/setup_sdcard.sh b/tools/setup_sdcard.sh
index 21d0c623a..eec11c19e 100755
--- a/tools/setup_sdcard.sh
+++ b/tools/setup_sdcard.sh
@@ -1052,6 +1052,26 @@ populate_rootfs () {
 		sync
 		sync
 
+		echo "-----------------------------"
+		if [ -f /usr/bin/stat ] ; then
+			echo "-----------------------------"
+			echo "Checking [${TEMPDIR}/disk/] permissions"
+			/usr/bin/stat ${TEMPDIR}/disk/
+			echo "-----------------------------"
+		fi
+
+		echo "Setting [${TEMPDIR}/disk/] chown root:root"
+		chown root:root ${TEMPDIR}/disk/
+		echo "Setting [${TEMPDIR}/disk/] chmod 755"
+		chmod 755 ${TEMPDIR}/disk/
+
+		if [ -f /usr/bin/stat ] ; then
+			echo "-----------------------------"
+			echo "Verifying [${TEMPDIR}/disk/] permissions"
+			/usr/bin/stat ${TEMPDIR}/disk/
+		fi
+		echo "-----------------------------"
+
 		if [ ! "x${oem_flasher_img}" = "x" ] ; then
 			if [ ! -d "${TEMPDIR}/disk/opt/emmc/" ] ; then
 				mkdir -p "${TEMPDIR}/disk/opt/emmc/"
-- 
GitLab