Skip to content

Instantly share code, notes, and snippets.

@XMB5
Created September 28, 2018 23:52
Show Gist options
  • Save XMB5/ccc46c9ce755309e670d8cbfa17aa584 to your computer and use it in GitHub Desktop.
Save XMB5/ccc46c9ce755309e670d8cbfa17aa584 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"
@shiypc
Copy link

shiypc commented Mar 16, 2021

Is this for macOS?

@XMB5
Copy link
Author

XMB5 commented Mar 16, 2021

no, but you could do a similar procedure on macos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment