diff options
author | 2023-02-02 06:24:47 +1100 | |
---|---|---|
committer | 2025-02-28 13:39:34 +0100 | |
commit | 866b6b773c1326d2b407f04c80aab3b43db02468 (patch) | |
tree | 761df144596a5ef4ed6d3eff63ba78df7b5417f4 | |
parent | bb5591d690a057fbc6533df2617189005ea95f40 (diff) | |
download | idevicerestore-866b6b773c1326d2b407f04c80aab3b43db02468.tar.gz idevicerestore-866b6b773c1326d2b407f04c80aab3b43db02468.tar.bz2 |
Add docker scripts to simplify setting up idevicerestore
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | docker/Dockerfile | 89 | ||||
-rwxr-xr-x | docker/build.sh | 8 | ||||
-rwxr-xr-x | docker/idevicerestore.sh | 7 | ||||
-rwxr-xr-x | docker/run.sh | 13 |
5 files changed, 126 insertions, 0 deletions
@@ -263,6 +263,15 @@ idevicerestore --help man idevicerestore ``` +### Docker + +Build the container with `build.sh` in the docker folder, which will build a +docker container with the latest source versions of all the required libraries. + +Run the container with `run.sh --latest` in the docker folder, +which will execute `usbmuxd` in the background, and then start `idevicerestore --latest`. +Any arguments passed to `run.sh` will be passed in to `idevicerestore`. + ## Contributing We welcome contributions from anyone and are grateful for every pull request! diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..37f2306 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,89 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND="noninteractive" +RUN apt-get update && apt-get install -y \ + build-essential \ + pkg-config \ + checkinstall \ + git \ + autoconf \ + automake \ + libtool-bin \ + libreadline-dev \ + libusb-1.0-0-dev \ + libcurl4-openssl-dev \ + libssl-dev \ + libzip-dev \ + zlib1g-dev \ + python3 \ + udev + +RUN git clone https://github.com/libimobiledevice/libplist.git && \ + cd libplist && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libplist -rf + +RUN git clone https://github.com/libimobiledevice/libtatsu.git && \ + cd libtatsu && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libtatsu -rf + +RUN git clone https://github.com/libimobiledevice/libimobiledevice-glue.git && \ + cd libimobiledevice-glue && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libimobiledevice-glue -rf + +RUN git clone https://github.com/libimobiledevice/libusbmuxd.git && \ + cd libusbmuxd && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libusbmuxd -rf + +RUN git clone https://github.com/libimobiledevice/libimobiledevice.git && \ + cd libimobiledevice && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libimobiledevice -rf + +RUN git clone https://github.com/libimobiledevice/libirecovery.git && \ + cd libirecovery && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm libirecovery -rf + +RUN git clone https://github.com/libimobiledevice/usbmuxd.git && \ + cd usbmuxd && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm usbmuxd -rf + +RUN git clone https://github.com/libimobiledevice/idevicerestore.git && \ + cd idevicerestore && \ + ./autogen.sh && \ + make && \ + make install && \ + cd .. && \ + rm idevicerestore -rf + +RUN ldconfig +WORKDIR /tmp +COPY idevicerestore.sh /usr/sbin/idevicerestore.sh +CMD idevicerestore.sh + diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 0000000..dc41566 --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +cd "$(dirname "$0")" + +docker build . -t idevicerestore-docker --no-cache + +echo "You can now use 'run.sh --latest' to run the restore." + diff --git a/docker/idevicerestore.sh b/docker/idevicerestore.sh new file mode 100755 index 0000000..cc80fbf --- /dev/null +++ b/docker/idevicerestore.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +usbmuxd & + +idevicerestore "$@" + diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 0000000..0078309 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e +cd "$(dirname "$0")" + +if [[ -z $(docker images | grep idevicerestore-docker) ]]; then + echo "Container not built, you will need to build it with 'build.sh'" + exit -1 +fi + +docker rm --force idevicerestore || true + +docker run --name idevicerestore -it --privileged --net=host -v /dev:/dev -v /run/udev/control:/run/udev/control -v "$(pwd):/tmp" idevicerestore-docker idevicerestore.sh "$@" + |