Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent
This commit is contained in:
commit
016734b818
|
@ -143,3 +143,15 @@ unload_modules() {
|
|||
|
||||
return 0
|
||||
}
|
||||
|
||||
unused_loop_device() {
|
||||
for DEVICE in `ls -1 /dev/loop*`; do
|
||||
losetup $DEVICE &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo $DEVICE
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
die "Error: Unable to find unused loopback device"
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
|||
|
||||
zpool_create() {
|
||||
for FILE in ${FILES}; do
|
||||
DEVICE=`/sbin/losetup -f`
|
||||
DEVICE=`unused_loop_device`
|
||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||
rm -f ${FILE} || exit 1
|
||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||
|
|
|
@ -13,7 +13,7 @@ DEVICES_M2=""
|
|||
|
||||
zpool_create() {
|
||||
for FILE in ${FILES_M1}; do
|
||||
DEVICE=`/sbin/losetup -f`
|
||||
DEVICE=`unused_loop_device`
|
||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||
rm -f ${FILE} || exit 1
|
||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
|||
|
||||
zpool_create() {
|
||||
for FILE in ${FILES}; do
|
||||
DEVICE=`/sbin/losetup -f`
|
||||
DEVICE=`unused_loop_device`
|
||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||
rm -f ${FILE} || exit 1
|
||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
|||
|
||||
zpool_create() {
|
||||
for FILE in ${FILES}; do
|
||||
DEVICE=`/sbin/losetup -f`
|
||||
DEVICE=`unused_loop_device`
|
||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||
rm -f ${FILE} || exit 1
|
||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||
|
|
Loading…
Reference in New Issue