Быстрая памятка для тех кто уже знает как это делается. Кто не в теме, читаем ниже подробно
Быстрая загрузка и все шаги для начала компиляции
Скачиваем нужную ветку
отсюда и вставляем перед первым && дальше все выполнится автоматом
&& cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
Готовые быстрые команды
22.03.5
git clone https://github.com/openwrt/openwrt.git -b v22.03.5 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
22.03.4
git clone https://github.com/openwrt/openwrt.git -b v22.03.4 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
22.03.3
git clone https://github.com/openwrt/openwrt.git -b v22.03.3 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
22.03.2
git clone https://github.com/openwrt/openwrt.git -b v22.03.2 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
22.03.1
git clone https://github.com/openwrt/openwrt.git -b v22.03.1 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
22.03.0
git clone https://github.com/openwrt/openwrt.git -b v22.03.0 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.7
git clone https://github.com/openwrt/openwrt.git -b v21.02.7 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.6
git clone https://github.com/openwrt/openwrt.git -b v21.02.6 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.5
git clone https://github.com/openwrt/openwrt.git -b v21.02.5 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.4
git clone https://github.com/openwrt/openwrt.git -b v21.02.4 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.3
git clone https://github.com/openwrt/openwrt.git -b v21.02.3 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.2
git clone https://github.com/openwrt/openwrt.git -b v21.02.2 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.1
git clone https://github.com/openwrt/openwrt.git -b v21.02.1 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
21.02.0
git clone https://github.com/openwrt/openwrt.git -b v21.02.0 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.10
git clone https://github.com/openwrt/openwrt.git -b v19.07.10 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.9
git clone https://github.com/openwrt/openwrt.git -b v19.07.9 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.8
git clone https://github.com/openwrt/openwrt.git -b v19.07.8 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.7
git clone https://github.com/openwrt/openwrt.git -b v19.07.7 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.6
git clone https://github.com/openwrt/openwrt.git -b v19.07.6 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.5
git clone https://github.com/openwrt/openwrt.git -b v19.07.5 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.4
git clone https://github.com/openwrt/openwrt.git -b v19.07.4 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.3
git clone https://github.com/openwrt/openwrt.git -b v19.07.3 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.2
git clone https://github.com/openwrt/openwrt.git -b v19.07.2 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.1
git clone https://github.com/openwrt/openwrt.git -b v19.07.1 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
19.07.0
git clone https://github.com/openwrt/openwrt.git -b v19.07.0 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.9
git clone https://github.com/openwrt/openwrt.git -b v18.06.9 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.8
git clone https://github.com/openwrt/openwrt.git -b v18.06.8 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.7
git clone https://github.com/openwrt/openwrt.git -b v18.06.7 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.6
git clone https://github.com/openwrt/openwrt.git -b v18.06.6 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.5
git clone https://github.com/openwrt/openwrt.git -b v18.06.5 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.4
git clone https://github.com/openwrt/openwrt.git -b v18.06.4 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.3
git clone https://github.com/openwrt/openwrt.git -b v18.06.3 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.2
git clone https://github.com/openwrt/openwrt.git -b v18.06.2 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.1
git clone https://github.com/openwrt/openwrt.git -b v18.06.1 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
18.06.0
git clone https://github.com/openwrt/openwrt.git -b v18.06.0 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
17.01.6
git clone https://github.com/openwrt/openwrt.git -b v17.01.6 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
17.01.5
git clone https://github.com/openwrt/openwrt.git -b v17.01.5 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
17.01.4
git clone https://github.com/openwrt/openwrt.git -b v17.01.4 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
17.01.3
git clone https://github.com/openwrt/openwrt.git -b v17.01.3 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
17.01.2
git clone https://github.com/openwrt/openwrt.git -b v17.01.2 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
17.01.1
git clone https://github.com/openwrt/openwrt.git -b v17.01.1 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
17.01.0
git clone https://github.com/openwrt/openwrt.git -b v17.01.0 && cd ~/openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && make prereq
Подготовка системыВсе манипуляции делаются на компьютере с Linux
Для начала установим все необходимое.
Открываем консоль и копируем туда команды
Debian/Ubuntu
sudo apt-get install subversion git
sudo apt-get install g++ libncurses5-dev zlib1g-dev gawk libssl-dev unzip make
Arch Linux/Manjaro
sudo pacman -S subversion git
sudo pacman -S gcc ncurses zlib gawk openssl unzip make
Более подробно про начальную подготовку смотрим тут https://openwrt.org/do…in/install-buildsystem
Получение исходных кодовДалее нужно скачать исходники прошивки (смотри спойлер
Git-репозитории проектов OpenWrt и LEDE )
Скачиваем необходимую нам ветку (в данном примере это OpenWrt v17.01.4)
git clone https://github.com/openwrt/openwrt.git -b v17.01.4
Далее, переходим в каталог с тем что у нас скачалось. ~/ (то есть home, он же домашний каталог) у нас создался каталог openwrt, нужно перейти в него для продолжения
В Ubuntu можно так:
Теперь нужно выполнить
./scripts/feeds update -a
После завершения процесса обновления выполняем
./scripts/feeds install -a
Почти все готово, далее выполняем
Если все ок, то будет вот такое сообщение: Collecting package info: done
Выбор компонентовЗапуск интерфейса выбора компонентов прошивки (в последних версиях появляется автоматически после предыдущего шага)
Перемещение по пунктам осуществляется клавишами клавиатуры: вверх-вниз, пробел и esc.
Target System
Target Profile можно выбрать для нужной модели, если оставить default profile тогда будет создано множество скомпилированных прошивок для всех устройств сразу из профиля Target System
Теперь немного простых пояснений:
Ставим web-интерфейс
и русский язык к нему
для поддержки L2TP нужно выбрать пакет xl2tpd
Так же необходимые протоколы pptp и тд выбираются здесь:
Network --->
<*> ppp
<*> ppp-mod-pppoe
<*> ppp-mod-pppol2tp
<*> ppp-mod-pptp
Добавление компонентов busybox:
Ну и далее ориентируйтесь по своим потребностям, помните что место в роутере не резиновое и часто нужно уложиться в 4 мб., так что не переусердствуйте.
Поиск осуществляется по клавише / на английской раскладке
ПодробнееКогда все закончили, сохраняем нашу конфигурацию кнопкой <Save>
Сборка.
Приступаем к сборке:
А для 4х-ядерного процессора, для включения всех ядер, команда будет такой: (число ядер +1, вот оно и -j5 получается)
Ждем, через полчаса-час находим свою прошивку в каталоге ~/openwrt/
binЕсли перед сборкой выбран правильный target, но прошивка получается размером больше допустимого для размера флеш вашего роутера - файлы *sysupgrade.bin и *factory.bin не будут созданы.
Очистка Удаляет содержимое каталогов bin и build_dir.
Удаляет содержимое каталогов /bin и /build_dir, а также дополнительно /staging_dir и /toolchain (инструментарий кросс-компиляции). 'Dirclean' - основная команда для полной очистки.
Удаляет все что вы собрали или настроили, а также удаляет все загруженное из репозитория и исходные коды пакетов.
ВНИМАНИЕ : Кроме всего прочего будет стерта ваша конфигурация сборки (.config), ваш набор инструментов (toolchain) и все прочие исходные коды. Используйте с осторожностью!
Адреса используемых репозиториев находится в файле feeds.conf.default