Page 1 of 2 12 LastLast
Results 1 to 15 of 95

Thread: Кросс-компиляция rTorrent

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805

    Post Кросс-компиляция rTorrent

    Откомпилировал svn версию rtorrent с поддержкой dht
    Вроде куда-то соединяется:
    PHP Code:
    (16:12:59DHT statistics39042 queries in2296 queries out1138 replies received4212981 bytes read8472606 bytes sent162 known nodes in 22 buckets1
               359 peers 
    (highest24tracked in 956 torrents
    Однако как это работает мне в общем и целом непонятно (а главное непонятно как должно ).

    Чтобы включить поддержку dht нужно внести изменения в конфигурационный файл согласно: http://libtorrent.rakshasa.no/wiki/RTorrentUsingDHT а также открыть соответствующий порт в iptables.
    libtorrent_0.11.9+r1020-1_mipsel.ipk.gz
    rtorrent_0.7.9+r1020-1_mipsel.ipk.gz

  2. #2
    Я в linux плохо разбираюсь, так что извиняте
    Попробовал установить


    Code:
     ipkg install rtorrent_0.7.9+r1020-1_mipsel.ipk
    Upgrading rtorrent on /opt/ from 0.7.9-2 to 0.7.9+r1020-1...
    package rtorrent suggests installing dtach
    Configuring bzip2
    update-alternatives: Error: not linking //opt/bin/bzip2 to /opt/bin/bzip2-bzip2 since //opt/bin/bzip2 exists and is not a link
    postinst script returned status 1
    ERROR: bzip2.postinst returned 1
    Configuring e2fsprogs
    update-alternatives: Error: not linking //opt/bin/chattr to /opt/bin/e2fsprogs-chattr since //opt/bin/chattr exists and is not a link
    update-alternatives: Error: not linking //opt/bin/lsattr to /opt/bin/e2fsprogs-lsattr since //opt/bin/lsattr exists and is not a link
    update-alternatives: Error: not linking //opt/sbin/fsck to /opt/sbin/e2fsprogs-fsck since //opt/sbin/fsck exists and is not a link
    postinst script returned status 1
    ERROR: e2fsprogs.postinst returned 1
    Configuring e2fsprogs
    update-alternatives: Error: not linking //opt/bin/chattr to /opt/bin/e2fsprogs-chattr since //opt/bin/chattr exists and is not a link
    update-alternatives: Error: not linking //opt/bin/lsattr to /opt/bin/e2fsprogs-lsattr since //opt/bin/lsattr exists and is not a link
    update-alternatives: Error: not linking //opt/sbin/fsck to /opt/sbin/e2fsprogs-fsck since //opt/sbin/fsck exists and is not a link
    postinst script returned status 1
    ERROR: e2fsprogs.postinst returned 1
    Configuring less
    update-alternatives: Error: not linking //opt/bin/less to /opt/bin/less-less since //opt/bin/less exists and is not a link
    postinst script returned status 1
    ERROR: less.postinst returned 1
    Configuring less
    update-alternatives: Error: not linking //opt/bin/less to /opt/bin/less-less since //opt/bin/less exists and is not a link
    postinst script returned status 1
    ERROR: less.postinst returned 1
    Configuring ncurses
    update-alternatives: Error: not linking //opt/bin/clear to /opt/bin/ncurses-clear since //opt/bin/clear exists and is not a link
    postinst script returned status 1
    ERROR: ncurses.postinst returned 1
    Configuring rtorrent
    Successfully terminated.
    что-то не так делаю ?

  3. #3
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    подозреваю, что если бы это был ipkg с родного репозитария, то эти файлы установились бы автоматом. А так есть 2 варианта:
    1)
    ipkg install rtorrent
    (эта комбинация должна установить все необходимые сторонние пакеты)
    ipkg remove rtorrent
    ipkg remove libtorrent
    после этого уже устаналивать данные файлы
    2)
    ставить все запрашиваемое вручную:
    ipkg install bzip2
    ipkg install e2fsprogs
    ipkg install less
    ipkg install ncurses
    и что там еще понадобится, далее опять таки устанавливать непосредственно эти файлы

  4. #4

    не компилируется rtorrent

    Точнее, компилируется, но не запускается.

    Я скачал optware, сделал всё по инструкции, сделал make rtorrent. Всё скомпилировалось.

    Запускаю на роутере (скопировав туда и либторрент) - ничего не пишет, top показывает что этот процесс занимает процессор но 90%. Сделал strip из тулчейна - тот же эффект.

  5. #5
    В то же время, если я подменяю libtorrent на собранный мною, то старый rtorrent (не тот, что я компилял, а из пакетов) работает. Скомпилированная мною простая программа на c++ (cout<<"hello, world") -работает. Скомпилял программу, использующая ncurses (nhn) - тоже работает.
    То есть, закорюка где-то в компиляции самого рторрента.

  6. #6
    Может начнете отсюда: Еще раз про rTorrent и web-морду к нему Установка rTorrent "на пальцах", а эту тему удалите?

  7. #7
    Quote Originally Posted by jan_h View Post
    Может начнете отсюда: Еще раз про rTorrent и web-морду к нему Установка rTorrent "на пальцах", а эту тему удалите?
    проблемы с установкой у меня нету. мне надо код rtorrent'а поковырять, чтобы он лучше работал на наших девайсах.

  8. #8
    ipkg upgrade libcurl

  9. #9
    Помогите скомилировать (скомпилируйте) libtorrent-0.12.6.tar.gz с немного подправленным src/tracker/tracker_http.cc


    никак не получается
    ./configure --build=mipsel-unknown-linux-gnu --host=mipsel-unknown-linux-gnu
    ........
    ...........
    checking for OPENSSL... configure: error: Package requirements (openssl) were not met:
    Attached Files Attached Files
    WL500gP v2 + USB WD 160Gb + HTC Shift USB Extension kit + QuickCam Pro 4000 + LOGITECH S-150 DIGITAL USB SPEAKERS + Mini Bluetooth Dongle
    installed: rtorrent, ados, samba3, lighttpd, palantir ,cron, rrd, mpd, mcabber

  10. #10
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    rtorrent/libtorrent нативно скомпилить не удастся. Надо поднимать кросскомпиляцию optware на ПК.

  11. #11
    Join Date
    Nov 2009
    Location
    Kyiv, Ukraine
    Posts
    142
    Quote Originally Posted by Algalish View Post
    С недавних пор libtorrent можно собрать с опцией --with-posix-fallocate
    а в конфиге самого рторрента прописать system.file_allocate.set = yes

    все работает прекрасно
    А можно по-подробнее что надо сделать чайнику в Линуксе, чтобы не было дефрагментации в rtorrent-е.

  12. #12
    Найти libtorrent (сейчас это libtorrent-0.12.6), скомпилированный под Вашу платформу с опцией --with-posix-fallocate

    Или скомпилировать самому, вот инструкции:
    http://code.google.com/p/wl500g/wiki...CustomFirmware
    http://vectormm.net/linux/60-samosto...-rtorrent.html

    Если руки дойдут и получиться - выложу сюда

  13. #13
    Проблема оказалась несколько глубже, кросс-компиляторы, вплоть до последнего рабочего, который мне попался gcc-4.2.4-uclibc-0.9.30 не в состоянии реализовать функцию posix_fallocate.
    Так что я решил просто дописать функцию захвата и заполнения файла нулями в саму библиотеку rtorrent'a.
    К сообщению приложено 2 пропатченых библиотеки libtorrent_0.12.6 : с TEXT PADDING и ZERO PADDING. Библиотека c TEXT PADDING вместо нулей вписывает текст NO MORE FRAGMENTATION, по этому тексту удобно наблюдать за заполнением файла и вы уверенны что он создан и rtorrent работает как надо.
    Библиотека c ZERO PADDING рекомендуется для настроенного rtorrent'a - заполнение нулями даёт возможность предварительного прослушивания/просмотра недокачанных файлов плеерами.

    Дамп области файла, где хорошо видно границу закачанного блока данных в зарезервированное пространство: http://img6.imageshack.us/img6/9757/...ionpadding.jpg

    Как пользоваться простому юзеру:
    Обновиться до rtorrent 0.8.6 (libtorrent 0.12.6), сейчас для этого достаточно набрать, предварительно остановив программу:
    ipkg update
    ipkg upgrade rtorrent
    ipkg upgrade libtorrent (если это не произойдёт автоматически)

    Подменить библиотеку libtorrent скачанной отсюда с архива, обычно достаточно заменить только файл: /opt/lib/libtorrent.so.11.0.6, это должен быть файл около мегабайта размером, не симлинк. У Вас путь может быть другим.
    Не забудьте добавить в rtorrent.conf строчку system.file_allocate.set = yes

    Если кому интересно код патча с ZERO PADDING:
    Code:
    root@darkstar:/wl500g/optware/oleg/builds/libtorrent/src/data# cat socket_file.cc.diff
    114,135c114
    <   //return !posix_fallocate(m_fd, offset, length);
    <   {
    <    bool success;
    <    char buf[ 4 * 1024 ] = {0};
    <    uint64_t len;
    <    uint64_t sb = sizeof( buf );
    <
    <    if (offset > length) throw internal_error("SocketFile::posix_fallocate()incorrect offset");
    <
    <    len = length-offset;
    <    success = 1;
    <    lseek(m_fd, offset, SEEK_SET);
    <    while ( len > 0 && success )
    <     {
    <      if (len < sb) sb = len;
    <      len -= sb;
    <      success = write( m_fd, buf, sb );
    <     }//while
    <
    <     lseek(m_fd, offset, SEEK_SET);
    <     return true;
    <   }//block
    ---
    >   return !posix_fallocate(m_fd, offset, length);
    Код патча с TEXT PADDING:
    Code:
    root@darkstar:/wl500g/optware/oleg/builds/libtorrent/src/data# cat socket_file.cc.text_padding.diff
    114,147c114
    <   //return !posix_fallocate(m_fd, offset, length);
    <   {
    <    bool success;
    <    char buf[ 4 * 1024 ] = {0};
    <    uint64_t len;
    <    uint64_t sb = sizeof( buf );
    <    uint64_t i;
    <
    <    if (offset > length) throw internal_error("SocketFile::posix_fallocate()incorrect offset");
    <    //return false;
    <
    <    //fill in padding buffer
    <
    <    //printf("sb = %i \r\n", sb);
    <    for (i=0;i<sb-27;i+=32) {
    <     strncpy(&buf[i]," -~+= NO MORE FRAGMENTATION =+~- ",32);
    <    }
    <
    <    len = length-offset;
    <    success = 1;
    <    lseek(m_fd, offset, SEEK_SET);
    <    while ( len > 0 && success )
    <     {
    <      if (len < sb) sb = len;
    <      len -= sb;
    <      success = write( m_fd, buf, sb );
    < //     printf("success = %i, len = %i,", success, len );
    < //     printf(" sb = %i \r\n", sb );
    <
    <     }//while
    <
    <     lseek(m_fd, offset, SEEK_SET);
    <     return true;
    <   }//block
    ---
    >   return !posix_fallocate(m_fd, offset, length);
    Тестирование работоспособности:

    до патча:
    root# filefrag Ferry_143.mp3
    Ferry_143.mp3: 1282 extents found, perfection would be 1 extent
    после патча:
    root# filefrag Ferry_140.mp3
    Ferry_140.mp3: 1 extent found

    Не забывайте, что для захвата пространства на диске роутеру может потребоваться значительное время, ведь максимальная скорость работы с диском колеблется в пределах 3.5МБайт/сек. Тоесть для первичного создания файла в таком режиме потребуется примерно столько же времени, сколько на перехеширование. Клиент на это время блокируется.

    Прошу отписаться тех, кто скачал и потестировал пропатченную библиотеку.
    Attached Files Attached Files

  14. #14
    Join Date
    Mar 2011
    Location
    UA
    Posts
    222

    rtorrent 0.8.9 и libtorrent 0.12.9

    на сколько реально это дело (rtorrent 0.8.9 и libtorrent 0.12.9) собрать энтузиастским тулчейном, ну и насколько сложно для начинающего собирателя/компильщика? какие подводные камни и т.п.
    Last edited by Omega; 23-11-2011 at 18:49. Reason: почитайте эту тему ... ;)
    RT-N16 + Entware repo

  15. #15
    Join Date
    Mar 2011
    Location
    UA
    Posts
    222
    Quote Originally Posted by ryzhov_al View Post
    Скорее да, чем нет. Если не лень собрать несколько зависимостей.
    Ок. Буду пробовать. Алексей, еси чо, то с вопросами к вам. Ок?
    RT-N16 + Entware repo

Page 1 of 2 12 LastLast

Similar Threads

  1. Простая настройка роутера до торрентов
    By gostest in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 1402
    Last Post: 21-05-2010, 18:58
  2. [How to] rtorrent & ntorrent
    By mancub in forum WL-500gP Tutorials
    Replies: 101
    Last Post: 18-12-2008, 07:21
  3. small number of peers for rTorrent
    By ufo95 in forum WL-500gP Q&A
    Replies: 0
    Last Post: 10-11-2008, 08:23
  4. older rtorrent version
    By FastJack in forum WL-500gP Q&A
    Replies: 1
    Last Post: 23-10-2007, 09:40

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •