Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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