Browse Source

Adding default parameters to start script

nas 4 years ago
parent
commit
36824b1de4
1 changed files with 21 additions and 2 deletions
  1. 21
    2
      staging/dev/start_vm.sh

+ 21
- 2
staging/dev/start_vm.sh View File

@@ -1,7 +1,26 @@
1 1
 #!/bin/sh
2 2
 
3
-IMG=$1
4
-echo "Mount $IMG"
3
+# Default parameters
4
+if [ $1 ];then
5
+    IMG=$1;
6
+else
7
+    echo "\nYou must provide the raspberry pi image as first parameter\n";
8
+    exit;
9
+fi
10
+
11
+if [ $2 ];then
12
+    KERNEL=$2;
13
+else
14
+    KERNEL="rpi-20200922/kernel-qemu-5.4.51-buster"
15
+fi
16
+
17
+if [ $3 ];then
18
+    DTB=$3;
19
+else
20
+    DTB="rpi-20200922/versatile-pb-buster-5.4.51.dtb"
21
+fi
22
+
23
+# Start qemu
5 24
 qemu-system-arm \
6 25
     -kernel rpi-20200922/kernel-qemu-5.4.51-buster \
7 26
     -dtb rpi-20200922/versatile-pb-buster-5.4.51.dtb \

Loading…
Cancel
Save