aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-04-05 16:57:13 -0700
committerChristian Cunningham <cc@localhost>2022-04-05 16:57:13 -0700
commitc6ba80fe1f8994a431d7c7a2a021864e66e4e59b (patch)
tree2b2fe502f34be5b50becc88ba551c3b6a98fd0c8
parent42628c4ffa5ed8a3d298f62562e790094211143f (diff)
Error if no disk is specified
This way, disks won't be unmounted errenously
-rw-r--r--Common.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/Common.mk b/Common.mk
index 44dd68c..160aef9 100644
--- a/Common.mk
+++ b/Common.mk
@@ -26,7 +26,6 @@ BSP ?= 2
GDEBUG ?= 0
DEBUG ?= 0
SILENT ?= 0
-DISK ?= /dev/sdc1
CROSS = arm-none-eabi
CC = ${CROSS}-gcc
@@ -149,7 +148,12 @@ test: clean build/kernel.elf
@tput setaf 6 2> /dev/null || true; echo Running Tests; tput sgr0 2> /dev/null || true
@./tests/run.sh
+ifndef $(DISK)
+copy:
+ @tput setaf 1 2> /dev/null || true; echo ERROR: No disk specified!; tput sgr0 2> /dev/null || true
+else
copy: clean build/kernel7.img
sudo mount $(DISK) /mnt/sd0
sudo cp build/kernel7.img /mnt/sd0
sudo umount /mnt/sd0
+endif \ No newline at end of file