Strip content selectively in files/ with CONFIG_TARGET_DEVICE_PACKAGES?

I am using the CONFIG_TARGET_PER_DEVICE_ROOTFS buildroot functionality to build for a range of ar71xx devices. One of those (unfortunately) includes a TL-WR841N v7 with 4 MB flash. I am including some custom scripts and extra UCI defaults, which pose no issue for the other ar71xx images I build, but the TL-WR841N v7 image is choking on a mere 3,4 kB.

Is there a way to use CONFIG_TARGET_DEVICE_PACKAGES_... to exclude files (stored under files/ in the buildroot)? As far as I can tell it can only include/exclude packages.


Well I guess the lack of answers means it's a no-no. :slight_smile: On the upside, I learnt that it's better to build with =m and explicitly include a package in CONFIG_TARGET_DEVICE_PACKAGES, instead of using =y and stripping packages afterwards. Scouring through the make V=s logs showed that a lot of packages weren't being removed, which was solved by setting them to modular. So, problem worked around. :sunglasses:

The easiest way would be not to put your files under files/, but to create a small package for them - a package you can include or omit.

But... 3.4 KB is a tiny difference, something that's easily swallowed by the next kernel upgrade - so the alternative of just making a little more space is probably a better option.

That is a nice idea indeed, to create a package for them. However, like I said, it turned out a lot of packages weren't being stripped because the buildroot considered them essential (among which USB support, e.g., which is useless on a stock TL-WR841N v7). For the 4 MB itself, there's still stuff to be stripped like debugging symbols both from the kernel and the userland, but then I'd rather go with a separate configuration for my remaining 4 MB devices altogether, so I don't have to cripple the fully functional ones. It would be neat to be able to see how much space is left. Maybe it's there tucked away somewhere in the make V=s output already, but I wasn't able to spot it.

Has 'solved' your issue anyways, by pushing TP-LINK TL-WR841N/ND v7 support into the ar71xx/tiny subtarget, making a common build (and TARGET_PER_DEVICE_ROOTFS) with generic devices no possible...

Thanks, I saw that commit. We'll see. I might just revert that commit to keep being able to build all my ar71xx images at the same time (KERNEL_KALLSYMS is disabled in stable releases already, unless I'm mistaken).