Patchwork [1/2] package_rpm.bbclass: ensure base-passwd and shadow get installed first

login
register
mail settings
Submitter Scott Garman
Date March 23, 2012, 4:43 a.m.
Message ID <e7e0cacf7bc478c69f9798846d8bdeb9ff4da6a6.1332453478.git.scott.a.garman@intel.com>
Download mbox | patch
Permalink /patch/24237/
State Accepted
Commit 3d2d3cb379608301b17ce57787d324c2f06bf4f9
Headers show

Comments

Scott Garman - March 23, 2012, 4:43 a.m.
When generating images, we need to make sure that base-passwd and
shadow get installed before other packages, which might need to create
custom user accounts.

Thanks to Richard Purdie for the initial version of this fix.

This fixes [YOCTO #2127]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 meta/classes/package_rpm.bbclass |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 80b1619..e83fc55 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -439,7 +439,14 @@  package_install_internal_rpm () {
 
 	fi
 
-	cat ${target_rootfs}/install/install_solution.manifest > ${target_rootfs}/install/total_solution.manifest
+	# If base-passwd or shadow are in the list of packages to install,
+	# ensure they are installed first to support later packages that
+	# may create custom users/groups (fixes Yocto bug #2127)
+	infile=${target_rootfs}/install/install_solution.manifest
+	outfile=${target_rootfs}/install/total_solution.manifest
+	cat $infile | grep /base-passwd-[0-9] > $outfile || true
+	cat $infile | grep /shadow-[0-9] >> $outfile || true
+	cat $infile | grep -v /shadow-[0-9] | grep -v /base-passwd-[0-9] >> $outfile
 	cat ${target_rootfs}/install/install_multilib_solution.manifest >> ${target_rootfs}/install/total_solution.manifest
 
 	# Construct install scriptlet wrapper