sm6225-common: rootdir: Import rootdir from BSP and CLO

Change-Id: I1bee2bc0301e313a84a9af8690acec3d24ac0112
Signed-off-by: ReStranger <restranger@disroot.org>

Co-authored-by: Nikita Savchenko <NikitaSavc@yandex.ru>
Change-Id: Iae30c6fd41a65312567e3a908cba18ab90c3e4ed

Co-authored-by: Nahhk <nahhk@proton.me>
Change-Id: I76ab1b81141e0e56b9937da76cf6df47905052e0
diff --git a/rootdir/bin/init.qti.write.sh b/rootdir/bin/init.qti.write.sh
new file mode 100755
index 0000000..a243551
--- /dev/null
+++ b/rootdir/bin/init.qti.write.sh
@@ -0,0 +1,27 @@
+#!/vendor/bin/sh
+#=============================================================================
+# Copyright (c) 2021 Qualcomm Technologies, Inc.
+# All Rights Reserved.
+# Confidential and Proprietary - Qualcomm Technologies, Inc.
+#=============================================================================
+
+write_with_check() {
+	local i=60
+	while [ $i -gt 0 ]
+	do
+		if [ -f "$1" ]; then
+			break
+		fi
+
+		sleep 1
+		i=$(($i-1))
+	done
+
+	if [ ! -f "$1" ]; then
+		exit 1
+	fi
+
+	echo $2 > $1
+}
+
+write_with_check "$1" "$2"