mirror of
https://github.com/ipxe/ipxe
synced 2025-12-07 09:50:26 +03:00
[contrib] Allow "cow" script to create the SAN device itself
Allow for an invocation pattern such as: ./cow /path/to/image/file vblade 1 2 eth0 Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -19,9 +19,10 @@ function cleanup () {
|
|||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
imgfile=$1
|
imgfile=$1 ; shift
|
||||||
if [ -z "$imgfile" ] ; then
|
command=$1 ; shift
|
||||||
echo Syntax: $0 /path/to/image/file
|
if [ -z "$imgfile" -o -z "$command" ] ; then
|
||||||
|
echo Syntax: $0 /path/to/image/file command [args..]
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -45,4 +46,4 @@ x=$imgfile.cow ; ln -s /dev/mapper/$dmname $x ; cowlink=$x
|
|||||||
|
|
||||||
# Wait until killed
|
# Wait until killed
|
||||||
echo "Created $cowlink"
|
echo "Created $cowlink"
|
||||||
while : ; do sleep 2147483647 ; done
|
$command "$@" $cowlink
|
||||||
|
|||||||
Reference in New Issue
Block a user