Skip to content

Instantly share code, notes, and snippets.

@djeraseit
Forked from XMB5/ipsw-extract.sh
Created July 15, 2020 01:56
Show Gist options
  • Save djeraseit/dd142690488effc6551c3a2c1661baaa to your computer and use it in GitHub Desktop.
Save djeraseit/dd142690488effc6551c3a2c1661baaa to your computer and use it in GitHub Desktop.
extract ipsw root file system on linux
#!/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