Add skip-blob/no-cache, rewrite CI again

This commit is contained in:
Cryptiiiic 2021-12-08 17:39:20 -08:00
parent e5041b855e
commit d2a1e87f00
No known key found for this signature in database
GPG key ID: 6027B509EFE3A76B
15 changed files with 1950 additions and 1988 deletions

View file

@ -6,7 +6,10 @@ on:
workflow_dispatch:
jobs:
mac-x86_64:
macOS:
env:
PROCURSUS: /opt/procursus
PATH: /opt/procursus/bin:/opt/procursus/libexec/gnubin:/usr/local/lib/ruby/gems/2.7.0/bin:/usr/local/opt/ruby@2.7/bin:/usr/local/opt/pipx_bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Users/runner/Library/Android/sdk/ndk-bundle:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools:/Users/runner/.ghcup/bin:/Users/runner/hostedtoolcache/stack/2.7.3/x64
runs-on: macos-11
steps:
- name: Checkout
@ -14,66 +17,92 @@ jobs:
with:
submodules: 'true'
fetch-depth: 0
- name: macOS x86_64 Build
id: mac-x86_64
- name: macOS Build
id: macOS-Build
run: |
cd /Users/runner/work/futurerestore/futurerestore/.github/workflows
curl -sO https://mac.cryptiiiic.com/CI-Scripts/futurerestore-mac-x86_64.sh
chmod +x futurerestore-mac-x86_64.sh
if [[ "$(file futurerestore-mac-x86_64.sh)" == "futurerestore-mac-x86_64.sh: a /usr/bin/env zsh script text executable, ASCII text" ]]; then ./futurerestore-mac-x86_64.sh; else ./mac-x86_64.sh; fi
- name: Archive
id: archive
./mac-bootstrap.sh
cat /etc/paths
which pkg-config
./Builder macOS x86_64 release 1300 10.12 &
./Builder macOS x86_64 debug 1300 10.12 &
./Builder macOS arm64 release 1700 11.0 &
./Builder macOS arm64 debug 1700 11.0 &
wait
./mac-post.sh
- name: macOS x86_64 RELEASE Archive
id: macOS-x86_64-RELEASE-Archive
uses: actions/upload-artifact@v2
with:
name: futurerestore-macOS-x86_64
name: futurerestore-macOS-x86_64-RELEASE
path: |
/Users/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-*.tar.xz
mac-arm64:
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
fetch-depth: 0
- name: macOS arm64 Build
id: mac-arm64
run: |
cd /Users/runner/work/futurerestore/futurerestore/.github/workflows
curl -sO https://mac.cryptiiiic.com/CI-Scripts/futurerestore-mac-arm64.sh
chmod +x futurerestore-mac-arm64.sh
if [[ "$(file futurerestore-mac-x86_64.sh)" == "futurerestore-mac-arm64.sh: a /usr/bin/env zsh script text executable, ASCII text" ]]; then ./futurerestore-mac-arm64.sh; else ./mac-arm64.sh; fi
- name: Archive
id: archive
/Users/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-macOS-x86_64-*-RELEASE.tar.xz
- name: macOS x86_64 DEBUG Archive
id: macOS-x86_64-DEBUG-Archive
uses: actions/upload-artifact@v2
with:
name: futurerestore-macOS-arm64
name: futurerestore-macOS-x86_64-DEBUG
path: |
/Users/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-*.tar.xz
linux:
/Users/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-macOS-x86_64-*-DEBUG.tar.xz
- name: macOS arm64 RELEASE Archive
id: macOS-arm64-RELEASE-Archive
uses: actions/upload-artifact@v2
with:
name: futurerestore-macOS-arm64-RELEASE
path: |
/Users/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-macOS-arm64-*-RELEASE.tar.xz
- name: macOS arm64 DEBUG Archive
id: macOS-arm64-DEBUG-Archive
uses: actions/upload-artifact@v2
with:
name: futurerestore-macOS-arm64-DEBUG
path: |
/Users/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-macOS-arm64-*-DEBUG.tar.xz
Linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
fetch-depth: 0
- name: Linux Build
id: linux
uses: addnab/docker-run-action@v3
with:
image: debian:buster-slim
options: -v ${{ github.workspace }}/..:/tmp/build/
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
fetch-depth: 0
- name: Linux Build
id: Linux
uses: addnab/docker-run-action@v3
with:
image: debian:buster-slim
options: -v ${{ github.workspace }}/..:/tmp/Builder/repos/
run: |
cd /tmp/Builder/repos/futurerestore/.github/workflows/
./linux-bootstrap.sh
./Builder Linux cctools
./Builder Linux x86_64 Release &
./Builder Linux x86_64 Debug &
wait
./linux-post.sh
- name: Linux x86_64 RELEASE Build
run: |
/tmp/build/futurerestore/.github/workflows/linux.sh
- name: Linux Copy
run: |
export FUTURERESTORE_VERSION_RELEASE=$(cat /home/runner/work/futurerestore/futurerestore/version.txt | tr -d '\n')
docker cp $(docker ps -ql):/tmp/build/futurerestore-${FUTURERESTORE_VERSION_RELEASE}-linux.tar.xz /home/runner/work/futurerestore/futurerestore/.github/workflows/
- name: Archive
id: archive
uses: actions/upload-artifact@v2
with:
name: futurerestore-linux
path: |
/home/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-*.tar.xz
mkdir -p /home/runner/work/futurerestore/futurerestore/.github/workflows/
docker cp $(docker ps -ql):/tmp/Builder/repos/futurerestore/.github/workflows/name1.txt /home/runner/work/futurerestore/futurerestore/.github/workflows/
docker cp $(docker ps -ql):/tmp/Builder/repos/futurerestore/.github/workflows/futurerestore1.tar.xz /home/runner/work/futurerestore/futurerestore/.github/workflows/
mv /home/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore1.tar.xz /home/runner/work/futurerestore/futurerestore/.github/workflows/$(cat /home/runner/work/futurerestore/futurerestore/.github/workflows/name1.txt)
- name: Linux x86_64 DEBUG Build
run: |
mkdir -p /home/runner/work/futurerestore/futurerestore/.github/workflows/
docker cp $(docker ps -ql):/tmp/Builder/repos/futurerestore/.github/workflows/name2.txt /home/runner/work/futurerestore/futurerestore/.github/workflows/
docker cp $(docker ps -ql):/tmp/Builder/repos/futurerestore/.github/workflows/futurerestore2.tar.xz /home/runner/work/futurerestore/futurerestore/.github/workflows/
mv /home/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore2.tar.xz /home/runner/work/futurerestore/futurerestore/.github/workflows/$(cat /home/runner/work/futurerestore/futurerestore/.github/workflows/name2.txt)
- name: futurerestore Linux x86_64 RELEASE Archive
id: futurerestore-Linux-x86_64-RELEASE-Archive
uses: actions/upload-artifact@v2
with:
name: futurerestore-Linux-x86_64-RELEASE
path: |
/home/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-Linux-x86_64*-RELEASE.tar.xz
- name: futurerestore Linux x86_64 DEBUG Archive
id: futurerestore-Linux-x86_64-DEBUG-Archive
uses: actions/upload-artifact@v2
with:
name: futurerestore-Linux-x86_64-DEBUG
path: |
/home/runner/work/futurerestore/futurerestore/.github/workflows/futurerestore-Linux-x86_64*-DEBUG.tar.xz

1701
.github/workflows/config.guess vendored Executable file

File diff suppressed because it is too large Load diff

29
.github/workflows/linux-bootstrap.sh vendored Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -e
export TMPDIR=/tmp
export BASE=${TMPDIR}/Builder/repos/futurerestore/.github/workflows
#sed -i 's/deb\.debian\.org/ftp.de.debian.org/g' /etc/apt/sources.list
apt-get -qq update
apt-get -yqq dist-upgrade
apt-get install --no-install-recommends -yqq zstd curl gnupg2 lsb-release wget software-properties-common build-essential git autoconf automake libtool-bin pkg-config cmake zlib1g-dev libminizip-dev libpng-dev libreadline-dev libbz2-dev libudev-dev libudev1
cp -RpP /usr/bin/ld /
rm -rf /usr/bin/ld /usr/lib/x86_64-linux-gnu/lib{usb-1.0,png*}.so*
cd ${TMPDIR}/Builder/repos/futurerestore
git submodule update --init --recursive
cd ${BASE}
curl -sO https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh 13 all
ln -sf /usr/bin/ld.lld-13 /usr/bin/ld
curl -sO https://cdn.cryptiiiic.com/bootstrap/Builder_Linux.tar.zst &
curl -sO https://cdn.cryptiiiic.com/deps/static/Linux/x86_64/Linux_x86_64_Release_Latest.tar.zst &
curl -sO https://cdn.cryptiiiic.com/deps/static/Linux/x86_64/Linux_x86_64_Debug_Latest.tar.zst &
wait
tar xf Linux_x86_64_Release_Latest.tar.zst -C ${TMPDIR}/Builder &
tar xf Linux_x86_64_Debug_Latest.tar.zst -C ${TMPDIR}/Builder &
tar xf Builder_Linux.tar.zst &
wait
rm -rf "*.zst"
cd ${BASE}

16
.github/workflows/linux-post.sh vendored Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
export TMPDIR=/tmp
export BASE=${TMPDIR}/Builder/repos/futurerestore/.github/workflows
cd ${BASE}/../../
export FUTURERESTORE_VERSION=$(git rev-list --count HEAD | tr -d '\n')
export FUTURERESTORE_VERSION_RELEASE=$(cat version.txt | tr -d '\n')
cd ${BASE}
echo "futurerestore-Linux-x86_64-${FUTURERESTORE_VERSION_RELEASE}-Build_${FUTURERESTORE_VERSION}-RELEASE.tar.xz" > name1.txt
echo "futurerestore-Linux-x86_64-${FUTURERESTORE_VERSION_RELEASE}-Build_${FUTURERESTORE_VERSION}-DEBUG.tar.xz" > name2.txt
cp -RpP "${TMPDIR}/Builder/Linux_x86_64_Release/bin/futurerestore" futurerestore
tar cpPJvf "futurerestore1.tar.xz" futurerestore
cp -RpP "${TMPDIR}/Builder/Linux_x86_64_Debug/bin/futurerestore" futurerestore
tar cpPJvf "futurerestore2.tar.xz" futurerestore

View file

@ -1,57 +0,0 @@
#!/usr/bin/env bash
echo 'step 1:'
set -e
export DIR=$(pwd)
export BASE=/tmp/build/
export C_ARGS="-fPIC -static"
export CXX_ARGS="-fPIC -static"
export LD_ARGS="-Wl,--allow-multiple-definition -static -L/usr/lib/x86_64-linux-gnu -L/tmp/out/lib"
export C_ARGS2="-fPIC"
export CXX_ARGS2="-fPIC"
export LD_ARGS2="-Wl,--allow-multiple-definition -L/usr/lib/x86_64-linux-gnu -L/tmp/out/lib"
export PKG_CFG="/tmp/out/lib/pkgconfig"
export CC_ARGS="CC=/usr/bin/clang-13 CXX=/usr/bin/clang++-13 LD=/usr/bin/ld.lld-13 RANLIB=/usr/bin/ranlib AR=/usr/bin/ar"
export CONF_ARGS="--prefix=/tmp/out --disable-dependency-tracking --disable-silent-rules --disable-debug --without-cython --disable-shared"
export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING=true -DCMAKE_C_FLAGS=${C_ARGS} -DCMAKE_CXX_FLAGS=${CXX_ARGS} -DCMAKE_SHARED_LINKER_FLAGS=${LD_ARGS} -DCMAKE_STATIC_LINKER_FLAGS=${LD_ARGS} -DCMAKE_INSTALL_PREFIX=/tmp/out -DBUILD_SHARED_LIBS=0 -Wno-dev"
export JNUM="-j$(($(nproc) / 2))"
export LNUM="-l$(($(nproc) / 2))"
cd ${BASE}
sed -i 's/deb\.debian\.org/ftp.de.debian.org/g' /etc/apt/sources.list
apt-get -qq update
apt-get -yqq dist-upgrade
apt-get install --no-install-recommends -yqq curl gnupg2 zstd lsb-release wget software-properties-common build-essential git autoconf automake libtool-bin pkg-config cmake zlib1g-dev libminizip-dev libpng-dev libreadline-dev libbz2-dev libudev-dev libudev1
curl -sO https://linux.cryptiiiic.com/CI-Scripts/linux.sh
chmod +x linux.sh
if [[ "$(file linux.sh)" == "linux.sh: Bourne-Again shell script, ASCII text executable" ]]
then
./linux.sh
else
cp -LRP /usr/bin/ld ~/
rm -rf /usr/bin/ld /usr/lib/x86_64-linux-gnu/lib{usb-1.0,png*}.so*
curl -sO https://apt.llvm.org/llvm.sh
chmod 0755 llvm.sh
./llvm.sh 13
ln -sf /usr/bin/ld.lld-13 /usr/bin/ld
echo 'step 2:'
curl -sO https://linux.cryptiiiic.com/CI-Scripts/linux.tar.zst
zstd -dk linux.tar.zst
tar xf ${BASE}/linux.tar -C / --warning=none || true || true
echo 'step 3:'
cd ${BASE}/futurerestore
export FUTURERESTORE_VERSION_RELEASE=$(cat version.txt | tr -d '\n')
git submodule init; git submodule update --recursive
cd external/tsschecker
git submodule init; git submodule update --recursive
cd ${BASE}/futurerestore
echo 'step 5:'
./autogen.sh ${CONF_ARGS} --enable-static ${CC_ARGS} CFLAGS="${C_ARGS2} -DIDEVICERESTORE_NOMAIN=1 -DTSSCHECKER_NOMAIN=1" LDFLAGS="${LD_ARGS2} -lpthread -ldl -lusb-1.0 -ludev -lusbmuxd-2.0 -llzfse -lcommon -lxpwn" PKG_CONFIG_PATH="${PKG_CFG}"
make $JNUM $LNUM
make $JNUM $LNUM install
echo 'step 6:'
cp /tmp/out/bin/futurerestore ${BASE}/futurerestore-${FUTURERESTORE_VERSION_RELEASE}
cd ${BASE}
tar cpJvf ${BASE}/futurerestore-${FUTURERESTORE_VERSION_RELEASE}-linux.tar.xz futurerestore-${FUTURERESTORE_VERSION_RELEASE}
ldd ${BASE}/futurerestore-${FUTURERESTORE_VERSION_RELEASE} || true
./futurerestore-${FUTURERESTORE_VERSION_RELEASE} || true
echo 'End'
fi

View file

@ -1,50 +0,0 @@
#!/usr/bin/env zsh
echo 'step 1:'
set -e
export DIR=$(pwd)
echo "export PROCURSUS=/opt/procursus" >> ~/.bash_profile
echo "export PATH=${PROCURSUS}/bin:${PROCURSUS}/libexec/gnubin:${PATH}" >> ~/.bash_profile
echo "export PROCURSUS=/opt/procursus" >> ~/.zshrc
echo "export PATH=${PROCURSUS}/bin:${PROCURSUS}/libexec/gnubin:${PATH}" >> ~/.zshrc
export BASE=/Users/runner/work/futurerestore/futurerestore/.github/workflows
export PROCURSUS=/opt/procursus
export PATH=${PROCURSUS}/bin:${PROCURSUS}/libexec/gnubin:${PATH}
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo 'step 2:'
curl -sO https://mac.cryptiiiic.com/CI-Scripts/bootstrap_arm64.tar.zst
zstd -dk bootstrap_arm64.tar.zst
sudo gtar xf ${BASE}/bootstrap_arm64.tar -C / --warning=none || true || true
sudo ${PROCURSUS}/bin/apt-get update -qq
sudo ${PROCURSUS}/bin/apt-get dist-upgrade -yqq
#sudo ${PROCURSUS}/bin/apt-get -yqq reinstall autopoint autoconf autoconf-archive automake bash bison cmake coreutils docbook-xml docbook-xsl dpkg fakeroot flex findutils gawk gnupg git grep groff ldid libtool make ncurses-bin openssl patch pkg-config po4a python3 sed tar triehash wget xz-utils zstd fd libgeneral-proc libimg4tool-proc libimobiledevice-glue-proc libimobiledevice-proc libinsn-proc libipatcher-proc libirecovery-proc liboffsetfinder64-proc libplist-proc libpng16-proc libssl-proc libusbmuxd-proc libxpwn-proc libzip-proc libfragmentzip-proc
echo 'step 3:'
cd ${BASE}/../..
export FUTURERESTORE_VERSION=$(git rev-list --count HEAD | tr -d '\n')
export FUTURERESTORE_VERSION_RELEASE=$(cat version.txt | tr -d '\n')
echo 'step 4:'
git submodule init; git submodule update --recursive
cd external/tsschecker
git submodule init; git submodule update --recursive
cd ${BASE}
mkdir -p /Users/runner/Procursus
sudo chown -R $(id -u):$(id -g) /Users/runner/Procursus
cd /Users/runner/Procursus
touch .keep
git init
git remote add origin https://github.com/ProcursusTeam/Procursus.git
git checkout -b main
git fetch origin 50c8311232cadc238a13673f734dcadc1b445537
git reset --hard FETCH_HEAD
git apply ${BASE}/proc_ci.diff
sudo chown -R $(id -u):$(id -g) /Users/runner/Procursus
echo 'step 5:'
gmake futurerestore-package NO_PGP=1 MEMO_TARGET=darwin-arm64 MEMO_CFVER=1700 DEBUG=0
echo 'step 6:'
rm -rf build_stage/darwin-arm64/1700/futurerestore/*
dpkg -X build_dist/darwin-arm64/1700/futurerestore*.deb build_stage/darwin-arm64/1700/futurerestore
cp -v build_stage/darwin-arm64/1700/futurerestore/opt/procursus/bin/futurerestore ${BASE}/futurerestore-arm64-${FUTURERESTORE_VERSION_RELEASE}
cd ${BASE}
otool -L ${BASE}/futurerestore-arm64-${FUTURERESTORE_VERSION_RELEASE} || true
${BASE}/futurerestore-arm64-${FUTURERESTORE_VERSION_RELEASE} || true
gtar cpJvf ${BASE}/futurerestore-${FUTURERESTORE_VERSION_RELEASE}-macOS-arm64.tar.xz futurerestore-arm64-${FUTURERESTORE_VERSION_RELEASE}
echo 'End'

33
.github/workflows/mac-bootstrap.sh vendored Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env zsh
set -e
export BASE=/Users/runner/work/futurerestore/futurerestore/.github/workflows
cd ${BASE}
curl -sO https://cdn.cryptiiiic.com/bootstrap/bootstrap_x86_64.tar.zst &
curl -sO https://cdn.cryptiiiic.com/bootstrap/Builder_macOS.tar.zst &
curl -sO https://cdn.cryptiiiic.com/deps/static/macOS/x86_64/macOS_x86_64_1300_Release_Latest.tar.zst &
curl -sO https://cdn.cryptiiiic.com/deps/static/macOS/arm64/macOS_arm64_1700_Release_Latest.tar.zst &
curl -sO https://cdn.cryptiiiic.com/deps/static/macOS/x86_64/macOS_x86_64_1300_Debug_Latest.tar.zst &
curl -sO https://cdn.cryptiiiic.com/deps/static/macOS/arm64/macOS_arm64_1700_Debug_Latest.tar.zst &
wait
sudo gtar xf ${BASE}/bootstrap_x86_64.tar.zst -C / --warning=none || true || true &
echo "${PROCURSUS}/bin" | sudo tee /etc/paths1
echo "${PROCURSUS}/libexec/gnubin" | sudo tee /etc/paths1
cat /etc/paths | sudo tee -a /etc/paths1
sudo mv /etc/paths{1,}
wait
mkdir -p ${TMPDIR}/Builder/repos
gtar xf macOS_x86_64_1300_Release_Latest.tar.zst -C ${TMPDIR}/Builder &
gtar xf macOS_x86_64_1300_Debug_Latest.tar.zst -C ${TMPDIR}/Builder &
gtar xf macOS_arm64_1700_Release_Latest.tar.zst -C ${TMPDIR}/Builder &
gtar xf macOS_arm64_1700_Debug_Latest.tar.zst -C ${TMPDIR}/Builder &
wait
gtar xf ${BASE}/Builder_macOS.tar.zst &
sudo ${PROCURSUS}/bin/apt-get update -qq
sudo ${PROCURSUS}/bin/apt-get dist-upgrade -yqq
sudo mv /usr/local/bin{,1}
ln -sf ${BASE}/../../ ${TMPDIR}/Builder/repos/futurerestore
cd ${TMPDIR}/Builder/repos/futurerestore
git submodule update --init --recursive
cd ${TMPDIR}/Builder/repos/futurerestore/.github/workflows

17
.github/workflows/mac-post.sh vendored Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
set -e
export BASE=${TMPDIR}/Builder/repos/futurerestore/.github/workflows
cd ${BASE}/../../
export FUTURERESTORE_VERSION=$(git rev-list --count HEAD | tr -d '\n')
export FUTURERESTORE_VERSION_RELEASE=$(cat version.txt | tr -d '\n')
cd ${BASE}
cp -RpP "${TMPDIR}/Builder/macOS_x86_64_1300_Release/bin/futurerestore" futurerestore
tar cpPJf "futurerestore-macOS-x86_64-${FUTURERESTORE_VERSION_RELEASE}-Build_${FUTURERESTORE_VERSION}-RELEASE.tar.xz" futurerestore
cp -RpP "${TMPDIR}/Builder/macOS_x86_64_1300_Debug/bin/futurerestore" futurerestore
tar cpPJf "futurerestore-macOS-x86_64-${FUTURERESTORE_VERSION_RELEASE}-Build_${FUTURERESTORE_VERSION}-DEBUG.tar.xz" futurerestore
cp -RpP "${TMPDIR}/Builder/macOS_arm64_1700_Release/bin/futurerestore" futurerestore
tar cpPJf "futurerestore-macOS-arm64-${FUTURERESTORE_VERSION_RELEASE}-Build_${FUTURERESTORE_VERSION}-RELEASE.tar.xz" futurerestore
cp -RpP "${TMPDIR}/Builder/macOS_arm64_1700_Debug/bin/futurerestore" futurerestore
tar cpPJf "futurerestore-macOS-arm64-${FUTURERESTORE_VERSION_RELEASE}-Build_${FUTURERESTORE_VERSION}-DEBUG.tar.xz" futurerestore

View file

@ -1,50 +0,0 @@
#!/usr/bin/env zsh
echo 'step 1:'
set -e
export DIR=$(pwd)
echo "export PROCURSUS=/opt/procursus" >> ~/.bash_profile
echo "export PATH=${PROCURSUS}/bin:${PROCURSUS}/libexec/gnubin:${PATH}" >> ~/.bash_profile
echo "export PROCURSUS=/opt/procursus" >> ~/.zshrc
echo "export PATH=${PROCURSUS}/bin:${PROCURSUS}/libexec/gnubin:${PATH}" >> ~/.zshrc
export BASE=/Users/runner/work/futurerestore/futurerestore/.github/workflows
export PROCURSUS=/opt/procursus
export PATH=${PROCURSUS}/bin:${PROCURSUS}/libexec/gnubin:${PATH}
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo 'step 2:'
curl -sO https://mac.cryptiiiic.com/CI-Scripts/bootstrap_x86_64.tar.zst
zstd -dk bootstrap_x86_64.tar.zst
sudo gtar xf ${BASE}/bootstrap_x86_64.tar -C / --warning=none || true || true
sudo ${PROCURSUS}/bin/apt-get update -qq
sudo ${PROCURSUS}/bin/apt-get dist-upgrade -yqq
#sudo ${PROCURSUS}/bin/apt-get -yqq reinstall autopoint autoconf autoconf-archive automake bash bison cmake coreutils docbook-xml docbook-xsl dpkg fakeroot flex findutils gawk gnupg git grep groff ldid libtool make ncurses-bin openssl patch pkg-config po4a python3 sed tar triehash wget xz-utils zstd fd libgeneral-proc libimg4tool-proc libimobiledevice-glue-proc libimobiledevice-proc libinsn-proc libipatcher-proc libirecovery-proc liboffsetfinder64-proc libplist-proc libpng16-proc libssl-proc libusbmuxd-proc libxpwn-proc libzip-proc libfragmentzip-proc
echo 'step 3:'
cd ${BASE}/../..
export FUTURERESTORE_VERSION=$(git rev-list --count HEAD | tr -d '\n')
export FUTURERESTORE_VERSION_RELEASE=$(cat version.txt | tr -d '\n')
echo 'step 4:'
git submodule init; git submodule update --recursive
cd external/tsschecker
git submodule init; git submodule update --recursive
cd ${BASE}
mkdir -p /Users/runner/Procursus
sudo chown -R $(id -u):$(id -g) /Users/runner/Procursus
cd /Users/runner/Procursus
touch .keep
git init
git remote add origin https://github.com/ProcursusTeam/Procursus.git
git checkout -b main
git fetch origin 50c8311232cadc238a13673f734dcadc1b445537
git reset --hard FETCH_HEAD
git apply ${BASE}/proc_ci.diff
sudo chown -R $(id -u):$(id -g) /Users/runner/Procursus
echo 'step 5:'
gmake futurerestore-package NO_PGP=1 MEMO_TARGET=darwin-amd64 MEMO_CFVER=1300 DEBUG=0
echo 'step 6:'
rm -rf build_stage/darwin-amd64/1300/futurerestore/*
dpkg -X build_dist/darwin-amd64/1300/futurerestore*.deb build_stage/darwin-amd64/1300/futurerestore
cp -v build_stage/darwin-amd64/1300/futurerestore/opt/procursus/bin/futurerestore ${BASE}/futurerestore-x86_64-${FUTURERESTORE_VERSION_RELEASE}
cd ${BASE}
otool -L ${BASE}/futurerestore-x86_64-${FUTURERESTORE_VERSION_RELEASE} || true
${BASE}/futurerestore-x86_64-${FUTURERESTORE_VERSION_RELEASE} || true
gtar cpJvf ${BASE}/futurerestore-${FUTURERESTORE_VERSION_RELEASE}-macOS-x86_64.tar.xz futurerestore-x86_64-${FUTURERESTORE_VERSION_RELEASE}
echo 'End'

File diff suppressed because it is too large Load diff

1
.gitignore vendored
View file

@ -12,6 +12,7 @@
aclocal.m4
autom4te.cache
compile
!.github/workflows/config.guess
config.*
configure
depcomp

View file

@ -76,6 +76,8 @@ Usage: `futurerestore [OPTIONS] iPSW`
| | ` --set-nonce=0xNONCE ` | Set custom nonce then exit recovery(requires use-pwndfu) |
| | ` --serial ` | Enable serial during boot(requires serial cable and use-pwndfu) |
| | ` --boot-args "BOOTARGS" ` | Set custom restore boot-args(PROCEED WITH CAUTION)(requires use-pwndfu) |
| | ` --no-cache ` | Disable cached patched iBSS/iBEC(requires use-pwndfu) |
| | ` --skip-blob ` | Skip SHSH blob validation(PROCEED WITH CAUTION)(requires use-pwndfu) |
| | ` --latest-sep ` | Use latest signed SEP instead of manually specifying one |
| ` -s ` | ` --sep PATH ` | Manually specify SEP to be flashed |
| ` -m ` | ` --sep-manifest PATH ` | BuildManifest for requesting SEP ticket |

View file

@ -509,28 +509,31 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, std::string bootarg
ibss_name.append(img3_end);
ibec_name.append(img3_end);
}
ibss = fopen(ibss_name.c_str(), "rb");
if(ibss) {
fseek(ibss, 0, SEEK_END);
iBSS.second = ftell(ibss);
fseek(ibss, 0, SEEK_SET);
retassure(iBSS.first = (char*)malloc(iBSS.second), "failed to malloc memory for Rose\n");
size_t freadRet=0;
retassure((freadRet = fread((char*)iBSS.first, 1, iBSS.second, ibss)) == iBSS.second, "failed to load iBSS. size=%zu but fread returned %zu\n",iBSS.second,freadRet);
fclose(ibss);
cache1 = true;
}
ibec = fopen(ibec_name.c_str(), "rb");
if(ibec) {
fseek(ibec, 0, SEEK_END);
iBEC.second = ftell(ibec);
fseek(ibec, 0, SEEK_SET);
retassure(iBEC.first = (char*)malloc(iBEC.second), "failed to malloc memory for Rose\n");
size_t freadRet=0;
retassure((freadRet = fread((char*)iBEC.first, 1, iBEC.second, ibec)) == iBEC.second, "failed to load iBEC. size=%zu but fread returned %zu\n",iBEC.second,freadRet);
fclose(ibec);
cache2 = true;
if(!_noCache) {
ibss = fopen(ibss_name.c_str(), "rb");
if (ibss) {
fseek(ibss, 0, SEEK_END);
iBSS.second = ftell(ibss);
fseek(ibss, 0, SEEK_SET);
retassure(iBSS.first = (char *) malloc(iBSS.second), "failed to malloc memory for Rose\n");
size_t freadRet = 0;
retassure((freadRet = fread((char *) iBSS.first, 1, iBSS.second, ibss)) == iBSS.second,
"failed to load iBSS. size=%zu but fread returned %zu\n", iBSS.second, freadRet);
fclose(ibss);
cache1 = true;
}
ibec = fopen(ibec_name.c_str(), "rb");
if (ibec) {
fseek(ibec, 0, SEEK_END);
iBEC.second = ftell(ibec);
fseek(ibec, 0, SEEK_SET);
retassure(iBEC.first = (char *) malloc(iBEC.second), "failed to malloc memory for Rose\n");
size_t freadRet = 0;
retassure((freadRet = fread((char *) iBEC.first, 1, iBEC.second, ibec)) == iBEC.second,
"failed to load iBEC. size=%zu but fread returned %zu\n", iBEC.second, freadRet);
fclose(ibec);
cache2 = true;
}
}
/* Patch bootloaders */
@ -1311,22 +1314,25 @@ void futurerestore::doRestore(const char *ipsw){
for now a simple pointercompare should be fine, because both plist_t should point into the same buildidentity inside the buildmanifest */
if (ticketIdentity != build_identity ){
error("BuildIdentity selected for restore does not match APTicket\n\n");
printf("BuildIdentity selected for restore:\n");
info("BuildIdentity selected for restore:\n");
img4tool::printGeneralBuildIdentityInformation(build_identity);
printf("\nBuildIdentity is valid for the APTicket:\n");
info("\nBuildIdentity is valid for the APTicket:\n");
if (ticketIdentity) img4tool::printGeneralBuildIdentityInformation(ticketIdentity),putchar('\n');
else{
printf("IM4M is not valid for any restore within the Buildmanifest\n");
printf("This APTicket can't be used for restoring this firmware\n");
info("IM4M is not valid for any restore within the Buildmanifest\n");
info("This APTicket can't be used for restoring this firmware\n");
}
reterror("APTicket can't be used for this restore\n");
}else{
if (!img4tool::isIM4MSignatureValid({im4m.first,im4m.second})){
printf("IM4M signature is not valid!\n");
if(_skipBlob) {
info("[WARNING] NOT VALIDATING SHSH BLOBS!\n");
} else {
reterror("APTicket can't be used for this restore\n");
}
printf("Verified APTicket to be valid for this restore\n");
}else{
if (!img4tool::isIM4MSignatureValid({im4m.first,im4m.second})){
info("IM4M signature is not valid!\n");
}
info("Verified APTicket to be valid for this restore\n");
}
}else if (_enterPwnRecoveryRequested){
info("[WARNING] skipping ramdisk hash check, since device is in pwnDFU according to user\n");

View file

@ -84,7 +84,10 @@ class futurerestore {
const char *_custom_nonce = NULL;
const char *_boot_args = NULL;
bool _noCache = false;
bool _skipBlob = false;
bool _enterPwnRecoveryRequested = false;
bool _rerestoreiOS9 = false;
//methods
@ -134,6 +137,8 @@ public:
void setKernelPath(const char *kernelPath);
void setNonce(const char *custom_nonce){_custom_nonce = custom_nonce;};
void setBootArgs(const char *boot_args){_boot_args = boot_args;};
void disableCache(){_noCache = true;};
void skipBlobValidation(){_skipBlob = true;};
bool isUpdateInstall(){return _isUpdateInstall;};
plist_t sepManifest(){return _sepbuildmanifest;};

View file

@ -55,6 +55,8 @@ static struct option longopts[] = {
{ "set-nonce", optional_argument, NULL, '7' },
{ "serial", no_argument, NULL, '8' },
{ "boot-args", required_argument, NULL, '9' },
{ "no-cache", no_argument, NULL, 'a' },
{ "skip-blob", no_argument, NULL, 'c' },
#endif
{ NULL, 0, NULL, 0 }
};
@ -71,7 +73,9 @@ static struct option longopts[] = {
#define FLAG_SET_NONCE 1 << 9
#define FLAG_SERIAL 1 << 10
#define FLAG_BOOT_ARGS 1 << 11
#define FLAG_NO_RESTORE_FR 1 << 12
#define FLAG_NO_CACHE 1 << 12
#define FLAG_SKIP_BLOB 1 << 13
#define FLAG_NO_RESTORE_FR 1 << 14
void cmd_help(){
printf("Usage: futurerestore [OPTIONS] iPSW\n");
printf("Allows restoring to non-matching firmware with custom SEP+baseband\n");
@ -94,6 +98,8 @@ void cmd_help(){
printf(" --set-nonce=0xNONCE\tSet custom nonce then exit recovery(requires use-pwndfu)\n");
printf(" --serial\t\t\tEnable serial during boot(requires serial cable and use-pwndfu)\n");
printf(" --boot-args\t\tSet custom restore boot-args(PROCEED WITH CAUTION)(requires use-pwndfu)\n");
printf(" --no-cache\t\tDisable cached patched iBSS/iBEC(requires use-pwndfu)\n");
printf(" --skip-blob\t\tSkip SHSH blob validation(PROCEED WITH CAUTION)(requires use-pwndfu)\n");
#endif
printf("\nOptions for SEP:\n");
@ -158,7 +164,7 @@ int main_r(int argc, const char * argv[]) {
return -1;
}
while ((opt = getopt_long(argc, (char* const *)argv, "ht:b:p:s:m:wudez0123456789", longopts, &optindex)) > 0) {
while ((opt = getopt_long(argc, (char* const *)argv, "ht:b:p:s:m:wudez0123456789ac", longopts, &optindex)) > 0) {
switch (opt) {
case 't': // long option: "apticket"; can be called as short option
apticketPaths.push_back(optarg);
@ -222,6 +228,12 @@ int main_r(int argc, const char * argv[]) {
flags |= FLAG_BOOT_ARGS;
bootargs = (optarg) ? optarg : NULL;
break;
case 'a': // long option: "no-cache";
flags |= FLAG_NO_CACHE;
break;
case 'c': // long option: "skip-blob";
flags |= FLAG_SKIP_BLOB;
break;
#endif
case 'e': // long option: "exit-recovery"; can be called as short option
exitRecovery = true;
@ -279,6 +291,10 @@ int main_r(int argc, const char * argv[]) {
}
if(flags & FLAG_BOOT_ARGS)
retassure((flags & FLAG_IS_PWN_DFU),"--boot-args requires --use-pwndfu\n");
if(flags & FLAG_NO_CACHE)
retassure((flags & FLAG_IS_PWN_DFU),"--no-cache requires --use-pwndfu\n");
if(flags & FLAG_SKIP_BLOB)
retassure((flags & FLAG_IS_PWN_DFU),"--skip-blob requires --use-pwndfu\n");
if (exitRecovery) {
client.exitRecovery();
@ -329,6 +345,14 @@ int main_r(int argc, const char * argv[]) {
client.setBootArgs(bootargs);
}
if(flags & FLAG_NO_CACHE) {
client.disableCache();
}
if(flags & FLAG_SKIP_BLOB) {
client.skipBlobValidation();
}
if (flags & FLAG_LATEST_SEP){
info("user specified to use latest signed SEP\n");
client.loadLatestSep();