# livenetroot - fetch a live image from the network and run it
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
[ -e /tmp/livenet.downloaded ] && exit 0
# args get passed from 40network/netroot
liveurl="${netroot#livenet:}"
imgfile=$(fetch_url "$liveurl")
warn "failed to download live image: error $?"
> /tmp/livenet.downloaded
# TODO: couldn't dmsquash-live-root handle this?
if [ ${imgfile##*.} = "iso" ]; then
exec /sbin/dmsquash-live-root $root