2 # fetch-liveupdate - fetch an update image for dmsquash-live media.
3 # this gets called by the "initqueue/online" hook for each network interface
6 # no updates requested? we're not needed.
7 [ -e /tmp
/liveupdates.info
] ||
return 0
9 command -v getarg
>/dev
/null || .
/lib
/dracut-lib.sh
10 command -v fetch_url
>/dev
/null || .
/lib
/url-lib.sh
11 command -v unpack_img
>/dev
/null || .
/lib
/img-lib.sh
13 read url
< /tmp
/liveupdates.info
15 info
"fetching live updates from $url"
17 fetch_url
"$url" /tmp
/updates.img
19 warn
"failed to fetch update image!"
24 unpack_img
/tmp
/updates.img
/updates.tmp.$$
26 warn
"failed to unpack update image!"
30 copytree
/updates.tmp.$$
/updates
31 mv /tmp
/liveupdates.info
/tmp
/liveupdates.
done