summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2016-07-26 14:47:34 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-07-26 20:38:25 +0200
commit74f18e8485b42874fcce37a1b78fbccb62d65d98 (patch)
treef4abf59cb4bf488202c63e5ace342bd4e8e48bb6
parent79018d4ab6db1e35d40a2b4b72e9a6b7f2947210 (diff)
downloadptxdist-work/nfsroot.tar.gz
ptxdist-work/nfsroot.tar.xz
ptxdist: implement image specific nfsrootwork/nfsroot
For the simple use-case (the rootfs contains all packages) the normal nfsroot works well. However, this is not useful to work with root filesystems that contain only a subset of all packages. With this change, if <IMAGE>_NFSROOT can be set to 'YES' then <platformdir>/nfsroot/<image> will be filled with the files from only the packages that are part of this image. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xbin/ptxdist2
-rw-r--r--rules/post/ptxd_make_world_common.make2
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk4
-rw-r--r--scripts/lib/ptxd_make_xpkg_pkg.sh13
4 files changed, 17 insertions, 4 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index 152aa84ea..862efe49c 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -1057,6 +1057,7 @@ clean() {
echo "${PTXDIST_LOG_PROMPT}cleaning root directory..."
rm -fr -- "${ROOTDIR}"
rm -fr -- "${PTXDIST_PLATFORMDIR}/root-debug"
+ rm -fr -- "${PTXDIST_PLATFORMDIR}/nfsroot"
echo "${PTXDIST_LOG_PROMPT}cleaning packages..."
rm -fr -- "${PKGDIR}"/*.ipk
echo "${PTXDIST_LOG_PROMPT}cleaning targetinstall stages..."
@@ -1153,6 +1154,7 @@ clean() {
echo "${PTXDIST_LOG_PROMPT}removing root..."
rm -fr -- "${ROOTDIR}"
rm -fr -- "${PTXDIST_PLATFORMDIR}/root-debug"
+ rm -fr -- "${PTXDIST_PLATFORMDIR}/nfsroot"
echo "${PTXDIST_LOG_PROMPT}removing state..."
rm -fr -- "${STATEDIR}"
echo "${PTXDIST_LOG_PROMPT}removing logfile..."
diff --git a/rules/post/ptxd_make_world_common.make b/rules/post/ptxd_make_world_common.make
index c561fabbd..5a4e9a6f3 100644
--- a/rules/post/ptxd_make_world_common.make
+++ b/rules/post/ptxd_make_world_common.make
@@ -103,6 +103,8 @@ world/env/impl = \
pkg_install_opt="$(call ptx/escape,$($(1)_INSTALL_OPT))" \
pkg_binconfig_glob="$(call ptx/escape,$($(1)_BINCONFIG_GLOB))" \
\
+ pkg_nfsroot_dirs="$(call ptx/escape,$($(1)_NFSROOT_DIRS))" \
+ \
pkg_deprecated_builddir="$(call ptx/escape,$($(1)_BUILDDIR))" \
pkg_deprecated_env="$(call ptx/escape,$($(1)_ENV))" \
pkg_deprecated_autoconf="$(call ptx/escape,$($(1)_AUTOCONF))" \
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index bbf8aaddd..aeea3a8f0 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -423,6 +423,10 @@ 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
+ 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
+ print "endif" > DGEN_DEPS_POST
print "endif" > DGEN_DEPS_POST
}
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index 841e2084e..aca5f6706 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -93,27 +93,32 @@ ptxd_install_resolve_usr_grp() {
export -f ptxd_install_resolve_usr_grp
ptxd_install_setup() {
+ local image
+ local -a nfsroot_dirs
+
case "${dst}" in
/*|"") ;;
*) ptxd_bailout "'dst' must be an absolute path!" ;;
esac
+ nfsroot_dirs=("${ptx_nfsroot}" ${pkg_nfsroot_dirs})
+
# all dirs
- dirs=("${ptx_nfsroot}" "${pkg_xpkg_tmp}")
+ dirs=("${nfsroot_dirs[@]}" "${pkg_xpkg_tmp}")
# nfs root dirs
# no setuid/setguid bit here
- ndirs=("${ptx_nfsroot}")
+ ndirs=("${nfsroot_dirs[@]}")
# package dirs
# this goes into the ipkg, thus full file modes here
pdirs=("${pkg_xpkg_tmp}")
# strip dirs
- sdirs=("${ptx_nfsroot}" "${pkg_xpkg_tmp}")
+ sdirs=("${nfsroot_dirs[@]}" "${pkg_xpkg_tmp}")
# dirs with separate debug files
- ddirs=("${ptx_nfsroot}")
+ ddirs=("${nfsroot_dirs[@]}")
mod_nfs="$(printf "0%o" $(( 0${mod} & ~06000 )))" &&
mod_rw="$(printf "0%o" $(( 0${mod} | 0200 )))" &&