Include specific package in build (imagebuilder)

When building a firmware using image builder, how would I tell image builder to use an existing package in the build root/tree rather than downloading any other version?

I don't think you can, IB will automatically locate the newest version of the package and include that in the build.

One sneaky way would be to simply place the package binaries as special FILES into the build. (especially if the package is simple and contains only a few files)

https://openwrt.org/docs/guide-user/additional-software/imagebuilder#files_variable

1 Like

Yes I could put the files in the files/ structure. The only thing that is not clear is when looking in the package, I see control.tar.gz and debian-binary files. I assume those are only for the installed so if I take the files in data.tar.gz, it's all I would need?

Principally yes. data.tar.gz contains the files to be installed.

But for some packages the control.tar.gz may contain special post-installation script "postinst". For most packages it only contains the standard actions, but for some there are some special commands to change permissions, create symlinks, or something. So, you should look also into it.

I understand and will do that.

Thanks for the help.

Or, or, rebuild the package with the artificially increased version number and place it in IB's packages/ folder.

Stangri, that's an interesting idea too if the other doesn't work.

Although the thread was left somewhat inconclusive, we recently found that the imagebuilder seems to go purely off filenames, it appears to not re-check and re-download the packages once they are downloaded. One might just get away with shoving the desired package into the /packages folder (or replace the already-downloaded ipk there.)

(In general, I feel the imagebuilder doesn't get the love -- and documentation -- it deserves.)

Just tried it with renaming @eduperez'es mwlwifi driver so that the filename is "higher" than the filename of the stock mwlwifi driver and IB certainly picked up the stock, which has "lower" file name, but higher manifest version number.

I have probably tried that in the past, hence my impression that it goes by the version number from the manifest. It may tho pick the file with more recent timestamp if the manifest versions are the same.

It would be nice to have an option which saves the packages and allows re-using them, maybe specifying which should/could be downloaded again. I find that every time I build, the packages are downloaded over and over again.

If you make clean, that is intended behaviour, its literal purpose is to clean out everything that has been generated or downloaded.

If you don't want re-downloads just re-make your image without make cleaning in between. It's not nearly as important with the Image Builder as it is with the full build process since the Image Builder is only "repackaging" pre-build parts into an image anyway, there's really nothing that could have been "built wrong" and needs cleaning.

2 Likes

I totally forgot about that as I had read that somewhere in the past.
Thank you.