2011-06-28 20:58:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2011-07-08 14:18:54 +00:00
|
|
|
# Include common bits
|
|
|
|
. inc/releng_getopts.inc
|
|
|
|
|
|
|
|
# Each releng_ test should decide whether or not it need
|
|
|
|
# a xorriso binary to test, since some do compilations only.
|
|
|
|
if [ ! -x $RELENG_XORRISO ]; then
|
|
|
|
print_help
|
|
|
|
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
|
|
|
exit 31
|
|
|
|
fi
|
|
|
|
|
|
|
|
# check data dir, if any and after checking -x xorriso
|
|
|
|
if [ -d "${GEN_DATA_DIR}" ]; then
|
|
|
|
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
|
|
|
printf "\n${SELF}: use '${SELF} -c1' to remove.\n"
|
|
|
|
exit 8
|
|
|
|
else
|
|
|
|
mkdir "${GEN_DATA_DIR}"
|
|
|
|
fi
|
|
|
|
|
2011-06-28 20:58:56 +00:00
|
|
|
RELENG_GENISOIMAGE=/usr/bin/genisoimage
|
|
|
|
RELENG_MKISOFS=/usr/bin/mkisofs
|
2011-06-29 17:44:03 +00:00
|
|
|
UPPER=40
|
2011-07-08 14:18:54 +00:00
|
|
|
|
|
|
|
# All must be set at this point
|
2011-07-09 09:58:57 +00:00
|
|
|
printf "\n${SELF}: Generating sample tree in ${GEN_DATA_DIR}..."
|
2011-06-28 20:58:56 +00:00
|
|
|
for ((i1=0; i1 < ${UPPER}/4; i1++))
|
|
|
|
do
|
|
|
|
for ((i2=0; i2 < ${UPPER}/2; i2++))
|
|
|
|
do
|
|
|
|
for ((i3=0; i3 < ${UPPER}; i3++))
|
|
|
|
do
|
|
|
|
mkdir -p ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3
|
|
|
|
touch ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3/FileOne
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
2011-07-06 11:30:10 +00:00
|
|
|
printf "done.\n"
|
2011-06-28 20:58:56 +00:00
|
|
|
|
|
|
|
# Disk cache might play dirty games, so re-run these several times?
|
|
|
|
if [ -x ${RELENG_XORRISO} ]; then
|
2011-07-06 11:30:10 +00:00
|
|
|
printf "\n${SELF}: Running ${RELENG_XORRISO} -as mkisofs -quiet -print-size ${GEN_DATA_DIR}\n"
|
2011-06-28 20:58:56 +00:00
|
|
|
time ${RELENG_XORRISO} -as mkisofs -quiet -print-size ${GEN_DATA_DIR}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x ${RELENG_GENISOIMAGE} ]; then
|
2011-07-06 11:30:10 +00:00
|
|
|
printf "\n${SELF}: Running ${RELENG_GENISOIMAGE} -quiet -print-size ${GEN_DATA_DIR}\n"
|
2011-06-28 20:58:56 +00:00
|
|
|
time ${RELENG_GENISOIMAGE} -quiet -print-size ${GEN_DATA_DIR}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x ${RELENG_MKISOFS} ]; then
|
2011-07-06 11:30:10 +00:00
|
|
|
printf "\n${SELF}: Running ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR}\n"
|
2011-06-28 20:58:56 +00:00
|
|
|
time ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR}
|
|
|
|
fi
|
|
|
|
|
2011-07-09 09:27:12 +00:00
|
|
|
#
|
|
|
|
cleanup
|
2011-06-28 20:58:56 +00:00
|
|
|
|
2011-07-09 09:27:12 +00:00
|
|
|
#
|
2011-06-29 17:44:03 +00:00
|
|
|
exit 0
|