diff options
author | George McCollister <george.mccollister@gmail.com> | 2011-05-19 16:03:55 -0500 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-05-20 19:40:28 +0200 |
commit | b5d6f1c952e7e577098371dd875357c519b2b310 (patch) | |
tree | 1dee4be2678ba0e9fce525084d09bd76fb8645a5 | |
parent | f15a9d54259d5f3fbe963f80d301ddc360569ece (diff) | |
download | ptxdist-b5d6f1c952e7e577098371dd875357c519b2b310.tar.gz ptxdist-b5d6f1c952e7e577098371dd875357c519b2b310.tar.xz |
build images from ipkg repository
Added option to build images from the ipkg repository.
Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | platforms/image_ipkg.in | 12 | ||||
-rw-r--r-- | rules/post/ptxd_make_image_common.make | 1 | ||||
-rw-r--r-- | rules/post/ptxd_make_image_prepare_work_dir.make | 6 | ||||
-rwxr-xr-x | scripts/ipkg-push | 24 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_image_common.sh | 13 |
5 files changed, 49 insertions, 7 deletions
diff --git a/platforms/image_ipkg.in b/platforms/image_ipkg.in index ef3698442..caafb240a 100644 --- a/platforms/image_ipkg.in +++ b/platforms/image_ipkg.in @@ -24,6 +24,18 @@ config IMAGE_IPKG_FORCED_PUSH If this option is checked, this is done by default. This is most useful for development purposes. +config IMAGE_INSTALL_FROM_IPKG_REPOSITORY + bool + select IMAGE_IPKG_PUSH_TO_REPOSITORY + select IMAGE_IPKG_FORCED_PUSH + prompt "make images: install packets from ipkg-repository" + help + If this option is checked the packet files from the + ipkg-repository are used to create the images + + Please note, that the ipkg-repository is currently a + local directory on your machine. + config IMAGE_IPKG_INDEX bool "generate ipkg.index" default y diff --git a/rules/post/ptxd_make_image_common.make b/rules/post/ptxd_make_image_common.make index fd639a30f..1581173f7 100644 --- a/rules/post/ptxd_make_image_common.make +++ b/rules/post/ptxd_make_image_common.make @@ -17,6 +17,7 @@ DOPERMISSIONS := '{ \ image/env = \ $(call ptx/env) \ image_pkgs_selected_target="$(call ptx/escape,$(PTX_PACKAGES_INSTALL))" \ + image_repo_dist_dir="$(call ptx/escape,$(PTXCONF_SETUP_IPKG_REPOSITORY)/$(call remove_quotes,$(PTXCONF_PROJECT))/dists/$(call remove_quotes,$(PTXCONF_PROJECT))$(call remove_quotes,$(PTXCONF_PROJECT_VERSION)))" \ \ image_work_dir="$(call ptx/escape,$(image/work_dir))" \ image_permissions="$(call ptx/escape,$(image/permissions))" diff --git a/rules/post/ptxd_make_image_prepare_work_dir.make b/rules/post/ptxd_make_image_prepare_work_dir.make index 0bdb0d3b0..0991efd3f 100644 --- a/rules/post/ptxd_make_image_prepare_work_dir.make +++ b/rules/post/ptxd_make_image_prepare_work_dir.make @@ -8,11 +8,15 @@ # see the README file. # +ifdef PTXCONF_IMAGE_INSTALL_FROM_IPKG_REPOSITORY +IMAGE_REQUIRES := $(STATEDIR)/ipkg-push +endif + # # extract all current ipkgs into the working directory # PHONY += $(STATEDIR)/image_working_dir -$(STATEDIR)/image_working_dir: +$(STATEDIR)/image_working_dir: $(IMAGE_REQUIRES) @$(call image/env) \ ptxd_make_image_prepare_work_dir @$(call touch, $@) diff --git a/scripts/ipkg-push b/scripts/ipkg-push index 48025cd02..4c8d224f1 100755 --- a/scripts/ipkg-push +++ b/scripts/ipkg-push @@ -119,9 +119,15 @@ for package in $IPKG_PACKAGES; do # this package wasn't there before, re-revision to -1 newpackage=`$SCRIPTDIR/ipkg-revision $POOL/$package - 1` if [ -n "$DIST" ]; then + cp -f "$IPKGDIR/../state/${IPKG_NAME}.perms" "$POOL/${newpackage%.ipk}.perms" + echo " linking.source...: ../../pool/$newpackage" echo " linking.to.......: $REPODIR/$PROJECT/dists/$DIST/$newpackage" - ln -sf ../../pool/$newpackage $REPODIR/$PROJECT/dists/$DIST/$newpackage + ln -sf ../../pool/${newpackage} $REPODIR/$PROJECT/dists/$DIST/$newpackage + + echo " perms linking.source...: ../../pool/${newpackage%.ipk}.perms" + echo " perms linking.to.......: $REPODIR/$PROJECT/dists/$DIST/${newpackage%.ipk}.perms" + ln -sf ../../pool/${newpackage%.ipk}.perms $REPODIR/$PROJECT/dists/$DIST/${newpackage%.ipk}.perms fi else @@ -149,7 +155,11 @@ for package in $IPKG_PACKAGES; do if [ -n "$DIST" ]; then echo " linking.source...: ../../pool/$latest_pkg" echo " linking.to.......: $REPODIR/$PROJECT/dists/$DIST/$latest_pkg" - ln -sf ../../pool/$latest_pkg $REPODIR/$PROJECT/dists/$DIST/$latest_pkg + ln -sf ../../pool/${latest_pkg} $REPODIR/$PROJECT/dists/$DIST/$latest_pkg + + echo " perms linking.source...: ../../pool/${latest_pkg%.ipk}.perms" + echo " perms linking.to.......: $REPODIR/$PROJECT/dists/$DIST/${latest_pkg%.ipk}.perms" + ln -sf ../../pool/${latest_pkg%.ipk}.perms $REPODIR/$PROJECT/dists/$DIST/${latest_pkg%.ipk}.perms fi continue fi @@ -159,10 +169,16 @@ for package in $IPKG_PACKAGES; do newpackage=`$SCRIPTDIR/ipkg-revision $POOL/$package - $(($IPKG_REV_PACKAGE+1))` echo "RSC2: newpackage=$newpackage" - if [ -n "$DIST" ]; then + if [ -n "$DIST" ]; then + cp -f "$IPKGDIR/../state/${IPKG_NAME}.perms" "$POOL/${newpackage%.ipk}.perms" + echo " linking.source...: ../../pool/$newpackage" echo " linking.to.......: $REPODIR/$PROJECT/dists/$DIST/$newpackage" - ln -sf ../../pool/$newpackage $REPODIR/$PROJECT/dists/$DIST/$newpackage + ln -sf ../../pool/${newpackage} $REPODIR/$PROJECT/dists/$DIST/$newpackage + + echo " perms linking.source...: ../../pool/${newpackage%.ipk}.perms" + echo " perms linking.to.......: $REPODIR/$PROJECT/dists/$DIST/${newpackage%.ipk}.perms" + ln -sf ../../pool/${newpackage%.ipk}.perms $REPODIR/$PROJECT/dists/$DIST/${newpackage%.ipk}.perms fi fi diff --git a/scripts/lib/ptxd_make_image_common.sh b/scripts/lib/ptxd_make_image_common.sh index 035afb765..30446a749 100644 --- a/scripts/lib/ptxd_make_image_common.sh +++ b/scripts/lib/ptxd_make_image_common.sh @@ -38,7 +38,11 @@ ptxd_get_ipkg_files() { # take first hit if ptxd_get_path "${ipkg_files[@]}"; then ptxd_reply_ipkg_files[${#ptxd_reply_ipkg_files[@]}]="${ptxd_reply}" - ptxd_reply_perm_files[${#ptxd_reply_perm_files[@]}]="${ptxd_reply%/*/*}/state/${1}.perms" + if [ -z "$(ptxd_get_ptxconf PTXCONF_IMAGE_INSTALL_FROM_IPKG_REPOSITORY)" ]; then + ptxd_reply_perm_files[${#ptxd_reply_perm_files[@]}]="${ptxd_reply%/*/*}/state/${1}.perms" + else + ptxd_reply_perm_files[${#ptxd_reply_perm_files[@]}]="${ptxd_reply%.ipk}.perms" + fi else ptxd_bailout "\ @@ -57,7 +61,12 @@ export -f ptxd_get_ipkg_files # initialize variables needed for image creation # ptxd_make_image_init() { - image_ipkg_repo_dirs=( "${ptx_pkg_dir}" ) + if [ -z "$(ptxd_get_ptxconf PTXCONF_IMAGE_INSTALL_FROM_IPKG_REPOSITORY)" ]; then + image_ipkg_repo_dirs=( "${ptx_pkg_dir}" ) + else + image_ipkg_repo_dirs=( "${image_repo_dist_dir}" ) + fi + if [ -n "${PTXDIST_BASE_PLATFORMDIR}" ]; then image_ipkg_repo_dirs[${#image_ipkg_repo_dirs[@]}]="${PTXDIST_BASE_PLATFORMDIR}/packages" fi |