Skip to contentSkip to conversation

package/bash: remove development files and modules on the target.

PATCH New Nicolas Cavallari 2 participants 3 messages Mar 31, 2021 – Apr 6, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/bash: remove development files and modules on the target.

bash installs /lib/pkgconfig/bash.pc on the target, which buildroot does not remove because it is not in the usual /usr/lib/pkgconfig.

It also install makefiles and example builtins in /lib/bash that are not required.

The Makefiles and .pc encode the build path and create reproducibility issues. Remove them.

---
 package/bash/bash.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/bash/bash.mk +2 -1
index efe7cbbe59..6af31f182d 100644
@@ -41,7 +41,8 @@ endif
 define BASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
-	rm -f $(TARGET_DIR)/bin/bashbug
+	rm -f $(TARGET_DIR)/bin/bashbug $(TARGET_DIR)/lib/pkgconfig/bash.pc
+	rm -rf $(TARGET_DIR)/lib/bash
 endef
 
 # Add /bin/bash to /etc/shells otherwise some login tools like dropbear
Signature · 1 line
2.31.0
#1 lore raw

PATCH 1/1 package/bash: remove development files and modules on the target.

Hello Nicolas,

package/bash/bash.mk endif · line 44

Quoted 10 lines · On Wed, 31 Mar 2021 10:15:59 +0200 Nicolas Cavallari…
package/bash/bash.mk +1 -1
index efe7cbbe59..6af31f182d 100644
@@ -41,7 +41,8 @@ endif
 define BASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
-	rm -f $(TARGET_DIR)/bin/bashbug
+	rm -f $(TARGET_DIR)/bin/bashbug $(TARGET_DIR)/lib/pkgconfig/bash.pc

I am wondering if target-finalize shouldn't take care of removing /lib/pkgconfig just like it removes /usr/lib/pkgconfig. This would have the benefit of also dropping the /lib/pkgconfig folder, which your change doesn't do.

What do you think?

package/bash/bash.mk endif · line 48

Quoted 4 lines
package/bash/bash.mk +1 -0
+	rm -rf $(TARGET_DIR)/lib/bash
 endef
 
 # Add /bin/bash to /etc/shells otherwise some login tools like dropbear

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/bash: remove development files and modules on the target.

Hello,

Quoted 16 lines · Thomas Petazzoni

package/bash/bash.mk endif · line 44

Quoted 8 lines · On Wed, 31 Mar 2021 10:15:59 +0200 Nicolas Cavallari…
package/bash/bash.mk +1 -1
@@ -41,7 +41,8 @@ endif
  define BASH_INSTALL_TARGET_CMDS
  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
  		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
-	rm -f $(TARGET_DIR)/bin/bashbug
+	rm -f $(TARGET_DIR)/bin/bashbug $(TARGET_DIR)/lib/pkgconfig/bash.pc

I am wondering if target-finalize shouldn't take care of removing /lib/pkgconfig just like it removes /usr/lib/pkgconfig. This would have the benefit of also dropping the /lib/pkgconfig folder, which your change doesn't do.

Quoted 1 line

What do you think?

This would work too, but do we want to add things to target-finalize just for (apparently) only one little package ?