Skip to content

Instantly share code, notes, and snippets.

@AndroPlus-org
Created July 9, 2022 12:14
Show Gist options
  • Save AndroPlus-org/5d8336fe51ab260764b0214e2784c74e to your computer and use it in GitHub Desktop.
Save AndroPlus-org/5d8336fe51ab260764b0214e2784c74e to your computer and use it in GitHub Desktop.
Unpack / extract data from EROFS image (It needs CONFIG_EROFS_FS=y kernel)
#!/bin/bash
mkdir -p data mountpoint
dir_path=`pwd`
dirs=`find ${dir_path}/* -maxdepth 0 -size +1c -type f -name "*.img"`
for dir in $dirs;
do
file=`basename $dir`
filename=`basename $dir .img`
echo $filename
sudo mount -t erofs -o loop $file mountpoint
sudo rsync -zarvhP mountpoint/ data
mv data $filename
sudo umount mountpoint
done
rmdir data mountpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment