Merge commit 'refs/top-bases/linux-zpios' into linux-zpios
This commit is contained in:
commit
8e5f7bd9d5
|
@ -143,3 +143,15 @@ unload_modules() {
|
||||||
|
|
||||||
return 0
|
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() {
|
zpool_create() {
|
||||||
for FILE in ${FILES}; do
|
for FILE in ${FILES}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
|
@ -13,7 +13,7 @@ DEVICES_M2=""
|
||||||
|
|
||||||
zpool_create() {
|
zpool_create() {
|
||||||
for FILE in ${FILES_M1}; do
|
for FILE in ${FILES_M1}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
||||||
|
|
||||||
zpool_create() {
|
zpool_create() {
|
||||||
for FILE in ${FILES}; do
|
for FILE in ${FILES}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
||||||
|
|
||||||
zpool_create() {
|
zpool_create() {
|
||||||
for FILE in ${FILES}; do
|
for FILE in ${FILES}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
Loading…
Reference in New Issue