The right way to remove an unwanted package and remove all "=m" packages

I've got a problem on the new v23.05.3 release version.
When I tried to make my personal build from the source code, the package - libpfring comes with error.

I have no time to go into the details for the real "bug/problems" or I'm not an expert for this really.

Then, I looked the libpfring package in make menuconfig, not be checked like [_], that means no need it in my build.

Then I removed ALL files with "libpfring" in filename from the source folder, fortunately my new build passed.

I know this would not be a right way to do such "remove" actions.

Any suggestions or any professional methods ? Thanks.

About "remove all =m packages", pls refer to

1 Like

I was always thinking before, openwrt building system does not smart enough.

Each time we make a build, the system will compile many unused packages. Not compile the menuconfig selections only.

You can build a specific package and its dependencies only with the make command.

Create file 999-fix.patch in directory feeds/packages/libs/libpfring/patches/ with following content:

--- a/kernel/pf_ring.c
+++ b/kernel/pf_ring.c
@@ -5562,18 +5562,18 @@ static int ring_bind(struct socket *sock, struct sockaddr *sa, int addr_len)
 {
   struct sock *sk = sock->sk;
-  char name[sizeof(sa->sa_data)+1];
+  char name[sizeof(sa->sa_data_min)+1];
 
   debug_printk(2, "ring_bind() called\n");
 
   /*
    * Check legality
    */
   if(addr_len != sizeof(struct sockaddr))
     return(-EINVAL);
   if(sa->sa_family != PF_RING)
     return(-EINVAL);
 
-  memcpy(name, sa->sa_data, sizeof(sa->sa_data));
+  memcpy(name, sa->sa_data, sizeof(sa->sa_data_min));
 
   /* Add trailing zero if missing */
   name[sizeof(name)-1] = '\0';

Source: https://github.com/openwrt/packages/issues/23621

1 Like

Thanks. My modified code in more than 10 packages, so I need to build all packages in one time.

Thanks, I'm not sure, my errors is because that issue, but after I know the package libpfring not used in my build, a simple method is that just remove the libpfring package from the source.

I also wonder why v23.05.3 release could pass the compiling with libpfring package, but I'm not.

I just downloaded package ikconfigs from the official site:
https://downloads.openwrt.org/releases/23.05.3/targets/mediatek/filogic/kmods/5.15.150-1-83850846aeb31a278a010941bbebf326/
unpack its and compare with my kernel .config
I didn't find any differences. Completely identical.

This is really very strange.

Have the same. Many unused packages are compiling. For example I don't need 'python3' or ' f2fs-tools' but it compiles. It's really annoying.
Now I am developing the fix for this, if Openwrt's team doesn't want do this at their side. This problem inherited in 24.10 also.

In the .config file, there are many packages marked "=m", we need to change all it to " is not set" and add "# " to front of the lines.

to do this, we can use a simple CLI cmd:

sed -i -r -e "s/^(.*=m)/# \0/" -e "s/=m/ is not set/g" .config

apply to your .config file, and then run make menuconfig again.

No more "=m" packages in the file!!!