What building enivronment I use to compile my version of OpenWRT?

I've already understand that I must use Ubuntu or Debian to build OpenWRT from source. Luckily I have ubuntu-server 24.04.2 LTS in my disposal.

[admin edit: removed ai content]

But I am not sure if all sufficient software are listed above and need your kind guidance. (I look through OpenWRT Wiki but could not find anything on that matter).

Please see https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem

3 Likes

AI is f-ing stupid, don't use it.

There's a reason why this template exists:

  • If someone asks a question on the forum and you do not know the answer, DO NOT turn to any generative AI or LLM instance, ask the question, and post the output as an answer - attributed or otherwise.

It's far better that the forum is populated with posts from knowledgable subject matter experts rather than unattributable, unproven content from LLMs which will then feed back via web scraping into the LLMs again, potentially compounding a wrong answer many times over.

9 Likes
  1. install the proper build dependencies as per your particular setup
    ubuntu build deps

  2. clone the openwrt git repo

git clone https://github.com/openwrt/openwrt.git
  1. cd into openwrt
cd openwrt
  1. update feeds
scripts/feeds update -a
scripts/feeds install -a
  1. make menuconfig and pick your target and required packages
make menuconfig
  1. save and exit menuconfig and start the build
make V=s -j $(nproc)

...hours later assuming you don't run into any errors, a new firmware can be found in the directory

 ~/openwrt/bin/targets/<target>/<sub-target>/
2 Likes

if I understand correctly, all packages that I have to install on Ubuntu-server 24 are (according to wiki):

sudo apt update
sudo apt install build-essential clang flex bison g++ gawk \
gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \
python3-setuptools rsync swig unzip zlib1g-dev file wget

Then I go further by your list?

Just follow the instructions please.

Edit: if something is missing the configure and make commands will tell you...

1 Like

For ubuntu 24.04 and building OpenWrt main/master post Apr 2024 ... yes.

Ok, well, I try to follow the instructions, by book.
and I now watch how asciidoc 500Mb is installing on my ubuntu-server. It is first package that listed in Prerequisites in Deb/Ubuntu branch.

But now I see that I only need that listed lower in wiki. I just feel confused and understand nothing. I guess I install all packages listed in first page of wiki [OpenWrt Wiki] Build system setup

you said in your first post you are using ubuntu 24.04 server... so unless you are building old openwrt firmware ... 19.07 or earlier, you use the first set of dependencies as the heading suggest

Modernized set for Ubuntu 24.04 that has Python 3.12 without python3-distutils: (OpenWrt main/master in Apr 2024)

sudo apt update
sudo apt install build-essential clang flex bison g++ gawk \
gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \
python3-setuptools rsync swig unzip zlib1g-dev file wget
1 Like

Many thanks. I now remove this asccii staff and install only packages needed for ubuntu-server 24.04 which I use

UPD: I now look through Build System Usage [OpenWrt Wiki] Build System Usage

And can not clearly understand how to understand that I am an unprivileged user?
I need to create user with rights to, well, what? Or I create user who just belongs to "users" group, not "adminstrators" group?

Use your normal login as a member of your Ubuntu-server Users group. Do Not cross-compile as an elevated user (i.e. sudo root).

1 Like

Thank you. Forgive my ignorance, but I must clarify that for myself, if you don't mind
I have a user, but he is privileged, I suppose

ladmin@ushare:~$ id ladmin
uid=1001(ladmin) gid=1001(ladmin) groups=1001(ladmin),27(sudo),108(lxd)

since he belongs to 1001 group

So, I must create user, like:

sudo adduser wrtbuilder

and user will have next priviliges:

ladmin@ushare:~$ id wrtbuilder
uid=1005(wrtbuilder) gid=1005(wrtbuilder) groups=1005(wrtbuilder)

Then I switch to that user

su - wrtbuilder

and start editing configs and compiling?
I hope that is enough?

i don't think this is root user. just do not use sudo ..

2 Likes

Thank you!
Till step 4 of this instruction [OpenWrt Wiki] Build System Usage everything goes fine, as far as I can see. I am so excited!

you don't need to configure the kernel as it suggest in the Build System Usage. so after step 4 is complete use the steps below

1 Like

My goal is to recompile ffmpeg with support of H.265, H.264, H.263 and recompile motion with support of ffmpeg It will take about 9 hours on my E8400 :slight_smile:

It would be cool if there were some web-interfcec similar to OpenWrt Firmware Selector but where user can not only choose what packages he needs but also recompile packages with desired settings or properties, for that matter. It would be awesome.

after the initial build, it takes only minutes to compile/recompile any package .. and if your doing any type of development you should get use to the build system and how it works anyway. Plus, its really not very complicated once you get use to it .

1 Like

if I understand correctly, first I compile my build "as is" and then make some changes in desired packages? But how do I say to build system that I want to include in image, for example, motion and ffmpeg? Via menuconfig? As I understand it is some general settings for (and before) building?

UPD: OMG, I

make menuconfig

and there are SO many interesting different options! Amazing!