#!/bin/bash set -x # Test: sudo mount -o remount,rw /; cp /usr/comma/bg.org /usr/comma/bg.jpg; bash shell/set_logo.sh # Check if md5sum of /usr/comma/bg.jpg is not equal to md5sum of /data/openpilot/shell/bg.jpg if [ "$(md5sum /usr/comma/bg.jpg | awk '{print $1}')" != "$(md5sum /data/openpilot/shell/bg.jpg | awk '{print $1}')" ]; then # If /usr/comma/bg.org does not exist if [ ! -f /usr/comma/bg.org ]; then if [[ "$(md5sum /usr/comma/bg.jpg | awk '{print $1}')" == "642380ba4c0f00b16e9cf6e613f43eec" ]]; then sudo mount -o remount,rw / sudo cp /usr/comma/bg.jpg /usr/comma/bg.org fi fi if [[ "$(md5sum /usr/comma/bg.org | awk '{print $1}')" != "642380ba4c0f00b16e9cf6e613f43eec" ]]; then sudo mount -o remount,ro / echo failed to backup the correct picture exit fi sudo mount -o remount,rw / # If /usr/comma/bg.org does exist if [ -f /usr/comma/bg.org ]; then sudo cp -f /data/openpilot/shell/bg.jpg /usr/comma/bg.jpg fi # If file /usr/comma/revert_logo.sh does not exist if [ "$(md5sum /data/openpilot/shell/revert_logo.sh | awk '{print $1}')" != "$(md5sum /usr/comma/revert_logo.sh | awk '{print $1}')" ]; then sudo cp /data/openpilot/shell/revert_logo.sh /usr/comma/revert_logo.sh fi if [ "$(md5sum md5sum /usr/comma/comma.sh | awk '{print $1}')" != "$(md5sum /data/openpilot/shell/usr_comma_comma.sh | awk '{print $1}')" ]; then if [[ "$(md5sum /usr/comma/comma.sh | awk '{print $1}')" == "ddbac0b46dd02efd672a0ef31ca426cf" ]]; then if [ ! -f /usr/comma/comma.org ]; then sudo cp /usr/comma/comma.sh /usr/comma/comma.org fi fi if [-f /usr/comma/comma.org ]; then sudo cp /data/openpilot/shell/usr_comma_comma.sh /usr/comma/comma.sh echo updated comma.sh fi fi echo Applied custom logo for comma boot sequence sudo sync sleep 2 sudo mount -o remount,ro / sudo sync sleep 2 fi