Skip to contentSkip to conversation

automated building of Opkg repository

Buildroot New Vinay Malkani 2 participants 4 messages Feb 3, 2014 VFS

lore
Share & tools
lore
#0 lore raw

I updated the patch to work with Description and Version correctly (These were causing compilation errors). In addition, I updated the patch to apply cleanly to pre-generic.mk
I'm not sure if this is the correct process so I hope this is the correct way to do it.

Vinay

#1 lore raw

PATCH 1/1 automated opkg repository building. Fixes Version, Description, and pkg-generic.mk

---
 fs/Config.in                |  1 +
 fs/ipk/Config.in            | 13 +++++++
 fs/ipk/ipk.mk               | 22 +++++++++++
 package/pkg-generic.mk      |  2 +
 support/scripts/ipk-post.sh | 94 +++++++++++++++++++++++++++++++++++++++++++++
 support/scripts/ipk-pre.sh  | 31 +++++++++++++++
 6 files changed, 163 insertions(+)
 create mode 100644 fs/ipk/Config.in
 create mode 100644 fs/ipk/ipk.mk
 create mode 100755 support/scripts/ipk-post.sh
 create mode 100755 support/scripts/ipk-pre.sh
fs/Config.in +1 -0
index da4c5ff..7689cc2 100644
@@ -11,5 +11,6 @@ source "fs/romfs/Config.in"
 source "fs/squashfs/Config.in"
 source "fs/tar/Config.in"
 source "fs/ubifs/Config.in"
+source "fs/ipk/Config.in"
 
 endmenu
fs/ipk/Config.in new file +13 -0
new file mode 100644
index 0000000..9087265
@@ -0,0 +1,13 @@
+config BR2_TARGET_ROOTFS_IPK_REPO
+	bool "Ipk repository with packages"
+	default y
+	help
+	  Create a repository compatible with opkg/dpkg tools.
+
+	  Each selected packages is splitted in 4 parts:
+	     - main package with debug symbols stripped off
+	     - debug symbols
+	     - development files
+	     - documentation files
+	     - locales
+
fs/ipk/ipk.mk new file +22 -0
new file mode 100644
index 0000000..8b8d6f2
@@ -0,0 +1,22 @@
+#############################################################
+#
+# Generate a repository for opkg
+#
+#############################################################
+
+define ROOTFS_IPK_REPO_CMD
+	mkdir -p $(BINARIES_DIR)/ipk_repository;                                                             \
+	( cd $(BINARIES_DIR)/ipk_repository && dpkg-scanpackages . ) > $(BINARIES_DIR)/ipk_repository/Packages; \
+	gzip < $(BINARIES_DIR)/ipk_repository/Packages      > $(BINARIES_DIR)/ipk_repository/Packages.gz;    \
+	echo "Archive: unstable"                           >> $(BINARIES_DIR)/ipk_repository/Release;        \
+	echo "Origin: Buildroot"                           >> $(BINARIES_DIR)/ipk_repository/Release;        \
+	echo "Label: Buildroot autogenerated repository"   >> $(BINARIES_DIR)/ipk_repository/Release;        \
+	echo "Architecture: $(ARCH)"                       >> $(BINARIES_DIR)/ipk_repository/Release;        \
+	echo "Your repository is ready.";                                                                    \
+	echo "If you use opkg, add this line to your /etc/opkg/buildroot.conf:";                             \
+	echo "   src/gz buildroot file://$(BINARIES_DIR)/ipk_repository";                                    \
+	echo "If you use apt, add this one to /etc/apt/sources.list.d/buildroot.list:";                      \
+	echo "   deb file://$(BINARIES_DIR)/ipk_repository .";
+endef
+
+$(eval $(call ROOTFS_TARGET,ipk_repo))
package/pkg-generic.mk +2 -0
index 1b99c2a..c1c682f 100644
@@ -216,6 +216,7 @@ $(BUILD_DIR)/%/.stamp_images_installed:
 $(BUILD_DIR)/%/.stamp_target_installed:
 	@$(call step_start,install-target)
 	@$(call MESSAGE,"Installing to target")
+	$(if $(BR2_TARGET_ROOTFS_IPK_REPO),support/scripts/ipk-pre.sh $(TARGET_DIR) $(BUILD_DIR) $($(PKG)_DIR_PREFIX) $($(PKG)_RAWNAME) $($(PKG)_VERSION)) $(ARCH) 
 	$(if $(BR2_INIT_SYSTEMD),\
 		$($(PKG)_INSTALL_INIT_SYSTEMD))
 	$(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
@@ -225,6 +226,7 @@ $(BUILD_DIR)/%/.stamp_target_installed:
 	$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
 		$(RM) -f $(addprefix $(TARGET_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ; \
 	fi
+	$(if $(BR2_TARGET_ROOTFS_IPK_REPO),support/scripts/ipk-post.sh $(TARGET_DIR) $(BUILD_DIR) $($(PKG)_DIR_PREFIX) $($(PKG)_RAWNAME) $($(PKG)_VERSION)) $(ARCH) 
 	$(Q)touch $@
 	@$(call step_end,install-target)
 
support/scripts/ipk-post.sh new file +94 -0

94 lines not on this page · raw message

support/scripts/ipk-pre.sh new file +31 -0
new file mode 100755
index 0000000..31f54bc
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Licence: GPL
+# Created: 2013-01-15 15:25:52+01:00
+# Main authors:
+#     - J?r?me Pouiller <[hidden email]>
+#     - Vinay Malkani <[hidden email]>
+#
+# First part of package building.
+#
+# It launches a daemon to spy write acces to target. Results are written to
+# .ipk_list_installed_files in build subdirectory of package.
+#
+
+TARGET_DIR=$1
+BUILD_DIR=$2
+PACKAGES_DIR=$3
+PKG_RAWNAME=$4
+PKG_VERSION=$5
+PKG_DIR=$PACKAGES_DIR/$PKG_RAWNAME
+PKG_BUILD_DIR=$BUILD_DIR/$PKG_RAWNAME-$PKG_VERSION
+IPK_DIR=$BUILD_DIR/ipk_build
+PKG=$PKG_RAWNAME
+
+inotifywait -mr $TARGET_DIR -e create -e modify -e moved_to --format '%e	%w%f' >  $PKG_BUILD_DIR/.ipk_list_installed_files &
+echo $! > $PKG_BUILD_DIR/.ipk_inotify_pid
+# FIXME Be sure inotifywait is started
+#sleep 3
+
+
+
Signature · 1 line
1.8.3.2
author
#2 lore raw
In reply to Vinay Malkani

Hi,

I updated the patch to work with Description and Version correctly (These were causing compilation errors).
In addition, I updated the patch to apply cleanly to pre-generic.mk I'm not sure if this is the correct process so I hope this is the correct way to do it.

Vinay

--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/automated-building-of-Opkg-repository-tp61315p61317.html
Sent from the Buildroot (busybox) mailing list archive at Nabble.com.

#3 lore raw
In reply to Vinay Malkani

Dear Vinay Malkani,

Quoted 3 lines · Vinay Malkani

I updated the patch to work with Description and Version correctly (These were causing compilation errors). In addition, I updated the patch to apply cleanly to pre-generic.mk
I'm not sure if this is the correct process so I hope this is the correct way to do it.

Thanks for this contribution. I am not sure where the original patch came from (you're saying that you updated the patch), but unfortunately, the Buildroot community has collectively decided quite some time ago that we would not support binary packages suck as ipkg packages, due to the significant additional complexity that it would add to the package infrastructure. The problem being that supporting binary packages is *much* more complicated than just grouping the files that each Buildroot package installs into different .ipk files.

Yann is currently working on adding a FAQ entry on this topic, see:

http://lists.busybox.net/pipermail/buildroot/2014-January/086084.html

You can also find a more detailed explanation by reading the chapter "Package management" in the report of a past Buildroot Developers Meeting at
http://lists.busybox.net/pipermail/buildroot/2011-November/047229.html.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com