From f08259cc9f5c81a22e9077c412382dac6da2590d Mon Sep 17 00:00:00 2001
From: Ryan Hancock <krhancoc@uwaterloo.ca>
Date: Tue, 18 Jan 2022 23:13:47 -0500
Subject: [PATCH] Zero out previous logs

---
 README.md                  | 13 +++++++++++++
 os161-container/helpers.sh |  6 ++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index a2fb032..f5a566d 100644
--- a/README.md
+++ b/README.md
@@ -109,3 +109,16 @@ Within the `/assignments` directory there are subdirectories for each assignment
 
 If the assignments repo has changed, either due to assignments being changed or bugs found (found at `os161-container/assignments`) you will need to just run `sudo ./install.sh` again.
 
+
+## Common Issues
+
+**Commands do not work and also there is randomly ^M, strings within the output:**
+This is due to windows placing return characters in the strings that get
+passed to the scripts. Please use git bash or a terminal that does UNIX
+string passing.
+
+**Cannot figure out the host**
+This occurs within newer level Macs that use Apple Silicon, docker
+currently requires x86 architectures to work, you'll need to use the
+student environment.
+
diff --git a/os161-container/helpers.sh b/os161-container/helpers.sh
index cd0e4db..06e2bbf 100755
--- a/os161-container/helpers.sh
+++ b/os161-container/helpers.sh
@@ -28,6 +28,7 @@ build_k_helper() {
 	# Configure - step 1
 	echo "[CS350] $1 Configuring Kernel..."
 	touch $LOGS/configure.log
+	truncate -s 0 $LOGS/configure.log
 	./configure --ostree=/os-compile --toolprefix=mips-harvard-os161- >> $LOGS/configure.log
 	cd kern/conf
 	./config $1 >> $LOGS/configure.log
@@ -36,10 +37,12 @@ build_k_helper() {
 	cd ../compile/$1
 	echo "[CS350] $1 Making Kernel..."
 	touch $LOGS/depend.log
+	truncate -s 0 $LOGS/depend.log
 	bmake depend >> $LOGS/depend.log 2>> $LOGS/depend.log
 
 	# Make and install - step 3
 	touch $LOGS/make.log
+	truncate -s 0 $LOGS/make.log
 	bmake WERROR= >> $LOGS/make.log 2>> $LOGS/make.log
 	bmake install >> $LOGS/make.log 2>> $LOGS/make.log
 
@@ -60,7 +63,6 @@ test_kernel() {
 	if [ "$#" -ne 1 ]; then
 		echo "Usage: test_kernel <ASST0, ASST1 ...>"
 	fi
-	echo $LOGS
 
 	cd /os-compile
 	echo "[CS350] Tests $1"
@@ -72,6 +74,7 @@ test_kernel() {
 		TOTAL=$(wc -l < $f)
 		DONE=0
 		touch $LOG
+		truncate -s 0 $LOG
 		for p in `cat $f` 
 		do
 			echo ">SPLIT<" >> $LOG
@@ -82,7 +85,6 @@ test_kernel() {
 		done
 	done
 	cd - > /dev/null
-	echo $LOGS
 	/evalaute $LOGS/test_public.log /assignments/$1
 }
 
-- 
GitLab