WRT3200ACM - Need help building ImageBuilder with all packages from source (not entirely solved)

Since the SATA PMP support is still not yet enabled for WRT3200ACM's kernel configuration in latest snapshot, I'm building the OpenWrt snapshot from source and I also consider building all available packages for the device so I can freeze a version and pick the packages I wanted later on, as I'm more accustomed to building the final image through ImageBuilder.

Before building, I have set the build targets to WRT3200ACM as well as enabling building all packages by default in the menuconfig and having performed make download without major issues.

However, I'm having problems when doing make under latest Manjaro as while the packages are built, it fails on the "opkg install" phase with an error stating that kmod-bluetooth_6lowpan cannot satisfy dependencies with kmod-6lowpan, and could not proceed any further even after I set to ignore packages that failed to build (IGNORE_ERRORS=m). I don't know the exact reason as I did find the packages in question built. The previous build processes always failed at this step and at the same package.

I'm not sure if others are having similar problems, or maybe I need another suitable Linux environment to build this. And besides, is it possible to only build the ImageBuilder/SDK without generating the image so as to bypass the "opkg install" phase at this point in case something's bugged?

Why are you trying to compile and install all packages available for OpenWrt?

  • A significant number of packages aren't applicable to the WRT AC Series (or any router for that matter)
    • For example, the WRT AC Series does not support Bluetooth (unless you're using a dongle that's supported), and bluetooth on a router is impractical for most use cases due to the 33ft limitation.

  • A significant number of packages will clash with one another (wifi supplicants, multiple dns and dhcp servers, just to name a few)

  • Development packages and their libraries are enormous

  • No WRT AC Series router has flash large enough to house all OpenWrt packages... I probably selected ~50% of the packages for my ClearFog Pro build and that was ~500MB
    • Utilizing an extroot would also be quite slow in comparison to the internal NAND flash

While it's tedious the first time around, go through menuconfig package by package to select the ones you need/want, inquiring about the package [?] when additional info is needed.

  • I've never used imagebuilder as I utilize a buildroot, and I'm not sure if the same functionality exists between the two (using environments, for example, allowing one to have git commit/revert control over their router configuration).
    • To simplify the process for users who've never configured a buildroot before, I created a script for Ubuntu that automates the entire setup

Actually I'm doing this because I intend to freeze a snapshot version of all packages and use ImageBuilder to pick the ones needed to produce the final image offline, as I'm more familiar with it at present. I do not intend to install everything (of course it's not possible), only for the sake that the package collection would be built as complete as possible, so that I can tweak the image or the system later on, if I need to add or remove anything.

This is needed, because snapshot version is constantly changing so I cannot configure it to grab the packages from the remote (unlike stable version). I recall that I only configured to build the stable LEDE ImageBuilder with default configuration and let it download the rest of the packages from official repo when using "make image", and it worked just fine.

Using default config only compiles a tiny fraction of the packages (and of course, the "make image" command on the resulted ImageBuilder fails due to missing packages), and given the massive list of packages I could easily get lost (I do have the "make image" command I used to build the stable image for my device, just not sure how to convert that one here).

While I'm not of any help with Imagebuilder since I'm not familiar with that process, I may very well be wrong, but I'm almost positive it's possible to use a buildoot to compile an image while offline from local packages, as the only thing make needs the internet for, provided all packages selected have already been compiled, is to download the kernel. There should be a command parameter for make that allows it to utilize a local copy of the kernel, rather than downloading it each time.

Everything is an awul lot, I would suggest getting a little more picky, and if it is just for you, simply set aside the buildroot/bin directory each time you do a build; same diff.

Sure looks to me that the third radio support BT.

1 Like

From what I know (maybe I'm wrong), the "make download" process pulls the source code of the all packages you configured to build (you can build without doing "make download", but that means the source code will be downloaded during the compilation process). The LEDE/OpenWrt source repo does not contain the source of all packages. The feeds/makefiles simply tell the build process where to get them as they're in separate official repos, or from third-party GitHub repos.

Apparently there are only three options in the menuconfig, and from what I saw:
Y [*] - The feature will be built and built-in to the image.
M [M] - The feature will be built as package AND installed.
N [ ]- The feature will NOT be built (no packages created).

For snapshot builds, I need a 4th option: Build as package only, do not install it into the image.

I could select packages myself, but I can often get lost as I would not know right away whether the package would pull all the dependencies (* or M in curly brackets) as with the ImageBuilder's "make image". Also, with ImageBuilder I specify whatever packages to be additionally included via "PACKAGES=xxxx" argument, but I often need to test it thoroughly to make sure I'm not missing anything, as some packages (for example, some LuCI feature packages) does not take certain program or kmod packages as required (and inform the user to install the packages in question manually to actually enable support of the feature). Should I find any other packages needed I could simply just add it in the PACKAGES argument and it'll be included (manually installing it through opkg will also do), but again, I need to actually have the package at hand.

Right now I'm planning to just do a make package/compile (or maybe else) just to make sure I get all the packages, then try building the ImageBuilder with default settings (make defconfig) to see if that works okay. As for the Bluetooth package in question... well, I do not necessarily want it, it's just a side-effect caused when I tried to build every package available for the ImageBuilder.

PS, the only reason I have to build it from source is because the SATA PMP feature is still not enabled upstream (the kernel config still left it as "not set"). The FS #547 has been reopened but still have not yet seen any formal progresses. Otherwise I could just use the ImageBuilder and SD snapshot from the Download section to configure the packages and build the image.

It seems this worked as desired:

  1. Use "./scripts/feeds update -a" then "./scripts/feeds install -a" to get the info of all the packages. You may add unofficial ones you want to build at this step in the feeds.conf.default.
  2. "make menuconfig" Select all packages (target specific, kernel and userspace) by default through Global Build Settings. After that, adjust kernel config if needed.
  3. Run "make" with IGNORE_ERRORS=m and wait until it fails at install phase (to make things faster, do a "make download" before "make" is recommended). DO NOT "make clean" at this point. Some packages may fail to build (for example, transmission couldn't be built on my system for some reasons).
  4. Remove or rename .config, and run "make menuconfig" again, select your previous target, then save it, run "make defconfig". Run "make" again. This time it'll only build and install the packages included in default build configurations, and succeed.

After those procedures I ended up with an ImageBuilder archive of ~480MB in size, containing all the extra packages built on step 3, which is what I expected. Will consider trying this one, though I might consider doing the procedure over in a separate Ubuntu environment to see whether my system (Manjaro Linux) might be causing certain packages to fail.

Building directly using default configuration (make defconfig) will only produce an ImageBuilder of around 30-40MB with most of the packages absent, similar to the one you'll find in the official OpenWrt Downloads section.

EDIT (20190124, after this many months): It seems I'm still having issues with packages... possibly due to the fact that several default kernel modules were being rebuilt during the second build run (with defconfig), resulting in other kernel modules that did not get built during second run rejected when using the created ImageBuilder.

Unfortunately, I've never succeeded in building an image based on snapshot yet (directly through make menuconfig) due to some of the packages are failing to build on Manjaro, though currently this is of low priority as OpenWrt 18.06.1 is considered good enough as a base.

1 Like