Skip to content

Commit

Permalink
Small changes to tracer serial driver script, deprecated old script
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Mar 20, 2024
1 parent 82c41b9 commit 301c413
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 5 additions & 7 deletions other/linux/install_tracer_serial_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ initramfs_update_command=(
"<You need to install and run an update initramfs implementation now>"
)

if type update-initramfs 1>/dev/null; then
if type update-initramfs; then
initramfs_update_command=(
update-initramfs
-u
)
echo "Found update-initramfs"
elif type update-tirfs 1>/dev/null; then
elif type update-tirfs; then
initramfs_update_command=(update-tirfs)
echo "Found update-tirfs"
else
Expand Down Expand Up @@ -99,10 +99,6 @@ if [ $dkms_remove_exit_code -eq 3 ]; then
echo "xr_usb_serial_common is not currently installed. No need to remove"
elif [ $dkms_remove_exit_code -eq 1 ]; then
# Exit codes and messages here: https://github.com/dell/dkms/issues/306
if echo "$dkms_remove_output" | grep "Your kernel headers for kernel" >/dev/null; then
echo "You need to install kernel modules!"
exit 1
fi
if echo "$dkms_remove_output" | grep "must be root" >/dev/null; then
echo "You need to run this command as root!"
exit 1
Expand All @@ -129,11 +125,13 @@ cp -a "$WORK_DIR/xr_usb_serial_common-1a" /usr/src/
echo -e "\tAdding module..."
dkms add -m xr_usb_serial_common -v 1a
echo -e "\tBuilding module..."
dkms build -m xr_usb_serial_common -v 1a
dkms build -m xr_usb_serial_common -v 1a || (echo -e "\nBuilding failed. Please make sure you have headers for your system installed (e.i. sudo apt install raspberrypi-kernel-headers)"; exit 1)
echo -e "\tInstalling module"
dkms install -m xr_usb_serial_common -v 1a
echo "Blacklisting cdc-acm by creating file /etc/modprobe.d/blacklist-cdc-acm.conf"
echo blacklist cdc-acm > /etc/modprobe.d/blacklist-cdc-acm.conf || echo "Failed to blacklist!"

echo "Going to update initramfs"
"${initramfs_update_command[@]}"

echo "Successfully installed! Please restart your device for these changes to take effect."
7 changes: 7 additions & 0 deletions other/linux/install_updated_serial_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
BASEDIR=$(dirname "$0")
cd "$BASEDIR" || exit 1

# This script is deprecated. See
# https://solarthing.readthedocs.io/en/latest/quickstart/serial-port/hardware/tracer/rs485-port.html
# You should instead use install_tracer_serial_driver.sh

echo "This script is deprecated. Please follow the updated instructions here: https://solarthing.readthedocs.io/en/latest/quickstart/serial-port/hardware/tracer/rs485-port.html"
echo

echo "This will edit config files on your system to disable cdc-acm "
echo "Only run this script if you need RS485 support for your EPEver tracer. DO NOT RUN OTHERWISE. THIS DOES NOT MAGICALLY FIX YOUR CABLE NOT WORKING."
printf "(Press enter to continue)"
Expand Down

0 comments on commit 301c413

Please sign in to comment.