gluon/patches/openwrt/0005-imagebuilder-add-hostpkgs-to-imagebuilder.patch
2021-08-15 17:08:37 +02:00

43 lines
2.1 KiB
Diff

From: Leonardo Mörlein <me@irrelefant.net>
Date: Sun, 15 Aug 2021 16:56:46 +0200
Subject: imagebuilder: add hostpkgs to imagebuilder
Before this commit, host packages were not installed into the
imagebuilder. This made it impossible to use lua in opkg
postinstall scripts in combination with the imagebuilder.
This commit changes this and ensures, that
- staging_dir/hostpkg is installed to the imagebuilder.
- staging_dir/hostpkg/lib/lua is installed into the imagebuilder.
After this commit, we are able to use lua in opkg postinstall
scripts in combination with the imagebuilder.
diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile
index 0580e41c5790d8989ec2daf38e89e046cd1c0862..79bfbbd86fd7ebc4fd888c6b408a2df712c85a81 100644
--- a/target/imagebuilder/Makefile
+++ b/target/imagebuilder/Makefile
@@ -100,12 +100,22 @@ endif
| $(XARGS) rm -rf
$(INSTALL_DIR) $(IB_IDIR)
-$(CP) $(STAGING_DIR_IMAGE)/* $(IB_IDIR)/
+ # install staging_dir/host/bin
$(INSTALL_DIR) $(PKG_BUILD_DIR)/staging_dir/host/bin
$(CP) $(STAGING_DIR_HOST)/bin/* $(PKG_BUILD_DIR)/staging_dir/host/bin/
(cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \
$(BUNDLER_COMMAND))
$(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib
STRIP=$(STAGING_DIR_HOST)/bin/sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/
+ # install staging_dir/hostpkg/bin
+ $(INSTALL_DIR) $(PKG_BUILD_DIR)/staging_dir/hostpkg/bin
+ $(CP) $(STAGING_DIR_HOST)/../hostpkg/bin/* $(PKG_BUILD_DIR)/staging_dir/hostpkg/bin/
+ (cd $(PKG_BUILD_DIR); find staging_dir/hostpkg/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \
+ $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/hostpkg)
+ # install lua libs
+ $(CP) $(STAGING_DIR_HOST)/../hostpkg/lib/lua $(PKG_BUILD_DIR)/staging_dir/hostpkg/lib/
+ STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/hostpkg/bin/
+ # bundle
(cd $(BUILD_DIR); \
tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(IB_NAME) \
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \