Created
July 9, 2022 12:14
-
-
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)
This file contains 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 | |
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