Commit Graph

24 Commits (0a66b74b51f7d58916504e0e8bb01b6e981b489b)

Author SHA1 Message Date
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Harald Hoyer e84af01462 url-lib: check for ctorrent binary before adding the url handler 2014-08-15 17:35:11 +02:00
Antony Messerli 338bad6393 Adds bittorrent support for live images
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.
2014-08-15 17:29:33 +02:00
Stig Telfer 1f28dfb2e4 url-lib: extend to enable TFTP support
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
2014-01-28 15:43:40 +01:00
Harald Hoyer 5c274467d6 url-lib.sh: handle 0-size files with curl
https://bugzilla.redhat.com/show_bug.cgi?id=989133#c9
2013-08-20 16:15:17 +02:00
Harald Hoyer b093aa2dc7 beautified shell code
checked with shellcheck http://www.shellcheck.net/about.html
2013-07-04 12:31:15 +02:00
Harald Hoyer 1b8616adee url-lib/url-lib.sh: turn off curl globbing
https://bugzilla.redhat.com/show_bug.cgi?id=907497
2013-05-28 16:16:26 +02:00
Harald Hoyer 31ba4de21d url-lib/url-lib.sh: remove bashism
remove the forgotten bashism "+="
2013-02-19 16:13:49 +01:00
Harald Hoyer 6ecb9a2d68 url-lib/url-lib.sh: add proxy support for curl 2013-02-11 13:56:04 +01:00
Harald Hoyer 918a6874df url-lib/url-lib.sh: remove bashisms 2013-02-11 13:55:44 +01:00
Harald Hoyer 7fa3b9e376 url-lib/url-lib.sh: turn off curl globbing
https://bugzilla.redhat.com/show_bug.cgi?id=907497
2013-02-08 16:52:38 +01:00
Brian C. Lane 13cb578a37 Add rd.noverifyssl argument (#852229)
This adds --insecure to the curl args so that self-signed certificates
will be accepted.
2012-10-09 17:37:29 +02:00
Harald Hoyer 914f531f39 45url-lib/url-lib.sh: give info what URL curl failed to download
https://bugzilla.redhat.com/show_bug.cgi?id=857836

Also allow self signed Certs and use "--insecure".

https://bugzilla.redhat.com/show_bug.cgi?id=852229
2012-09-18 16:31:24 +02:00
Harald Hoyer eecb3d5552 url-lib/url-lib.sh: disable curl progress bar
https://bugzilla.redhat.com/show_bug.cgi?id=817301
https://bugzilla.redhat.com/show_bug.cgi?id=824883
2012-05-29 16:18:22 +02:00
Will Woods dc1504121b url-lib: don't use --progress-bar if TERM=dumb (RHBZ#814713)
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
2012-04-23 11:25:20 +02:00
Will Woods c6a91ec992 url-lib: don't add existing handlers multiple times
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.
2012-04-23 11:25:20 +02:00
Will Woods 7e60091c6b url-lib: clean up output
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
2012-03-09 11:13:08 +01:00
Will Woods 8a0d2fc56f url-lib: make nfs support optional
Only include /lib/nfs-lib.sh if it exists, and then only run
add_url_handler if nfs-lib was imported.
2012-03-02 11:11:56 +01:00
Jan Stodola 778f767bcc Fix correct nfs path 2012-03-02 11:10:59 +01:00
Will Woods ed293f6d0c url-lib: fix fetch_url return value for dotfiles
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>
2012-02-21 10:11:11 +01:00
Harald Hoyer 4977febf46 s/bash/sh for all new *-lib.sh 2012-02-15 15:46:24 +01:00
Will Woods d663f5aeb0 add set_http_header to url-lib
This allows you to set custom headers for curl to send with HTTP
requests.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods 370329ca3b url-lib: add support for NFS
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>
2012-02-15 15:46:24 +01:00
Will Woods 753c82d0e6 add module 45url-lib
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>
2012-02-15 15:46:24 +01:00