]>
Commit | Line | Data |
---|---|---|
6d2a7943 WW |
1 | #!/bin/bash |
2 | # livenetroot - fetch a live image from the network and run it | |
6d2a7943 WW |
3 | |
4 | type 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 |
9 | PATH=/usr/sbin:/usr/bin:/sbin:/bin |
10 | ||
11 | # args get passed from 40network/netroot | |
5978983b WW |
12 | netroot="$2" |
13 | liveurl="${netroot#livenet:}" | |
14 | info "fetching $liveurl" | |
15 | imgfile=$(fetch_url "$liveurl") | |
16 | [ $? = 0 ] || die "failed to download live image: error $?" | |
17 | ||
18 | # TODO: couldn't dmsquash-live-root handle this? | |
19 | if [ ${imgfile##*.} = "iso" ]; then | |
6d2a7943 WW |
20 | root=$(losetup -f) |
21 | losetup $root $imgfile | |
22 | else | |
23 | root=$imgfile | |
24 | fi | |
5978983b | 25 | |
6d2a7943 | 26 | exec /sbin/dmsquash-live-root $root |