Path: blob/master/tools/power/pm-graph/install_latest_from_github.sh
26285 views
#!/bin/sh1# SPDX-License-Identifier: GPL-2.02#3# Script which clones and installs the latest pm-graph4# from http://github.com/intel/pm-graph.git56OUT=`mktemp -d 2>/dev/null`7if [ -z "$OUT" -o ! -e $OUT ]; then8echo "ERROR: mktemp failed to create folder"9exit10fi1112cleanup() {13if [ -e "$OUT" ]; then14cd $OUT15rm -rf pm-graph16cd /tmp17rmdir $OUT18fi19}2021git clone http://github.com/intel/pm-graph.git $OUT/pm-graph22if [ ! -e "$OUT/pm-graph/sleepgraph.py" ]; then23echo "ERROR: pm-graph github repo failed to clone"24cleanup25exit26fi2728cd $OUT/pm-graph29echo "INSTALLING PM-GRAPH"30sudo make install31if [ $? -eq 0 ]; then32echo "INSTALL SUCCESS"33sleepgraph -v34else35echo "INSTALL FAILED"36fi37cleanup383940