Commit 1e340375 authored by Benoit Rat's avatar Benoit Rat

script: add --report function

- This function print all the information needed
- Call the Makefile (clean, update, install)
- Add report.log to the gitignore
parent 0d8b3d17
......@@ -24,3 +24,4 @@
firmware/
pdf/
.INIT
report.log
......@@ -153,6 +153,49 @@ insertmodule()
exit 0
}
reportlog()
{
olog="$(pwd)/report.log"
genreport 2>&1 | tee ${olog}
echo "Report generated in file ${olog}"
}
genreport()
{
cd ${scriptdir}/..
date
uname -n -r
lsb_release -d
pwd
gengitreport
make -C ${scriptdir}/.. clean
make -C ${scriptdir}/.. update
make -C ${scriptdir}/..
echo "Now performing installation..."
read -p "This step require sudo! Continue? [y/N]: " ret
if [ "x$ret" = "xy" ]; then
sudo make -C ${scriptdir}/.. install
else
echo "WARNING: Installation skipped"
fi
}
gengitreport()
{
git describe --always
subs=$(git submodule foreach git describe --always --dirty="+" | grep Entering | sed "s/Entering '\(.*\)'.*/\1/g")
for sub in $subs; do
echo "$sub/:";
cd $sub;
gengitreport
done
}
### Show help of the function
help ()
{
......@@ -166,6 +209,7 @@ Options:
-i|--install) Install the gateware for the driver (require sudo)
-l|--load) Load modules in kernel (require sudo)
--insert) Insert modules in kernel (require sudo)
--report) Make everything and generate report.log
EOF
exit 0
}
......@@ -186,6 +230,7 @@ while [ $# -gt 0 ]; do # Until you run out of parameters . . .
-i|--install) insthdl; exit;;
-l|--load) loadmodule; exit;;
--insert) insertmodule; exit;;
--report) reportlog; exit;;
*) help;;
esac
shift # Check next set of parameters.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment