Explorar el Código

Adding default parameters to start script

nas hace 4 años
padre
commit
36824b1de4
Se han modificado 1 ficheros con 21 adiciones y 2 borrados
  1. 21
    2
      staging/dev/start_vm.sh

+ 21
- 2
staging/dev/start_vm.sh Ver fichero

@@ -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…
Cancelar
Guardar