From: Martin Jansa <martin.jansa@gmail.com>
To: Bryan Evenson <bevenson@melinkcorp.com>
Cc: poky@yoctoproject.org
Subject: Re: [PATCH] scripts/contrib/make_ipk_repo.sh: Add new image-specific package feed generator
Date: Tue, 12 Aug 2014 13:22:28 +0200 [thread overview]
Message-ID: <20140812112228.GD14848@jama> (raw)
In-Reply-To: <1407775650-27646-1-git-send-email-bevenson@melinkcorp.com>
[-- Attachment #1: Type: text/plain, Size: 5163 bytes --]
On Mon, Aug 11, 2014 at 12:47:30PM -0400, Bryan Evenson wrote:
> Adding a new script which generates a reduced package feed
> directory. The script uses the list of installed packages for a
> specific build image and creates a new package feed directory
> with only the packages relevant to that image. This is useful
> for distributing firmware upgrades.
>
> At this time the script only works for opkg repositories. Further
> modifications are needed for the script to work with other package
> management systems.
This belongs to oe-core ML
>
> Signed-off-by: Bryan Evenson <bevenson@melinkcorp.com>
> ---
> scripts/contrib/make_ipk_repo.sh | 93 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 93 insertions(+)
> create mode 100755 scripts/contrib/make_ipk_repo.sh
>
> diff --git a/scripts/contrib/make_ipk_repo.sh b/scripts/contrib/make_ipk_repo.sh
> new file mode 100755
> index 0000000..b04535e
> --- /dev/null
> +++ b/scripts/contrib/make_ipk_repo.sh
> @@ -0,0 +1,93 @@
> +#!/bin/bash
> +
> +# Creates a package feed directory that only contains the packages that were
> +# installed with the referenced image. This script depends on image build
> +# history to properly operate. In your conf/local.conf, add the following two
> +# lines:
> +# INHERIT += "buildhistory"
> +# BUILDHISTORY_COMMIT = "1"
> +#
> +# At this time this script is only setup to create opkg package feeds.
> +# Further script modification is needed if you use a different package
> +# managment system.
> +#
> +# This script assumes it is being run from your image build directory. Some
> +# paths may need to be modified if it is run from a different directory.
> +#
> +# Assumes that the relevant image was recently built. If you have done any
> +# package builds since the last image build, it is suggested that you re-build
> +# relevant image.
> +#
> +# Script input variables:
> +# $1 - The image name (i.e. "core-image-minimal")
> +# $2 - The target machine (i.e. "beaglebone")
> +# $3 - The target architecture (i.e. "arm926ejste")
> +# $4 - The target directory (i.e. "feed")
> +#
> +
> +# Validate the number of input variables
> +if [[ "$#" -ne 4 ]]; then
> + echo "Unexpected number of arguments";
> + echo "Usage: make_ipk_repo.sh IMAGE_NAME TARGET_MACHINE TARGET_ARCH TARGET_DIR";
> + exit 1;
> +fi
> +
> +# Some packages inexplicably contain a "1:" in the package name that does not
> +# belong there. Remove this text from these package names.
> +
> +sed -i 's/1://g' tmp/buildhistory/images/"$2"/eglibc/"$1"/installed-packages.txt
> +
> +# Read in the list of packages used by the image. This includes the
> +# machine/architecture independent packages ("all"), the architecture specific
> +# packages, and the machine specific packages.
> +ALL_PKG_LIST=$(grep '_all\.ipk' tmp/buildhistory/images/"$2"/eglibc/"$1"/installed-packages.txt)
> +ARCH_PKG_LIST=$(grep '_'"$3"'\.ipk' tmp/buildhistory/images/"$2"/eglibc/"$1"/installed-packages.txt)
> +MACHINE_PKG_LIST=$(grep '_'"$2"'\.ipk' tmp/buildhistory/images/"$2"/eglibc/"$1"/installed-packages.txt)
> +
> +echo "ALL_PKG_LIST is $ALL_PKG_LIST";
> +echo "ARCH_PKG_LIST is $ARCH_PKG_LIST";
> +echo "MACHINE_PKG_LIST is $MACHINE_PKG_LIST";
> +
> +# Create the new directory for the feeds, making sure there is no previous copy
> +rm -r "$4"/
> +rm "$4".zip
> +mkdir -p "$4"/
> +
> +# Copy over the "all" packages
> +mkdir -p "$4"/all/
> +echo "Copying packages to 'all' directory"
> +for i in $ALL_PKG_LIST; do
> + cp tmp/deploy/ipk/all/"$i" "$4"/all/
> +done
> +
> +# Copy over the architecture packages
> +mkdir -p "$4"/$3/
> +echo "Copying packages to '$3' directory"
> +for i in $ARCH_PKG_LIST; do
> + cp tmp/deploy/ipk/"$3"/"$i" "$4"/"$3"/
> +done
> +
> +# Copy over the machine packages
> +mkdir -p "$4"/"$2"/
> +echo "Copying packages to '$2' directory"
> +for i in $MACHINE_PKG_LIST; do
> + cp tmp/deploy/ipk/"$2"/"$i" "$4"/"$2"/
> +done
> +
> +# Build the package index files
> +echo "Building package index files"
> +touch "$4"/Packages
> +flock "$4"/Packages.flock -c "tmp/sysroots/i686-linux/usr/bin/opkg-make-index -r $4/Packages -p $4/Packages -m $4/"
> +touch "$4"/all/Packages
> +flock "$4"/all/Packages.flock -c "tmp/sysroots/i686-linux/usr/bin/opkg-make-index -r $4/all/Packages -p $4/all/Packages -m $4/all/"
> +touch "$4"/"$3"/Packages
> +flock "$4"/"$3"/Packages.flock -c "tmp/sysroots/i686-linux/usr/bin/opkg-make-index -r $4/$3/Packages -p $4/$3/Packages -m $4/$3/"
> +touch "$4"/"$2"/Packages
> +flock "$4"/"$2"/Packages.flock -c "tmp/sysroots/i686-linux/usr/bin/opkg-make-index -r $4/$2/Packages -p $4/$2/Packages -m $4/$2/"
> +
> +#Create a zip file of the directory for archive purposes
> +cd "$4"/
> +zip -r "$4" .
> +
> +echo "A reduced package repository has been created at $4"
> +
> --
> 1.7.9.5
>
> --
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]
next prev parent reply other threads:[~2014-08-12 11:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-11 16:47 [PATCH] scripts/contrib/make_ipk_repo.sh: Add new image-specific package feed generator Bryan Evenson
2014-08-12 11:22 ` Martin Jansa [this message]
2014-08-12 12:41 ` Richard Purdie
2014-08-12 13:33 ` Bryan Evenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140812112228.GD14848@jama \
--to=martin.jansa@gmail.com \
--cc=bevenson@melinkcorp.com \
--cc=poky@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.