curl für die DBox2?

Kreuzuebersetzer, Diskussion über Änderungen im Tuxbox-CDK und Tuxbox-CVS
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

curl für die DBox2?

Beitrag von 3PO »

Hallo Zusammen,

nachdem ja der wget der Busybox ja sehr eingeschränkt ist, wollte ich mal fragen, ob es eine Möglichkeit gibt, curl zu installieren.

Da ich eine 1GB SD-Karte eingebaut habe, sollte es vom Platz her keine Probleme geben.

Das müsste doch mit: LD_LIBRARY_PATH= zu machen sein, oder?
Houdini
Developer
Beiträge: 2183
Registriert: Mittwoch 10. Dezember 2003, 07:59

Re: curl für die DBox2?

Beitrag von Houdini »

ist doch schon mit drin:

Code: Alles auswählen

/ # ls -la /lib/libcu*
-rw-r--r--    1 root     root       124236 Jan 16 21:21 /lib/libcurl.so.2
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

Houdini hat geschrieben:ist doch schon mit drin:

Code: Alles auswählen

/ # ls -la /lib/libcu*
-rw-r--r--    1 root     root       124236 Jan 16 21:21 /lib/libcurl.so.2
....Nur leider bin ich da nicht so der Profi.

Was muss ich denn tun, um curl benutzen zu können?
Houdini
Developer
Beiträge: 2183
Registriert: Mittwoch 10. Dezember 2003, 07:59

Re: curl für die DBox2?

Beitrag von Houdini »

ok, du hast Recht, libcurl ist mit drin aber nicht curl
dann also zusätzlich noch das curl-binary mit ins image machen
(curl wird zusammen mit libcurl gebaut, oder du nimmst es aus einer yadd-distri)
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

Nun, wie schon gesagt, ich bin da nicht so der Profi....

Könntest Du evtl. bitte kurz beschreiben was zu tun ist? Bild
seife
Developer
Beiträge: 4189
Registriert: Sonntag 2. November 2003, 12:36

Re: curl für die DBox2?

Beitrag von seife »

hannebamb(el)
Foren-Moderator
Beiträge: 297
Registriert: Montag 11. Oktober 2004, 14:51

Re: curl für die DBox2?

Beitrag von hannebamb(el) »

Naja, wie houdini schrieb, kopierst du dir das binary entweder aus einer yadd oder du baust dir, wie seife sagte einmal das cdk.
Am Ende des Build Prozesses wirst du das curl binary finden.
Dieses strippst du sinnvollerweise noch (ist aber kein Muss) und kopierst es auf deine SD Card.
Dann machst du es ausführbar (mit chmod 755 /pfad/zu/deinem/curl) und benutzt es anschliessend)
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

So viel Aufand wollte wollte eigenlich nicht treiben..... 8)

Aber vlt. hat ja Jemand schon eine fertig compilerte curl, und stellt diese freundlicher weise zur Verfügung. :wink:
ingrid
Erleuchteter
Erleuchteter
Beiträge: 600
Registriert: Samstag 14. Oktober 2006, 10:53

Re: curl für die DBox2?

Beitrag von ingrid »

Wo ist denn beim "rauskopieren aus 'ner YADD" und "kopieren auf Deine SD" der Aufwand? :gruebel:
Das ist doch schon auf dem Silbertablett präsentiert... :dash:
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

ingrid hat geschrieben:Wo ist denn beim "rauskopieren aus 'ner YADD" und "kopieren auf Deine SD" der Aufwand? :gruebel:
Das ist doch schon auf dem Silbertablett präsentiert... :dash:

Geht leider nicht. :gruebel: :dash:

Code: Alles auswählen

~ # curl http://xxxxxxxxxxxxxx
curl: symbol lookup error: curl: undefined symbol: curl_version
~ #
seife
Developer
Beiträge: 4189
Registriert: Sonntag 2. November 2003, 12:36

Re: curl für die DBox2?

Beitrag von seife »

Du mußt natürlich auch die libcurl.so dazu kopieren, denn die im Image hat dieses Symbol rausgestripped - weil es keines der binaries im Image benötigt.

Du wärst schon dreimal fertig, wenn du den Link oben beachtet und dir einfach ein eigenes Image gebaut hättest ;-)
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

So, vielen Dank für Eure Geduld und vor allem für die hillfreichen Tipps, - es hat doch noch geklappt. :)

Siehe:

Code: Alles auswählen

Using username "root".


BusyBox v1.2.1 (2007.12.14-15:13+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.


~ # curl --help
curl 7.10.1 (powerpc-tuxbox-linux-gnu) libcurl/7.10.1
Usage: curl [options...] <url>
Options: (H) means HTTP/HTTPS only, (F) means FTP only
 -a/--append        Append to target file when uploading (F)
 -A/--user-agent <string> User-Agent to send to server (H)
 -b/--cookie <name=string/file> Cookie string or file to read cookies from (H)
 -B/--use-ascii     Use ASCII/text transfer
 -c/--cookie-jar <file> Write all cookies to this file after operation (H)
 -C/--continue-at <offset> Specify absolute resume offset
 -d/--data <data>   HTTP POST data (H)
    --data-ascii <data>   HTTP POST ASCII data (H)
    --data-binary <data>  HTTP POST binary data (H)
    --disable-epsv  Prevents curl from using EPSV (F)
 -D/--dump-header <file> Write the headers to this file
    --egd-file <file> EGD socket path for random data (SSL)
 -e/--referer       Referer page (H)
 -E/--cert <cert[:passwd]> Specifies your certificate file and password (HTTPS)
    --cert-type <type> Specifies certificate file type (DER/PEM/ENG) (HTTPS)
    --key <key>     Specifies private key file (HTTPS)
    --key-type <type> Specifies private key  file type (DER/PEM/ENG) (HTTPS)
    --pass  <pass>  Specifies passphrase for the private key (HTTPS)
    --engine <eng>  Specifies the crypto engine to use (HTTPS)
    --cacert <file> CA certifciate to verify peer against (SSL)
    --capath <directory> CA directory (made using c_rehash) to verify
                    peer against (SSL, NOT Windows)
    --ciphers <list> What SSL ciphers to use (SSL)
    --compressed    Request a compressed response (using deflate).
    --connect-timeout <seconds> Maximum time allowed for connection
    --crlf          Convert LF to CRLF in upload. Useful for MVS (OS/390)
 -f/--fail          Fail silently (no output at all) on errors (H)
 -F/--form <name=content> Specify HTTP POST data (H)
 -g/--globoff       Disable URL sequences and ranges using {} and []
 -G/--get           Send the -d data with a HTTP GET (H)
 -h/--help          This help text
 -H/--header <line> Custom header to pass to server. (H)
 -i/--include       Include the HTTP-header in the output (H)
 -I/--head          Fetch document info only (HTTP HEAD/FTP SIZE)
 -j/--junk-session-cookies Ignore session cookies read from file (H)
    --interface <interface> Specify the interface to be used
    --krb4 <level>  Enable krb4 with specified security level (F)
 -k/--insecure      Allow curl to connect to SSL sites without certs (H)
 -K/--config        Specify which config file to read
 -l/--list-only     List only names of an FTP directory (F)
    --limit-rate <rate> Limit how fast transfers to allow
 -L/--location      Follow Location: hints (H)
 -m/--max-time <seconds> Maximum time allowed for the transfer
 -M/--manual        Display huge help text
 -n/--netrc         Must read .netrc for user name and password
    --netrc-optional  Use either .netrc or URL; overrides -n
 -N/--no-buffer     Disables the buffering of the output stream
 -o/--output <file> Write output to <file> instead of stdout
 -O/--remote-name   Write output to a file named as the remote file
 -p/--proxytunnel   Perform non-HTTP services through a HTTP proxy
 -P/--ftpport <address> Use PORT with address instead of PASV when ftping (F)
 -q                 When used as the first parameter disables .curlrc
 -Q/--quote <cmd>   Send QUOTE command to FTP before file transfer (F)
 -r/--range <range> Retrieve a byte range from a HTTP/1.1 or FTP server
 -R/--remote-time   Set the remote file's time on the local output
 -s/--silent        Silent mode. Don't output anything
 -S/--show-error    Show error. With -s, make curl show errors when they occur
    --stderr <file> Where to redirect stderr. - means stdout.
 -t/--telnet-option <OPT=val> Set telnet option
    --trace <file>  Dump a network/debug trace to the given file
    --trace-ascii <file>  Like --trace but without the hex output
 -T/--upload-file <file> Transfer/upload <file> to remote site
    --url <URL>     Another way to specify URL to work with
 -u/--user <user[:password]> Specify user and password to use
                    Overrides -n and --netrc-optional
 -U/--proxy-user <user[:password]> Specify Proxy authentication
 -v/--verbose       Makes the operation more talkative
 -V/--version       Outputs version number then quits
 -w/--write-out [format] What to output after completion
 -x/--proxy <host[:port]>  Use proxy. (Default port is 1080)
    --random-file <file> File to use for reading random data from (SSL)
 -X/--request <command> Specific request command to use
 -y/--speed-time    Time needed to trig speed-limit abort. Defaults to 30
 -Y/--speed-limit   Stop transfer if below speed-limit for 'speed-time' secs
 -z/--time-cond <time> Includes a time condition to the server (H)
 -Z/--max-redirs <num> Set maximum number of redirections allowed (H)
 -0/--http1.0       Force usage of HTTP 1.0 (H)
 -1/--tlsv1         Force usage of TLSv1 (H)
 -2/--sslv2         Force usage of SSLv2 (H)
 -3/--sslv3         Force usage of SSLv3 (H)
 -#/--progress-bar  Display transfer progress as a progress bar
~ # netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 192.168.178.202:ssh     wks-1:3211              ESTABLISHED
tcp        0    132 192.168.178.202:ssh     wks-1:3212              ESTABLISHED
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  3      [ ]         STREAM     CONNECTED     6979   /tmp/camd.socket
unix  3      [ ]         STREAM     CONNECTED     6978
~ # cd /mmc
/mmc # cd wget
/mmc/wget # ./wget
/mmc/wget # wget
/mmc/wget # ./mmc/wget/wget
-sh: ./mmc/wget/wget: not found
/mmc/wget # ls
wget
/mmc/wget # /mmc/wget/wget
/mmc/wget # /mmc/wget/wget http://hhöhjvhj
wget: bad address 'hhöhjvhj'
/mmc/wget # /mmc/wget/wget --help
/mmc/wget # clerar
-sh: clerar: not found
/mmc/wget # cd /
/ # clerar
-sh: clerar: not found
/ # clear
/ # curl --help
curl 7.10.1 (powerpc-tuxbox-linux-gnu) libcurl/7.10.1
Usage: curl [options...] <url>
Options: (H) means HTTP/HTTPS only, (F) means FTP only
 -a/--append        Append to target file when uploading (F)
 -A/--user-agent <string> User-Agent to send to server (H)
 -b/--cookie <name=string/file> Cookie string or file to read cookies from (H)
 -B/--use-ascii     Use ASCII/text transfer
 -c/--cookie-jar <file> Write all cookies to this file after operation (H)
 -C/--continue-at <offset> Specify absolute resume offset
 -d/--data <data>   HTTP POST data (H)
    --data-ascii <data>   HTTP POST ASCII data (H)
    --data-binary <data>  HTTP POST binary data (H)
    --disable-epsv  Prevents curl from using EPSV (F)
 -D/--dump-header <file> Write the headers to this file
    --egd-file <file> EGD socket path for random data (SSL)
 -e/--referer       Referer page (H)
 -E/--cert <cert[:passwd]> Specifies your certificate file and password (HTTPS)
    --cert-type <type> Specifies certificate file type (DER/PEM/ENG) (HTTPS)
    --key <key>     Specifies private key file (HTTPS)
    --key-type <type> Specifies private key  file type (DER/PEM/ENG) (HTTPS)
    --pass  <pass>  Specifies passphrase for the private key (HTTPS)
    --engine <eng>  Specifies the crypto engine to use (HTTPS)
    --cacert <file> CA certifciate to verify peer against (SSL)
    --capath <directory> CA directory (made using c_rehash) to verify
                    peer against (SSL, NOT Windows)
    --ciphers <list> What SSL ciphers to use (SSL)
    --compressed    Request a compressed response (using deflate).
    --connect-timeout <seconds> Maximum time allowed for connection
    --crlf          Convert LF to CRLF in upload. Useful for MVS (OS/390)
 -f/--fail          Fail silently (no output at all) on errors (H)
 -F/--form <name=content> Specify HTTP POST data (H)
 -g/--globoff       Disable URL sequences and ranges using {} and []
 -G/--get           Send the -d data with a HTTP GET (H)
 -h/--help          This help text
 -H/--header <line> Custom header to pass to server. (H)
 -i/--include       Include the HTTP-header in the output (H)
 -I/--head          Fetch document info only (HTTP HEAD/FTP SIZE)
 -j/--junk-session-cookies Ignore session cookies read from file (H)
    --interface <interface> Specify the interface to be used
    --krb4 <level>  Enable krb4 with specified security level (F)
 -k/--insecure      Allow curl to connect to SSL sites without certs (H)
 -K/--config        Specify which config file to read
 -l/--list-only     List only names of an FTP directory (F)
    --limit-rate <rate> Limit how fast transfers to allow
 -L/--location      Follow Location: hints (H)
 -m/--max-time <seconds> Maximum time allowed for the transfer
 -M/--manual        Display huge help text
 -n/--netrc         Must read .netrc for user name and password
    --netrc-optional  Use either .netrc or URL; overrides -n
 -N/--no-buffer     Disables the buffering of the output stream
 -o/--output <file> Write output to <file> instead of stdout
 -O/--remote-name   Write output to a file named as the remote file
 -p/--proxytunnel   Perform non-HTTP services through a HTTP proxy
 -P/--ftpport <address> Use PORT with address instead of PASV when ftping (F)
 -q                 When used as the first parameter disables .curlrc
 -Q/--quote <cmd>   Send QUOTE command to FTP before file transfer (F)
 -r/--range <range> Retrieve a byte range from a HTTP/1.1 or FTP server
 -R/--remote-time   Set the remote file's time on the local output
 -s/--silent        Silent mode. Don't output anything
 -S/--show-error    Show error. With -s, make curl show errors when they occur
    --stderr <file> Where to redirect stderr. - means stdout.
 -t/--telnet-option <OPT=val> Set telnet option
    --trace <file>  Dump a network/debug trace to the given file
    --trace-ascii <file>  Like --trace but without the hex output
 -T/--upload-file <file> Transfer/upload <file> to remote site
    --url <URL>     Another way to specify URL to work with
 -u/--user <user[:password]> Specify user and password to use
                    Overrides -n and --netrc-optional
 -U/--proxy-user <user[:password]> Specify Proxy authentication
 -v/--verbose       Makes the operation more talkative
 -V/--version       Outputs version number then quits
 -w/--write-out [format] What to output after completion
 -x/--proxy <host[:port]>  Use proxy. (Default port is 1080)
    --random-file <file> File to use for reading random data from (SSL)
 -X/--request <command> Specific request command to use
 -y/--speed-time    Time needed to trig speed-limit abort. Defaults to 30
 -Y/--speed-limit   Stop transfer if below speed-limit for 'speed-time' secs
 -z/--time-cond <time> Includes a time condition to the server (H)
 -Z/--max-redirs <num> Set maximum number of redirections allowed (H)
 -0/--http1.0       Force usage of HTTP 1.0 (H)
 -1/--tlsv1         Force usage of TLSv1 (H)
 -2/--sslv2         Force usage of SSLv2 (H)
 -3/--sslv3         Force usage of SSLv3 (H)
 -#/--progress-bar  Display transfer progress as a progress bar
/ #

Jetzt hätte ich aber noch eine Frage:

Geht das auch mit dem wget Befehl und Falls ja, wie?

Denn der ist doch eigentlich, wenn auch sehr stark kastriert, in der BusyBox schon mit drin.... :gruebel:
Houdini
Developer
Beiträge: 2183
Registriert: Mittwoch 10. Dezember 2003, 07:59

Re: curl für die DBox2?

Beitrag von Houdini »

Geht das auch mit dem wget Befehl und Falls ja, wie?
Die curl Hilfeseite anzeigen? - Wohl kaum

Jetzt wäre der geeignete Zeitpunkt, um uns mal mitzuteilen was du eigentlich vorhast...
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

Houdini hat geschrieben:
Geht das auch mit dem wget Befehl und Falls ja, wie?
Die curl Hilfeseite anzeigen? - Wohl kaum.
Das ist mir auch klar... :P :P :P

Ich wollte damit nur ausdrücken, das curl geht.
Jetzt wäre der geeignete Zeitpunkt, um uns mal mitzuteilen was du eigentlich vorhast...
Nun, wie ich schon gepostet habe ist der "integrierte" wget Befehf eben doch sehr eingeschränkt, deshalb bin ich auf curl ausgewichen.
(--> Dazu habe ich ein Script, dass das Aler von Dateien auf einen Webserver abfagen kann, ohne diese erst herunterladen zu müssen..)

Da ja nun curl geht, wollte ich eben wissen, ob man wget auch, oder so ähnlich einbauen kann.....

Der Hintergrund ist folgender:

Ich habe hier einen kleinen NAS mit FreeNAS.
Nun wolte ich mir ein kleines Plugin basteln, mit dem ich, bei Bedarf, den FreeNAS herunterfahren kann.
Dazu habe ich in der Dokumentation von FreeNAS gefunden, das man das mit dem wget Befehl machen kann:

Code: Alles auswählen

wget --post-data='Submit= Yes ' --user=LOGIN --password=PASSWORD http://<IP_DES_FREENAS_PC>/shutdown.php
Deshalb nochmal die Frage:

Gibt es eine Möglichkeit den wget Befehl so einzubauen oder "aufzubohren", dass er die o.g. Funkton kann?
Houdini
Developer
Beiträge: 2183
Registriert: Mittwoch 10. Dezember 2003, 07:59

Re: curl für die DBox2?

Beitrag von Houdini »

Das busybox wget kann keinen post Befehl.
Dazu das "ausgewachsene" wget benutzen.
Dazu gibts hier auch was im Forum
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

Houdini hat geschrieben:Das busybox wget kann keinen post Befehl.
Dazu das "ausgewachsene" wget benutzen.
Dazu gibts hier auch was im Forum
Nun, ich nehme mal an, dass Du diesen Tread hier meinst: wget bauen ohne busybox ?

Aber wie schon gesagt, ich bin nicht so der Profi, was das Imagebauen angeht..... :oops:
ingrid
Erleuchteter
Erleuchteter
Beiträge: 600
Registriert: Samstag 14. Oktober 2006, 10:53

Re: curl für die DBox2?

Beitrag von ingrid »

Wenn's mehr nicht ist...

Code: Alles auswählen

make wget
hat wget 1.10.2 gebaut, ich hab's dir hier hochgeladen: wget.zip

Ohne Gewähr, ich hab's nur fix gebaut, mehr nicht. Fragen zwecklos. :lol:

Edit: Ist übrigens ungestripped, also nicht über die Größe meckern. Darüber kannste Dir ja später Gedanken machen, wenn Du das wget wirklich brauchen solltest...
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

BildBildBild Vielen 1000 Dank großer Meister.

Funktioniert 100%ig.

btw: Über die Größe mache ich mit keine Gedanken, da ich eine SD-Karte mit 1GB in der Box habe.
musicus
Einsteiger
Einsteiger
Beiträge: 140
Registriert: Mittwoch 9. August 2006, 10:29

Re: curl für die DBox2?

Beitrag von musicus »

klick
klack
klonck

...geht vielleicht auch ohne curl und neuem wget?

Gruß musicus
3PO
Interessierter
Interessierter
Beiträge: 36
Registriert: Sonntag 23. Mai 2004, 09:16

Re: curl für die DBox2?

Beitrag von 3PO »

musicus hat geschrieben:klick
klack
klonck

...geht vielleicht auch ohne curl und neuem wget?

Gruß musicus

@ musicus,

ich bin mir nicht sicher, ob ich verstehe, was Du damit sagen willst? :gruebel:

Meine Fragen bezogen sich auf eine DBox2, und nicht auf eine Fritz!box.
musicus
Einsteiger
Einsteiger
Beiträge: 140
Registriert: Mittwoch 9. August 2006, 10:29

Re: curl für die DBox2?

Beitrag von musicus »

@3PO

sorry, wenn ich mich so spät etwas wortkarg ausgedrückt habe.

Unter den 3 Links ist eine Möglichkeit beschrieben, wie man mit
netcat den wget-Post Befehl simulieren (ersetzen) kann.

Ich habe dies bei meinem Fritzbox-Plugin erfolgreich angewendet
(unter anderem um die Passwortabfrage der Fritzbox von der dbox aus
zu verwirklichen) -stolzbin-

Da mir nicht bekannt ist, welche Daten Du per wget und post holen willst,
kann ich nicht garantieren, ob diese Methode bei Dir funktioniert,
aber ich denke ein Versuch wäre es wert...

...nichts für ungut.

Gruß musicus