Last active
June 9, 2016 09:38
-
-
Save MilhouseVH/b5c7d9266b84674db3a1303d298cb2b7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
TMPDIR=/home/neil/projects/extract | |
IMGMAX=${1:-3} | |
DOSYNC=${2:-Y} | |
echo "PROCESSES: ${IMGMAX}" | |
echo "DO SYNC : ${DOSYNC}" | |
function checkimage() | |
{ | |
echo | |
echo "CHECKING $1:" | |
local loop | |
sudo kpartx -av $1 | |
loop="$(sudo kpartx -l $1 | head -1 | awk '{ print $1 }')" | |
sudo fsck -a /dev/mapper/${loop} | |
sudo kpartx -d $1 | |
} | |
rm -fr /tmp/img*.img.gz /tmp/img*.img | |
for ((i=1; i<=$IMGMAX; i++)); do | |
# ./mkimage ${i} ${DOSYNC} & | |
echo "IMAGE: ${i}..." | |
./mkimage 1 ${DOSYNC} || exit | |
done | |
#wait | |
exit | |
cd $TMPDIR | |
mv /tmp/img*.img.gz $TMPDIR | |
gunzip -vf img*.gz | |
for ((i=1; i<=$IMGMAX; i++)); do | |
checkimage img${i}.img | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment