Jérôme Pouiller | 15 Jan 17:47 2013

[PATCH v0] Add support for automated building of Opkg repository

Dear,

I wrote a first draft of support of building deb or ipk file in Buildroot. The 
result looks like this:
  http://sysmic.org/~jezz/ipk_repository

This patch use inotify to spy which file are installed by package. Once 
installation is done, it copy file to a temporary directory where ipk file is 
built.

During this copy, file are splited in 5 ipk files:
        - main package with debug symbols stripped off
        - debug symbols
        - development files
        - documentation files
        - locales

All these files exist since it is done before target-finalize rule. 

Next script create "control" files needed for building. Script parse Config.in 
file to extract help and place it as Description in ipk file.

Finaly, dpkg-deb is used to create files. Files get deb extention but they are 
compatible with opkg/ipkg. I don't know if it would be better to use opkg-build 
script.

Result is not so bad, as you can see on URL above and it is not intrusive. I would
be glad to get your opinion about this work. What do you think about it?

Current restrictions and things to do:
(Continue reading)

Jérôme Pouiller | 15 Jan 17:47 2013

[PATCH 1/3] Add an entry in images sub-menu for ipk repository building

Just add necessary infrastructure.

Signed-off-by: Jérôme Pouiller <jezz <at> sysmic.org>
---
 fs/Config.in     |    1 +
 fs/ipk/Config.in |   13 +++++++++++++
 fs/ipk/ipk.mk    |   22 ++++++++++++++++++++++
 3 files changed, 36 insertions(+)
 create mode 100644 fs/ipk/Config.in
 create mode 100644 fs/ipk/ipk.mk

diff --git a/fs/Config.in b/fs/Config.in
index da4c5ff..7689cc2 100644
--- a/fs/Config.in
+++ b/fs/Config.in
 <at>  <at>  -11,5 +11,6  <at>  <at>  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
diff --git a/fs/ipk/Config.in b/fs/ipk/Config.in
new file mode 100644
index 0000000..b42c9ab
--- /dev/null
+++ b/fs/ipk/Config.in
 <at>  <at>  -0,0 +1,13  <at>  <at> 
+config BR2_TARGET_ROOTFS_IPK_REPO
+	bool "Ipk repository with packages"
(Continue reading)

Jérôme Pouiller | 15 Jan 17:47 2013

[PATCH 2/3] Add main scripts for opkg repository building.

These scripts are called during installation of packages.

Signed-off-by: Jérôme Pouiller <jezz <at> sysmic.org>
---
 package/pkg-generic.mk      |    2 +
 support/scripts/ipk-post.sh |   95 +++++++++++++++++++++++++++++++++++++++++++
 support/scripts/ipk-pre.sh  |   30 ++++++++++++++
 3 files changed, 127 insertions(+)
 create mode 100755 support/scripts/ipk-post.sh
 create mode 100755 support/scripts/ipk-pre.sh

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 59de0f0..b0eca0a 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
 <at>  <at>  -140,12 +140,14  <at>  <at>  $(BUILD_DIR)/%/.stamp_images_installed:
 # Install to target dir
 $(BUILD_DIR)/%/.stamp_target_installed:
 	 <at> $(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),\
 		$($(PKG)_INSTALL_INIT_SYSV))
 	$($(PKG)_INSTALL_TARGET_CMDS)
 	$(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
+	$(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 $ <at> 
(Continue reading)

Jérôme Pouiller | 15 Jan 17:47 2013

[PATCH 3/3] Add parsing of Config.in in ipk-post.sh.

Built packages now contains description from Buildroot.

Signed-off-by: Jérôme Pouiller <jezz <at> sysmic.org>
---
 support/scripts/ipk-post.sh |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/support/scripts/ipk-post.sh b/support/scripts/ipk-post.sh
index a5beacb..2bfd736 100755
--- a/support/scripts/ipk-post.sh
+++ b/support/scripts/ipk-post.sh
 <at>  <at>  -38,6 +38,23  <at>  <at>  for P in $PKG $PKG-i18n $PKG-doc $PKG-dbg $PKG-dev; do
 	[ $P == $PKG-dbg  ] && echo "Depends: $PKG"
 	[ $P == $PKG-doc  ] && echo "Recommends: $PKG"
 	echo "Description: $PKG"
+	STATE=EMPTY
+	while IFS= read LINE; do
+		if [[ $STATE == GETINDENT ]]; then
+		INDENT="$(echo "$LINE" | grep -o '^[ 	]*')" 
+		STATE=GETHELP
+		fi
+		if [[ $STATE == GETHELP ]]; then
+		if [[ "$LINE" =~ ^"$INDENT" ]]; then
+			echo "	${LINE#$INDENT}"
+		elif [[ "$LINE" == "" ]]; then 
+			echo "	." 
+		else 
+			break
+		fi
+		fi
(Continue reading)

Jérôme Pouiller | 17 Jan 11:23 2013

Re: [PATCH v0] Add support for automated building of Opkg repository

On Tuesday 15 January 2013 17:47:07 Jérôme Pouiller wrote:
> Dear,
> 
> I wrote a first draft of support of building deb or ipk file in Buildroot.
> The result looks like this:
>   http://sysmic.org/~jezz/ipk_repository
> 
> This patch use inotify to spy which file are installed by package. Once
> installation is done, it copy file to a temporary directory where ipk file
> is built.
[...]
> Result is not so bad, as you can see on URL above and it is not intrusive. I
> would be glad to get your opinion about this work. What do you think about
> it?
[...]
Hello all,

I am surprised to have any reply to this patch proposal. Patches have been 
correctly sent? (I didn't receive them but I am sure it come from my local 
mailer daemon since they appear on gmame). Or I am just too impatient?

I would like to know if some of you think this feature is interesting/useful? 
And do you think I take the right way?

Regards,

--

-- 
Jérôme Pouiller
Thomas Petazzoni | 17 Jan 13:54 2013

Re: [PATCH v0] Add support for automated building of Opkg repository

Dear Jérôme Pouiller,

On Thu, 17 Jan 2013 11:23:17 +0100, Jérôme Pouiller wrote:

> I am surprised to have any reply to this patch proposal. Patches have
> been correctly sent? (I didn't receive them but I am sure it come
> from my local mailer daemon since they appear on gmame). Or I am just
> too impatient?

Patches have been received. I intend to give a reply to them, but I
need a bit of time to do so. I'll get back with my comments soon.

Best regards,

Thomas
--

-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot <at> busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Jérôme Pouiller | 17 Jan 15:39 2013

Re: [PATCH v0] Add support for automated building of Opkg repository

On Thursday 17 January 2013 13:54:18 Thomas Petazzoni wrote:
> On Thu, 17 Jan 2013 11:23:17 +0100, Jérôme Pouiller wrote:
> > I am surprised to have any reply to this patch proposal. Patches have
> > been correctly sent? (I didn't receive them but I am sure it come
> > from my local mailer daemon since they appear on gmame). Or I am just
> > too impatient?
> 
> Patches have been received. I intend to give a reply to them, but I
> need a bit of time to do so. I'll get back with my comments soon.

Sorry to have been too impatient. :-)

Regards,

--

-- 
Jérôme Pouiller
Carsten Schoenert | 13 Feb 22:43 2013
Picon

Re: [PATCH v0] Add support for automated building of Opkg repository

Hello Jérôme,

Am 15.01.2013 17:47, schrieb Jérôme Pouiller:
> Dear,
> 
> I wrote a first draft of support of building deb or ipk file in Buildroot. The 
> result looks like this:
>   http://sysmic.org/~jezz/ipk_repository

This looks impressive and the OPKG packaging would be a really "killer"
feature in buildroot for me! OPKG packages is one of the features I'm
really missing.

> This patch use inotify to spy which file are installed by package. Once 
> installation is done, it copy file to a temporary directory where ipk file is 
> built.
> 
> During this copy, file are splited in 5 ipk files:
>         - main package with debug symbols stripped off
>         - debug symbols
>         - development files
>         - documentation files
>         - locales

This would be much more than I use currently in an other existing
project, sounds like you wanted to build the *one* big solution. ;)

> 
> All these files exist since it is done before target-finalize rule. 
> 
(Continue reading)


Gmane