This patch adds bittorrent support to 45url-lib for those that might want
to retrieve the same live image for multiple systems at once without
saturating the network.
This patch requires ctorrent to be installed into initramfs.
Torrent kernel command line format:
root=live:torrent://example.com/liveboot.img.torrent
Start a tracker:
bttrack --bind <tracker_ip> --port 6969 --dfile dstate --reannounce_interval 60
Create the torrent:
ctorrent -t live_image -u http://<tracker_ip>:6969/announce -s live_image.torrent
Seed the initial torrent:
ctorrent live_image.torrent
Boot the live image.
Add new functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.
These functions print a warning line telling the user, which binary is
missing for the specific dracut module.
This unifies the way of checking for binaries and makes the life of an
initramfs creator easier, if he wants to find out why a specific dracut
module is not included in the initramfs.
Libcurl has wider capabilities than those assigned to it by Dracut.
In this patch to url-lib I've added registration for TFTP URLs,
which I've found to be useful.
Enjoy,
Stig Telfer
Basically, s390 is the only place I've ever seen TERM=dumb, and it's too
dumb to handle '\r', so --progress-bar produces waaaaay too much output.
The normal progress meter only prints something once per second, so
that's reasonable on terminals where '\r' doesn't work.
See also: https://bugzilla.redhat.com/show_bug.cgi?id=814713
Every time url-lib gets imported we end up making the list of handlers
longer with redundant entries. That's silly - we shouldn't add items
that already exist.
Note that this means you'll have to manipulate the handler list yourself
if you want to change the position/priority of existing handlers.
For curl_fetch_url (http/https/ftp):
- use --progress-bar (the output is less messy)
- print the URL we're fetching so the user know's what's happening
For curl and nfs:
- don't echo the filename if it was provided by the user
If you do "fetch_url $url/.somefile", fetch_url would return failure,
because "$outdir/*" wouldn't match the file.
Use ls -A (which busybox ls supports) to actually find possible dotfiles
in the created output dir.
Signed-off-by: Will Woods <wwoods@redhat.com>
This adds nfs_fetch_url to allow fetching arbitrary files from NFS.
This means that livenet can now run using an NFS-mounted live image,
which reduces memory usage by a lot.
Signed-off-by: Will Woods <wwoods@redhat.com>
url-lib adds some functions for dealing with URLs (mostly for fetching
files, for the moment).
It uses curl to handle http/https/ftp URLs, but it can be extended by other
modules at runtime by using the "add_url_handler" function.
Signed-off-by: Will Woods <wwoods@redhat.com>