]> git.ipfire.org Git - thirdparty/dracut.git/blame - modules.d/90livenet/livenetroot.sh
Renamed all shell scripts to *.sh
[thirdparty/dracut.git] / modules.d / 90livenet / livenetroot.sh
CommitLineData
6d2a7943
WW
1#!/bin/bash
2# livenetroot - fetch a live image from the network and run it
6d2a7943
WW
3
4type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
5[ -f /tmp/root.info ] && . /tmp/root.info
6
5978983b
WW
7. /lib/url-lib.sh
8
6d2a7943
WW
9PATH=/usr/sbin:/usr/bin:/sbin:/bin
10
11# args get passed from 40network/netroot
5978983b
WW
12netroot="$2"
13liveurl="${netroot#livenet:}"
14info "fetching $liveurl"
15imgfile=$(fetch_url "$liveurl")
16[ $? = 0 ] || die "failed to download live image: error $?"
17
18# TODO: couldn't dmsquash-live-root handle this?
19if [ ${imgfile##*.} = "iso" ]; then
6d2a7943
WW
20 root=$(losetup -f)
21 losetup $root $imgfile
22else
23 root=$imgfile
24fi
5978983b 25
6d2a7943 26exec /sbin/dmsquash-live-root $root