The right way to remove an unwanted package from source code folder

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.

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.