Skip to content

Commit 91be4b6

Browse files
xiaoxqCapri2014
authored andcommittedMay 10, 2018
Scripts: Add tools to setup HOST, including udev rules.
1 parent 4090c64 commit 91be4b6

File tree

6 files changed

+36
-1
lines changed

6 files changed

+36
-1
lines changed
 

‎docker/setup_host/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Setup HOST
2+
3+
## One-time setup
4+
5+
You need to run the `setup_host.sh` at least once for a new HOST environment.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="0", MODE="0666", SYMLINK+="novatel0", OWNER="apollo", GROUP="apollo"
2+
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="1", MODE="0666", SYMLINK+="novatel1", OWNER="apollo", GROUP="apollo"
3+
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="2", MODE="0666", SYMLINK+="novatel2", OWNER="apollo", GROUP="apollo"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file was automatically generated by the /lib/udev/write_net_rules
2+
# program, run by the persistent-net-generator.rules rules file.
3+
#
4+
# You can modify it, as long as you keep each rule on a single
5+
# line, and change only the value of the NAME= key.
6+
7+
SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTR{name}=="AR023ZWDR(Rev[0-9][0-9][0-9]s)", MODE="0666", SYMLINK+="camera/obstacle", OWNER="apollo", GROUP="apollo"
8+
SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTR{name}=="AR023ZWDR(Rev[0-9][0-9][0-9])", MODE="0666", SYMLINK+="camera/trafficlights", OWNER="apollo", GROUP="apollo"
9+
SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTR{name}=="AR023ZWDR(Rev[0-9][0-9][0-9]F12)", MODE="0666", SYMLINK+="camera/lanemark", OWNER="apollo", GROUP="apollo"
File renamed without changes.

‎docker/canary/setup_host.sh ‎docker/setup_host/setup_host.sh

+19-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@
1818

1919
APOLLO_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
2020

21+
# Setup core dump format.
2122
if [ -e /proc/sys/kernel ]; then
22-
echo "${APOLLO_ROOT_DIR}/data/core/core_%e.%p" > /proc/sys/kernel/core_pattern
23+
echo "${APOLLO_ROOT_DIR}/data/core/core_%e.%p" | \
24+
sudo tee /proc/sys/kernel/core_pattern
25+
fi
26+
27+
# Setup ntpdate to run once per second. Log at /var/log/syslog.
28+
grep -q ntpdate /etc/crontab
29+
if [ $? -ne 0 ]; then
30+
echo "*/1 * * * * root ntpdate -v -u us.pool.ntp.org" | \
31+
sudo tee -a /etc/crontab
32+
fi
33+
34+
# Add udev rules.
35+
sudo cp -r ${APOLLO_ROOT_DIR}/docker/setup_host/etc/* /etc/
36+
37+
# Add uvcvideo clock config.
38+
grep -q uvcvideo /etc/modules
39+
if [ $? -ne 0 ]; then
40+
echo "uvcvideo clock=realtime" | sudo tee -a /etc/modules
2341
fi

0 commit comments

Comments
 (0)
Please sign in to comment.