From 58aa0ada7d7f57a9cf7502a298e6a923ede79727 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 20 May 2018 21:17:14 +0200 Subject: [PATCH 1/7] Improve usability (updates and attach) --- install-all | 11 ++++++++++- tools/README | 1 + tools/attach | 4 ++++ tools/update | 23 +++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tools/README create mode 100755 tools/attach create mode 100755 tools/update diff --git a/install-all b/install-all index b40437b8..500e24e8 100755 --- a/install-all +++ b/install-all @@ -8,6 +8,8 @@ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sud # Install libglez # +mkdir cathook; cd cathook + git clone --recursive https://github.com/nullworks/libglez.git;cd libglez;mkdir build;cd build;cmake ..;make;sudo make install;cd ..;cd .. # @@ -26,4 +28,11 @@ git clone --recursive https://github.com/nullworks/simple-ipc.git;cd simple-ipc; # Build cathook # -git clone --recursive https://github.com/nullworks/cathook.git;cd cathook;mkdir build;cd build;cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo); sudo make data +git clone --recursive https://github.com/nullworks/cathook.git;cd cathook;mkdir build;cd build;cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo); sudo make data; cd ..; cd .. + +# +# Do post installation stuff +# + +cp -a -u ./cathook/tools/. ./ +rm ./README diff --git a/tools/README b/tools/README new file mode 100644 index 00000000..b7037c9e --- /dev/null +++ b/tools/README @@ -0,0 +1 @@ +These files are not intended to be run from this folder. diff --git a/tools/attach b/tools/attach new file mode 100755 index 00000000..21deff49 --- /dev/null +++ b/tools/attach @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +cd cathook +sudo bash attach diff --git a/tools/update b/tools/update new file mode 100755 index 00000000..2c0ad074 --- /dev/null +++ b/tools/update @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +cd cathook + +update() +{ + git fetch >update.log + if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit + fi + if ! git submodule update --remote --recursive >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit + fi +} + +update + +cd build; cmake ..; make; cd ..; cd .. + +cp -a -u ./cathook/tools/. ./; rm ./README + From 0e75bec7a6c0178a41b3a3c8fd8484834c35f393 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sun, 20 May 2018 21:52:45 +0200 Subject: [PATCH 2/7] Remove install-all file after install --- install-all | 1 + 1 file changed, 1 insertion(+) diff --git a/install-all b/install-all index 500e24e8..2dbb670c 100755 --- a/install-all +++ b/install-all @@ -36,3 +36,4 @@ git clone --recursive https://github.com/nullworks/cathook.git;cd cathook;mkdir cp -a -u ./cathook/tools/. ./ rm ./README +cd ..; rm install-all From f60d43484083ad3d5f28b019a38dd66d1d902ce8 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 20 May 2018 23:05:56 +0200 Subject: [PATCH 3/7] Use wget to get the latest version of the updater --- tools/update | 6 +++++- tools/updater | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 tools/updater diff --git a/tools/update b/tools/update index 2c0ad074..f3ac8be2 100755 --- a/tools/update +++ b/tools/update @@ -1,5 +1,9 @@ #!/usr/bin/env bash +rm ./updater +wget https://raw.githubusercontent.com/TotallyNotElite/cathook/testingbranch01/tools/updater +bash updater +: ' cd cathook update() @@ -20,4 +24,4 @@ update cd build; cmake ..; make; cd ..; cd .. cp -a -u ./cathook/tools/. ./; rm ./README - +' diff --git a/tools/updater b/tools/updater new file mode 100755 index 00000000..ef9287d3 --- /dev/null +++ b/tools/updater @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +cd cathook + + +git fetch >update.log +if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +if ! git submodule update --remote --recursive >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +} + +cd build; cmake ..; make; cd ..; cd .. + +cp -a -u ./cathook/tools/. ./; rm ./README; rm ./updater + From 4083d988b0d7dcf455641603186d80be60f2e878 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Mon, 21 May 2018 10:40:28 +0200 Subject: [PATCH 4/7] Also update and build other dependencies --- tools/updater | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/tools/updater b/tools/updater index ef9287d3..48f9a552 100755 --- a/tools/updater +++ b/tools/updater @@ -1,8 +1,7 @@ #!/usr/bin/env bash +sudo echo Elevated -cd cathook - - +cd libglez git fetch >update.log if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 @@ -12,9 +11,44 @@ if ! git submodule update --remote --recursive >>update.log; then $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 exit fi -} +cd build; cmake ..; make;sudo make install;cd ..; cd .. +cd libxoverlay +git fetch >update.log +if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +if ! git submodule update --remote --recursive >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +cd build; cmake ..; make;sudo make install;cd ..; cd .. + +cd simple-ipc +git fetch >update.log +if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +if ! git submodule update --remote --recursive >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +cd build; cmake ..; make;sudo make install;cd ..; cd .. + +cd cathook +git fetch >update.log +if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +if ! git submodule update --remote --recursive >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi cd build; cmake ..; make; cd ..; cd .. + cp -a -u ./cathook/tools/. ./; rm ./README; rm ./updater From 39166fc90621204505e5eb9c4fdcf981c32c53ea Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Mon, 21 May 2018 10:57:42 +0200 Subject: [PATCH 5/7] Fixed bash issues after updating update script --- tools/updater | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/updater b/tools/updater index 48f9a552..17df17e6 100755 --- a/tools/updater +++ b/tools/updater @@ -51,4 +51,5 @@ cd build; cmake ..; make; cd ..; cd .. cp -a -u ./cathook/tools/. ./; rm ./README; rm ./updater - +exit +#Important! Otherwise you will run into weird bash issues after copying files From b3b1ff6d25f704b5f02e27900df2ac46bbaeed8a Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Mon, 21 May 2018 11:07:46 +0200 Subject: [PATCH 6/7] Same as last commit Bash is weird --- tools/update | 30 +++++------------------------- tools/{updater => updater.sh} | 2 -- 2 files changed, 5 insertions(+), 27 deletions(-) rename tools/{updater => updater.sh} (97%) diff --git a/tools/update b/tools/update index f3ac8be2..5aef4dce 100755 --- a/tools/update +++ b/tools/update @@ -1,27 +1,7 @@ #!/usr/bin/env bash -rm ./updater -wget https://raw.githubusercontent.com/TotallyNotElite/cathook/testingbranch01/tools/updater -bash updater - -: ' -cd cathook - -update() -{ - git fetch >update.log - if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then - $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 - exit - fi - if ! git submodule update --remote --recursive >>update.log; then - $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 - exit - fi +rm ./updater.sh +wget https://raw.githubusercontent.com/TotallyNotElite/cathook/testingbranch01/tools/updater.sh +updater() { + source updater.sh } - -update - -cd build; cmake ..; make; cd ..; cd .. - -cp -a -u ./cathook/tools/. ./; rm ./README -' +updater diff --git a/tools/updater b/tools/updater.sh similarity index 97% rename from tools/updater rename to tools/updater.sh index 17df17e6..12e592a0 100755 --- a/tools/updater +++ b/tools/updater.sh @@ -51,5 +51,3 @@ cd build; cmake ..; make; cd ..; cd .. cp -a -u ./cathook/tools/. ./; rm ./README; rm ./updater -exit -#Important! Otherwise you will run into weird bash issues after copying files From da379f9eacce5242399fb1a8438640c2fcf1a451 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Mon, 21 May 2018 11:14:43 +0200 Subject: [PATCH 7/7] Finalized update script --- tools/update | 2 +- tools/updater.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/update b/tools/update index 5aef4dce..036e9134 100755 --- a/tools/update +++ b/tools/update @@ -1,6 +1,6 @@ #!/usr/bin/env bash rm ./updater.sh -wget https://raw.githubusercontent.com/TotallyNotElite/cathook/testingbranch01/tools/updater.sh +wget https://raw.githubusercontent.com/nullworks/cathook/master/tools/updater.sh updater() { source updater.sh } diff --git a/tools/updater.sh b/tools/updater.sh index 12e592a0..02b178b4 100755 --- a/tools/updater.sh +++ b/tools/updater.sh @@ -50,4 +50,4 @@ fi cd build; cmake ..; make; cd ..; cd .. -cp -a -u ./cathook/tools/. ./; rm ./README; rm ./updater +cp -a -u ./cathook/tools/. ./; rm ./README; rm ./updater.sh