Created
October 7, 2021 17:37
-
-
Save lwlsw/e2fcf5fccb8d2e0fcb86b74853b67b81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap 'echo "Exiting..."' EXIT | |
echo "futurerestore compile script for Linux" | |
echo "Supported distros: Ubuntu 20.04, 20.10, 21.04, Fedora 33 to 34, Arch Linux" | |
echo | |
. /etc/os-release | |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig | |
if [[ $UBUNTU_CODENAME == "focal" ]] || [[ $UBUNTU_CODENAME == "groovy" ]] || [[ $UBUNTU_CODENAME == "hirsute" ]]; then | |
sudo add-apt-repository universe | |
sudo apt update | |
sudo apt install -y pkg-config libtool automake g++ python-dev libzip-dev libcurl4-openssl-dev cmake libssl-dev libusb-1.0-0-dev libreadline-dev libbz2-dev libpng-dev git | |
elif [[ $ID == "fedora" ]] && (( $VERSION_ID >= 33 )); then | |
sudo dnf install -y automake gcc g++ python3-devel git libcurl-devel libtool libusb-devel make libzip-devel openssl-devel pkgconfig readline-devel zlib-devel | |
elif [[ $ID == "arch" ]] || [[ $ID_LIKE == "arch" ]]; then | |
echo "Arch users can install from the AUR instead: futurerestore-marijuanarm-git" | |
echo "Press ENTER to continue to compile anyway (or Ctrl+C to cancel)" | |
read -s | |
sudo pacman -Syu --noconfirm --needed base-devel curl libzip openssl python | |
else | |
echo "Your distro is not supported by this compile script" | |
exit 1 | |
fi | |
rm -rf futurerestore_build | |
mkdir futurerestore_build | |
cd futurerestore_build | |
git clone https://github.com/libimobiledevice/libplist | |
git clone https://github.com/libimobiledevice/libusbmuxd | |
git clone https://github.com/libimobiledevice/libimobiledevice | |
git clone https://github.com/lzfse/lzfse | |
git clone https://github.com/libimobiledevice/libirecovery | |
git clone https://github.com/tihmstar/libgeneral | |
git clone https://github.com/tihmstar/libfragmentzip | |
git clone https://github.com/tihmstar/img4tool | |
git clone --recursive https://github.com/marijuanARM/futurerestore | |
cd libplist ; ./autogen.sh ; make ; sudo make install ; cd .. | |
cd libusbmuxd ; ./autogen.sh ; make ; sudo make install ; cd .. | |
cd libimobiledevice ; ./autogen.sh ; make ; sudo make install ; cd .. | |
cd lzfse ; make ; sudo make install ; cd .. | |
cd libirecovery ; ./autogen.sh ; make ; sudo make install ; cd .. | |
cd libgeneral ; ./autogen.sh --enable-static --disable-shared ; make ; sudo make install ; cd .. | |
cd libfragmentzip ; ./autogen.sh --enable-static --disable-shared ; make ; sudo make install ; cd .. | |
cd img4tool ; ./autogen.sh --enable-static --disable-shared ; make ; sudo make install ; cd .. | |
cd futurerestore ; ./autogen.sh ; make ; sudo make install ; cd .. | |
sudo ldconfig | |
echo | |
echo "Done" | |
echo "Run futurerestore AT YOUR OWN RISK; Things are not guaranteed to work" | |
echo | |
echo "Launching futurerestore after compiling: sudo futurerestore <arguments>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment