From ae5756f47531ce350839fb72094d5d79fc2f6354 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sun, 15 Aug 2021 17:08:37 +0200 Subject: [PATCH] patches: Update openwrt IB patches --- ...builder-add-hostpkgs-to-imagebuilder.patch | 42 +++++++++++++++++ ...way-add-scripts-imagebuilder-into-IB.patch | 20 ++++++++ ...uilder-hacky-way-to-use-ib-for-gluon.patch | 46 ------------------- ...ay-add-scripts-imagebuilder-into-dir.patch | 19 -------- 4 files changed, 62 insertions(+), 65 deletions(-) create mode 100644 patches/openwrt/0005-imagebuilder-add-hostpkgs-to-imagebuilder.patch create mode 100644 patches/openwrt/0006-imagebuilder-hacky-way-add-scripts-imagebuilder-into-IB.patch delete mode 100644 patches/openwrt/0018-imagebuilder-hacky-way-to-use-ib-for-gluon.patch delete mode 100644 patches/openwrt/0019-imagebuilder-hacky-way-add-scripts-imagebuilder-into-dir.patch diff --git a/patches/openwrt/0005-imagebuilder-add-hostpkgs-to-imagebuilder.patch b/patches/openwrt/0005-imagebuilder-add-hostpkgs-to-imagebuilder.patch new file mode 100644 index 00000000..e96a2fae --- /dev/null +++ b/patches/openwrt/0005-imagebuilder-add-hostpkgs-to-imagebuilder.patch @@ -0,0 +1,42 @@ +From: Leonardo Mörlein +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))"; \ diff --git a/patches/openwrt/0006-imagebuilder-hacky-way-add-scripts-imagebuilder-into-IB.patch b/patches/openwrt/0006-imagebuilder-hacky-way-add-scripts-imagebuilder-into-IB.patch new file mode 100644 index 00000000..12ef03e3 --- /dev/null +++ b/patches/openwrt/0006-imagebuilder-hacky-way-add-scripts-imagebuilder-into-IB.patch @@ -0,0 +1,20 @@ +From: Leonardo Mörlein +Date: Sun, 15 Aug 2021 17:06:51 +0200 +Subject: imagebuilder: hacky way add scripts/imagebuilder into IB + +diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile +index 79bfbbd86fd7ebc4fd888c6b408a2df712c85a81..8b89af5c6b490d1ad756fd6c21a8e30a4722a3b6 100644 +--- a/target/imagebuilder/Makefile ++++ b/target/imagebuilder/Makefile +@@ -40,6 +40,11 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean + $(TMP_DIR)/.packageinfo \ + $(PKG_BUILD_DIR)/ + ++ # add gluon specific build scripts to IB ++ $(CP) -L \ ++ $(TOPDIR)/../scripts/imagebuilder/* \ ++ $(PKG_BUILD_DIR)/ ++ + ifeq ($(CONFIG_IB_STANDALONE),) + echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf + $(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf) diff --git a/patches/openwrt/0018-imagebuilder-hacky-way-to-use-ib-for-gluon.patch b/patches/openwrt/0018-imagebuilder-hacky-way-to-use-ib-for-gluon.patch deleted file mode 100644 index 112a702e..00000000 --- a/patches/openwrt/0018-imagebuilder-hacky-way-to-use-ib-for-gluon.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: lemoer -Date: Wed, 6 Jan 2021 05:41:56 +0100 -Subject: imagebuilder: hacky way to use ib for gluon - -- Include scripts/ into the imagebuilder. -- Install openwrt/staging_dir/hostpkg into the imagebuilder. -- Install openwrt/staging_dir/hostpkg/lib/lua into the imagebuilder. - -diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile -index 05c7cf3318deb18af1851524c533b1c47af52e1e..e478b5f266cf47a638c82798e8ee596d1820d2ee 100644 ---- a/target/imagebuilder/Makefile -+++ b/target/imagebuilder/Makefile -@@ -35,6 +35,11 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean - $(TMP_DIR)/.packageinfo \ - $(PKG_BUILD_DIR)/ - -+ mkdir -p $(PKG_BUILD_DIR)/gluon -+ $(CP) -L \ -+ $(TOPDIR)/../scripts \ -+ $(PKG_BUILD_DIR)/gluon/ -+ - ifeq ($(CONFIG_IB_STANDALONE),) - echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf - $(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf) -@@ -81,11 +86,21 @@ 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 | \ - $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host) - STRIP=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 - $(TAR) -cf - -C $(BUILD_DIR) $(IB_NAME) | xz -zc -7e > $@ - - download: diff --git a/patches/openwrt/0019-imagebuilder-hacky-way-add-scripts-imagebuilder-into-dir.patch b/patches/openwrt/0019-imagebuilder-hacky-way-add-scripts-imagebuilder-into-dir.patch deleted file mode 100644 index 252ddee7..00000000 --- a/patches/openwrt/0019-imagebuilder-hacky-way-add-scripts-imagebuilder-into-dir.patch +++ /dev/null @@ -1,19 +0,0 @@ -From: lemoer -Date: Wed, 6 Jan 2021 17:23:27 +0100 -Subject: imagebuilder: hacky way add scripts/imagebuilder into dir - -diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile -index e478b5f266cf47a638c82798e8ee596d1820d2ee..4b538529e950f820aede91275b779ab53f88ff71 100644 ---- a/target/imagebuilder/Makefile -+++ b/target/imagebuilder/Makefile -@@ -39,6 +39,10 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean - $(CP) -L \ - $(TOPDIR)/../scripts \ - $(PKG_BUILD_DIR)/gluon/ -+ $(CP) -L \ -+ $(TOPDIR)/../scripts/imagebuilder/* \ -+ $(PKG_BUILD_DIR)/ -+ echo "{}" > $(PKG_BUILD_DIR)/custom.json - - ifeq ($(CONFIG_IB_STANDALONE),) - echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf