From 856d8dd0f5314913ffa54f97c24611980bb6ac71 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 19 May 2018 18:06:47 +0200 Subject: [PATCH 01/14] Changes to the install script 1. Inform user that it only works for Ubuntu. 2. Use wget to download the file from the main cathook repo. We don't need to maintain a secondary repo if we can avoid it. 3. The file is however not executable. We need to use bash to execute it. 4. The command is all-in-one --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8e869478..7c88af58 100755 --- a/README.md +++ b/README.md @@ -35,14 +35,13 @@ and a lot of useful features, including # INSTALLATION -## Automatic: +## Automatic: (Ubuntu based only) If you already downloaded the repo, simply run * `install-all` Else simply run: -* `git clone --recursive https://github.com/nullworks/One-in-all-cathook-install/blob/master/install-all.git` -and run it's install-all script. +* `wget https://raw.githubusercontent.com/nullworks/cathook/master/install-all && bash install-all` ## Manual: You need CMake to build cathook, CMake should take care of dependencies From a008321aa68e1b04295e0da21fb94fb7493b434e Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 19 May 2018 18:15:11 +0200 Subject: [PATCH 02/14] Improvements to install script Whats the point of running apt-update 3 times if you could just run it once? --- install-all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-all b/install-all index 5b9fb851..fedd7839 100755 --- a/install-all +++ b/install-all @@ -2,7 +2,7 @@ # Install base Dependencies # -sudo apt update && sudo apt install build-essential gcc-multilib g++-multilib software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install gcc-snapshot g++-6-multilib gcc-6 g++-6 -y && sudo apt update && sudo apt install git libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y +sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install build-essential gcc-multilib g++-multilib software-properties-common gcc-snapshot g++-6-multilib gcc-6 g++-6 libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y # # Install libglez From 736f72b0934ac3bd00fc256065661dbd27e3c438 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 19 May 2018 18:18:06 +0200 Subject: [PATCH 03/14] Don't forget to clone cathook as well --- install-all | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install-all b/install-all index fedd7839..562d1e48 100755 --- a/install-all +++ b/install-all @@ -25,5 +25,4 @@ git clone --recursive https://github.com/nullworks/simple-ipc.git;cd simple-ipc; # # Build cathook # - -mkdir build;cd build;cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo);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);make data From 4e3b4ec23c1b9c8570a7ddbf6dcb7ff775d14836 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 19 May 2018 18:43:55 +0200 Subject: [PATCH 04/14] Remove "already cloned repo" method It's no longer compatible with the updated script. --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 7c88af58..fe3cd416 100755 --- a/README.md +++ b/README.md @@ -36,10 +36,7 @@ and a lot of useful features, including # INSTALLATION ## Automatic: (Ubuntu based only) -If you already downloaded the repo, simply run -* `install-all` - -Else simply run: +Run in terminal: * `wget https://raw.githubusercontent.com/nullworks/cathook/master/install-all && bash install-all` From 572dd0fcf132961b5ae238bf08cfe18390d2d3a2 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sun, 20 May 2018 12:05:08 +0200 Subject: [PATCH 05/14] Add git to dependencies and run make data with su --- install-all | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-all b/install-all index 562d1e48..53adb580 100755 --- a/install-all +++ b/install-all @@ -2,7 +2,7 @@ # Install base Dependencies # -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install build-essential gcc-multilib g++-multilib software-properties-common gcc-snapshot g++-6-multilib gcc-6 g++-6 libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y +sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install build-essential git gcc-multilib g++-multilib software-properties-common gcc-snapshot g++-6-multilib gcc-6 g++-6 libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y # # Install libglez @@ -25,4 +25,4 @@ 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);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 From ab16b1f24860edd0e1f432f26072e47826199eb9 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sun, 20 May 2018 12:08:54 +0200 Subject: [PATCH 06/14] Run install-data as root instead --- install-all | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install-all b/install-all index 53adb580..6e5fd763 100755 --- a/install-all +++ b/install-all @@ -25,4 +25,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); cd .. + +# +# Install +# + +sudo bash install-data From f86c9785ca835083d0d5c98689a01e24a3925690 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sun, 20 May 2018 12:11:26 +0200 Subject: [PATCH 07/14] Run make data with su instead Wow I'm actually an idiot. --- install-all | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/install-all b/install-all index 6e5fd763..b40437b8 100755 --- a/install-all +++ b/install-all @@ -26,10 +26,4 @@ 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); cd .. - -# -# Install -# - -sudo bash install-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 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 08/14] 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 09/14] 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 10/14] 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 11/14] 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 12/14] 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 13/14] 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 14/14] 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