diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-06-17 10:09:21 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-06-21 09:34:50 +0200 |
commit | 56f6cc230a0783905c6304b9473988dec1afef74 (patch) | |
tree | 670c5b3e27c13db75bb1e0192c059909d5b88bb9 /scripts/lib | |
parent | b9f107beffc787967d23101de4f0e2a2b8b4b915 (diff) | |
download | ptxdist-56f6cc230a0783905c6304b9473988dec1afef74.tar.gz ptxdist-56f6cc230a0783905c6304b9473988dec1afef74.tar.xz |
cleanup package creation
Remove indirection now, that only one package tool remains.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/ptxd_lib_dgen.awk | 2 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_image_prepare_work_dir.sh | 11 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_opkg_common.sh | 22 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_opkg_finish.sh | 22 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_common.sh | 10 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_finish.sh | 20 |
6 files changed, 25 insertions, 62 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index d34550806..7d53acbdc 100644 --- a/scripts/lib/ptxd_lib_dgen.awk +++ b/scripts/lib/ptxd_lib_dgen.awk @@ -429,7 +429,7 @@ function write_deps_pkg_active_image(this_PKG, this_pkg, prefix) { # print "ifneq ($(strip $(" this_PKG "_PKGS)),)" > DGEN_DEPS_POST print "$(" this_PKG "_IMAGE):" " \ - $(STATEDIR)/host-$(call remove_quotes,$(PTXCONF_HOST_PACKAGE_MANAGEMENT)).install.post" > DGEN_DEPS_POST + $(STATEDIR)/host-opkg.install.post" > DGEN_DEPS_POST print "ifeq ($(strip $(" this_PKG "_NFSROOT)),YES)" > DGEN_DEPS_POST print "$(foreach pkg,$(" this_PKG "_PKGS),$(eval $(PTX_MAP_TO_PACKAGE_$(pkg))_NFSROOT_DIRS += " \ "$(PTXDIST_PLATFORMDIR)/nfsroot/" this_pkg "))" > DGEN_DEPS_POST diff --git a/scripts/lib/ptxd_make_image_prepare_work_dir.sh b/scripts/lib/ptxd_make_image_prepare_work_dir.sh index 84a6ca8db..570cb7f89 100644 --- a/scripts/lib/ptxd_make_image_prepare_work_dir.sh +++ b/scripts/lib/ptxd_make_image_prepare_work_dir.sh @@ -22,16 +22,11 @@ # ptxd_make_image_extract_xpkg_files() { # FIXME: consolidate "ptxd_install_setup_src" - local src="/etc/ipkg.conf" + local src="/etc/opkg/opkg.conf" local xpkg_conf="${PTXDIST_TEMPDIR}/${FUNCNAME}_xpkg.conf" local work_dir="$1" local -a list ptxd_reply - if ptxd_get_ptxconf "PTXCONF_HOST_PACKAGE_MANAGEMENT_OPKG" > /dev/null; then - echo "option force_postinstall 1" > "${xpkg_conf}" - src="/etc/opkg/opkg.conf" - else - src="/etc/ipkg.conf" - fi + echo "option force_postinstall 1" > "${xpkg_conf}" list=( \ "${PTXDIST_WORKSPACE}/projectroot${PTXDIST_PLATFORMSUFFIX}${src}" \ "${PTXDIST_WORKSPACE}/projectroot${src}${PTXDIST_PLATFORMSUFFIX}" \ @@ -61,7 +56,7 @@ ${list[*]} ptxd_replace_magic "${ptxd_reply}" >> "${xpkg_conf}" && DESTDIR="${work_dir}" \ - ${ptx_xpkg_type} -f "${xpkg_conf}" -o "${work_dir}" \ + opkg -f "${xpkg_conf}" -o "${work_dir}" \ install "${ptxd_reply_ipkg_files[@]}" && # fix directory permissions diff --git a/scripts/lib/ptxd_make_opkg_common.sh b/scripts/lib/ptxd_make_opkg_common.sh deleted file mode 100644 index dca858021..000000000 --- a/scripts/lib/ptxd_make_opkg_common.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2009 by Marc Kleine-Budde <mkl@pengutronix.de> -# 2011 by George McCollister <george.mccollister@gmail.com> -# -# See CREDITS for details about who has contributed to this project. -# -# For further information about the PTXdist project and license conditions -# see the README file. -# - - -# -# initialize variables needed to package opkgs -# -ptxd_make_opkg_init() { - pkg_opkg_tmp="${pkg_xpkg_tmp}/opkg" - pkg_xpkg_control_dir="${pkg_opkg_tmp}/CONTROL" - pkg_xpkg_control="${pkg_xpkg_control_dir}/control" - pkg_xpkg_conffiles="${pkg_xpkg_control_dir}/conffiles" -} -export -f ptxd_make_opkg_init diff --git a/scripts/lib/ptxd_make_opkg_finish.sh b/scripts/lib/ptxd_make_opkg_finish.sh deleted file mode 100644 index 2505f2bcf..000000000 --- a/scripts/lib/ptxd_make_opkg_finish.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2005, 2006, 2007 Robert Schwebel <r.schwebel@pengutronix.de> -# 2008, 2009, 2010 by Marc Kleine-Budde <mkl@pengutronix.de> -# 2011 by George McCollister <george.mccollister@gmail.com> -# -# See CREDITS for details about who has contributed to this project. -# -# For further information about the PTXdist project and license conditions -# see the README file. -# - -# -# the actual opkg package creation, will run in fakeroot -# -ptxd_make_opkg_finish_impl() { - chown -R 0:0 "${pkg_xpkg_tmp}" && - ptxd_make_xpkg_pkg "${pkg_opkg_tmp}" "${pkg_xpkg_cmds}" "${pkg_xpkg_perms}" && - opkg-build ${ptx_xpkg_extra_args} "${pkg_opkg_tmp}" "${ptx_pkg_dir}" -} -export -f ptxd_make_opkg_finish_impl - diff --git a/scripts/lib/ptxd_make_xpkg_common.sh b/scripts/lib/ptxd_make_xpkg_common.sh index 028287d78..6b1c77f1b 100644 --- a/scripts/lib/ptxd_make_xpkg_common.sh +++ b/scripts/lib/ptxd_make_xpkg_common.sh @@ -72,8 +72,8 @@ export -f ptxd_do_xpkg_map # initialize variables needed for packaging # ptxd_make_xpkg_init() { - if [ -z "${ptx_xpkg_type}" -o -z "${pkg_xpkg}" ]; then - ptxd_bailout "'pkg_xpkg' or 'ptx_xpkg_type' undefined" + if [ -z "${pkg_xpkg}" ]; then + ptxd_bailout "'pkg_xpkg' undefined" fi # @@ -108,8 +108,10 @@ ptxd_make_xpkg_init() { pkg_xpkg_install_deps="${ptx_state_dir}/${pkg_xpkg}.deps" pkg_xpkg_perms="${ptx_state_dir}/${pkg_xpkg}.perms" pkg_xpkg_cmds="${ptx_state_dir}/${pkg_xpkg}.cmds" - pkg_xpkg_tmp="${ptx_pkg_dir}/${pkg_xpkg}.tmp" - "ptxd_make_${ptx_xpkg_type}_init" + pkg_xpkg_tmp="${ptx_pkg_dir}/${pkg_xpkg}.tmp" + pkg_xpkg_control_dir="${pkg_xpkg_tmp}/CONTROL" + pkg_xpkg_control="${pkg_xpkg_control_dir}/control" + pkg_xpkg_conffiles="${pkg_xpkg_control_dir}/conffiles" } export -f ptxd_make_xpkg_init diff --git a/scripts/lib/ptxd_make_xpkg_finish.sh b/scripts/lib/ptxd_make_xpkg_finish.sh index ecdd38321..18c7ff745 100644 --- a/scripts/lib/ptxd_make_xpkg_finish.sh +++ b/scripts/lib/ptxd_make_xpkg_finish.sh @@ -10,9 +10,19 @@ # # -# run the actual package creation in fakeroot +# the actual opkg package creation, will run in fakeroot # ptxd_make_xpkg_finish_impl() { + chown -R 0:0 "${pkg_xpkg_tmp}" && + ptxd_make_xpkg_pkg "${pkg_xpkg_tmp}" "${pkg_xpkg_cmds}" "${pkg_xpkg_perms}" && + opkg-build ${ptx_xpkg_extra_args} "${pkg_xpkg_tmp}" "${ptx_pkg_dir}" +} +export -f ptxd_make_xpkg_finish_impl + +# +# run the actual package creation in fakeroot +# +ptxd_make_xpkg_finish_run() { local -a fake_args if [ -f "${pkg_fake_env}" ]; then fake_args=( "-i" "${pkg_fake_env}" ) @@ -20,9 +30,9 @@ ptxd_make_xpkg_finish_impl() { fake_args[${#fake_args[@]}]="-u" export ${!pkg_*} ${!ptx_*} - fakeroot "${fake_args[@]}" -- "ptxd_make_${ptx_xpkg_type}_finish_impl" + fakeroot "${fake_args[@]}" -- "ptxd_make_xpkg_finish_impl" } -export -f ptxd_make_xpkg_finish_impl +export -f ptxd_make_xpkg_finish_run # # function to create a generic package @@ -86,8 +96,8 @@ EOF # # create pkg # - echo -e "xpkg_finish: creating ${ptx_xpkg_type} package ...\n" && - ptxd_make_xpkg_finish_impl && + echo -e "xpkg_finish: creating opkg package ...\n" && + ptxd_make_xpkg_finish_run && rm -rf "${pkg_xpkg_tmp}" || { local ret=$? echo -e "\nxpkg_finish: failed.\n" |