-
-
Save djeraseit/dd142690488effc6551c3a2c1661baaa to your computer and use it in GitHub Desktop.
extract ipsw root file system on linux
This file contains hidden or 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 | |
USAGE=$'extract ipsw root file system on linux | |
usage: ipsw-extract.sh iPhone_Restore.ipsw | |
requires apfs-fuse - https://github.com/sgan81/apfs-fuse' | |
if [ -z "$1" ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
mkdir extract | |
unzip "$1" -d extract | |
cd extract | |
#ramdisk is the largest file | |
RAMDISK="$(find . -maxdepth 1 -printf '%s %p\n' | sort -nr | head -n 1 | cut -d' ' -f 2-)" | |
echo "ramdisk filename: $RAMDISK" | |
mkdir mount | |
sudo apfs-fuse "$RAMDISK" mount | |
MOUNT_FULL="$(readlink -f mount)" | |
echo "ramdisk mounted on $MOUNT_FULL" | |
echo "to unmount, run sudo fusermount -u $MOUNT_FULL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment