-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix for passing closures, more automated image generation
- Loading branch information
Showing
21 changed files
with
347 additions
and
40 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
all: ext2.img vfat.img nilfs.img | ||
|
||
format: ext2.img vfat.img nilfs.img | ||
./loopback_fs_setup.sh ext2.img ext2 && ./gen_files.sh && ./loopback_fs_teardown.sh | ||
./loopback_fs_setup.sh vfat.img vfat && ./gen_files.sh && ./loopback_fs_teardown.sh | ||
./loopback_fs_setup.sh nilfs.img nilfs2 && ./gen_files.sh && ./loopback_fs_teardown.sh | ||
|
||
clean: | ||
rm -f *.img | ||
|
||
|
||
ext2.img: | ||
dd if=/dev/zero of=ext2.img bs=`expr 1024 \* 1024` count=100 | ||
yes | /sbin/mkfs.ext2 ext2.img | ||
|
||
vfat.img: | ||
dd if=/dev/zero of=vfat.img bs=`expr 1024 \* 1024` count=100 | ||
yes | /usr/sbin/mkfs.vfat vfat.img | ||
|
||
nilfs.img: | ||
dd if=/dev/zero of=nilfs.img bs=`expr 1024 \* 1024` count=256 | ||
yes | /sbin/mkfs.nilfs2 -L mkfsnilfs -b 4096 nilfs.img |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
|
||
sudo chmod -R 777 /mnt/FSTEST | ||
|
||
for a in `seq 5`; do | ||
echo "A$a" >/mnt/FSTEST/"$a".aaa | ||
done | ||
|
||
for b in `seq 5`; do | ||
mkdir -p /mnt/FSTEST/"$b"d | ||
for a in `seq 5`; do | ||
echo "AAA$a" >/mnt/FSTEST/"$b"d/$a.qqq | ||
done | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# associate image with lo, mount fs image | ||
|
||
FS_IMAGE="$1" | ||
FS_TYPE="$2" | ||
|
||
if [ -z $FS_IMAGE ]; then | ||
echo "No file given!" | ||
exit -1 | ||
fi | ||
|
||
sudo /sbin/losetup /dev/loop5 "$FS_IMAGE" | ||
|
||
retval=$? | ||
if [ $retval -ne 0 ]; then | ||
exit $retval | ||
fi | ||
|
||
FLAGS="" | ||
if [ "$FS_TYPE" = "vfat" ]; then | ||
FLAGS=-oumask=000,uid=1000 | ||
echo $FLAGS | ||
fi | ||
|
||
sudo /bin/mount -t "$FS_TYPE" /dev/loop5 /mnt/FSTEST $FLAGS | ||
retval=$? | ||
|
||
if [ $retval -ne 0 ]; then | ||
echo "Bad mount!" | ||
sudo /sbin/losetup -d /dev/loop5 | ||
exit $retval | ||
fi | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# unmount fs, deassociate image with lo | ||
sudo /bin/umount /mnt/FSTEST | ||
retval=$? | ||
if [ $retval -ne 0 ]; then | ||
echo "Failed to unmount." | ||
fi | ||
|
||
sudo /sbin/losetup -d /dev/loop5 | ||
retval=$? | ||
|
||
if [ $retval -ne 0 ]; then | ||
echo "Failed to losetup -d" | ||
fi | ||
|
||
exit $retval |
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
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
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
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
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
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
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
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
Oops, something went wrong.