-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstall_via_serial.sh
executable file
·53 lines (43 loc) · 1.22 KB
/
install_via_serial.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# Marcel Timm, RhinoDevel, 2019aug12
# This script does the following:
# -------------------------------
#
# - Runs creation script to generate kernel file.
# - Configures serial device.
# - Sends kernel file to serial device via XMODEM.
# - Sends start-kernel command to serial device.
# Setup some constants:
# ---------------------
SERIAL_DEVICE=/dev/ttyUSB0 # Serial device to communicate with Raspi.
KERNEL_FILENAME=kernel.img # Name of kernel file to send to Raspi.
# Execute script commands:
# ------------------------
echo "*********************************"
echo "*** Running creation script.. ***"
echo "*********************************"
echo
#
./create.sh
#
echo
echo "***********************************"
echo "*** Configuring serial device.. ***"
echo "***********************************"
echo
#
sudo bash -c "stty -F ${SERIAL_DEVICE} 115200"
echo "******************************"
echo "*** Sending created file.. ***"
echo "******************************"
echo
#
sudo bash -c "sx ${KERNEL_FILENAME} < ${SERIAL_DEVICE} > ${SERIAL_DEVICE}"
#
echo
echo "*******************************"
echo "*** Sending start command.. ***"
echo "*******************************"
echo
#
sudo bash -c "echo -n g > ${SERIAL_DEVICE}"