Also if you have the unfused (read debug?) hardware - it writes clips to sata (read any usb) device plugged in. Vision task certainly checks if this dir exists and if it is, I guess writes there.
# if board is not fused, check if a SSD drive is plugged in, automount to
# "/tmp/external_drive/" and start writing clips/RTDVs to it
if detect-ecu-unfused; then
echo "Boot $bootcount: Settling udev $(/sbin/uptime-seconds) s after boot"
# wait for udev to finish so that drive will be mounted if it is present
# finish early if the external drive is already mounted
udevadm settle --exit-if-exists=/dev/sda1 --timeout=1
echo "Boot $bootcount: udev settled $(/sbin/uptime-seconds) s after boot"
# Check if a SSD drive is present and "/tmp/external_drive" is not already mounted
if [ ! -d /tmp/external_drive ] && [ -b "/dev/sda1" ]; then
# Mount the drive and set permissions
mkdir /tmp/external_drive
mount -t ext4 -o data=writeback,barrier=0 /dev/sda1 /tmp/external_drive
if [ $? -ne 0 ]; then
# Can't mount the drive, remove folder
rmdir /tmp/external_drive
echo "Boot $bootcount: External drive detected but not mounted. $(/sbin/uptime-seconds) s after boot"
else
chmod 774 /tmp/external_drive
chown root:autopilot /tmp/external_drive
# Vision will dump logs into /tmp/external_drive/clips
ensure_directory "/tmp/external_drive/clips" "1774" "root:log"
# FIXME - RTDV logs will all go into the same folder across multiple drives.
# only way to differentiate drives will be the time stamps in the
# log files themselves
ensure_directory "/tmp/external_drive/dvlog" "0770" "root:autopilot"
ensure_directory "/tmp/external_drive/dvlog/staging" "0770" "root:autopilot"
# Bind the usb-storage kernel thread and IRQ to the Vision CPUs
for pid in $(pgrep usb-storage); do
taskset -p 6 ${pid}
done
for pid in $(pgrep xhci); do
taskset -p 6 ${pid}
done
echo "Boot $bootcount: External drive mounted $(/sbin/uptime-seconds) s after boot"
fi
fi
fi