I. Компиляция
Для закачки и установки необходимого софта потребуется ~500 MB свободного места на HDD.
Скачиваем исходники (~100 MB) с ftp-сервера D-Link:
[root@localhost gpl]# wget
ftp://ftp.dlink.ru/pub/ADSL/GPL_source_ ... GPL.tar.gzРаспаковываем:
[root@localhost gpl]# gunzip -c RU_DSL-2640U_3-06-04-3C_GPL.tar.gz | tar xvf -
consumer_install
README
RU_DSL-2640U_3-06-04-3C_consumer.tar.gz
RU_DSL-2640U_3-06-04-3C_uclibc_crosstools_3.4.2_0.9.27.tar.gz
Читаем инструкцию:
[root@localhost gpl]# cat README
RU_DSL-2640U Open Source Release
This release contains all of the files needed to build a RU_DSL-2640U image.
To build an image, please follow the below process:
1. System Request:
Redhat Linux 9.0
2. All operations should be performed as the "root" user
3. Install tools and source code
#./consumer_install
4. Build image:
# cd RU_DSL-2640U_3-06-04-3C
# make PROFILE=RU_DSL-2640U
The final image is located in the targets/RU_DSL-2640U subdirectory.
Specify this image in the RU_DSL-2640U Web interface image upgrade
item in order to upgrade the device image.
Red Hat Linux 9.0:
[root@localhost gpl]# uname -a
Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
[root@localhost gpl]# gcc -v
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Запускаем скрипт установки:
[root@localhost gpl]# ./consumer_install
Скрипт предлагает установить на ПК компоненты, необходимые для сборки firmware Broadcom DSL modem/router, нажимаем "y":
This script installs Broadcom DSL modem/router components onto your Linux PC.
The installation will overwrite existing files. You will be prompted before a
component is installed.
This script may create directories and overwrite existing files. Therefore,
you will need to have root privilages to run this script.
Press 'y' to continue: y
Теперь нам сообщают, что "исходники" будут установлены в /home/pudeev/gpl/Broadcom (для удобства я у себя переименовал длинные файлы начинающиеся на RU_DSL-2640U_3-06-04-3C_* в Broadcom), нажимаем "y":
The Broadcom DSL modem/router source files are ready to be installed at
/home/pudeev/gpl/Broadcom. Existing source files, in any, will be overwritten.
Press 'y' to install the Broadcom DSL modem/router source files: y
Ждем 2-3 минуты пока закончится процесс извлечения и копирования файлов из архива RU_DSL-2640U_3-06-04-3C_consumer.tar.gz (у меня это Broadcom_consumer.tar.gz) в каталог /home/pudeev/gpl/Broadcom.
Затем скрипт предлагает установить ПО Toolchain (кросс-компилятор для процессора с архитектурой MIPS для ОС Linux, библиотеки C для embedded Linux) в директорию /opt/toolchains, нажимаем "y":
The Broadcom DSL modem/router toolchain is ready to be installed at /opt/toolchains.
Existing toolchain files, if any, will be overwritten.
Press 'y' to install the Broadcom toolchain: y
Ждем несколько секунд пока установятся два rpm-пакета:
Installing files from /home/pudeev/gpl/Broadcom_uclibc_crosstools_3.4.2_0.9.27.tar.gz.
uclibc-crosstools-common.i386.rpm
uclibc-crosstools-mips.i386.rpm
Preparing... ########################################### [100%]
package uclibc-crosstools-common-3.4.2-12 is already installed
package uclibc-crosstools-mips-3.4.2-12 is already installed
Все. Процесс установки закончен. Теперь посмотрим что получилось:
[root@localhost gpl]# ls -l /home/pudeev/gpl/Broadcom
total 88
drwxrwxrwx 4 root root 4096 Nov 14 2007 bcmdrivers
drwxr-xr-x 3 root root 4096 Jul 29 13:06 hostTools
drwxr-xr-x 3 root root 4096 Jul 29 13:05 kernel
-rwxrwxrwx 1 root root 54093 Nov 14 2007 Makefile
drwxr-xr-x 3 root root 4096 Jul 29 13:06 shared
drwxr-xr-x 5 root root 4096 Jul 29 13:06 targets
drwxr-xr-x 4 root root 4096 Jul 29 13:06 userapps
-rwxrwxrwx 1 root root 68 Nov 5 2007 version.make
Информация о версии релиза (3-06-04-3C):
[root@localhost gpl]# cd Broadcom
[root@localhost Broadcom]# cat version.make
BRCM_VERSION=3
BRCM_RELEASE=06
BRCM_EXTRAVERSION=04
ASUS_RELEASE=3C
Настройка ядра:
[[root@localhost Broadcom]# cd kernel/linux
[root@localhost linux]# make menuconfig
Добавить/удалить утилиты в BusyBox:
[root@localhost Broadcom]# cd userapps/opensource/busybox
[root@localhost busybox]# make menuconfig
[root@localhost busybox]# mv brcm.config brcmconfig.old
[root@localhost busybox]# mv .config brcm.config
[root@localhost busybox]# chmod +x brcm.config
Для компиляции и сборки запускаем скрипт и ждем несколько минут:
[root@localhost gpl]# cd Broadcom
[root@localhost Broadcom]# make PROFILE=RU_DSL-2640U
Окончательный результат работы скрипта - готовый имидж прошивки:
[root@localhost Broadcom]# ls images/
RU_DSL-2640U_306043C00_cfe_fs_kernel_3.06L..