All of lore.kernel.org
 help / color / mirror / Atom feed
* [CONSOLIDATED PULL 00/20] 05-June-2011
@ 2011-06-06  6:44 Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries Saul Wold
                   ` (20 more replies)
  0 siblings, 21 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

Richard,

This pulls together a set of changes from the later
part of last week, these have been built. I have updated
Nitin's comment about the License change (which was adding
years).

This also includes Scott's User Addition code.

I did not pull Bruce's change due to a known build issue
with x86-64, I am expecting an update from him.

Thanks
	Sau!


The following changes since commit 2a52f806f3789f717219651b97dc64fec3881f7f:

  qmake_base.bbclass: fix lrelease/lupdate binary names (2011-06-02 18:26:19 +0100)

are available in the git repository at:
  git://git.openembedded.org/openembedded-core-contrib sgw/stage
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=sgw/stage

Khem Raj (2):
  allarch.bbclass: Define BASE_PACKAGE_ARCH = "all"
  util-linux_2.19.1.bb: Fix compliation on uclibc

Martin Jansa (1):
  base.bbclass: add cleansstate task between clean and cleanall

Nitin A Kamble (3):
  m4: upgrade from 1.4.15 to 1.4.16
  autoconf: upgrade from 2.65 to 2.68
  bison: upgrade from 2.4.3 to 2.5

Otavio Salvador (4):
  gnutls: use INC_PR on 2.12.5 version recipe
  gnutls: add p11tool into gnutls-bin
  package.bbclass: add support to split Qt translation files
  xf86-driver-common.inc: remove .la files to avoid unpackaged warning

Phil Blundell (1):
  gcc-package-cross: also install the symlinks in libexec with target
    prefix

Saul Wold (2):
  bitbake.conf: Create staticlibs pacakge for static libraries
  tzcode: Update to 2011g

Scott Garman (7):
  shadow: recipe and patch cleanup
  shadow: add a -native recipe with customized utilities
  base-passwd: populate the target sysroot with passwd/group/login.defs
  useradd.bbclass: new class for managing user/group permissions
  useradd-example: example recipe for using inherit useradd
  bitbake.conf: set PSEUDO_PASSWD within FAKEROOTENV
  package_rpm.bbclass: make RPM use on-disk permissions

 .../recipes-skeleton/useradd/useradd-example.bb    |   72 ++
 meta/classes/allarch.bbclass                       |    1 +
 meta/classes/base.bbclass                          |    7 +-
 meta/classes/package.bbclass                       |   41 +-
 meta/classes/package_rpm.bbclass                   |    2 +
 meta/classes/useradd.bbclass                       |  163 +++
 meta/conf/bitbake.conf                             |   14 +-
 .../base-passwd/base-passwd-3.5.22/login.defs      |  386 ++++++
 .../recipes-core/base-passwd/base-passwd_3.5.22.bb |   27 +-
 .../uclibc-__progname-conflict.patch               |   31 +
 meta/recipes-core/util-linux/util-linux_2.19.1.bb  |    4 +-
 .../{autoconf-2.65 => autoconf}/autoconf-x.patch   |    0
 .../autoheader-nonfatal-warnings.patch             |    0
 .../autoreconf-exclude.patch                       |    0
 .../autoreconf-foreign.patch                       |    0
 .../autoreconf-gnuconfigize.patch                  |    0
 .../autoreconf-include.patch                       |    0
 .../{autoconf-2.65 => autoconf}/config_site.patch  |   19 +-
 .../fix_path_xtra.patch                            |   14 +-
 .../path_prog_fixes.patch                          |    0
 .../program_prefix.patch                           |    0
 .../{autoconf_2.65.bb => autoconf_2.68.bb}         |    6 +-
 meta/recipes-devtools/bison/bison/m4.patch         |  131 --
 .../bison/bison/uclibc-sched_param-def.patch       |   21 -
 .../bison/{bison_2.4.3.bb => bison_2.5.bb}         |    7 +-
 meta/recipes-devtools/gcc/gcc-package-cross.inc    |    1 +
 .../{m4-native_1.4.15.bb => m4-native_1.4.16.bb}   |    0
 .../m4/{m4_1.4.15.bb => m4_1.4.16.bb}              |    6 +-
 .../shadow/files/add_root_cmd_options.patch        | 1296 ++++++++++++++++++++
 .../files/shadow-4.1.3-dots-in-usernames.patch     |    4 +
 .../shadow-4.1.4.2-env-reset-keep-locale.patch     |    4 +
 .../files/shadow-4.1.4.2-groupmod-pam-check.patch  |    4 +
 .../files/shadow-4.1.4.2-su_no_sanitize_env.patch  |    4 +
 .../shadow/files/shadow.automake-1.11.patch        |    4 +
 .../shadow/shadow-native_4.1.4.3.bb                |   66 +
 meta/recipes-extended/shadow/shadow.inc            |  123 --
 meta/recipes-extended/shadow/shadow_4.1.4.3.bb     |  139 ++-
 .../recipes-extended/tzcode/tzcode-native_2009r.bb |   19 -
 .../recipes-extended/tzcode/tzcode-native_2011g.bb |   25 +
 .../xorg-driver/xf86-driver-common.inc             |    6 +-
 meta/recipes-support/gnutls/gnutls.inc             |    3 +-
 meta/recipes-support/gnutls/gnutls_2.12.5.bb       |    2 +-
 42 files changed, 2313 insertions(+), 339 deletions(-)
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file1
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file2
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file3
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file4
 create mode 100644 meta/classes/useradd.bbclass
 create mode 100644 meta/recipes-core/base-passwd/base-passwd-3.5.22/login.defs
 create mode 100644 meta/recipes-core/util-linux/util-linux-2.19.1/uclibc-__progname-conflict.patch
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoconf-x.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoheader-nonfatal-warnings.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-exclude.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-foreign.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-gnuconfigize.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-include.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/config_site.patch (60%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/fix_path_xtra.patch (90%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/path_prog_fixes.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/program_prefix.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf_2.65.bb => autoconf_2.68.bb} (85%)
 delete mode 100644 meta/recipes-devtools/bison/bison/uclibc-sched_param-def.patch
 rename meta/recipes-devtools/bison/{bison_2.4.3.bb => bison_2.5.bb} (85%)
 rename meta/recipes-devtools/m4/{m4-native_1.4.15.bb => m4-native_1.4.16.bb} (100%)
 rename meta/recipes-devtools/m4/{m4_1.4.15.bb => m4_1.4.16.bb} (75%)
 create mode 100644 meta/recipes-extended/shadow/files/add_root_cmd_options.patch
 create mode 100644 meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb
 delete mode 100644 meta/recipes-extended/shadow/shadow.inc
 delete mode 100644 meta/recipes-extended/tzcode/tzcode-native_2009r.bb
 create mode 100644 meta/recipes-extended/tzcode/tzcode-native_2011g.bb

-- 
1.7.3.4




^ permalink raw reply	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:55   ` Phil Blundell
  2011-06-06 17:03   ` Khem Raj
  2011-06-06  6:44 ` [CONSOLIDATED PULL 02/20] m4: upgrade from 1.4.15 to 1.4.16 Saul Wold
                   ` (19 subsequent siblings)
  20 siblings, 2 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/conf/bitbake.conf |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index de94316..520b808 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -194,9 +194,13 @@ This package contains ELF symbols and related sources for debugging purposes."
 
 SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files"
 DESCRIPTION_${PN}-dev ?= "${DESCRIPTION}  \
-This package contains symbolic links, static binaries, header files, and \
+This package contains symbolic links, header files, and \
 related items necessary for software development."
 
+SUMMARY_${PN}-staticlibs ?= "${SUMMARY} - Development files (Static Libraries)"
+DESCRIPTION_${PN}-staticlibs?= "${DESCRIPTION}  \
+This package contains static libraries for software development."
+
 SUMMARY_${PN}-doc ?= "${SUMMARY} - Documentation files"
 DESCRIPTION_${PN}-doc ?= "${DESCRIPTION}  \
 This package contains documentation."
@@ -248,13 +252,17 @@ FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
 SECTION_${PN}-doc = "doc"
 
 FILES_${PN}-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \
-                ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig \
+                ${libdir}/*.o ${libdir}/pkgconfig \
                 ${datadir}/pkgconfig ${datadir}/aclocal \
                 ${base_libdir}/*.a ${base_libdir}/*.o"
 SECTION_${PN}-dev = "devel"
 ALLOW_EMPTY_${PN}-dev = "1"
 RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
 
+FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
+SECTION_${PN}-staticlibs = "devel"
+RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"
+
 DOTDEBUG-dbg = "${bindir}/.debug ${sbindir}/.debug ${libexecdir}/.debug ${libdir}/.debug \
             ${base_bindir}/.debug ${base_sbindir}/.debug ${base_libdir}/.debug ${libdir}/${PN}/.debug \
             ${libdir}/matchbox-panel/.debug /usr/src/debug"
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 02/20] m4: upgrade from 1.4.15 to 1.4.16
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 03/20] autoconf: upgrade from 2.65 to 2.68 Saul Wold
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Nitin A Kamble <nitin.a.kamble@intel.com>

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 .../{m4-native_1.4.15.bb => m4-native_1.4.16.bb}   |    0
 .../m4/{m4_1.4.15.bb => m4_1.4.16.bb}              |    6 +++---
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename meta/recipes-devtools/m4/{m4-native_1.4.15.bb => m4-native_1.4.16.bb} (100%)
 rename meta/recipes-devtools/m4/{m4_1.4.15.bb => m4_1.4.16.bb} (75%)

diff --git a/meta/recipes-devtools/m4/m4-native_1.4.15.bb b/meta/recipes-devtools/m4/m4-native_1.4.16.bb
similarity index 100%
rename from meta/recipes-devtools/m4/m4-native_1.4.15.bb
rename to meta/recipes-devtools/m4/m4-native_1.4.16.bb
diff --git a/meta/recipes-devtools/m4/m4_1.4.15.bb b/meta/recipes-devtools/m4/m4_1.4.16.bb
similarity index 75%
rename from meta/recipes-devtools/m4/m4_1.4.15.bb
rename to meta/recipes-devtools/m4/m4_1.4.16.bb
index 586071f..53ef5ae 100644
--- a/meta/recipes-devtools/m4/m4_1.4.15.bb
+++ b/meta/recipes-devtools/m4/m4_1.4.16.bb
@@ -4,14 +4,14 @@ compatible although it has some extensions (for example, handling more than 9 po
 GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc."
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
-	file://examples/COPYING;md5=380fd7d57d3fd009a5716e074a845d6d"
+	file://examples/COPYING;md5=fbc986d45b3dae6725c29870dd6b669d"
 
 PR = "r0"
 SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz \
            file://ac_config_links.patch;patch=1"
 
-SRC_URI[md5sum] = "5649a2e593b6c639deae9e72ede777dd"
-SRC_URI[sha256sum] = "3d66dfeb609007062265a67b9a2c08d3686a74068830bacae60a6d58413c9367"
+SRC_URI[md5sum] = "a5dfb4f2b7370e9d34293d23fd09b280"
+SRC_URI[sha256sum] = "e9176a35bb13a1b08482359aa554ee8072794f58f00e4827bf0e06b570c827da"
 
 inherit autotools
 
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 03/20] autoconf: upgrade from 2.65 to 2.68
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 02/20] m4: upgrade from 1.4.15 to 1.4.16 Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 04/20] bison: upgrade from 2.4.3 to 2.5 Saul Wold
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Nitin A Kamble <nitin.a.kamble@intel.com>

And rebase the patches to the newer code.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 .../{autoconf-2.65 => autoconf}/autoconf-x.patch   |    0
 .../autoheader-nonfatal-warnings.patch             |    0
 .../autoreconf-exclude.patch                       |    0
 .../autoreconf-foreign.patch                       |    0
 .../autoreconf-gnuconfigize.patch                  |    0
 .../autoreconf-include.patch                       |    0
 .../{autoconf-2.65 => autoconf}/config_site.patch  |   19 ++++++++++++++-----
 .../fix_path_xtra.patch                            |   14 +++++++-------
 .../path_prog_fixes.patch                          |    0
 .../program_prefix.patch                           |    0
 .../{autoconf_2.65.bb => autoconf_2.68.bb}         |    6 +++---
 11 files changed, 24 insertions(+), 15 deletions(-)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoconf-x.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoheader-nonfatal-warnings.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-exclude.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-foreign.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-gnuconfigize.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/autoreconf-include.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/config_site.patch (60%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/fix_path_xtra.patch (90%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/path_prog_fixes.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf-2.65 => autoconf}/program_prefix.patch (100%)
 rename meta/recipes-devtools/autoconf/{autoconf_2.65.bb => autoconf_2.68.bb} (85%)

diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/autoconf-x.patch b/meta/recipes-devtools/autoconf/autoconf/autoconf-x.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/autoconf-x.patch
rename to meta/recipes-devtools/autoconf/autoconf/autoconf-x.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/autoheader-nonfatal-warnings.patch b/meta/recipes-devtools/autoconf/autoconf/autoheader-nonfatal-warnings.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/autoheader-nonfatal-warnings.patch
rename to meta/recipes-devtools/autoconf/autoconf/autoheader-nonfatal-warnings.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-exclude.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-exclude.patch
rename to meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-foreign.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-foreign.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-foreign.patch
rename to meta/recipes-devtools/autoconf/autoconf/autoreconf-foreign.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-gnuconfigize.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-gnuconfigize.patch
rename to meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-include.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/autoreconf-include.patch
rename to meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/config_site.patch b/meta/recipes-devtools/autoconf/autoconf/config_site.patch
similarity index 60%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/config_site.patch
rename to meta/recipes-devtools/autoconf/autoconf/config_site.patch
index e3ff318..9f04440 100644
--- a/meta/recipes-devtools/autoconf/autoconf-2.65/config_site.patch
+++ b/meta/recipes-devtools/autoconf/autoconf/config_site.patch
@@ -6,17 +6,26 @@ them.
 
 RP 1/2/10
 
-Index: autoconf-2.65/lib/autoconf/general.m4
+Updated for 2.68 version: the CONFIG_SITE var was not getting used at all
+fixed the 2.68 code 
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/27
+
+Index: autoconf-2.68/lib/autoconf/general.m4
 ===================================================================
---- autoconf-2.65.orig/lib/autoconf/general.m4	2010-02-01 12:41:32.329073138 +0000
-+++ autoconf-2.65/lib/autoconf/general.m4	2010-02-01 12:41:56.769040799 +0000
-@@ -1863,17 +1863,10 @@
+--- autoconf-2.68.orig/lib/autoconf/general.m4
++++ autoconf-2.68/lib/autoconf/general.m4
+@@ -1878,7 +1878,6 @@ AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPL
  m4_define([AC_SITE_LOAD],
  [# Prefer an explicitly selected file to automatically selected ones.
  ac_site_file1=NONE
 -ac_site_file2=NONE
  if test -n "$CONFIG_SITE"; then
-   ac_site_file1=$CONFIG_SITE
+   # We do not want a PATH search for config.site.
+   case $CONFIG_SITE in @%:@((
+@@ -1886,14 +1885,8 @@ if test -n "$CONFIG_SITE"; then
+     */*) ac_site_file1=$CONFIG_SITE;;
+     *)   ac_site_file1=./$CONFIG_SITE;;
+   esac
 -elif test "x$prefix" != xNONE; then
 -  ac_site_file1=$prefix/share/config.site
 -  ac_site_file2=$prefix/etc/config.site
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/fix_path_xtra.patch b/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
similarity index 90%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/fix_path_xtra.patch
rename to meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
index 29fe6a2..65df88f 100644
--- a/meta/recipes-devtools/autoconf/autoconf-2.65/fix_path_xtra.patch
+++ b/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
@@ -6,11 +6,11 @@ This patch removes them to stop any confusion.
 
 RP - 20071115
 
-Index: autoconf-2.65/lib/autoconf/libs.m4
+Index: autoconf-2.68/lib/autoconf/libs.m4
 ===================================================================
---- autoconf-2.65.orig/lib/autoconf/libs.m4	2009-10-29 01:53:41.000000000 +0000
-+++ autoconf-2.65/lib/autoconf/libs.m4	2010-01-29 13:40:13.000000000 +0000
-@@ -159,53 +159,6 @@
+--- autoconf-2.68.orig/lib/autoconf/libs.m4
++++ autoconf-2.68/lib/autoconf/libs.m4
+@@ -159,53 +159,6 @@ m4_popdef([AC_Lib_Name])dnl
  # --------------------- #
  
  
@@ -32,7 +32,7 @@ Index: autoconf-2.65/lib/autoconf/libs.m4
 -	@echo libdir='${LIBDIR}'
 -_ACEOF
 -  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
--    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+-    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 -    for ac_var in incroot usrlibdir libdir; do
 -      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
 -    done
@@ -64,7 +64,7 @@ Index: autoconf-2.65/lib/autoconf/libs.m4
  # _AC_PATH_X_DIRECT
  # -----------------
  # Internal subroutine of _AC_PATH_X.
-@@ -213,44 +166,7 @@
+@@ -213,44 +166,7 @@ fi
  m4_define([_AC_PATH_X_DIRECT],
  [# Standard set of common directories for X headers.
  # Check X11 before X11Rn because it is often a symlink to the current release.
@@ -110,7 +110,7 @@ Index: autoconf-2.65/lib/autoconf/libs.m4
  
  if test "$ac_x_includes" = no; then
    # Guess where to find include files, by looking for Xlib.h.
-@@ -299,7 +215,6 @@
+@@ -299,7 +215,6 @@ AC_DEFUN([_AC_PATH_X],
  [AC_CACHE_VAL(ac_cv_have_x,
  [# One or both of the vars are not set, and there is no cached value.
  ac_x_includes=no ac_x_libraries=no
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/path_prog_fixes.patch b/meta/recipes-devtools/autoconf/autoconf/path_prog_fixes.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/path_prog_fixes.patch
rename to meta/recipes-devtools/autoconf/autoconf/path_prog_fixes.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf-2.65/program_prefix.patch b/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
similarity index 100%
rename from meta/recipes-devtools/autoconf/autoconf-2.65/program_prefix.patch
rename to meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
diff --git a/meta/recipes-devtools/autoconf/autoconf_2.65.bb b/meta/recipes-devtools/autoconf/autoconf_2.68.bb
similarity index 85%
rename from meta/recipes-devtools/autoconf/autoconf_2.65.bb
rename to meta/recipes-devtools/autoconf/autoconf_2.68.bb
index 0bc615e..c647a15 100644
--- a/meta/recipes-devtools/autoconf/autoconf_2.65.bb
+++ b/meta/recipes-devtools/autoconf/autoconf_2.68.bb
@@ -1,6 +1,6 @@
 require autoconf.inc
 
-PR = "r2"
+PR = "r0"
 
 PARALLEL_MAKE = ""
 
@@ -17,8 +17,8 @@ SRC_URI += "file://autoreconf-include.patch;patch=1 \
 	   ${@['file://path_prog_fixes.patch;patch=1', ''][bb.data.inherits_class('native', d)]} \
            file://config_site.patch;patch=1"
 
-SRC_URI[md5sum] = "a6de1cc6434cd64038b0a0ae4e252b33"
-SRC_URI[sha256sum] = "db11944057f3faf229ff5d6ce3fcd819f565455c152b72cec17ebc1cbb80136b"
+SRC_URI[md5sum] = "864d785215aa60d627c91fcb21b05b07"
+SRC_URI[sha256sum] = "c491fb273fd6d4ca925e26ceed3d177920233c76d542b150ff35e571454332c8"
 
 DEPENDS_virtclass-native = "m4-native gnu-config-native"
 RDEPENDS_${PN}_virtclass-native = "m4-native gnu-config-native"
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 04/20] bison: upgrade from 2.4.3 to 2.5
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (2 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 03/20] autoconf: upgrade from 2.65 to 2.68 Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 05/20] allarch.bbclass: Define BASE_PACKAGE_ARCH = "all" Saul Wold
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Nitin A Kamble <nitin.a.kamble@intel.com>

This version of bison needs m4 1.4.16 or newer

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 meta/recipes-devtools/bison/bison/m4.patch         |  131 --------------------
 .../bison/bison/uclibc-sched_param-def.patch       |   21 ---
 .../bison/{bison_2.4.3.bb => bison_2.5.bb}         |    7 +-
 3 files changed, 3 insertions(+), 156 deletions(-)
 delete mode 100644 meta/recipes-devtools/bison/bison/uclibc-sched_param-def.patch
 rename meta/recipes-devtools/bison/{bison_2.4.3.bb => bison_2.5.bb} (85%)

diff --git a/meta/recipes-devtools/bison/bison/m4.patch b/meta/recipes-devtools/bison/bison/m4.patch
index 0754a90..d139da5 100644
--- a/meta/recipes-devtools/bison/bison/m4.patch
+++ b/meta/recipes-devtools/bison/bison/m4.patch
@@ -75,109 +75,6 @@ Index: bison-2.4.2/m4/uintmax_t.m4
 +   if <inttypes.h> and <stdint.h> don't define.])
 +  fi
 +])
-Index: bison-2.4.2/m4/glibc21.m4
-===================================================================
---- /dev/null
-+++ bison-2.4.2/m4/glibc21.m4
-@@ -0,0 +1,32 @@
-+# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
-+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+# Test for the GNU C Library, version 2.1 or newer.
-+# From Bruno Haible.
-+
-+AC_DEFUN([jm_GLIBC21],
-+  [
-+    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
-+      ac_cv_gnu_library_2_1,
-+      [AC_EGREP_CPP([Lucky GNU user],
-+	[
-+#include <features.h>
-+#ifdef __GNU_LIBRARY__
-+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-+  Lucky GNU user
-+ #endif
-+#endif
-+	],
-+	ac_cv_gnu_library_2_1=yes,
-+	ac_cv_gnu_library_2_1=no)
-+      ]
-+    )
-+    AC_SUBST(GLIBC21)
-+    GLIBC21="$ac_cv_gnu_library_2_1"
-+  ]
-+)
-Index: bison-2.4.2/m4/stdint_h.m4
-===================================================================
---- /dev/null
-+++ bison-2.4.2/m4/stdint_h.m4
-@@ -0,0 +1,28 @@
-+# stdint_h.m4 serial 2 (gettext-0.11.4)
-+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert.
-+
-+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
-+# doesn't clash with <sys/types.h>, and declares uintmax_t.
-+
-+AC_DEFUN([jm_AC_HEADER_STDINT_H],
-+[
-+  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
-+  [AC_TRY_COMPILE(
-+    [#include <sys/types.h>
-+#include <stdint.h>],
-+    [uintmax_t i = (uintmax_t) -1;],
-+    jm_ac_cv_header_stdint_h=yes,
-+    jm_ac_cv_header_stdint_h=no)])
-+  if test $jm_ac_cv_header_stdint_h = yes; then
-+    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
-+[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
-+   and declares uintmax_t. ])
-+  fi
-+])
-Index: bison-2.4.2/m4/inttypes_h.m4
-===================================================================
---- /dev/null
-+++ bison-2.4.2/m4/inttypes_h.m4
-@@ -0,0 +1,28 @@
-+# inttypes_h.m4 serial 4 (gettext-0.11.4)
-+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert.
-+
-+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
-+# doesn't clash with <sys/types.h>, and declares uintmax_t.
-+
-+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
-+[
-+  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
-+  [AC_TRY_COMPILE(
-+    [#include <sys/types.h>
-+#include <inttypes.h>],
-+    [uintmax_t i = (uintmax_t) -1;],
-+    jm_ac_cv_header_inttypes_h=yes,
-+    jm_ac_cv_header_inttypes_h=no)])
-+  if test $jm_ac_cv_header_inttypes_h = yes; then
-+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
-+[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
-+   and declares uintmax_t. ])
-+  fi
-+])
 Index: bison-2.4.2/m4/ulonglong.m4
 ===================================================================
 --- /dev/null
@@ -206,34 +103,6 @@ Index: bison-2.4.2/m4/ulonglong.m4
 +      [Define if you have the unsigned long long type.])
 +  fi
 +])
-Index: bison-2.4.2/m4/codeset.m4
-===================================================================
---- /dev/null
-+++ bison-2.4.2/m4/codeset.m4
-@@ -0,0 +1,23 @@
-+# codeset.m4 serial AM1 (gettext-0.10.40)
-+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Bruno Haible.
-+
-+AC_DEFUN([AM_LANGINFO_CODESET],
-+[
-+  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
-+    [AC_TRY_LINK([#include <langinfo.h>],
-+      [char* cs = nl_langinfo(CODESET);],
-+      am_cv_langinfo_codeset=yes,
-+      am_cv_langinfo_codeset=no)
-+    ])
-+  if test $am_cv_langinfo_codeset = yes; then
-+    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
-+      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
-+  fi
-+])
 Index: bison-2.4.2/m4/intdiv0.m4
 ===================================================================
 --- /dev/null
diff --git a/meta/recipes-devtools/bison/bison/uclibc-sched_param-def.patch b/meta/recipes-devtools/bison/bison/uclibc-sched_param-def.patch
deleted file mode 100644
index 6774838..0000000
--- a/meta/recipes-devtools/bison/bison/uclibc-sched_param-def.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Upstream-Status: Pending
-
-uclibc defines __GLIBC__ but it does not expose struct shed_param as much as glibc
-and is not needed too per standard. gnulib attempts to use it but we have to account
-for it because in this case uclibc does not behave like glibc.
-
--Khem
-
-http://bugs.gentoo.org/336484
-
---- m4-1.4.14/lib/spawn.in.h
-+++ m4-1.4.14/lib/spawn.in.h
-@@ -31,7 +31,7 @@
- 
- /* Get definitions of 'struct sched_param' and 'sigset_t'.
-    But avoid namespace pollution on glibc systems.  */
--#ifndef __GLIBC__
-+#if !defined __GLIBC__ || defined __UCLIBC__
- # include <sched.h>
- # include <signal.h>
- #endif
diff --git a/meta/recipes-devtools/bison/bison_2.4.3.bb b/meta/recipes-devtools/bison/bison_2.5.bb
similarity index 85%
rename from meta/recipes-devtools/bison/bison_2.4.3.bb
rename to meta/recipes-devtools/bison/bison_2.5.bb
index 3c164d9..b81efab 100644
--- a/meta/recipes-devtools/bison/bison_2.4.3.bb
+++ b/meta/recipes-devtools/bison/bison_2.5.bb
@@ -10,18 +10,17 @@ SECTION = "devel"
 PRIORITY = "optional"
 DEPENDS = "bison-native"
 
-PR = "r2"
+PR = "r0"
 
 BASE_SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.gz \
 	   file://m4.patch \
-	   file://uclibc-sched_param-def.patch \
 	  "
 
 SRC_URI = "${BASE_SRC_URI} \
         file://fix_cross_manpage_building.patch "
 
-SRC_URI[md5sum] = "ea45c778b36bdc7a720096819e292a73"
-SRC_URI[sha256sum] = "6b17be5e63ff6667c83f6ef0423befe0ba23d4bc554c4c33b02ce5bb65179b16"
+SRC_URI[md5sum] = "687e1dcd29452789d34eaeea4c25abe4"
+SRC_URI[sha256sum] = "722def46e4a19a5b7a579ef30db1965f86c37c1a20a5f0113743a2e4399f7c99"
 
 DEPENDS_virtclass-native = "gettext-native"
 SRC_URI_virtclass-native = "${BASE_SRC_URI}"
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 05/20] allarch.bbclass: Define BASE_PACKAGE_ARCH = "all"
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (3 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 04/20] bison: upgrade from 2.4.3 to 2.5 Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 06/20] util-linux_2.19.1.bb: Fix compliation on uclibc Saul Wold
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Khem Raj <raj.khem@gmail.com>

If not overridden it gets the value which is for target recipes
usually defined in machine tune files

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/allarch.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
index 26fca70..e3ac392 100644
--- a/meta/classes/allarch.bbclass
+++ b/meta/classes/allarch.bbclass
@@ -2,6 +2,7 @@
 # This class is used for architecture independent recipes/data files (usally scripts)
 #
 
+BASE_PACKAGE_ARCH = "all"
 PACKAGE_ARCH = "all"
 
 # No need for virtual/libc or a cross compiler
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 06/20] util-linux_2.19.1.bb: Fix compliation on uclibc
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (4 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 05/20] allarch.bbclass: Define BASE_PACKAGE_ARCH = "all" Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 07/20] base.bbclass: add cleansstate task between clean and cleanall Saul Wold
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Khem Raj <raj.khem@gmail.com>

util-linux 2.19 needs this patch to successfully
compile on uclibc systems. This is a bug in util-linux
that goes unnoticed on eglibc builds.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../uclibc-__progname-conflict.patch               |   31 ++++++++++++++++++++
 meta/recipes-core/util-linux/util-linux_2.19.1.bb  |    4 ++-
 2 files changed, 34 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-core/util-linux/util-linux-2.19.1/uclibc-__progname-conflict.patch

diff --git a/meta/recipes-core/util-linux/util-linux-2.19.1/uclibc-__progname-conflict.patch b/meta/recipes-core/util-linux/util-linux-2.19.1/uclibc-__progname-conflict.patch
new file mode 100644
index 0000000..45826b1
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux-2.19.1/uclibc-__progname-conflict.patch
@@ -0,0 +1,31 @@
+configure should include errno.h instead of argp.h when
+checking for presence of program_invocation_short_name
+uclibc defines this to be const char* unlike util-linux-ng
+which defines this to be char* so this error goes unnoticed
+on glibc/eglibc systems.
+
+here is the error it fixes
+
+in file included from mountP.h:14:0,                                                                               
+                 from cache.c:29:                                                                                  
+/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname'                                                                                                  
+../../../include/c.h:118:14: note: previous declaration of '__progname' was here                                   
+make[3]: *** [cache.lo] Error 1          
+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: util-linux-2.19.1/configure.ac
+===================================================================
+--- util-linux-2.19.1.orig/configure.ac
++++ util-linux-2.19.1/configure.ac
+@@ -250,7 +250,7 @@ esac
+ 
+ 
+ AC_MSG_CHECKING(whether program_invocation_short_name is defined)
+-AC_TRY_COMPILE([#include <argp.h>],
++AC_TRY_COMPILE([#include <errno.h>],
+                [program_invocation_short_name = "test";],
+                AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, 1,
+                          [Define if program_invocation_short_name is defined])
diff --git a/meta/recipes-core/util-linux/util-linux_2.19.1.bb b/meta/recipes-core/util-linux/util-linux_2.19.1.bb
index 7fe7497..8067ab5 100644
--- a/meta/recipes-core/util-linux/util-linux_2.19.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.19.1.bb
@@ -6,7 +6,9 @@ require util-linux.inc
 LICENSE_util-linux-lscpu = "GPLv3+"
 
 SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
-                  file://util-linux-ng-2.16-mount_lock_path.patch"
+            file://util-linux-ng-2.16-mount_lock_path.patch \
+            file://uclibc-__progname-conflict.patch \      
+"
 
 SRC_URI[md5sum] = "3eab06f05163dfa65479c44e5231932c"
 SRC_URI[sha256sum] = "d3eac4afcc687b3ae1ffedcab2dc12df84c7ba7045cce31386d2b7040a011c7d"
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 07/20] base.bbclass: add cleansstate task between clean and cleanall
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (5 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 06/20] util-linux_2.19.1.bb: Fix compliation on uclibc Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 08/20] gnutls: use INC_PR on 2.12.5 version recipe Saul Wold
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Martin Jansa

From: Martin Jansa <martin.jansa@gmail.com>

* sometimes it's usefull to remove only sstate cache and keep downloaded sources for rebuild

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/base.bbclass |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 8f4ef1e..6f0484e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -408,10 +408,13 @@ def check_gcc3(data):
 	
 	return False
 
-addtask cleanall after do_clean
-python do_cleanall() {
+addtask cleansstate after do_clean
+python do_cleansstate() {
         sstate_clean_cachefiles(d)
+}
 
+addtask cleanall after do_cleansstate
+python do_cleanall() {
         src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split()
         if len(src_uri) == 0:
             return
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 08/20] gnutls: use INC_PR on 2.12.5 version recipe
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (6 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 07/20] base.bbclass: add cleansstate task between clean and cleanall Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 09/20] gnutls: add p11tool into gnutls-bin Saul Wold
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Otavio Salvador <otavio@ossystems.com.br>

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-support/gnutls/gnutls_2.12.5.bb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-support/gnutls/gnutls_2.12.5.bb b/meta/recipes-support/gnutls/gnutls_2.12.5.bb
index b27a065..9d3f5ab 100644
--- a/meta/recipes-support/gnutls/gnutls_2.12.5.bb
+++ b/meta/recipes-support/gnutls/gnutls_2.12.5.bb
@@ -1,6 +1,6 @@
 require gnutls.inc
 
-PR = "r0"
+PR = "${INC_PR}.0"
 
 SRC_URI += "file://gnutls-openssl.patch \
             file://configure-fix.patch"
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 09/20] gnutls: add p11tool into gnutls-bin
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (7 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 08/20] gnutls: use INC_PR on 2.12.5 version recipe Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files Saul Wold
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Otavio Salvador <otavio@ossystems.com.br>

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-support/gnutls/gnutls.inc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-support/gnutls/gnutls.inc b/meta/recipes-support/gnutls/gnutls.inc
index 03aed6a..9257880 100644
--- a/meta/recipes-support/gnutls/gnutls.inc
+++ b/meta/recipes-support/gnutls/gnutls.inc
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.gnu.org/software/gnutls/"
 BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
 DEPENDS = "zlib lzo libtasn1 libgcrypt (>= 1.4.2) libcap"
 
-INC_PR = "r1"
+INC_PR = "r2"
 
 LICENSE = "GPLv3+ & LGPLv2.1+"
 LICENSE_${PN} = "LGPLv2.1+"
@@ -39,6 +39,7 @@ FILES_${PN}-bin = "${bindir}/gnutls-serv \
                    ${bindir}/gnutls-cli \
                    ${bindir}/srptool \
                    ${bindir}/psktool \
+                   ${bindir}/p11tool \
                    ${bindir}/certtool \
                    ${bindir}/gnutls-srpcrypt"
 
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (8 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 09/20] gnutls: add p11tool into gnutls-bin Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06 17:14   ` Richard Purdie
  2011-06-06  6:44 ` [CONSOLIDATED PULL 11/20] xf86-driver-common.inc: remove .la files to avoid unpackaged warning Saul Wold
                   ` (10 subsequent siblings)
  20 siblings, 1 reply; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Otavio Salvador <otavio@ossystems.com.br>

There're many Qt applications that provide translation files in '.qm'
format however those weren't being splitted as GetText based
ones.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/package.bbclass |   41 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 1e6a872..e4be20f 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -343,6 +343,8 @@ python package_do_split_locales() {
 		bb.debug(1, "package requested not splitting locales")
 		return
 
+	import re
+
 	packages = (bb.data.getVar('PACKAGES', d, True) or "").split()
 
 	datadir = bb.data.getVar('datadir', d, True)
@@ -358,12 +360,29 @@ python package_do_split_locales() {
 
 	localedir = os.path.join(dvar + datadir, 'locale')
 
-	if not os.path.isdir(localedir):
+	locales = []
+	if os.path.isdir(localedir):
+		locales = os.listdir(localedir)
+
+	# Check of Qt translation files
+	qm_re = re.compile("(.*)\.qm$")
+	qm_files = {}
+	for root, dirs, files in os.walk(dvar):
+		for file in files:
+			qm_file = qm_re.match(file)
+			if qm_file:
+				locale = qm_file.group(1)
+				relpath = os.path.join(root, file).replace(dvar, '', 1)
+				if relpath:
+					if not qm_files.has_key(locale):
+						qm_files[locale] = []
+
+					qm_files[locale].append(relpath)
+
+	if len(locales) == 0 and len(qm_files) == 0:
 		bb.debug(1, "No locale files in this package")
 		return
 
-	locales = os.listdir(localedir)
-
 	# This is *really* broken
 	mainpkg = packages[0]
 	# At least try and patch it up I guess...
@@ -372,13 +391,27 @@ python package_do_split_locales() {
 	if mainpkg.find('-dev'):
 		mainpkg = mainpkg.replace('-dev', '')
 
+	# Queue Qt locales for spliting
+	for l in qm_files.keys():
+		if l not in locales:
+			locales.append(l)
+
+	# Split the locales into different packages
 	summary = bb.data.getVar('SUMMARY', d, True) or pn
 	description = bb.data.getVar('DESCRIPTION', d, True) or "" 
 	for l in locales:
 		ln = legitimize_package_name(l)
 		pkg = pn + '-locale-' + ln
 		packages.append(pkg)
-		bb.data.setVar('FILES_' + pkg, os.path.join(datadir, 'locale', l), d)
+		files = []
+		files.append(os.path.join(datadir, 'locale', l))
+
+		if qm_files.has_key(l):
+			locale_re = re.compile("^.*([a-z]{2}(_[A-Z]{2})?)$")
+			ln = legitimize_package_name(locale_re.match(l).group(1))
+			files += qm_files[l]
+
+		bb.data.setVar('FILES_' + pkg, " ".join(files), d)
 		bb.data.setVar('RDEPENDS_' + pkg, '%s virtual-locale-%s' % (mainpkg, ln), d)
 		bb.data.setVar('RPROVIDES_' + pkg, '%s-locale %s-translation' % (pn, ln), d)
 		bb.data.setVar('SUMMARY_' + pkg, '%s - %s translations' % (summary, l), d)
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 11/20] xf86-driver-common.inc: remove .la files to avoid unpackaged warning
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (9 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 12/20] gcc-package-cross: also install the symlinks in libexec with target prefix Saul Wold
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core

From: Otavio Salvador <otavio@ossystems.com.br>

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 .../xorg-driver/xf86-driver-common.inc             |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-graphics/xorg-driver/xf86-driver-common.inc b/meta/recipes-graphics/xorg-driver/xf86-driver-common.inc
index 550423b..6ff1391 100644
--- a/meta/recipes-graphics/xorg-driver/xf86-driver-common.inc
+++ b/meta/recipes-graphics/xorg-driver/xf86-driver-common.inc
@@ -5,7 +5,7 @@ SECTION = "x11/drivers"
 LICENSE = "MIT-X"
 
 PE = "1"
-PR = "r0"
+PR = "r1"
 
 DEPENDS = "virtual/xserver-xf86 xproto randrproto util-macros"
 
@@ -27,3 +27,7 @@ do_configure_prepend () {
     mv configure.ac.new configure.ac
 }
 
+do_install_append () {
+    # driver's la files are not packaged
+    rm -f ${D}${libdir}/xorg/modules/drivers/*.la
+}
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 12/20] gcc-package-cross: also install the symlinks in libexec with target prefix
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (10 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 11/20] xf86-driver-common.inc: remove .la files to avoid unpackaged warning Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 13/20] shadow: recipe and patch cleanup Saul Wold
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Phil Blundell

From: Phil Blundell <pb@pbcl.net>

.. since this is where collect2 seems to look for them.  This seems like
it is really a bug in collect2, but installing the symlinks is an easy
workaround.  Without this you get "could not find ld" errors when using -flto.

Signed-off-by: Phil Blundell <philb@gnu.org>
---
 meta/recipes-devtools/gcc/gcc-package-cross.inc |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-package-cross.inc b/meta/recipes-devtools/gcc/gcc-package-cross.inc
index 04c8101..b51336b 100644
--- a/meta/recipes-devtools/gcc/gcc-package-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-package-cross.inc
@@ -20,6 +20,7 @@ do_install () {
 	install -d $dest
 	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
 		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
 	done
 
 	# Remove things we don't need but keep share/java
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 13/20] shadow: recipe and patch cleanup
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (11 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 12/20] gcc-package-cross: also install the symlinks in libexec with target prefix Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 14/20] shadow: add a -native recipe with customized utilities Saul Wold
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Scott Garman

From: Scott Garman <scott.a.garman@intel.com>

Taking over maintenance of the shadow recipe. Cleaning it up in
preparation of adding a -native version that will be used to add
users/groups during preinstall.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 .../files/shadow-4.1.3-dots-in-usernames.patch     |    4 +
 .../shadow-4.1.4.2-env-reset-keep-locale.patch     |    4 +
 .../files/shadow-4.1.4.2-groupmod-pam-check.patch  |    4 +
 .../files/shadow-4.1.4.2-su_no_sanitize_env.patch  |    4 +
 .../shadow/files/shadow.automake-1.11.patch        |    4 +
 meta/recipes-extended/shadow/shadow.inc            |  123 -----------------
 meta/recipes-extended/shadow/shadow_4.1.4.3.bb     |  139 ++++++++++++++++++-
 7 files changed, 151 insertions(+), 131 deletions(-)
 delete mode 100644 meta/recipes-extended/shadow/shadow.inc

diff --git a/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch b/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
index 7a2ff2e..a7bb0a9 100644
--- a/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
+++ b/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
@@ -9,6 +9,10 @@
 #
 # comment added by Kevin Tian <kevin.tian@intel.com>, 2010-08-11
 
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 Index: shadow-4.1.4.2/libmisc/chkname.c
 ===================================================================
 --- shadow-4.1.4.2.orig/libmisc/chkname.c	2009-04-28 12:14:04.000000000 -0700
diff --git a/meta/recipes-extended/shadow/files/shadow-4.1.4.2-env-reset-keep-locale.patch b/meta/recipes-extended/shadow/files/shadow-4.1.4.2-env-reset-keep-locale.patch
index 124065c..6514746 100644
--- a/meta/recipes-extended/shadow/files/shadow-4.1.4.2-env-reset-keep-locale.patch
+++ b/meta/recipes-extended/shadow/files/shadow-4.1.4.2-env-reset-keep-locale.patch
@@ -12,6 +12,10 @@
 http://bugs.gentoo.org/283725
 https://alioth.debian.org/tracker/index.php?func=detail&aid=311740&group_id=30580&atid=411480
 
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 Index: shadow-4.1.4.2/libmisc/env.c
 ===================================================================
 --- shadow-4.1.4.2.orig/libmisc/env.c	2009-04-27 13:07:56.000000000 -0700
diff --git a/meta/recipes-extended/shadow/files/shadow-4.1.4.2-groupmod-pam-check.patch b/meta/recipes-extended/shadow/files/shadow-4.1.4.2-groupmod-pam-check.patch
index 6682fe8..640200b 100644
--- a/meta/recipes-extended/shadow/files/shadow-4.1.4.2-groupmod-pam-check.patch
+++ b/meta/recipes-extended/shadow/files/shadow-4.1.4.2-groupmod-pam-check.patch
@@ -17,6 +17,10 @@ http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2009-November/007850.h
 	* NEWS, src/groupmod.c: Fixed groupmod when configured with
 	--enable-account-tools-setuid.
 
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 Index: shadow-4.1.4.2/src/groupmod.c
 ===================================================================
 --- shadow-4.1.4.2.orig/src/groupmod.c	2009-06-05 15:16:58.000000000 -0700
diff --git a/meta/recipes-extended/shadow/files/shadow-4.1.4.2-su_no_sanitize_env.patch b/meta/recipes-extended/shadow/files/shadow-4.1.4.2-su_no_sanitize_env.patch
index f67251c..0dc4d75 100644
--- a/meta/recipes-extended/shadow/files/shadow-4.1.4.2-su_no_sanitize_env.patch
+++ b/meta/recipes-extended/shadow/files/shadow-4.1.4.2-su_no_sanitize_env.patch
@@ -12,6 +12,10 @@
 http://bugs.gentoo.org/show_bug.cgi?id=301957
 https://alioth.debian.org/scm/browser.php?group_id=30580
 
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 Index: shadow-4.1.4.2/src/su.c
 ===================================================================
 --- shadow-4.1.4.2.orig/src/su.c	2009-07-23 13:38:56.000000000 -0700
diff --git a/meta/recipes-extended/shadow/files/shadow.automake-1.11.patch b/meta/recipes-extended/shadow/files/shadow.automake-1.11.patch
index 36d7be6..a793f09 100644
--- a/meta/recipes-extended/shadow/files/shadow.automake-1.11.patch
+++ b/meta/recipes-extended/shadow/files/shadow.automake-1.11.patch
@@ -11,6 +11,10 @@
 
 man_nopan is for !USE_PAM already included in man_MANS and automake-1.11 hates to install some file twice
 
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 diff -uNr shadow-4.1.4.2.orig/man/Makefile.am shadow-4.1.4.2/man/Makefile.am
 --- shadow-4.1.4.2.orig/man/Makefile.am	2009-03-14 15:40:10.000000000 +0100
 +++ shadow-4.1.4.2/man/Makefile.am	2010-04-02 07:31:17.000000000 +0200
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
deleted file mode 100644
index 35bd6a8..0000000
--- a/meta/recipes-extended/shadow/shadow.inc
+++ /dev/null
@@ -1,123 +0,0 @@
-DESCRIPTION = "Tools to change and administer password and group data."
-HOMEPAGE = "http://pkg-shadow.alioth.debian.org/"
-BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
-SECTION = "base utils"
-LICENSE = "BSD | Artistic"
-LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
-                    file://src/passwd.c;firstline=8;endline=30;md5=2899a045e90511d0e043b85a7db7e2fe"
-
-PR = "r1"
-
-PAM_PLUGINS = "  libpam-runtime \
-                 pam-plugin-faildelay \
-                 pam-plugin-securetty \
-                 pam-plugin-nologin \
-                 pam-plugin-env \
-                 pam-plugin-group \
-                 pam-plugin-limits \
-                 pam-plugin-lastlog \
-                 pam-plugin-motd \
-                 pam-plugin-mail \
-                 pam-plugin-shells \
-                 pam-plugin-rootok"
-                 
-DEPENDS = "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
-RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
-
-# since we deduce from ${SERIAL_CONSOLE}
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-# Additional Policy files for PAM
-PAM_SRC_URI = "file://pam.d/chfn \
-               file://pam.d/chpasswd \
-               file://pam.d/chsh \
-               file://pam.d/login \
-               file://pam.d/newusers \
-               file://pam.d/passwd \
-               file://pam.d/su"
-
-SRC_URI = "ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-${PV}.tar.bz2 \
-           file://login_defs_pam.sed \
-           ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
-           file://securetty"
-
-inherit autotools gettext
-
-EXTRA_OECONF += "--without-audit \
-                 --without-libcrack \
-                 ${@base_contains('DISTRO_FEATURES', 'pam', '--with-libpam', '--without-libpam', d)} \
-                 --without-selinux"
-
-do_install_append() {
-	# Ensure that the image has as /var/spool/mail dir so shadow can put mailboxes there if the user
-	# reconfigures Shadow to default (see sed below).
-	install -d ${D}${localstatedir}/spool/mail
-
-	if [ -e ${WORKDIR}/pam.d ]; then
-		install -d ${D}${sysconfdir}/pam.d/
-		install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
-		# Remove defaults that are not used when supporting PAM
-		sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs
-	fi
-
-	# Enable CREATE_HOME by default.
-	sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
-
-	# As we are on an embedded system ensure the users mailbox is in ~/ not
-	# /var/spool/mail by default as who knows where or how big /var is.
-	# The system MDA will set this later anyway.
-	sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
-	sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
-
-	# disable checking emails at all
-	sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
-
-	# now we don't have a mail system. disable mail creation for now
-	sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
-	sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
-
-	install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} 
-	for i in passwd chfn newgrp chsh ; do
-		mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}
-	done
-
-	mv ${D}${sbindir}/chpasswd ${D}${sbindir}/chpasswd.${PN}
-	mv ${D}${sbindir}/vigr ${D}${base_sbindir}/vigr.${PN}
-	mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw.${PN}
-	mv ${D}${bindir}/login ${D}${base_bindir}/login.${PN}
-
-	# Ensure we add a suitable securetty file to the package that has most common embedded TTYs defined.
-	if [ ! -z "${SERIAL_CONSOLE}" ]; then
-	# our SERIAL_CONSOLE contains baud rate too and sometime -L option as well.
-	# the following pearl :) takes that and converts it into newline sepated tty's and appends
-	# them into securetty. So if a machine has a weird looking console device node (e.g. ttyAMA0) that securetty
-	# does not know then it will get appended to securetty and root login will be allowed on
-	# that console.
-		echo "${SERIAL_CONSOLE}" | sed -e 's/[0-9][0-9]\|\-L//g'|tr "[ ]" "[\n]"  >> ${WORKDIR}/securetty
-	fi
-	install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty 
-}
-
-pkg_postinst_${PN} () {
-	update-alternatives --install ${bindir}/passwd passwd passwd.${PN} 200
-	update-alternatives --install ${sbindir}/chpasswd chpasswd chpasswd.${PN} 200
-	update-alternatives --install ${bindir}/chfn chfn chfn.${PN} 200
-	update-alternatives --install ${bindir}/newgrp newgrp newgrp.${PN} 200
-	update-alternatives --install ${bindir}/chsh chsh chsh.${PN} 200
-	update-alternatives --install ${base_bindir}/login login login.${PN} 200
-	update-alternatives --install ${base_sbindir}/vipw vipw vipw.${PN} 200
-	update-alternatives --install ${base_sbindir}/vigr vigr vigr.${PN} 200
-
-	if [ "x$D" != "x" ]; then
-		exit 1
-	fi  
-
-	pwconv
-	grpconv
-}
-
-pkg_prerm_${PN} () {
-	for i in passwd chpasswd chfn newgrp chsh login vipw vigr ; do
-		update-alternatives --remove $i $i.${PN}
-	done
-}
diff --git a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
index c8aa223..930ef3d 100644
--- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
+++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
@@ -1,14 +1,137 @@
-require shadow.inc
+SUMMARY = "Tools to change and administer password and group data"
+DESCRIPTION = "Tools to change and administer password and group data"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base utils"
+PRIORITY = "optional"
+LICENSE = "BSD | Artistic"
+LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
+                    file://src/passwd.c;firstline=8;endline=30;md5=2899a045e90511d0e043b85a7db7e2fe"
 
-PR = "r1"
+DEPENDS = "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
+PR = "r2"
 
-SRC_URI += "file://shadow.automake-1.11.patch \
-	    file://shadow-4.1.3-dots-in-usernames.patch \
-	    file://shadow-4.1.4.2-env-reset-keep-locale.patch \
-	    file://shadow-4.1.4.2-groupmod-pam-check.patch \
-	    file://shadow-4.1.4.2-su_no_sanitize_env.patch"
+SRC_URI = "ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-${PV}.tar.bz2 \
+           file://login_defs_pam.sed \
+           ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+           file://securetty \
+           file://shadow.automake-1.11.patch \
+           file://shadow-4.1.3-dots-in-usernames.patch \
+           file://shadow-4.1.4.2-env-reset-keep-locale.patch \
+           file://shadow-4.1.4.2-groupmod-pam-check.patch \
+           file://shadow-4.1.4.2-su_no_sanitize_env.patch"
 
 SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
 SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
 
-EXTRA_OECONF_libc-uclibc += " --with-nscd=no "
+inherit autotools gettext
+
+# Since we deduce our arch from ${SERIAL_CONSOLE}
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+EXTRA_OECONF += "--without-audit \
+                 --without-libcrack \
+                 ${@base_contains('DISTRO_FEATURES', 'pam', '--with-libpam', '--without-libpam', d)} \
+                 --without-selinux"
+EXTRA_OECONF_libc-uclibc += "--with-nscd=no"
+
+PAM_PLUGINS = "libpam-runtime \
+               pam-plugin-faildelay \
+               pam-plugin-securetty \
+               pam-plugin-nologin \
+               pam-plugin-env \
+               pam-plugin-group \
+               pam-plugin-limits \
+               pam-plugin-lastlog \
+               pam-plugin-motd \
+               pam-plugin-mail \
+               pam-plugin-shells \
+               pam-plugin-rootok"
+
+# Additional Policy files for PAM
+PAM_SRC_URI = "file://pam.d/chfn \
+               file://pam.d/chpasswd \
+               file://pam.d/chsh \
+               file://pam.d/login \
+               file://pam.d/newusers \
+               file://pam.d/passwd \
+               file://pam.d/su"
+
+do_install_append() {
+	# Ensure that the image has as a /var/spool/mail dir so shadow can
+	# put mailboxes there if the user reconfigures shadow to its
+	# defaults (see sed below).
+	install -d ${D}${localstatedir}/spool/mail
+
+	if [ -e ${WORKDIR}/pam.d ]; then
+		install -d ${D}${sysconfdir}/pam.d/
+		install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+		# Remove defaults that are not used when supporting PAM.
+		sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs
+	fi
+
+	# Enable CREATE_HOME by default.
+	sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
+
+	# As we are on an embedded system, ensure the users mailbox is in
+	# ~/ not /var/spool/mail by default, as who knows where or how big
+	# /var is. The system MDA will set this later anyway.
+	sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
+	sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
+
+	# Disable checking emails.
+	sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
+
+	# Now we don't have a mail system. Disable mail creation for now.
+	sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
+	sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
+
+	install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} 
+	for i in passwd chfn newgrp chsh ; do
+		mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}
+	done
+
+	mv ${D}${sbindir}/chpasswd ${D}${sbindir}/chpasswd.${PN}
+	mv ${D}${sbindir}/vigr ${D}${base_sbindir}/vigr.${PN}
+	mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw.${PN}
+	mv ${D}${bindir}/login ${D}${base_bindir}/login.${PN}
+
+	# Ensure we add a suitable securetty file to the package that has
+	# most common embedded TTYs defined.
+	if [ ! -z "${SERIAL_CONSOLE}" ]; then
+		# Our SERIAL_CONSOLE contains a baud rate and sometimes a -L
+		# option as well. The following pearl :) takes that and converts
+		# it into newline-separated tty's and appends them into
+		# securetty. So if a machine has a weird looking console device
+		# node (e.g. ttyAMA0) that securetty does not know, it will get
+		# appended to securetty and root logins will be allowed on that
+		# console.
+		echo "${SERIAL_CONSOLE}" | sed -e 's/[0-9][0-9]\|\-L//g'|tr "[ ]" "[\n]"  >> ${WORKDIR}/securetty
+	fi
+	install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty 
+}
+
+pkg_postinst_${PN} () {
+	update-alternatives --install ${bindir}/passwd passwd passwd.${PN} 200
+	update-alternatives --install ${sbindir}/chpasswd chpasswd chpasswd.${PN} 200
+	update-alternatives --install ${bindir}/chfn chfn chfn.${PN} 200
+	update-alternatives --install ${bindir}/newgrp newgrp newgrp.${PN} 200
+	update-alternatives --install ${bindir}/chsh chsh chsh.${PN} 200
+	update-alternatives --install ${base_bindir}/login login login.${PN} 200
+	update-alternatives --install ${base_sbindir}/vipw vipw vipw.${PN} 200
+	update-alternatives --install ${base_sbindir}/vigr vigr vigr.${PN} 200
+
+	if [ "x$D" != "x" ]; then
+		exit 1
+	fi  
+
+	pwconv
+	grpconv
+}
+
+pkg_prerm_${PN} () {
+	for i in passwd chpasswd chfn newgrp chsh login vipw vigr ; do
+		update-alternatives --remove $i $i.${PN}
+	done
+}
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 14/20] shadow: add a -native recipe with customized utilities
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (12 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 13/20] shadow: recipe and patch cleanup Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 15/20] base-passwd: populate the target sysroot with passwd/group/login.defs Saul Wold
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Scott Garman

From: Scott Garman <scott.a.garman@intel.com>

This adds a -native recipe for the shadow utilities.

The custom --root option allows the the following utilities to be
run within a chroot when invoked under pseudo:

* useradd
* groupadd
* usermod
* groupmod
* userdel
* groupdel
* passwd
* gpasswd
* pwconv
* pwunconv
* grpconv
* grpunconv

They can then be used to manipulate user and group account information
in target sysroots.

useradd was also modified to create home directories recursively when
necessary.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 .../shadow/files/add_root_cmd_options.patch        | 1296 ++++++++++++++++++++
 .../shadow/shadow-native_4.1.4.3.bb                |   66 +
 2 files changed, 1362 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-extended/shadow/files/add_root_cmd_options.patch
 create mode 100644 meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb

diff --git a/meta/recipes-extended/shadow/files/add_root_cmd_options.patch b/meta/recipes-extended/shadow/files/add_root_cmd_options.patch
new file mode 100644
index 0000000..db969bb
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/add_root_cmd_options.patch
@@ -0,0 +1,1296 @@
+Add a --root command option to the following utilties:
+
+* useradd
+* groupadd
+* usermod
+* groupmod
+* userdel
+* groupdel
+* passwd
+* gpasswd
+* pwconv
+* pwunconv
+* grpconv
+* grpunconv
+
+This option allows the utilities to be chrooted when run under pseudo.
+They can then be used to manipulate user and group account information
+in target sysroots.
+
+The useradd utility was also modified to create home directories
+recursively when necessary.
+
+Upstream-Status: Inappropriate [Other]
+Workaround is specific to our build system.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN shadow-4.1.4.3.orig//src/gpasswd.c shadow-4.1.4.3//src/gpasswd.c
+--- shadow-4.1.4.3.orig//src/gpasswd.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/gpasswd.c	2011-05-28 17:09:52.346013331 -0700
+@@ -63,6 +63,7 @@
+  * (/etc/gshadow present) */
+ static bool is_shadowgrp;
+ #endif
++static const char *newroot = "";
+ 
+ /* Flags set by options */
+ static bool aflg = false;
+@@ -97,6 +98,7 @@
+ static void usage (void);
+ static RETSIGTYPE catch_signals (int killed);
+ static bool is_valid_user_list (const char *users);
++static void process_root_flag (int argc, char **argv);
+ static void process_flags (int argc, char **argv);
+ static void check_flags (int argc, int opt_index);
+ static void open_files (void);
+@@ -136,6 +138,7 @@
+ 	           "Options:\n"
+ 	           "  -a, --add USER                add USER to GROUP\n"
+ 	           "  -d, --delete USER             remove USER from GROUP\n"
++	           "  -Q  --root CHROOT_DIR         directory to chroot into\n"
+ 	           "  -r, --remove-password         remove the GROUP's password\n"
+ 	           "  -R, --restrict                restrict access to GROUP to its members\n"
+ 	           "  -M, --members USER,...        set the list of members of GROUP\n"
+@@ -226,6 +229,55 @@
+ }
+ 
+ /*
++ * process_root_flag - chroot if given the --root option
++ *
++ * We do this outside of process_flags() because
++ * the is_shadow_pwd boolean needs to be set before
++ * process_flags(), and if we do need to chroot() we
++ * must do so before is_shadow_pwd gets set.
++ */
++static void process_root_flag (int argc, char **argv)
++{
++	/*
++	 * Parse the command line options.
++	 */
++	int flag;
++	int option_index = 0;
++	static struct option long_options[] = {
++		{"root", required_argument, NULL, 'Q'},
++		{NULL, 0, NULL, '\0'}
++	};
++
++	while ((flag = getopt_long (argc, argv, "a:A:d:gM:Q:rR", long_options, &option_index)) != -1) {
++		switch (flag) {
++		case 'Q':
++			if ('/' != optarg[0]) {
++				fprintf (stderr,
++				         _("%s: invalid chroot path '%s'\n"),
++				         Prog, optarg);
++				exit (E_BAD_ARG);
++			}
++			newroot = optarg;
++
++			if (access (newroot, F_OK) != 0) {
++				fprintf(stderr,
++				        _("%s: chroot directory %s does not exist\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			if ( chroot(newroot) != 0 ) {
++				fprintf(stderr,
++				        _("%s: unable to chroot to directory %s\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			break;
++		/* no-op on everything else - they will be hanled by process_flags() */
++		}
++	}
++}
++
++/*
+  * process_flags - process the command line options and arguments
+  */
+ static void process_flags (int argc, char **argv)
+@@ -235,6 +287,7 @@
+ 	static struct option long_options[] = {
+ 		{"add", required_argument, NULL, 'a'},
+ 		{"delete", required_argument, NULL, 'd'},
++		{"root", required_argument, NULL, 'Q'},
+ 		{"remove-password", no_argument, NULL, 'r'},
+ 		{"restrict", no_argument, NULL, 'R'},
+ 		{"administrators", required_argument, NULL, 'A'},
+@@ -242,7 +295,7 @@
+ 		{NULL, 0, NULL, '\0'}
+ 		};
+ 
+-	while ((flag = getopt_long (argc, argv, "a:A:d:gM:rR", long_options, &option_index)) != -1) {
++	while ((flag = getopt_long (argc, argv, "a:A:d:gM:Q:rR", long_options, &option_index)) != -1) {
+ 		switch (flag) {
+ 		case 'a':	/* add a user */
+ 			aflg = true;
+@@ -283,6 +336,9 @@
+ 			}
+ 			Mflg = true;
+ 			break;
++		case 'Q':
++			/* no-op since we handled this in process_root_flag() earlier */
++			break;
+ 		case 'r':	/* remove group password */
+ 			rflg = true;
+ 			break;
+@@ -995,6 +1051,8 @@
+ 	setbuf (stdout, NULL);
+ 	setbuf (stderr, NULL);
+ 
++	process_root_flag (argc, argv);
++
+ #ifdef SHADOWGRP
+ 	is_shadowgrp = sgr_file_present ();
+ #endif
+diff -urN shadow-4.1.4.3.orig//src/groupadd.c shadow-4.1.4.3//src/groupadd.c
+--- shadow-4.1.4.3.orig//src/groupadd.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/groupadd.c	2011-05-28 17:09:52.346013331 -0700
+@@ -76,6 +76,7 @@
+ static gid_t group_id;
+ static /*@null@*/char *group_passwd;
+ static /*@null@*/char *empty_list = NULL;
++static const char *newroot = "";
+ 
+ static bool oflg = false;	/* permit non-unique group ID to be specified with -g */
+ static bool gflg = false;	/* ID value for the new group */
+@@ -120,6 +121,7 @@
+ 	(void) fputs (_("  -o, --non-unique              allow to create groups with duplicate\n"
+ 	                "                                (non-unique) GID\n"), stderr);
+ 	(void) fputs (_("  -p, --password PASSWORD       use this encrypted password for the new group\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), stderr);
+ 	(void) fputs (_("  -r, --system                  create a system account\n"), stderr);
+ 	(void) fputs ("\n", stderr);
+ 	exit (E_USAGE);
+@@ -383,12 +385,13 @@
+ 		{"key", required_argument, NULL, 'K'},
+ 		{"non-unique", no_argument, NULL, 'o'},
+ 		{"password", required_argument, NULL, 'p'},
++		{"root", required_argument, NULL, 'R'},
+ 		{"system", no_argument, NULL, 'r'},
+ 		{NULL, 0, NULL, '\0'}
+ 	};
+ 
+ 	while ((c =
+-		getopt_long (argc, argv, "fg:hK:op:r", long_options,
++		getopt_long (argc, argv, "fg:hK:op:R:r", long_options,
+ 		             &option_index)) != -1) {
+ 		switch (c) {
+ 		case 'f':
+@@ -440,6 +443,28 @@
+ 			pflg = true;
+ 			group_passwd = optarg;
+ 			break;
++		case 'R':
++			if ('/' != optarg[0]) {
++				fprintf (stderr,
++				         _("%s: invalid chroot path '%s'\n"),
++				         Prog, optarg);
++				exit (E_BAD_ARG);
++			}
++			newroot = optarg;
++
++			if (access (newroot, F_OK) != 0) {
++				fprintf(stderr,
++				        _("%s: chroot directory %s does not exist\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			if ( chroot(newroot) != 0 ) {
++				fprintf(stderr,
++				        _("%s: unable to chroot to directory %s\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			break;
+ 		case 'r':
+ 			rflg = true;
+ 			break;
+diff -urN shadow-4.1.4.3.orig//src/groupdel.c shadow-4.1.4.3//src/groupdel.c
+--- shadow-4.1.4.3.orig//src/groupdel.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/groupdel.c	2011-05-28 17:09:52.346013331 -0700
+@@ -36,6 +36,7 @@
+ 
+ #include <ctype.h>
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <grp.h>
+ #include <pwd.h>
+ #ifdef ACCT_TOOLS_SETUID
+@@ -59,6 +60,7 @@
+ 
+ static char *group_name;
+ static gid_t group_id = -1;
++static const char *newroot = "";
+ 
+ #ifdef	SHADOWGRP
+ static bool is_shadow_grp;
+@@ -70,12 +72,14 @@
+ /*@-exitarg@*/
+ #define E_SUCCESS	0	/* success */
+ #define E_USAGE		2	/* invalid command syntax */
++#define E_BAD_ARG	3	/* invalid argument to option */
+ #define E_NOTFOUND	6	/* specified group doesn't exist */
+ #define E_GROUP_BUSY	8	/* can't remove user's primary group */
+ #define E_GRP_UPDATE	10	/* can't update group file */
+ 
+ /* local function prototypes */
+ static void usage (void);
++static void process_flags (int argc, char **argv);
+ static void grp_update (void);
+ static void close_files (void);
+ static void open_files (void);
+@@ -86,11 +90,78 @@
+  */
+ static void usage (void)
+ {
+-	fputs (_("Usage: groupdel group\n"), stderr);
++	(void) fprintf (stderr,
++					_("Usage: groupdel [options]\n"
++					  "\n"
++					  "Options:\n"),
++					Prog);
++	(void) fputs (_("  -g, --group GROUP            group name to delete\n"), stderr);
++	(void) fputs (_("  -h, --help                   display this help message and exit\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR        directory to chroot into\n"), stderr);
++	(void) fputs ("\n", stderr);
+ 	exit (E_USAGE);
+ }
+ 
+ /*
++ * process_flags - perform command line argument setting
++ *
++ *	process_flags() interprets the command line arguments and sets
++ *	the values that the user will be created with accordingly. The
++ *	values are checked for sanity.
++ */
++static void process_flags (int argc, char **argv)
++{
++	{
++		/*
++		 * Parse the command line options.
++		 */
++		int c;
++		static struct option long_options[] = {
++			{"group", required_argument, NULL, 'g'},
++			{"help", no_argument, NULL, 'h'},
++			{"root", required_argument, NULL, 'R'},
++			{NULL, 0, NULL, '\0'}
++		};
++		while ((c = getopt_long (argc, argv,
++								 "g:R:",
++								 long_options, NULL)) != -1) {
++			switch (c) {
++			case 'g':
++				group_name = optarg;
++				break;
++			case 'h':
++				usage ();
++				break;
++			case 'R':
++				if ('/' != optarg[0]) {
++					fprintf (stderr,
++							_("%s: invalid chroot path '%s'\n"),
++							Prog, optarg);
++					exit (E_BAD_ARG);
++				}
++				newroot = optarg;
++
++				if (access (newroot, F_OK) != 0) {
++					fprintf(stderr,
++							_("%s: chroot directory %s does not exist\n"),
++							Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				if ( chroot(newroot) != 0 ) {
++					fprintf(stderr,
++							_("%s: unable to chroot to directory %s\n"),
++							Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				break;
++			default:
++				usage ();
++			}
++		}
++	}
++}
++
++/*
+  * grp_update - update group file entries
+  *
+  *	grp_update() writes the new records to the group files.
+@@ -328,14 +399,14 @@
+ 	(void) bindtextdomain (PACKAGE, LOCALEDIR);
+ 	(void) textdomain (PACKAGE);
+ 
+-	if (argc != 2) {
++   if (argc == 1) {
+ 		usage ();
+ 	}
+ 
+-	group_name = argv[1];
+-
+ 	OPENLOG ("groupdel");
+ 
++	process_flags (argc, argv);
++
+ #ifdef ACCT_TOOLS_SETUID
+ #ifdef USE_PAM
+ 	{
+diff -urN shadow-4.1.4.3.orig//src/groupmod.c shadow-4.1.4.3//src/groupmod.c
+--- shadow-4.1.4.3.orig//src/groupmod.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/groupmod.c	2011-05-28 17:09:52.346013331 -0700
+@@ -79,6 +79,7 @@
+ static char *group_passwd;
+ static gid_t group_id;
+ static gid_t group_newid;
++static char *newroot = "";
+ 
+ struct cleanup_info_mod info_passwd;
+ struct cleanup_info_mod info_group;
+@@ -126,6 +127,7 @@
+ 	(void) fputs (_("  -o, --non-unique              allow to use a duplicate (non-unique) GID\n"), stderr);
+ 	(void) fputs (_("  -p, --password PASSWORD       change the password to this (encrypted)\n"
+ 	                "                                PASSWORD\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), stderr);
+ 	(void) fputs ("\n", stderr);
+ 	exit (E_USAGE);
+ }
+@@ -346,10 +348,11 @@
+ 		{"new-name", required_argument, NULL, 'n'},
+ 		{"non-unique", no_argument, NULL, 'o'},
+ 		{"password", required_argument, NULL, 'p'},
++		{"root", required_argument, NULL, 'R'},
+ 		{NULL, 0, NULL, '\0'}
+ 	};
+ 	while ((c =
+-		getopt_long (argc, argv, "g:hn:op:",
++		getopt_long (argc, argv, "g:hn:op:R:",
+ 		             long_options, &option_index)) != -1) {
+ 		switch (c) {
+ 		case 'g':
+@@ -373,6 +376,28 @@
+ 			group_passwd = optarg;
+ 			pflg = true;
+ 			break;
++		case 'R':
++			if ('/' != optarg[0]) {
++				fprintf (stderr,
++				         _("%s: invalid chroot path '%s'\n"),
++				         Prog, optarg);
++				exit (E_BAD_ARG);
++			}
++			newroot = optarg;
++
++			if (access (newroot, F_OK) != 0) {
++				fprintf(stderr,
++				        _("%s: chroot directory %s does not exist\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			if ( chroot(newroot) != 0 ) {
++				fprintf(stderr,
++				        _("%s: unable to chroot to directory %s\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			break;
+ 		default:
+ 			usage ();
+ 		}
+diff -urN shadow-4.1.4.3.orig//src/grpconv.c shadow-4.1.4.3//src/grpconv.c
+--- shadow-4.1.4.3.orig//src/grpconv.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/grpconv.c	2011-05-28 17:09:52.346013331 -0700
+@@ -39,6 +39,7 @@
+ 
+ #include <errno.h>
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <grp.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -50,6 +51,14 @@
+ #ifdef SHADOWGRP
+ #include "groupio.h"
+ #include "sgroupio.h"
++
++/*
++ * exit status values
++ */
++/*@-exitarg@*/
++#define E_USAGE		2	/* invalid command syntax */
++#define E_BAD_ARG	3	/* invalid argument to option */
++
+ /*
+  * Global variables
+  */
+@@ -57,9 +66,12 @@
+ 
+ static bool gr_locked  = false;
+ static bool sgr_locked = false;
++static const char *newroot = "";
+ 
+ /* local function prototypes */
+ static void fail_exit (int status);
++static void usage (void);
++static void process_flags (int argc, char **argv);
+ 
+ static void fail_exit (int status)
+ {
+@@ -82,6 +94,77 @@
+ 	exit (status);
+ }
+ 
++/*
++ * usage - display usage message and exit
++ */
++static void usage (void)
++{
++	(void) fprintf (stderr,
++					_("Usage: grpconv [options]\n"
++					  "\n"
++					  "Options:\n"),
++					Prog);
++	(void) fputs (_("  -h, --help                    display this help message and exit\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), stderr);
++	(void) fputs ("\n", stderr);
++	exit (E_USAGE);
++}
++
++/*
++ * process_flags - perform command line argument setting
++ *
++ *	process_flags() interprets the command line arguments and sets
++ *	the values that the user will be created with accordingly. The
++ *	values are checked for sanity.
++ */
++static void process_flags (int argc, char **argv)
++{
++	{
++		/*
++		 * Parse the command line options.
++		 */
++		int c;
++		static struct option long_options[] = {
++			{"help", no_argument, NULL, 'h'},
++			{"root", required_argument, NULL, 'R'},
++			{NULL, 0, NULL, '\0'}
++		};
++		while ((c = getopt_long (argc, argv,
++								 "R:",
++								 long_options, NULL)) != -1) {
++			switch (c) {
++			case 'h':
++				usage ();
++				break;
++			case 'R':
++				if ('/' != optarg[0]) {
++					fprintf (stderr,
++					         _("%s: invalid chroot path '%s'\n"),
++					         Prog, optarg);
++					exit (E_BAD_ARG);
++				}
++				newroot = optarg;
++
++				if (access (newroot, F_OK) != 0) {
++					fprintf(stderr,
++					        _("%s: chroot directory %s does not exist\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				if ( chroot(newroot) != 0 ) {
++					fprintf(stderr,
++					        _("%s: unable to chroot to directory %s\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				break;
++			default:
++				usage ();
++			}
++		}
++	}
++}
++
+ int main (int argc, char **argv)
+ {
+ 	const struct group *gr;
+@@ -100,6 +183,8 @@
+ 
+ 	OPENLOG ("grpconv");
+ 
++	process_flags (argc, argv);
++
+ 	if (gr_lock () == 0) {
+ 		fprintf (stderr,
+ 		         _("%s: cannot lock %s; try again later.\n"),
+diff -urN shadow-4.1.4.3.orig//src/grpunconv.c shadow-4.1.4.3//src/grpunconv.c
+--- shadow-4.1.4.3.orig//src/grpunconv.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/grpunconv.c	2011-05-28 17:09:52.346013331 -0700
+@@ -43,6 +43,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <time.h>
+ #include <unistd.h>
+ #include <grp.h>
+@@ -51,6 +52,14 @@
+ #ifdef SHADOWGRP
+ #include "groupio.h"
+ #include "sgroupio.h"
++
++/*
++ * exit status values
++ */
++/*@-exitarg@*/
++#define E_USAGE		2	/* invalid command syntax */
++#define E_BAD_ARG	3	/* invalid argument to option */
++
+ /*
+  * Global variables
+  */
+@@ -58,9 +67,12 @@
+ 
+ static bool gr_locked  = false;
+ static bool sgr_locked = false;
++static const char *newroot = "";
+ 
+ /* local function prototypes */
+ static void fail_exit (int status);
++static void usage (void);
++static void process_flags (int argc, char **argv);
+ 
+ static void fail_exit (int status)
+ {
+@@ -83,6 +95,77 @@
+ 	exit (status);
+ }
+ 
++/*
++ * usage - display usage message and exit
++ */
++static void usage (void)
++{
++	(void) fprintf (stderr,
++					_("Usage: grpunconv [options]\n"
++					  "\n"
++					  "Options:\n"),
++					Prog);
++	(void) fputs (_("  -h, --help                    display this help message and exit\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), stderr);
++	(void) fputs ("\n", stderr);
++	exit (E_USAGE);
++}
++
++/*
++ * process_flags - perform command line argument setting
++ *
++ * process_flags() interprets the command line arguments and sets
++ * the values that the user will be created with accordingly. The
++ * values are checked for sanity.
++ */
++static void process_flags (int argc, char **argv)
++{
++	{
++		/*
++		 * Parse the command line options.
++		 */
++		int c;
++		static struct option long_options[] = {
++			{"help", no_argument, NULL, 'h'},
++			{"root", required_argument, NULL, 'R'},
++			{NULL, 0, NULL, '\0'}
++		};
++		while ((c = getopt_long (argc, argv,
++								 "R:",
++								 long_options, NULL)) != -1) {
++			switch (c) {
++			case 'h':
++				usage ();
++				break;
++			case 'R':
++				if ('/' != optarg[0]) {
++					fprintf (stderr,
++					         _("%s: invalid chroot path '%s'\n"),
++					         Prog, optarg);
++					exit (E_BAD_ARG);
++				}
++				newroot = optarg;
++
++				if (access (newroot, F_OK) != 0) {
++					fprintf(stderr,
++					        _("%s: chroot directory %s does not exist\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				if ( chroot(newroot) != 0 ) {
++					fprintf(stderr,
++					        _("%s: unable to chroot to directory %s\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				break;
++			default:
++				usage ();
++			}
++		}
++	}
++}
++
+ int main (int argc, char **argv)
+ {
+ 	const struct group *gr;
+@@ -100,6 +183,8 @@
+ 
+ 	OPENLOG ("grpunconv");
+ 
++	process_flags (argc, argv);
++
+ 	if (sgr_file_present () == 0) {
+ 		exit (0);	/* no /etc/gshadow, nothing to do */
+ 	}
+diff -urN shadow-4.1.4.3.orig//src/passwd.c shadow-4.1.4.3//src/passwd.c
+--- shadow-4.1.4.3.orig//src/passwd.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/passwd.c	2011-05-28 17:09:52.346013331 -0700
+@@ -75,6 +75,7 @@
+ static char *name;		/* The name of user whose password is being changed */
+ static char *myname;		/* The current user's name */
+ static bool amroot;		/* The caller's real UID was 0 */
++static const char *newroot = "";
+ 
+ static bool
+     aflg = false,			/* -a - show status for all users */
+@@ -174,6 +175,7 @@
+ 	         "  -n, --mindays MIN_DAYS        set minimum number of days before password\n"
+ 	         "                                change to MIN_DAYS\n"
+ 	         "  -q, --quiet                   quiet mode\n"
++	         "  -R, --root CHROOT_DIR         directory to chroot into\n"
+ 	         "  -r, --repository REPOSITORY   change password in REPOSITORY repository\n"
+ 	         "  -S, --status                  report password status on the named account\n"
+ 	         "  -u, --unlock                  unlock the password of the named account\n"
+@@ -803,6 +805,7 @@
+ 			{"lock", no_argument, NULL, 'l'},
+ 			{"mindays", required_argument, NULL, 'n'},
+ 			{"quiet", no_argument, NULL, 'q'},
++			{"root", required_argument, NULL, 'R'},
+ 			{"repository", required_argument, NULL, 'r'},
+ 			{"status", no_argument, NULL, 'S'},
+ 			{"unlock", no_argument, NULL, 'u'},
+@@ -811,7 +814,7 @@
+ 			{NULL, 0, NULL, '\0'}
+ 		};
+ 
+-		while ((c = getopt_long (argc, argv, "adei:kln:qr:Suw:x:",
++		while ((c = getopt_long (argc, argv, "adei:kln:qR:r:Suw:x:",
+ 		                         long_options, &option_index)) != -1) {
+ 			switch (c) {
+ 			case 'a':
+@@ -858,6 +861,28 @@
+ 			case 'q':
+ 				qflg = true;	/* ok for users */
+ 				break;
++			case 'R':
++				if ('/' != optarg[0]) {
++					fprintf (stderr,
++					         _("%s: invalid chroot path '%s'\n"),
++					         Prog, optarg);
++					exit (E_BAD_ARG);
++				}
++				newroot = optarg;
++
++				if (access (newroot, F_OK) != 0) {
++					fprintf(stderr,
++					        _("%s: chroot directory %s does not exist\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				if ( chroot(newroot) != 0 ) {
++					fprintf(stderr,
++				            _("%s: unable to chroot to directory %s\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				break;
+ 			case 'r':
+ 				/* -r repository (files|nis|nisplus) */
+ 				/* only "files" supported for now */
+diff -urN shadow-4.1.4.3.orig//src/pwconv.c shadow-4.1.4.3//src/pwconv.c
+--- shadow-4.1.4.3.orig//src/pwconv.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/pwconv.c	2011-05-28 17:09:52.346013331 -0700
+@@ -59,6 +59,7 @@
+ 
+ #include <errno.h>
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <pwd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -79,6 +80,7 @@
+ #define E_SUCCESS	0	/* success */
+ #define E_NOPERM	1	/* permission denied */
+ #define E_USAGE		2	/* invalid command syntax */
++#define E_BAD_ARG	3	/* invalid argument to option */
+ #define E_FAILURE	3	/* unexpected failure, nothing done */
+ #define E_MISSING	4	/* unexpected failure, passwd file missing */
+ #define E_PWDBUSY	5	/* passwd file(s) busy */
+@@ -90,9 +92,12 @@
+ 
+ static bool spw_locked = false;
+ static bool pw_locked = false;
++static const char *newroot = "";
+ 
+ /* local function prototypes */
+ static void fail_exit (int status);
++static void usage (void);
++static void process_flags (int argc, char **argv);
+ 
+ static void fail_exit (int status)
+ {
+@@ -115,6 +120,77 @@
+ 	exit (status);
+ }
+ 
++/*
++ * usage - display usage message and exit
++ */
++static void usage (void)
++{
++	(void) fprintf (stderr,
++					_("Usage: pwconv [options]\n"
++					  "\n"
++					  "Options:\n"),
++					Prog);
++	(void) fputs (_("  -h, --help                    display this help message and exit\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), stderr);
++	(void) fputs ("\n", stderr);
++	exit (E_USAGE);
++}
++
++/*
++ * process_flags - perform command line argument setting
++ *
++ *	process_flags() interprets the command line arguments and sets
++ *	the values that the user will be created with accordingly. The
++ *	values are checked for sanity.
++ */
++static void process_flags (int argc, char **argv)
++{
++	{
++		/*
++		 * Parse the command line options.
++		 */
++		int c;
++		static struct option long_options[] = {
++			{"help", no_argument, NULL, 'h'},
++			{"root", required_argument, NULL, 'R'},
++			{NULL, 0, NULL, '\0'}
++		};
++		while ((c = getopt_long (argc, argv,
++								 "R:",
++								 long_options, NULL)) != -1) {
++			switch (c) {
++			case 'h':
++				usage ();
++				break;
++			case 'R':
++				if ('/' != optarg[0]) {
++					fprintf (stderr,
++					         _("%s: invalid chroot path '%s'\n"),
++					         Prog, optarg);
++					exit (E_BAD_ARG);
++				}
++				newroot = optarg;
++
++				if (access (newroot, F_OK) != 0) {
++					fprintf(stderr,
++					        _("%s: chroot directory %s does not exist\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				if ( chroot(newroot) != 0 ) {
++					fprintf(stderr,
++					        _("%s: unable to chroot to directory %s\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				break;
++			default:
++				usage ();
++			}
++		}
++	}
++}
++
+ int main (int argc, char **argv)
+ {
+ 	const struct passwd *pw;
+@@ -122,9 +198,6 @@
+ 	const struct spwd *sp;
+ 	struct spwd spent;
+ 
+-	if (1 != argc) {
+-		(void) fputs (_("Usage: pwconv\n"), stderr);
+-	}
+ 	Prog = Basename (argv[0]);
+ 
+ 	(void) setlocale (LC_ALL, "");
+@@ -133,6 +206,8 @@
+ 
+ 	OPENLOG ("pwconv");
+ 
++	process_flags (argc, argv);
++
+ 	if (pw_lock () == 0) {
+ 		fprintf (stderr,
+ 		         _("%s: cannot lock %s; try again later.\n"),
+diff -urN shadow-4.1.4.3.orig//src/pwunconv.c shadow-4.1.4.3//src/pwunconv.c
+--- shadow-4.1.4.3.orig//src/pwunconv.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/pwunconv.c	2011-05-28 17:09:52.356013600 -0700
+@@ -35,6 +35,7 @@
+ #ident "$Id: pwunconv.c 2852 2009-04-30 21:44:35Z nekral-guest $"
+ 
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <pwd.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+@@ -46,15 +47,24 @@
+ #include "shadowio.h"
+ 
+ /*
++ * exit status values
++ */
++/*@-exitarg@*/
++#define E_USAGE		2	/* invalid command syntax */
++#define E_BAD_ARG	3	/* invalid argument to option */
++/*
+  * Global variables
+  */
+ char *Prog;
+ 
+ static bool spw_locked = false;
+ static bool pw_locked = false;
++static const char *newroot = "";
+ 
+ /* local function prototypes */
+ static void fail_exit (int status);
++static void usage (void);
++static void process_flags (int argc, char **argv);
+ 
+ static void fail_exit (int status)
+ {
+@@ -75,6 +85,76 @@
+ 	exit (status);
+ }
+ 
++/*
++ * usage - display usage message and exit
++ */
++static void usage (void)
++{
++	(void) fprintf (stderr,
++					_("Usage: pwunconv [options]\n"
++					  "\n"
++					  "Options:\n"),
++					Prog);
++	(void) fputs (_("  -h, --help                    display this help message and exit\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), stderr);
++	(void) fputs ("\n", stderr);
++	exit (E_USAGE);
++}
++
++/*
++ * process_flags - perform command line argument setting
++ *
++ * process_flags() interprets the command line arguments and sets
++ * the values that the user will be created with accordingly. The
++ * values are checked for sanity.
++ */
++static void process_flags (int argc, char **argv)
++{
++	{
++		/*
++		 * Parse the command line options.
++		 */
++		int c;
++		static struct option long_options[] = {
++			{"help", no_argument, NULL, 'h'},
++			{"root", required_argument, NULL, 'R'},
++			{NULL, 0, NULL, '\0'}
++		};
++		while ((c = getopt_long (argc, argv,
++								 "R:",
++								 long_options, NULL)) != -1) {
++			switch (c) {
++			case 'h':
++				usage ();
++				break;
++			case 'R':
++				if ('/' != optarg[0]) {
++					fprintf (stderr,
++					         _("%s: invalid chroot path '%s'\n"),
++					         Prog, optarg);
++					exit (E_BAD_ARG);
++				}
++				newroot = optarg;
++
++				if (access (newroot, F_OK) != 0) {
++					fprintf(stderr,
++					        _("%s: chroot directory %s does not exist\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				if ( chroot(newroot) != 0 ) {
++					fprintf(stderr,
++					        _("%s: unable to chroot to directory %s\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				break;
++			default:
++				usage ();
++			}
++		}
++	}
++}
+ 
+ int main (int argc, char **argv)
+ {
+@@ -93,6 +173,8 @@
+ 
+ 	OPENLOG ("pwunconv");
+ 
++	process_flags (argc, argv);
++
+ 	if (!spw_file_present ()) {
+ 		/* shadow not installed, do nothing */
+ 		exit (0);
+diff -urN shadow-4.1.4.3.orig//src/useradd.c shadow-4.1.4.3//src/useradd.c
+--- shadow-4.1.4.3.orig//src/useradd.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/useradd.c	2011-05-28 17:10:25.446909971 -0700
+@@ -112,6 +112,7 @@
+ #ifdef WITH_SELINUX
+ static const char *user_selinux = "";
+ #endif
++static const char *newroot = "";
+ 
+ static long user_expire = -1;
+ static bool is_shadow_pwd;
+@@ -189,6 +190,7 @@
+ static void new_spent (struct spwd *);
+ static void grp_update (void);
+ 
++static void process_root_flag (int argc, char **argv);
+ static void process_flags (int argc, char **argv);
+ static void close_files (void);
+ static void open_files (void);
+@@ -711,6 +713,7 @@
+ 	(void) fputs (_("  -o, --non-unique              allow to create users with duplicate\n"
+ 	                "                                (non-unique) UID\n"), stderr);
+ 	(void) fputs (_("  -p, --password PASSWORD       encrypted password of the new account\n"), stderr);
++	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), stderr);
+ 	(void) fputs (_("  -r, --system                  create a system account\n"), stderr);
+ 	(void) fputs (_("  -s, --shell SHELL             login shell of the new account\n"), stderr);
+ 	(void) fputs (_("  -u, --uid UID                 user ID of the new account\n"), stderr);
+@@ -943,6 +946,59 @@
+ }
+ 
+ /*
++ * process_root_flag - chroot if given the --root option
++ *
++ * We do this outside of process_flags() because
++ * the is_shadow_pwd boolean needs to be set before
++ * process_flags(), and if we do need to chroot() we
++ * must do so before is_shadow_pwd gets set.
++ */
++static void process_root_flag (int argc, char **argv)
++{
++	/*
++	 * Parse the command line options.
++	 */
++	int c;
++	static struct option long_options[] = {
++		{"root", required_argument, NULL, 'R'},
++		{NULL, 0, NULL, '\0'}
++	};
++	while ((c = getopt_long (argc, argv,
++#ifdef WITH_SELINUX
++	                         "b:c:d:De:f:g:G:k:K:lmMNop:R:rs:u:UZ:",
++#else
++	                         "b:c:d:De:f:g:G:k:K:lmMNop:R:rs:u:U",
++#endif
++	                         long_options, NULL)) != -1) {
++		switch (c) {
++		case 'R':
++			if ('/' != optarg[0]) {
++				fprintf (stderr,
++				         _("%s: invalid chroot path '%s'\n"),
++				         Prog, optarg);
++				exit (E_BAD_ARG);
++			}
++			newroot = optarg;
++
++			if (access (newroot, F_OK) != 0) {
++				fprintf(stderr,
++				        _("%s: chroot directory %s does not exist\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			if ( chroot(newroot) != 0 ) {
++				fprintf(stderr,
++				        _("%s: unable to chroot to directory %s\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			break;
++		/* no-op on everything else - they will be hanled by process_flags() */
++		}
++	}
++}
++
++/*
+  * process_flags - perform command line argument setting
+  *
+  *	process_flags() interprets the command line arguments and sets
+@@ -978,6 +1034,7 @@
+ 			{"no-user-group", no_argument, NULL, 'N'},
+ 			{"non-unique", no_argument, NULL, 'o'},
+ 			{"password", required_argument, NULL, 'p'},
++			{"root", required_argument, NULL, 'R'},
+ 			{"system", no_argument, NULL, 'r'},
+ 			{"shell", required_argument, NULL, 's'},
+ #ifdef WITH_SELINUX
+@@ -989,9 +1046,9 @@
+ 		};
+ 		while ((c = getopt_long (argc, argv,
+ #ifdef WITH_SELINUX
+-		                         "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:UZ:",
++		                         "b:c:d:De:f:g:G:k:K:lmMNop:R:rs:u:UZ:",
+ #else
+-		                         "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:U",
++		                         "b:c:d:De:f:g:G:k:K:lmMNop:R:rs:u:U",
+ #endif
+ 		                         long_options, NULL)) != -1) {
+ 			switch (c) {
+@@ -1156,6 +1213,9 @@
+ 				}
+ 				user_pass = optarg;
+ 				break;
++			case 'R':
++				/* no-op since we handled this in process_root_flag() earlier */
++				break;
+ 			case 'r':
+ 				rflg = true;
+ 				break;
+@@ -1748,8 +1808,16 @@
+ #ifdef WITH_SELINUX
+ 		selinux_file_context (user_home);
+ #endif
+-		/* XXX - create missing parent directories.  --marekm */
+-		if (mkdir (user_home, 0) != 0) {
++		/* shell out to invoke mkdir -p 
++		 * creating a subshell under pseudo's chroot() breaks the jail
++		 * (bug in pseudo), so make sure we include the full host path
++		 * to the sysroot when the --root option is in use.
++		 */
++		int sysroot_path_len = strlen(newroot);
++		int home_path_len = strlen(user_home);
++		char cmd[sysroot_path_len + home_path_len + 10];
++		sprintf(cmd, "mkdir -p %s%s", newroot, user_home);
++		if (system (cmd) != 0) {
+ 			fprintf (stderr,
+ 			         _("%s: cannot create directory %s\n"),
+ 			         Prog, user_home);
+@@ -1861,6 +1929,7 @@
+ 	 */
+ 	user_groups[0] = (char *) 0;
+ 
++	process_root_flag (argc, argv);
+ 
+ 	is_shadow_pwd = spw_file_present ();
+ #ifdef SHADOWGRP
+diff -urN shadow-4.1.4.3.orig//src/userdel.c shadow-4.1.4.3//src/userdel.c
+--- shadow-4.1.4.3.orig//src/userdel.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/userdel.c	2011-05-28 17:09:52.356013600 -0700
+@@ -79,6 +79,7 @@
+ static char *user_name;
+ static uid_t user_id;
+ static char *user_home;
++static const char *newroot = "";
+ 
+ static bool fflg = false;
+ static bool rflg = false;
+@@ -119,6 +120,7 @@
+ 	         "  -f, --force                   force removal of files,\n"
+ 	         "                                even if not owned by user\n"
+ 	         "  -h, --help                    display this help message and exit\n"
++	         "  -R, --root CHROOT_DIR         directory to chroot into\n"
+ 	         "  -r, --remove                  remove home directory and mail spool\n"
+ 	         "\n"), stderr);
+ 	exit (E_USAGE);
+@@ -768,12 +770,34 @@
+ 			{"remove", no_argument, NULL, 'r'},
+ 			{NULL, 0, NULL, '\0'}
+ 		};
+-		while ((c = getopt_long (argc, argv, "fhr",
++		while ((c = getopt_long (argc, argv, "fhR:r",
+ 		                         long_options, NULL)) != -1) {
+ 			switch (c) {
+ 			case 'f':	/* force remove even if not owned by user */
+ 				fflg = true;
+ 				break;
++			case 'R':
++				if ('/' != optarg[0]) {
++					fprintf (stderr,
++					         _("%s: invalid chroot path '%s'\n"),
++					         Prog, optarg);
++					exit (E_BAD_ARG);
++				}
++				newroot = optarg;
++
++				if (access (newroot, F_OK) != 0) {
++					fprintf(stderr,
++					        _("%s: chroot directory %s does not exist\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				if ( chroot(newroot) != 0 ) {
++					fprintf(stderr,
++					        _("%s: unable to chroot to directory %s\n"),
++					        Prog, newroot);
++					exit (E_BAD_ARG);
++				}
++				break;
+ 			case 'r':	/* remove home dir and mailbox */
+ 				rflg = true;
+ 				break;
+diff -urN shadow-4.1.4.3.orig//src/usermod.c shadow-4.1.4.3//src/usermod.c
+--- shadow-4.1.4.3.orig//src/usermod.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3//src/usermod.c	2011-05-28 17:09:52.356013600 -0700
+@@ -110,6 +110,7 @@
+ static long user_newinactive;
+ static long sys_ngroups;
+ static char **user_groups;	/* NULL-terminated list */
++static const char *newroot = "";
+ 
+ static bool
+     aflg = false,		/* append to existing secondary group set */
+@@ -164,6 +165,7 @@
+ #endif
+ static void grp_update (void);
+ 
++static void process_root_flag (int, char **);
+ static void process_flags (int, char **);
+ static void close_files (void);
+ static void open_files (void);
+@@ -323,6 +325,7 @@
+ 	         "                                new location (use only with -d)\n"
+ 	         "  -o, --non-unique              allow using duplicate (non-unique) UID\n"
+ 	         "  -p, --password PASSWORD       use encrypted password for the new password\n"
++	         "  -R  --root CHROOT_DIR         directory to chroot into\n"
+ 	         "  -s, --shell SHELL             new login shell for the user account\n"
+ 	         "  -u, --uid UID                 new UID for the user account\n"
+ 	         "  -U, --unlock                  unlock the user account\n"
+@@ -802,6 +805,60 @@
+ }
+ 
+ /*
++ * process_root_flag - chroot if given the --root option
++ *
++ * We do this outside of process_flags() because
++ * the is_shadow_pwd boolean needs to be set before
++ * process_flags(), and if we do need to chroot() we
++ * must do so before is_shadow_pwd gets set.
++ */
++static void process_root_flag (int argc, char **argv)
++{
++	/*
++	 * Parse the command line options.
++	 */
++	int c;
++	static struct option long_options[] = {
++		{"root", required_argument, NULL, 'R'},
++		{NULL, 0, NULL, '\0'}
++	};
++	while ((c = getopt_long (argc, argv,
++#ifdef WITH_SELINUX
++                             "ac:d:e:f:g:G:hl:Lmop:R:s:u:UZ:",
++#else
++	                         "ac:d:e:f:g:G:hl:Lmop:R:s:u:U",
++#endif
++	                         long_options, NULL)) != -1) {
++		switch (c) {
++		case 'R':
++			if (    (!VALID (optarg) ) 
++				|| (   ('/' != optarg[0]) ) ) {
++				fprintf (stderr,
++				         _("%s: invalid chroot path '%s'\n"),
++				         Prog, optarg);
++				exit (E_BAD_ARG);
++			}
++			newroot = optarg;
++
++			if (access (newroot, F_OK) != 0) {
++				fprintf(stderr,
++				        _("%s: chroot directory %s does not exist\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			if ( chroot(newroot) != 0 ) {
++				fprintf(stderr,
++				        _("%s: unable to chroot to directory %s\n"),
++				        Prog, newroot);
++				exit (E_BAD_ARG);
++			}
++			break;
++		/* no-op on everything else - they will be hanled by process_flags() */
++		}
++	}
++}
++
++/*
+  * process_flags - perform command line argument setting
+  *
+  *	process_flags() interprets the command line arguments and sets the
+@@ -895,6 +952,7 @@
+ 			{"move-home", no_argument, NULL, 'm'},
+ 			{"non-unique", no_argument, NULL, 'o'},
+ 			{"password", required_argument, NULL, 'p'},
++			{"root", required_argument, NULL, 'R'},
+ #ifdef WITH_SELINUX
+ 			{"selinux-user", required_argument, NULL, 'Z'},
+ #endif
+@@ -905,9 +963,9 @@
+ 		};
+ 		while ((c = getopt_long (argc, argv,
+ #ifdef WITH_SELINUX
+-			                 "ac:d:e:f:g:G:hl:Lmop:s:u:UZ:",
++			                 "ac:d:e:f:g:G:hl:Lmop:R:s:u:UZ:",
+ #else
+-			                 "ac:d:e:f:g:G:hl:Lmop:s:u:U",
++			                 "ac:d:e:f:g:G:hl:Lmop:R:s:u:U",
+ #endif
+ 			                 long_options, NULL)) != -1) {
+ 			switch (c) {
+@@ -999,6 +1057,9 @@
+ 				user_pass = optarg;
+ 				pflg = true;
+ 				break;
++			case 'R':
++				/* no-op since we handled this in process_root_flag() earlier */
++				break;
+ 			case 's':
+ 				if (!VALID (optarg)) {
+ 					fprintf (stderr,
+@@ -1715,6 +1776,8 @@
+ 
+ 	OPENLOG ("usermod");
+ 
++	process_root_flag (argc, argv);
++
+ 	is_shadow_pwd = spw_file_present ();
+ #ifdef SHADOWGRP
+ 	is_shadow_grp = sgr_file_present ();
diff --git a/meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb
new file mode 100644
index 0000000..2f93e05
--- /dev/null
+++ b/meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb
@@ -0,0 +1,66 @@
+SUMMARY = "Tools to change and administer password and group data"
+DESCRIPTION = "Tools to change and administer password and group data"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base utils"
+PRIORITY = "optional"
+LICENSE = "BSD | Artistic"
+LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
+                    file://src/passwd.c;firstline=8;endline=30;md5=2899a045e90511d0e043b85a7db7e2fe"
+
+PR = "r0"
+
+SRC_URI = "ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-${PV}.tar.bz2 \
+           file://shadow.automake-1.11.patch \
+           file://shadow-4.1.3-dots-in-usernames.patch \
+           file://shadow-4.1.4.2-env-reset-keep-locale.patch \
+           file://add_root_cmd_options.patch"
+
+SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
+SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778" 
+
+inherit autotools gettext native
+
+EXTRA_OECONF += "--without-audit \
+                 --without-libcrack \
+                 --without-libpam \
+                 --without-selinux"
+
+do_install_append() {
+	# Enable CREATE_HOME by default.
+	sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
+
+	# As we are on an embedded system, ensure the users mailbox is in
+	# ~/ not /var/spool/mail by default, as who knows where or how big
+	# /var is. The system MDA will set this later anyway.
+	sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
+	sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
+
+	# Disable checking emails.
+	sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
+
+	# Now we don't have a mail system. Disable mail creation for now.
+	sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
+	sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
+
+	install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} 
+	for i in passwd chfn newgrp chsh ; do
+		mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}
+	done
+
+	mv ${D}${sbindir}/chpasswd ${D}${sbindir}/chpasswd.${PN}
+}
+
+pkg_postinst_${PN} () {
+	update-alternatives --install ${bindir}/passwd passwd passwd.${PN} 200
+	update-alternatives --install ${sbindir}/chpasswd chpasswd chpasswd.${PN} 200
+	update-alternatives --install ${bindir}/chfn chfn chfn.${PN} 200
+	update-alternatives --install ${bindir}/newgrp newgrp newgrp.${PN} 200
+	update-alternatives --install ${bindir}/chsh chsh chsh.${PN} 200
+}
+
+pkg_prerm_${PN} () {
+	for i in passwd chpasswd chfn newgrp chsh ; do
+		update-alternatives --remove $i $i.${PN}
+	done
+}
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 15/20] base-passwd: populate the target sysroot with passwd/group/login.defs
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (13 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 14/20] shadow: add a -native recipe with customized utilities Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 16/20] useradd.bbclass: new class for managing user/group permissions Saul Wold
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Scott Garman

From: Scott Garman <scott.a.garman@intel.com>

The passwd, group, and login.defs files in the target sysroot will
be used when recipes create custom user and group permissions in
their packages.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 .../base-passwd/base-passwd-3.5.22/login.defs      |  386 ++++++++++++++++++++
 .../recipes-core/base-passwd/base-passwd_3.5.22.bb |   27 ++-
 2 files changed, 411 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/base-passwd/base-passwd-3.5.22/login.defs

diff --git a/meta/recipes-core/base-passwd/base-passwd-3.5.22/login.defs b/meta/recipes-core/base-passwd/base-passwd-3.5.22/login.defs
new file mode 100644
index 0000000..1d392ac
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd-3.5.22/login.defs
@@ -0,0 +1,386 @@
+#
+# /etc/login.defs - Configuration control definitions for the shadow package.
+#
+#	$Id: login.defs 3038 2009-07-23 20:41:35Z nekral-guest $
+#
+
+#
+# Delay in seconds before being allowed another attempt after a login failure
+# Note: When PAM is used, some modules may enfore a minimal delay (e.g.
+#       pam_unix enforces a 2s delay)
+#
+FAIL_DELAY		3
+
+#
+# Enable logging and display of /var/log/faillog login failure info.
+#
+FAILLOG_ENAB		yes
+
+#
+# Enable display of unknown usernames when login failures are recorded.
+#
+LOG_UNKFAIL_ENAB	no
+
+#
+# Enable logging of successful logins
+#
+LOG_OK_LOGINS		no
+
+#
+# Enable logging and display of /var/log/lastlog login time info.
+#
+LASTLOG_ENAB		yes
+
+#
+# Enable checking and display of mailbox status upon login.
+#
+# Disable if the shell startup files already check for mail
+# ("mailx -e" or equivalent).
+#
+#MAIL_CHECK_ENAB		yes
+
+#
+# Enable additional checks upon password changes.
+#
+OBSCURE_CHECKS_ENAB	yes
+
+#
+# Enable checking of time restrictions specified in /etc/porttime.
+#
+PORTTIME_CHECKS_ENAB	yes
+
+#
+# Enable setting of ulimit, umask, and niceness from passwd gecos field.
+#
+QUOTAS_ENAB		yes
+
+#
+# Enable "syslog" logging of su activity - in addition to sulog file logging.
+# SYSLOG_SG_ENAB does the same for newgrp and sg.
+#
+SYSLOG_SU_ENAB		yes
+SYSLOG_SG_ENAB		yes
+
+#
+# If defined, either full pathname of a file containing device names or
+# a ":" delimited list of device names.  Root logins will be allowed only
+# upon these devices.
+#
+CONSOLE		/etc/securetty
+#CONSOLE	console:tty01:tty02:tty03:tty04
+
+#
+# If defined, all su activity is logged to this file.
+#
+#SULOG_FILE	/var/log/sulog
+
+#
+# If defined, ":" delimited list of "message of the day" files to
+# be displayed upon login.
+#
+MOTD_FILE	/etc/motd
+#MOTD_FILE	/etc/motd:/usr/lib/news/news-motd
+
+#
+# If defined, this file will be output before each login prompt.
+#
+#ISSUE_FILE	/etc/issue
+
+#
+# If defined, file which maps tty line to TERM environment parameter.
+# Each line of the file is in a format something like "vt100  tty01".
+#
+#TTYTYPE_FILE	/etc/ttytype
+
+#
+# If defined, login failures will be logged here in a utmp format.
+# last, when invoked as lastb, will read /var/log/btmp, so...
+#
+FTMP_FILE	/var/log/btmp
+
+#
+# If defined, name of file whose presence which will inhibit non-root
+# logins.  The contents of this file should be a message indicating
+# why logins are inhibited.
+#
+NOLOGINS_FILE	/etc/nologin
+
+#
+# If defined, the command name to display when running "su -".  For
+# example, if this is defined as "su" then a "ps" will display the
+# command is "-su".  If not defined, then "ps" would display the
+# name of the shell actually being run, e.g. something like "-sh".
+#
+SU_NAME		su
+
+#
+# *REQUIRED*
+#   Directory where mailboxes reside, _or_ name of file, relative to the
+#   home directory.  If you _do_ define both, #MAIL_DIR takes precedence.
+#
+#MAIL_DIR	/var/spool/mail
+MAIL_FILE	.mail
+
+#
+# If defined, file which inhibits all the usual chatter during the login
+# sequence.  If a full pathname, then hushed mode will be enabled if the
+# user's name or shell are found in the file.  If not a full pathname, then
+# hushed mode will be enabled if the file exists in the user's home directory.
+#
+HUSHLOGIN_FILE	.hushlogin
+#HUSHLOGIN_FILE	/etc/hushlogins
+
+#
+# If defined, either a TZ environment parameter spec or the
+# fully-rooted pathname of a file containing such a spec.
+#
+#ENV_TZ		TZ=CST6CDT
+#ENV_TZ		/etc/tzname
+
+#
+# If defined, an HZ environment parameter spec.
+#
+# for Linux/x86
+ENV_HZ		HZ=100
+# For Linux/Alpha...
+#ENV_HZ		HZ=1024
+
+#
+# *REQUIRED*  The default PATH settings, for superuser and normal users.
+#
+# (they are minimal, add the rest in the shell startup files)
+ENV_SUPATH	PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ENV_PATH	PATH=/bin:/usr/bin
+
+#
+# Terminal permissions
+#
+#	TTYGROUP	Login tty will be assigned this group ownership.
+#	TTYPERM		Login tty will be set to this permission.
+#
+# If you have a "write" program which is "setgid" to a special group
+# which owns the terminals, define TTYGROUP to the group number and
+# TTYPERM to 0620.  Otherwise leave TTYGROUP commented out and assign
+# TTYPERM to either 622 or 600.
+#
+TTYGROUP	tty
+TTYPERM		0600
+
+#
+# Login configuration initializations:
+#
+#	ERASECHAR	Terminal ERASE character ('\010' = backspace).
+#	KILLCHAR	Terminal KILL character ('\025' = CTRL/U).
+#	ULIMIT		Default "ulimit" value.
+#
+# The ERASECHAR and KILLCHAR are used only on System V machines.
+# The ULIMIT is used only if the system supports it.
+# (now it works with setrlimit too; ulimit is in 512-byte units)
+#
+# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
+#
+ERASECHAR	0177
+KILLCHAR	025
+#ULIMIT		2097152
+
+# Default initial "umask" value for non-PAM enabled systems.
+# UMASK is also used by useradd and newusers to set the mode of new home
+# directories.
+# 022 is the default value, but 027, or even 077, could be considered
+# better for privacy. There is no One True Answer here: each sysadmin
+# must make up her mind.
+UMASK		022
+
+#
+# Password aging controls:
+#
+#	PASS_MAX_DAYS	Maximum number of days a password may be used.
+#	PASS_MIN_DAYS	Minimum number of days allowed between password changes.
+#	PASS_MIN_LEN	Minimum acceptable password length.
+#	PASS_WARN_AGE	Number of days warning given before a password expires.
+#
+PASS_MAX_DAYS	99999
+PASS_MIN_DAYS	0
+PASS_MIN_LEN	5
+PASS_WARN_AGE	7
+
+#
+# If "yes", the user must be listed as a member of the first gid 0 group
+# in /etc/group (called "root" on most Linux systems) to be able to "su"
+# to uid 0 accounts.  If the group doesn't exist or is empty, no one
+# will be able to "su" to uid 0.
+#
+SU_WHEEL_ONLY	no
+
+#
+# If compiled with cracklib support, where are the dictionaries
+#
+CRACKLIB_DICTPATH	/var/cache/cracklib/cracklib_dict
+
+#
+# Min/max values for automatic uid selection in useradd
+#
+UID_MIN			 1000
+UID_MAX			60000
+# System accounts
+SYS_UID_MIN		  101
+SYS_UID_MAX		  999
+
+#
+# Min/max values for automatic gid selection in groupadd
+#
+GID_MIN			 1000
+GID_MAX			60000
+# System accounts
+SYS_GID_MIN		  101
+SYS_GID_MAX		  999
+
+#
+# Max number of login retries if password is bad
+#
+LOGIN_RETRIES		5
+
+#
+# Max time in seconds for login
+#
+LOGIN_TIMEOUT		60
+
+#
+# Maximum number of attempts to change password if rejected (too easy)
+#
+PASS_CHANGE_TRIES	5
+
+#
+# Warn about weak passwords (but still allow them) if you are root.
+#
+PASS_ALWAYS_WARN	yes
+
+#
+# Number of significant characters in the password for crypt().
+# Default is 8, don't change unless your crypt() is better.
+# Ignored if MD5_CRYPT_ENAB set to "yes".
+#
+#PASS_MAX_LEN		8
+
+#
+# Require password before chfn/chsh can make any changes.
+#
+CHFN_AUTH		yes
+
+#
+# Which fields may be changed by regular users using chfn - use
+# any combination of letters "frwh" (full name, room number, work
+# phone, home phone).  If not defined, no changes are allowed.
+# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
+# 
+CHFN_RESTRICT		rwh
+
+#
+# Password prompt (%s will be replaced by user name).
+#
+# XXX - it doesn't work correctly yet, for now leave it commented out
+# to use the default which is just "Password: ".
+#LOGIN_STRING		"%s's Password: "
+
+#
+# Only works if compiled with MD5_CRYPT defined:
+# If set to "yes", new passwords will be encrypted using the MD5-based
+# algorithm compatible with the one used by recent releases of FreeBSD.
+# It supports passwords of unlimited length and longer salt strings.
+# Set to "no" if you need to copy encrypted passwords to other systems
+# which don't understand the new algorithm.  Default is "no".
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+# This variable is deprecated. You should use ENCRYPT_METHOD.
+#
+#MD5_CRYPT_ENAB	no
+
+#
+# Only works if compiled with ENCRYPTMETHOD_SELECT defined:
+# If set to MD5 , MD5-based algorithm will be used for encrypting password
+# If set to SHA256, SHA256-based algorithm will be used for encrypting password
+# If set to SHA512, SHA512-based algorithm will be used for encrypting password
+# If set to DES, DES-based algorithm will be used for encrypting password (default)
+# Overrides the MD5_CRYPT_ENAB option
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+#ENCRYPT_METHOD DES
+
+#
+# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512.
+#
+# Define the number of SHA rounds.
+# With a lot of rounds, it is more difficult to brute forcing the password.
+# But note also that it more CPU resources will be needed to authenticate
+# users.
+#
+# If not specified, the libc will choose the default number of rounds (5000).
+# The values must be inside the 1000-999999999 range.
+# If only one of the MIN or MAX values is set, then this value will be used.
+# If MIN > MAX, the highest value will be used.
+#
+# SHA_CRYPT_MIN_ROUNDS 5000
+# SHA_CRYPT_MAX_ROUNDS 5000
+
+#
+# List of groups to add to the user's supplementary group set
+# when logging in on the console (as determined by the CONSOLE
+# setting).  Default is none.
+#
+# Use with caution - it is possible for users to gain permanent
+# access to these groups, even when not logged in on the console.
+# How to do it is left as an exercise for the reader...
+#
+#CONSOLE_GROUPS		floppy:audio:cdrom
+
+#
+# Should login be allowed if we can't cd to the home directory?
+# Default in no.
+#
+DEFAULT_HOME	yes
+
+#
+# If this file exists and is readable, login environment will be
+# read from it.  Every line should be in the form name=value.
+#
+ENVIRON_FILE	/etc/environment
+
+#
+# If defined, this command is run when removing a user.
+# It should remove any at/cron/print jobs etc. owned by
+# the user to be removed (passed as the first argument).
+#
+#USERDEL_CMD	/usr/sbin/userdel_local
+
+#
+# Enable setting of the umask group bits to be the same as owner bits
+# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
+# the same as gid, and username is the same as the primary group name.
+#
+# This also enables userdel to remove user groups if no members exist.
+#
+USERGROUPS_ENAB yes
+
+#
+# If set to a non-nul number, the shadow utilities will make sure that
+# groups never have more than this number of users on one line.
+# This permit to support split groups (groups split into multiple lines,
+# with the same group ID, to avoid limitation of the line length in the
+# group file).
+#
+# 0 is the default value and disables this feature.
+#
+#MAX_MEMBERS_PER_GROUP	0
+
+#
+# If useradd should create home directories for users by default (non
+# system users only)
+# This option is overridden with the -M or -m flags on the useradd command
+# line.
+#
+CREATE_HOME     yes
+
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
index 6f768ca..3315c68 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.22.bb
@@ -1,13 +1,14 @@
 SUMMARY = "Base system master password/group files."
 DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group).  The update-passwd tool is also provided to keep the system databases synchronized with these master files."
 SECTION = "base"
-PR = "r1"
+PR = "r2"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
            file://nobash.patch \
-           file://root-home.patch"
+           file://root-home.patch \
+           file://login.defs"
 
 SRC_URI[md5sum] = "47f22ab6b572d0133409ff6ad1fab402"
 SRC_URI[sha256sum] = "d34acb35a9f9f221e7e4f642b9ef4b22083dd77bb2fc7216756f445316d842fc"
@@ -16,6 +17,8 @@ S = "${WORKDIR}/base-passwd"
 
 inherit autotools
 
+SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
+
 do_install () {
 	install -d -m 755 ${D}${sbindir}
 	install -p -m 755 update-passwd ${D}${sbindir}/
@@ -27,6 +30,7 @@ do_install () {
 	install -d -m 755 ${D}${datadir}/base-passwd
 	install -p -m 644 passwd.master ${D}${datadir}/base-passwd/
 	install -p -m 644 group.master ${D}${datadir}/base-passwd/
+	install -p -m 644 ${S}/../login.defs ${D}${datadir}/base-passwd/login.defs
 
 	install -d -m 755 ${D}${docdir}/${PN}
 	install -p -m 644 debian/changelog ${D}${docdir}/${PN}/
@@ -45,5 +49,24 @@ pkg_postinst_${PN} () {
 	if [ ! -e $D${sysconfdir}/group ] ; then
 		cp $D${datadir}/base-passwd/group.master $D${sysconfdir}/group
 	fi
+
+	if [ ! -e $D{sysconfdir}/login.defs ] ; then
+		cp $D${datadir}/base-passwd/login.defs $D${sysconfdir}/login.defs
+	fi
 	exit 0
 }
+
+base_passwd_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		# Staging does not copy ${sysconfdir} files into the
+		# target sysroot, so we need to do so manually. We
+		# put these files in the target sysroot so they can
+		# be used by recipes which use custom user/group
+		# permissions.
+		install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
+		install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd
+		install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group
+		install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/login.defs ${STAGING_DIR_TARGET}/${sysconfdir}/login.defs
+	fi
+}
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 16/20] useradd.bbclass: new class for managing user/group permissions
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (14 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 15/20] base-passwd: populate the target sysroot with passwd/group/login.defs Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 17/20] useradd-example: example recipe for using inherit useradd Saul Wold
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Scott Garman

From: Scott Garman <scott.a.garman@intel.com>

This class is to be used by recipes that need to set up specific
user/group accounts and set custom file/directory permissions.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 meta/classes/useradd.bbclass |  163 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 163 insertions(+), 0 deletions(-)
 create mode 100644 meta/classes/useradd.bbclass

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
new file mode 100644
index 0000000..3f07e5e
--- /dev/null
+++ b/meta/classes/useradd.bbclass
@@ -0,0 +1,163 @@
+USERADDPN ?= "${PN}"
+
+# base-passwd-cross provides the default passwd and group files in the
+# target sysroot, and shadow-native provides the utilities needed to
+# add and modify user and group accounts
+DEPENDS_append = " base-passwd shadow-native"
+RDEPENDS_${USERADDPN}_append = " base-passwd shadow"
+
+PSEUDO="${STAGING_DIR_NATIVE}/usr/bin/pseudo"
+export PSEUDO
+PSEUDO_LOCALSTATEDIR="${STAGING_DIR_TARGET}/var/pseudo"
+export PSEUDO_LOCALSTATEDIR
+PSEUDO_PASSWD = "${STAGING_DIR_TARGET}"
+export PSEUDO_PASSWD
+
+useradd_preinst () {
+OPT=""
+SYSROOT=""
+
+if test "x$D" != "x"; then
+	# Installing into a sysroot
+	SYSROOT="${STAGING_DIR_TARGET}"
+	OPT="--root ${STAGING_DIR_TARGET}"
+
+	# Add groups and users defined for all recipe packages
+	GROUPADD_PARAM="${@get_all_cmd_params(d, 'group')}"
+	USERADD_PARAM="${@get_all_cmd_params(d, 'user')}"
+else
+	# Installing onto a target
+	PSEUDO=""
+
+	# Add groups and users defined only for this package
+	GROUPADD_PARAM="${GROUPADD_PARAM}"
+	USERADD_PARAM="${USERADD_PARAM}"
+fi
+
+# Perform group additions first, since user additions may depend
+# on these groups existing
+if test "x$GROUPADD_PARAM" != "x"; then
+	echo "Running groupadd commands..."
+	# Invoke multiple instances of groupadd for parameter lists
+	# separated by ';'
+	opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1`
+	remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-`
+	while test "x$opts" != "x"; do
+		eval $PSEUDO groupadd -f $OPT $opts
+
+		if test "x$opts" = "x$remaining"; then
+			break
+		fi
+		opts=`echo "$remaining" | cut -d ';' -f 1`
+		remaining=`echo "$remaining" | cut -d ';' -f 2-`
+	done
+fi 
+
+if test "x$USERADD_PARAM" != "x"; then
+	echo "Running useradd commands..."
+	# Invoke multiple instances of useradd for parameter lists
+	# separated by ';'
+	opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1`
+	remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-`
+	while test "x$opts" != "x"; do
+		# useradd does not have a -f option, so we have to check if the
+		# username already exists manually
+		username=`echo "$opts" | awk '{ print $NF }'`
+		user_exists=`grep "^$username:" $SYSROOT/etc/passwd || true`
+		if test "x$user_exists" = "x"; then
+			eval $PSEUDO useradd $OPT $opts
+		else
+			echo "Note: username $username already exists, not re-creating it"
+		fi
+
+		if test "x$opts" = "x$remaining"; then
+			break
+		fi
+		opts=`echo "$remaining" | cut -d ';' -f 1`
+		remaining=`echo "$remaining" | cut -d ';' -f 2-`
+	done
+fi
+}
+
+useradd_sysroot () {
+	# Explicitly set $D since it isn't set to anything
+	# before do_install
+	D=${D}
+	useradd_preinst
+}
+
+useradd_sysroot_sstate () {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		useradd_sysroot
+	fi
+}
+
+do_install[prefuncs] += "useradd_sysroot"
+SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
+
+# Recipe parse-time sanity checks
+def update_useradd_after_parse(d):
+	if bb.data.getVar('USERADD_PACKAGES', d) == None:
+		if bb.data.getVar('USERADD_PARAM', d) == None and bb.data.getVar('GROUPADD_PARAM', d) == None:
+			raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM" % bb.data.getVar('FILE', d)
+
+python __anonymous() {
+	update_useradd_after_parse(d)
+}
+
+# Return a single [GROUP|USER]ADD_PARAM formatted string which includes the
+# [group|user]add parameters for all packages in this recipe
+def get_all_cmd_params(d, cmd_type):
+	import string
+	
+	localdata = bb.data.createCopy(d)
+	param_type = cmd_type.upper() + "ADD_PARAM_%s"
+	params = []
+
+	pkgs = bb.data.getVar('USERADD_PACKAGES', d, 1)
+	if pkgs == None:
+		pkgs = bb.data.getVar('USERADDPN', d, 1)
+		packages = (bb.data.getVar('PACKAGES', d, 1) or "").split()
+		if not pkgs in packages and packages != []:
+			pkgs = packages[0]
+
+	for pkg in pkgs.split():
+		param = bb.data.getVar(param_type % pkg, localdata, 1)
+		params.append(param)
+
+	return string.join(params, "; ")
+
+# Adds the preinst script into generated packages
+fakeroot python populate_packages_prepend () {
+	def update_useradd_package(pkg):
+		bb.debug(1, 'adding user/group calls to preinst for %s' % pkg)
+		localdata = bb.data.createCopy(d)
+		overrides = bb.data.getVar("OVERRIDES", localdata, 1)
+		bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata)
+		bb.data.update_data(localdata)
+
+		"""
+		useradd preinst is appended here because pkg_preinst may be
+		required to execute on the target. Not doing so may cause
+		useradd preinst to be invoked twice, causing unwanted warnings.
+		"""
+		preinst = bb.data.getVar('pkg_preinst', localdata, 1)
+		if not preinst:
+			preinst = '#!/bin/sh\n'
+		preinst += bb.data.getVar('useradd_preinst', localdata, 1)
+		bb.data.setVar('pkg_preinst_%s' % pkg, preinst, d)
+
+	# We add the user/group calls to all packages to allow any package
+	# to contain files owned by the users/groups defined in the recipe.
+	# The user/group addition code is careful not to create duplicate
+	# entries, so this is safe.
+	pkgs = bb.data.getVar('USERADD_PACKAGES', d, 1)
+	if pkgs == None:
+		pkgs = bb.data.getVar('USERADDPN', d, 1)
+		packages = (bb.data.getVar('PACKAGES', d, 1) or "").split()
+		if not pkgs in packages and packages != []:
+			pkgs = packages[0]
+	for pkg in pkgs.split():
+		update_useradd_package(pkg)
+}
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 17/20] useradd-example: example recipe for using inherit useradd
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (15 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 16/20] useradd.bbclass: new class for managing user/group permissions Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 18/20] bitbake.conf: set PSEUDO_PASSWD within FAKEROOTENV Saul Wold
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Scott Garman

From: Scott Garman <scott.a.garman@intel.com>

An example recipe for demonstrating/documenting how user and
group manipulation is done with 'inherit useradd'

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 .../recipes-skeleton/useradd/useradd-example.bb    |   72 ++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file1
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file2
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file3
 create mode 100644 meta-skeleton/recipes-skeleton/useradd/useradd-example/file4

diff --git a/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb b/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
new file mode 100644
index 0000000..6c6edf0
--- /dev/null
+++ b/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
@@ -0,0 +1,72 @@
+SUMMARY = "Example recipe for using inherit useradd"
+DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
+SECTION = "examples"
+PR = "r0"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://file1 \
+           file://file2 \
+           file://file3 \
+           file://file4"
+
+S = "${WORKDIR}"
+
+PACKAGES =+ "${PN}-user3"
+
+inherit useradd
+
+# Specify which package(s) should include the user/group code.
+# Make sure that any packages which install files owned by custom
+# users/groups are included here. The code which adds users and
+# groups is idempotent.
+USERADD_PACKAGES = "${PN} ${PN}-user3"
+
+# You *must* set USERADD_PARAM and/or GROUPADD_PARAM when
+# you inherit useradd.
+
+# USERADD_PARAM specifies command line options to pass to the
+# useradd command. Multiple users can be created by separating
+# the commands with a semicolon. Here we'll create two users,
+# user1 and user2:
+USERADD_PARAM_${PN} = "-u 1200 -d /home/user1 -r -s /bin/bash user1; -u 1201 -d /home/user2 -r -s /bin/bash user2"
+
+# user3 will be managed in the useradd-example-user3 pacakge:
+USERADD_PARAM_${PN}-user3 = "-u 1202 -d /home/user3 -r -s /bin/bash user3"
+
+# GROUPADD_PARAM works the same way, which you set to the options
+# you'd normally pass to the groupadd command. This will create
+# groups group1 and group2:
+GROUPADD_PARAM_${PN} = "-g 880 group1; -g 890 group2"
+
+# Likewise, we'll manage group3 in the useradd-example-user3 package:
+GROUPADD_PARAM_${PN}-user3 = "-g 900 group3"
+
+do_install () {
+	install -d -m 755 ${D}/usr/share/user1
+	install -d -m 755 ${D}/usr/share/user2
+	install -d -m 755 ${D}/usr/share/user3
+
+	install -p -m 644 file1 ${D}/usr/share/user1/
+	install -p -m 644 file2 ${D}/usr/share/user1/
+
+	install -p -m 644 file2 ${D}/usr/share/user2/
+	install -p -m 644 file3 ${D}/usr/share/user2/
+
+	install -p -m 644 file3 ${D}/usr/share/user3/
+	install -p -m 644 file4 ${D}/usr/share/user3/
+
+	# The new users and groups are created before the do_install
+	# step, so you are now free to make use of them:
+	chown -R user1 ${D}/usr/share/user1
+	chown -R user2 ${D}/usr/share/user2
+	chown -R user3 ${D}/usr/share/user3
+
+	chgrp -R group1 ${D}/usr/share/user1
+	chgrp -R group2 ${D}/usr/share/user2
+	chgrp -R group3 ${D}/usr/share/user3
+}
+
+FILES_${PN} = "/usr/share/user1/* /usr/share/user2/*"
+FILES_${PN}-user3 = "/usr/share/user3/*"
diff --git a/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1 b/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1
new file mode 100644
index 0000000..e69de29
diff --git a/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2 b/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2
new file mode 100644
index 0000000..e69de29
diff --git a/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3 b/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3
new file mode 100644
index 0000000..e69de29
diff --git a/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4 b/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4
new file mode 100644
index 0000000..e69de29
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 18/20] bitbake.conf: set PSEUDO_PASSWD within FAKEROOTENV
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (16 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 17/20] useradd-example: example recipe for using inherit useradd Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 19/20] package_rpm.bbclass: make RPM use on-disk permissions Saul Wold
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Scott Garman

From: Scott Garman <scott.a.garman@intel.com>

PSEUDO_PASSWD needs to point to the directory where passwd and group
files are kept. This will allow pseudo to use those users and groups
to change file ownership.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 meta/conf/bitbake.conf |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 520b808..f03f732 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -555,7 +555,7 @@ SRC_URI = "file://${FILE}"
 
 # Use pseudo as the fakeroot implementation
 PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
-FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
+FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${STAGING_DIR_TARGET}/etc PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
 FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
 PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
 
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 19/20] package_rpm.bbclass: make RPM use on-disk permissions
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (17 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 18/20] bitbake.conf: set PSEUDO_PASSWD within FAKEROOTENV Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-06  6:44 ` [CONSOLIDATED PULL 20/20] tzcode: Update to 2011g Saul Wold
  2011-06-07 20:40 ` [CONSOLIDATED PULL 00/20] 05-June-2011 Richard Purdie
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: Scott Garman

From: Scott Garman <scott.a.garman@intel.com>

Instruct RPM to use the on-disk permissions, owners, groups,
and directory permissions, instead of defaulting to root:root

Code changes suggested by Mark Hatle.

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

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 3df66cc..d8e86c5 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -484,6 +484,7 @@ python write_specfile () {
 			else:
 				bb.note("Creating RPM package for %s" % splitname)
 				spec_files_top.append('%files')
+				spec_files_top.append('%defattr(-,-,-,-)')
 				if file_list:
 					spec_files_top.extend(file_list)
 				spec_files_top.append('')
@@ -570,6 +571,7 @@ python write_specfile () {
 		else:
 			bb.note("Creating RPM package for %s" % splitname)
 			spec_files_bottom.append('%%files -n %s' % splitname)
+			spec_files_bottom.append('%defattr(-,-,-,-)')
 			if file_list:
 				spec_files_bottom.extend(file_list)
 			spec_files_bottom.append('')
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [CONSOLIDATED PULL 20/20] tzcode: Update to 2011g
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (18 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 19/20] package_rpm.bbclass: make RPM use on-disk permissions Saul Wold
@ 2011-06-06  6:44 ` Saul Wold
  2011-06-07 20:40 ` [CONSOLIDATED PULL 00/20] 05-June-2011 Richard Purdie
  20 siblings, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06  6:44 UTC (permalink / raw)
  To: openembedded-core; +Cc: ilkka.tengvall

[YOCTO #1080]

Thanks to ilkka.tengvall@nsn.com

Cc: ilkka.tengvall@nsn.com
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 .../recipes-extended/tzcode/tzcode-native_2009r.bb |   19 ---------------
 .../recipes-extended/tzcode/tzcode-native_2011g.bb |   25 ++++++++++++++++++++
 2 files changed, 25 insertions(+), 19 deletions(-)
 delete mode 100644 meta/recipes-extended/tzcode/tzcode-native_2009r.bb
 create mode 100644 meta/recipes-extended/tzcode/tzcode-native_2011g.bb

diff --git a/meta/recipes-extended/tzcode/tzcode-native_2009r.bb b/meta/recipes-extended/tzcode/tzcode-native_2009r.bb
deleted file mode 100644
index 886687a..0000000
--- a/meta/recipes-extended/tzcode/tzcode-native_2009r.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-DESCRIPTION = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
-LICENSE = "PD"
-PR = "r0"
-
-LIC_FILES_CHKSUM = "file://${WORKDIR}/README;md5=3ae8198f82258417ce29066d3b034035"
-
-SRC_URI = "ftp://elsie.nci.nih.gov/pub/tzcode${PV}.tar.gz \
-           ftp://elsie.nci.nih.gov/pub/tzdata2009s.tar.gz"
-
-S = "${WORKDIR}"
-
-inherit native
-
-do_install () {
-        install -d ${D}${bindir}/
-        install -m 755 zic ${D}${bindir}/
-        install -m 755 zdump ${D}${bindir}/
-        install -m 755 tzselect ${D}${bindir}/
-}
diff --git a/meta/recipes-extended/tzcode/tzcode-native_2011g.bb b/meta/recipes-extended/tzcode/tzcode-native_2011g.bb
new file mode 100644
index 0000000..95ba7ef
--- /dev/null
+++ b/meta/recipes-extended/tzcode/tzcode-native_2011g.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+LICENSE = "PD"
+PR = "r0"
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/README;md5=3ae8198f82258417ce29066d3b034035"
+
+SRC_URI = "ftp://elsie.nci.nih.gov/pub/tzcode${PV}.tar.gz;name=tzcode \
+           ftp://elsie.nci.nih.gov/pub/tzdata2011g.tar.gz;name=tzdata"
+
+SRC_URI[tzcode.md5sum] = "ecb564279b28c5b184421c525d997d6c"
+SRC_URI[tzcode.sha256sum] = "636c735d8df1276cc8ab88bc31bb36a21f91ed34e26d181303ecd8fe48021bc2"
+SRC_URI[tzdata.md5sum] = "a068c27e7e426fdb12ab0c88506df20d"
+SRC_URI[tzdata.sha256sum] = "01a2a189eeda63baacc5e68e6c13afffc7edce182102fffc53acbf35e8703d3c"
+
+
+S = "${WORKDIR}"
+
+inherit native
+
+do_install () {
+        install -d ${D}${bindir}/
+        install -m 755 zic ${D}${bindir}/
+        install -m 755 zdump ${D}${bindir}/
+        install -m 755 tzselect ${D}${bindir}/
+}
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06  6:44 ` [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries Saul Wold
@ 2011-06-06  6:55   ` Phil Blundell
  2011-06-06 10:50     ` Richard Purdie
  2011-06-06 14:59     ` Saul Wold
  2011-06-06 17:03   ` Khem Raj
  1 sibling, 2 replies; 37+ messages in thread
From: Phil Blundell @ 2011-06-06  6:55 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
>  SECTION_${PN}-dev = "devel"
>  ALLOW_EMPTY_${PN}-dev = "1"
>  RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
>  
> +FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
> +SECTION_${PN}-staticlibs = "devel"
> +RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"

This should be ${EXTENDPKGV}, right?

p.





^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06  6:55   ` Phil Blundell
@ 2011-06-06 10:50     ` Richard Purdie
  2011-06-06 16:50       ` Saul Wold
  2011-06-06 14:59     ` Saul Wold
  1 sibling, 1 reply; 37+ messages in thread
From: Richard Purdie @ 2011-06-06 10:50 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, 2011-06-06 at 07:55 +0100, Phil Blundell wrote:
> On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
> >  SECTION_${PN}-dev = "devel"
> >  ALLOW_EMPTY_${PN}-dev = "1"
> >  RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
> >  
> > +FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
> > +SECTION_${PN}-staticlibs = "devel"
> > +RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"
> 
> This should be ${EXTENDPKGV}, right?

It should.

I'm also not 100% convinced I like "-staticlibs" vs "-staticdev" as it
doesn't feel consistent.

The user gets exposed to these at the package manager level and will
"xxx install xxx-staticX". The end result they'll get will be the
installation of everything they need for static development (i.e. the
-dev packages will get pulled in for the headers). This means they don't
just result in the static libs as there are dependencies there. From the
user perspective they are therefore packages for static development, not
just the static libraries...

Cheers,

Richard








^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06  6:55   ` Phil Blundell
  2011-06-06 10:50     ` Richard Purdie
@ 2011-06-06 14:59     ` Saul Wold
  1 sibling, 0 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06 14:59 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 06/05/2011 11:55 PM, Phil Blundell wrote:
> On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
>>   SECTION_${PN}-dev = "devel"
>>   ALLOW_EMPTY_${PN}-dev = "1"
>>   RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
>>
>> +FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
>> +SECTION_${PN}-staticlibs = "devel"
>> +RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"
>
> This should be ${EXTENDPKGV}, right?
>
Fixed and pushed an update to the sgw/stage.

Must have done a cut and paste on an older version.

There are still a number of recipes that name manual adjustment.

Sau!

> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 10:50     ` Richard Purdie
@ 2011-06-06 16:50       ` Saul Wold
  2011-06-06 17:31         ` Otavio Salvador
  2011-06-06 19:34         ` Koen Kooi
  0 siblings, 2 replies; 37+ messages in thread
From: Saul Wold @ 2011-06-06 16:50 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 06/06/2011 03:50 AM, Richard Purdie wrote:
> On Mon, 2011-06-06 at 07:55 +0100, Phil Blundell wrote:
>> On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
>>>   SECTION_${PN}-dev = "devel"
>>>   ALLOW_EMPTY_${PN}-dev = "1"
>>>   RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
>>>
>>> +FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
>>> +SECTION_${PN}-staticlibs = "devel"
>>> +RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"
>>
>> This should be ${EXTENDPKGV}, right?
>
> It should.
>
> I'm also not 100% convinced I like "-staticlibs" vs "-staticdev" as it
> doesn't feel consistent.
>
> The user gets exposed to these at the package manager level and will
> "xxx install xxx-staticX". The end result they'll get will be the
> installation of everything they need for static development (i.e. the
> -dev packages will get pulled in for the headers). This means they don't
> just result in the static libs as there are dependencies there. From the
> user perspective they are therefore packages for static development, not
> just the static libraries...
>
Richard,

I agree that they are for development and that by their nature they have 
a dependency on the Development packages, but they contain libs only, 
not all the development headers or tools, I think its therefore 
mis-leading to call the package staticdev since they do not contain all 
the development bits (they might depend on all the bits).  It's a subtle 
but important distinction.

As was pointed out earlier Fedora packages static libraries in a 
"-static" package, but this had other implications for OE due to -static 
already being in use (for busybox and mplayer), I am not sure that this 
is not a problem for OE-Core, I would need to investigate.  Meego also 
seems to use the Fedora standard with "-static".

I still believe that -staticlibs is a better identifier for these packages.

Sau!

> Cheers,
>
> Richard
>
>
>
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06  6:44 ` [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries Saul Wold
  2011-06-06  6:55   ` Phil Blundell
@ 2011-06-06 17:03   ` Khem Raj
  2011-06-06 19:01     ` Richard Purdie
  1 sibling, 1 reply; 37+ messages in thread
From: Khem Raj @ 2011-06-06 17:03 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, Jun 5, 2011 at 11:44 PM, Saul Wold <sgw@linux.intel.com> wrote:
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>  meta/conf/bitbake.conf |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index de94316..520b808 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -194,9 +194,13 @@ This package contains ELF symbols and related sources for debugging purposes."
>
>  SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files"
>  DESCRIPTION_${PN}-dev ?= "${DESCRIPTION}  \
> -This package contains symbolic links, static binaries, header files, and \
> +This package contains symbolic links, header files, and \
>  related items necessary for software development."
>
> +SUMMARY_${PN}-staticlibs ?= "${SUMMARY} - Development files (Static Libraries)"
> +DESCRIPTION_${PN}-staticlibs?= "${DESCRIPTION}  \
> +This package contains static libraries for software development."
> +
>  SUMMARY_${PN}-doc ?= "${SUMMARY} - Documentation files"
>  DESCRIPTION_${PN}-doc ?= "${DESCRIPTION}  \
>  This package contains documentation."
> @@ -248,13 +252,17 @@ FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
>  SECTION_${PN}-doc = "doc"
>
>  FILES_${PN}-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \
> -                ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig \
> +                ${libdir}/*.o ${libdir}/pkgconfig \
>                 ${datadir}/pkgconfig ${datadir}/aclocal \
>                 ${base_libdir}/*.a ${base_libdir}/*.o"
>  SECTION_${PN}-dev = "devel"
>  ALLOW_EMPTY_${PN}-dev = "1"
>  RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
>
> +FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
> +SECTION_${PN}-staticlibs = "devel"
> +RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"
> +

I think if you need to divide it then -dev should be divided into
static, dynamic and headers otherwise this may not be so useful.

>  DOTDEBUG-dbg = "${bindir}/.debug ${sbindir}/.debug ${libexecdir}/.debug ${libdir}/.debug \
>             ${base_bindir}/.debug ${base_sbindir}/.debug ${base_libdir}/.debug ${libdir}/${PN}/.debug \
>             ${libdir}/matchbox-panel/.debug /usr/src/debug"
> --
> 1.7.3.4
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files
  2011-06-06  6:44 ` [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files Saul Wold
@ 2011-06-06 17:14   ` Richard Purdie
  2011-06-06 17:27     ` Otavio Salvador
  0 siblings, 1 reply; 37+ messages in thread
From: Richard Purdie @ 2011-06-06 17:14 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
> From: Otavio Salvador <otavio@ossystems.com.br>
> 
> There're many Qt applications that provide translation files in '.qm'
> format however those weren't being splitted as GetText based
> ones.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

Am I right in assuming all these qt applications use one of the qt
classes?

I do wonder if this shouldn't be part of one of the qt classes as part
of a package_do_split_locales_append() or prepend() style function from
a code separation point of view. I do appreciate the need to influence
the list of locales although you could do that through directory
creation or an extra variable but we could enhance package.bbclass to
support that.

> ---
>  meta/classes/package.bbclass |   41 +++++++++++++++++++++++++++++++++++++----
>  1 files changed, 37 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index 1e6a872..e4be20f 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -343,6 +343,8 @@ python package_do_split_locales() {
>  		bb.debug(1, "package requested not splitting locales")
>  		return
>  
> +	import re
> +
>  	packages = (bb.data.getVar('PACKAGES', d, True) or "").split()
>  
>  	datadir = bb.data.getVar('datadir', d, True)
> @@ -358,12 +360,29 @@ python package_do_split_locales() {
>  
>  	localedir = os.path.join(dvar + datadir, 'locale')
>  
> -	if not os.path.isdir(localedir):
> +	locales = []
> +	if os.path.isdir(localedir):
> +		locales = os.listdir(localedir)
> +
> +	# Check of Qt translation files
> +	qm_re = re.compile("(.*)\.qm$")
> +	qm_files = {}
> +	for root, dirs, files in os.walk(dvar):
> +		for file in files:
> +			qm_file = qm_re.match(file)
> +			if qm_file:
> +				locale = qm_file.group(1)
> +				relpath = os.path.join(root, file).replace(dvar, '', 1)
> +				if relpath:
> +					if not qm_files.has_key(locale):
> +						qm_files[locale] = []
> +
> +					qm_files[locale].append(relpath)
> +
> +	if len(locales) == 0 and len(qm_files) == 0:
>  		bb.debug(1, "No locale files in this package")
>  		return
>  
> -	locales = os.listdir(localedir)
> -
>  	# This is *really* broken
>  	mainpkg = packages[0]
>  	# At least try and patch it up I guess...
> @@ -372,13 +391,27 @@ python package_do_split_locales() {
>  	if mainpkg.find('-dev'):
>  		mainpkg = mainpkg.replace('-dev', '')
>  
> +	# Queue Qt locales for spliting
> +	for l in qm_files.keys():
> +		if l not in locales:
> +			locales.append(l)
> +
> +	# Split the locales into different packages
>  	summary = bb.data.getVar('SUMMARY', d, True) or pn
>  	description = bb.data.getVar('DESCRIPTION', d, True) or "" 
>  	for l in locales:
>  		ln = legitimize_package_name(l)
>  		pkg = pn + '-locale-' + ln
>  		packages.append(pkg)
> -		bb.data.setVar('FILES_' + pkg, os.path.join(datadir, 'locale', l), d)
> +		files = []
> +		files.append(os.path.join(datadir, 'locale', l))
> +
> +		if qm_files.has_key(l):
> +			locale_re = re.compile("^.*([a-z]{2}(_[A-Z]{2})?)$")
> +			ln = legitimize_package_name(locale_re.match(l).group(1))
> +			files += qm_files[l]

Regardless, this is changing ln under some weird circumstances.
Shouldn't the code adding this to the locales list be handling this
translation? I can see potential duplication between the arrays and a
host of other nasty bugs with this code as it stands :/. Please take
that regexp out of this loop at the very least.


Cheers,

Richard


> +
> +		bb.data.setVar('FILES_' + pkg, " ".join(files), d)
>  		bb.data.setVar('RDEPENDS_' + pkg, '%s virtual-locale-%s' % (mainpkg, ln), d)
>  		bb.data.setVar('RPROVIDES_' + pkg, '%s-locale %s-translation' % (pn, ln), d)
>  		bb.data.setVar('SUMMARY_' + pkg, '%s - %s translations' % (summary, l), d)





^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files
  2011-06-06 17:14   ` Richard Purdie
@ 2011-06-06 17:27     ` Otavio Salvador
  2011-06-06 19:29       ` Richard Purdie
  0 siblings, 1 reply; 37+ messages in thread
From: Otavio Salvador @ 2011-06-06 17:27 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, Jun 6, 2011 at 17:14, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
>> From: Otavio Salvador <otavio@ossystems.com.br>
>>
>> There're many Qt applications that provide translation files in '.qm'
>> format however those weren't being splitted as GetText based
>> ones.
>>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>
> Am I right in assuming all these qt applications use one of the qt
> classes?

I'd expect it.

> I do wonder if this shouldn't be part of one of the qt classes as part
> of a package_do_split_locales_append() or prepend() style function from
> a code separation point of view.

I believe there's going to have a lot of code duplication between the
two to do that.

> I do appreciate the need to influence
> the list of locales although you could do that through directory
> creation or an extra variable but we could enhance package.bbclass to
> support that.

I don't understand what you meant by this. Mind to elaborate it a bit more?

...
>> +             if qm_files.has_key(l):
>> +                     locale_re = re.compile("^.*([a-z]{2}(_[A-Z]{2})?)$")
>> +                     ln = legitimize_package_name(locale_re.match(l).group(1))
>> +                     files += qm_files[l]
>
> Regardless, this is changing ln under some weird circumstances.
> Shouldn't the code adding this to the locales list be handling this
> translation? I can see potential duplication between the arrays and a
> host of other nasty bugs with this code as it stands :/. Please take
> that regexp out of this loop at the very least.

Where do you suggest me to move the regexp to?

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 16:50       ` Saul Wold
@ 2011-06-06 17:31         ` Otavio Salvador
  2011-06-06 19:00           ` Richard Purdie
  2011-06-06 19:34         ` Koen Kooi
  1 sibling, 1 reply; 37+ messages in thread
From: Otavio Salvador @ 2011-06-06 17:31 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, Jun 6, 2011 at 16:50, Saul Wold <sgw@linux.intel.com> wrote:
...
> As was pointed out earlier Fedora packages static libraries in a "-static"
> package, but this had other implications for OE due to -static already being
> in use (for busybox and mplayer), I am not sure that this is not a problem
> for OE-Core, I would need to investigate.  Meego also seems to use the
> Fedora standard with "-static".
...

I personally prefer -static. -staticlib seems redundant for me since
we can end with libfoo-staticlib

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 17:31         ` Otavio Salvador
@ 2011-06-06 19:00           ` Richard Purdie
  2011-06-06 19:07             ` Otavio Salvador
  0 siblings, 1 reply; 37+ messages in thread
From: Richard Purdie @ 2011-06-06 19:00 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, 2011-06-06 at 17:31 +0000, Otavio Salvador wrote:
> On Mon, Jun 6, 2011 at 16:50, Saul Wold <sgw@linux.intel.com> wrote:
> ...
> > As was pointed out earlier Fedora packages static libraries in a "-static"
> > package, but this had other implications for OE due to -static already being
> > in use (for busybox and mplayer), I am not sure that this is not a problem
> > for OE-Core, I would need to investigate.  Meego also seems to use the
> > Fedora standard with "-static".
> ...
> 
> I personally prefer -static. -staticlib seems redundant for me since
> we can end with libfoo-staticlib

-static doesn't really work well given we already have -static packages
meaning something else (e.g. the busybox case).

Cheers,

Richard




^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 17:03   ` Khem Raj
@ 2011-06-06 19:01     ` Richard Purdie
  0 siblings, 0 replies; 37+ messages in thread
From: Richard Purdie @ 2011-06-06 19:01 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, 2011-06-06 at 10:03 -0700, Khem Raj wrote:
> On Sun, Jun 5, 2011 at 11:44 PM, Saul Wold <sgw@linux.intel.com> wrote:
> > Signed-off-by: Saul Wold <sgw@linux.intel.com>
> > ---
> >  meta/conf/bitbake.conf |   12 ++++++++++--
> >  1 files changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index de94316..520b808 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -194,9 +194,13 @@ This package contains ELF symbols and related sources for debugging purposes."
> >
> >  SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files"
> >  DESCRIPTION_${PN}-dev ?= "${DESCRIPTION}  \
> > -This package contains symbolic links, static binaries, header files, and \
> > +This package contains symbolic links, header files, and \
> >  related items necessary for software development."
> >
> > +SUMMARY_${PN}-staticlibs ?= "${SUMMARY} - Development files (Static Libraries)"
> > +DESCRIPTION_${PN}-staticlibs?= "${DESCRIPTION}  \
> > +This package contains static libraries for software development."
> > +
> >  SUMMARY_${PN}-doc ?= "${SUMMARY} - Documentation files"
> >  DESCRIPTION_${PN}-doc ?= "${DESCRIPTION}  \
> >  This package contains documentation."
> > @@ -248,13 +252,17 @@ FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
> >  SECTION_${PN}-doc = "doc"
> >
> >  FILES_${PN}-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \
> > -                ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig \
> > +                ${libdir}/*.o ${libdir}/pkgconfig \
> >                 ${datadir}/pkgconfig ${datadir}/aclocal \
> >                 ${base_libdir}/*.a ${base_libdir}/*.o"
> >  SECTION_${PN}-dev = "devel"
> >  ALLOW_EMPTY_${PN}-dev = "1"
> >  RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
> >
> > +FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
> > +SECTION_${PN}-staticlibs = "devel"
> > +RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"
> > +
> 
> I think if you need to divide it then -dev should be divided into
> static, dynamic and headers otherwise this may not be so useful.

The dynamic package would only consist of some symlinks and .la files
though so wouldn't be that much extra compared to the -dev package?

Cheers,

Richard




^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 19:00           ` Richard Purdie
@ 2011-06-06 19:07             ` Otavio Salvador
  2011-06-06 19:31               ` Richard Purdie
  2011-06-07 10:08               ` Phil Blundell
  0 siblings, 2 replies; 37+ messages in thread
From: Otavio Salvador @ 2011-06-06 19:07 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, Jun 6, 2011 at 19:00, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2011-06-06 at 17:31 +0000, Otavio Salvador wrote:
>> I personally prefer -static. -staticlib seems redundant for me since
>> we can end with libfoo-staticlib
>
> -static doesn't really work well given we already have -static packages
> meaning something else (e.g. the busybox case).

Aren't we changing the wrong name? In my opinion then busybox ought to
be renamed. Like busybox-staticlinked or busybox-nolibs.

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files
  2011-06-06 17:27     ` Otavio Salvador
@ 2011-06-06 19:29       ` Richard Purdie
  0 siblings, 0 replies; 37+ messages in thread
From: Richard Purdie @ 2011-06-06 19:29 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, 2011-06-06 at 17:27 +0000, Otavio Salvador wrote:
> On Mon, Jun 6, 2011 at 17:14, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
> >> From: Otavio Salvador <otavio@ossystems.com.br>
> >>
> >> There're many Qt applications that provide translation files in '.qm'
> >> format however those weren't being splitted as GetText based
> >> ones.
> >>
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> >
> > Am I right in assuming all these qt applications use one of the qt
> > classes?
> 
> I'd expect it.
> 
> > I do wonder if this shouldn't be part of one of the qt classes as part
> > of a package_do_split_locales_append() or prepend() style function from
> > a code separation point of view.
> 
> I believe there's going to have a lot of code duplication between the
> two to do that.

Not really. Something like:

python package_do_split_locales_qm() {
   import re

   dvar = bb.data.getVar('PKGD', d, True)
 
   # Check of Qt translation files
   qm_re = re.compile("(.*)\.qm$")
   qm_files = {}
   for root, dirs, files in os.walk(dvar):
       for file in files:
           qm_file = qm_re.match(file)
           if qm_file:
               locale = qm_file.group(1)
               relpath = os.path.join(root, file).replace(dvar, '', 1)
               if relpath:
                   if not qm_files.has_key(locale):
                       qm_files[locale] = []
                   qm_files[locale].append(relpath)
 
    locale_re = re.compile("^.*([a-z]{2}(_[A-Z]{2})?)$")
    for l in qm_files:
        ln = legitimize_package_name(locale_re.match(l).group(1))
        pkg = pn + '-locale-' + ln
        bb.data.setVar('FILES_' + pkg, " ".join(qm_files[l]), d)
}

PACKAGE_PREPROCESS_FUNCS += "package_do_split_locales_qm"

which doesn't really duplicate anything with package.bbclass. To make
that work we'd need to set PACKAGELOCALES and change package.bbclass to
something like:

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 1e6a872..66796e7 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -358,12 +358,18 @@ python package_do_split_locales() {
 
 	localedir = os.path.join(dvar + datadir, 'locale')
 
-	if not os.path.isdir(localedir):
+	locales = set()
+	if os.path.isdir(localedir):
+		locales |= os.listdir(localedir)
+
+	extralocales = d.getVar("PACKAGELOCALES", True)
+	if extralocales:
+		locales |= extralocales
+
+	if not locales:
 		bb.debug(1, "No locale files in this package")
 		return
 
-	locales = os.listdir(localedir)
-
 	# This is *really* broken
 	mainpkg = packages[0]
 	# At least try and patch it up I guess...
@@ -378,7 +384,11 @@ python package_do_split_locales() {
 		ln = legitimize_package_name(l)
 		pkg = pn + '-locale-' + ln
 		packages.append(pkg)
-		bb.data.setVar('FILES_' + pkg, os.path.join(datadir, 'locale', l), d)
+		files = os.path.join(datadir, 'locale', l)
+		extrafiles = d.getVar('FILES_' + pkg, True)
+		if extrafiles:
+			files = extrafiles + " " + files
+		bb.data.setVar('FILES_' + pkg, files, d)
 		bb.data.setVar('RDEPENDS_' + pkg, '%s virtual-locale-%s' % (mainpkg, ln), d)
 		bb.data.setVar('RPROVIDES_' + pkg, '%s-locale %s-translation' % (pn, ln), d)
 		bb.data.setVar('SUMMARY_' + pkg, '%s - %s translations' % (summary, l), d)

and there are probably neater ways to do this.

> > I do appreciate the need to influence
> > the list of locales although you could do that through directory
> > creation or an extra variable but we could enhance package.bbclass to
> > support that.
> 
> I don't understand what you meant by this. Mind to elaborate it a bit more?

See above for the kind of thing I'm thinking of.

> ...
> >> +             if qm_files.has_key(l):
> >> +                     locale_re = re.compile("^.*([a-z]{2}(_[A-Z]{2})?)$")
> >> +                     ln = legitimize_package_name(locale_re.match(l).group(1))
> >> +                     files += qm_files[l]
> >
> > Regardless, this is changing ln under some weird circumstances.
> > Shouldn't the code adding this to the locales list be handling this
> > translation? I can see potential duplication between the arrays and a
> > host of other nasty bugs with this code as it stands :/. Please take
> > that regexp out of this loop at the very least.
> 
> Where do you suggest me to move the regexp to?

Well, I was thinking about the loop above this one just over qm_files
instead of all locales. Also note that re.compile can be reused and can
also live outside any looping.

Cheers,

Richard






^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 19:07             ` Otavio Salvador
@ 2011-06-06 19:31               ` Richard Purdie
  2011-06-07 10:08               ` Phil Blundell
  1 sibling, 0 replies; 37+ messages in thread
From: Richard Purdie @ 2011-06-06 19:31 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, 2011-06-06 at 19:07 +0000, Otavio Salvador wrote:
> On Mon, Jun 6, 2011 at 19:00, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Mon, 2011-06-06 at 17:31 +0000, Otavio Salvador wrote:
> >> I personally prefer -static. -staticlib seems redundant for me since
> >> we can end with libfoo-staticlib
> >
> > -static doesn't really work well given we already have -static packages
> > meaning something else (e.g. the busybox case).
> 
> Aren't we changing the wrong name? In my opinion then busybox ought to
> be renamed. Like busybox-staticlinked or busybox-nolibs.

I think it goes to show that -static is a bad choice of name as it can
take so many different meanings. Its also why I feel strong it should
reflect what people would use it for, not what it physically contains.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 16:50       ` Saul Wold
  2011-06-06 17:31         ` Otavio Salvador
@ 2011-06-06 19:34         ` Koen Kooi
  1 sibling, 0 replies; 37+ messages in thread
From: Koen Kooi @ 2011-06-06 19:34 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer


Op 6 jun 2011, om 18:50 heeft Saul Wold het volgende geschreven:

> On 06/06/2011 03:50 AM, Richard Purdie wrote:
>> On Mon, 2011-06-06 at 07:55 +0100, Phil Blundell wrote:
>>> On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
>>>>  SECTION_${PN}-dev = "devel"
>>>>  ALLOW_EMPTY_${PN}-dev = "1"
>>>>  RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
>>>> 
>>>> +FILES_${PN}-staticlibs = "${libdir}/*.a ${base_libdir}/*.a"
>>>> +SECTION_${PN}-staticlibs = "devel"
>>>> +RDEPENDS_${PN}-staticlibs = "${PN}-dev (= ${EXTENDPV})"
>>> 
>>> This should be ${EXTENDPKGV}, right?
>> 
>> It should.
>> 
>> I'm also not 100% convinced I like "-staticlibs" vs "-staticdev" as it
>> doesn't feel consistent.
>> 
>> The user gets exposed to these at the package manager level and will
>> "xxx install xxx-staticX". The end result they'll get will be the
>> installation of everything they need for static development (i.e. the
>> -dev packages will get pulled in for the headers). This means they don't
>> just result in the static libs as there are dependencies there. From the
>> user perspective they are therefore packages for static development, not
>> just the static libraries...
>> 
> Richard,
> 
> I agree that they are for development and that by their nature they have a dependency on the Development packages, but they contain libs only, not all the development headers or tools, I think its therefore mis-leading to call the package staticdev since they do not contain all the development bits (they might depend on all the bits).  It's a subtle but important distinction.
> 
> As was pointed out earlier Fedora packages static libraries in a "-static" package, but this had other implications for OE due to -static already being in use (for busybox and mplayer), I am not sure that this is not a problem for OE-Core, I would need to investigate.  Meego also seems to use the Fedora standard with "-static".

I just brought that up as the only 2 points of conflict I remember, I still like the '-static' name. But I'm biased since I did this in -dev a while ago :)


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries
  2011-06-06 19:07             ` Otavio Salvador
  2011-06-06 19:31               ` Richard Purdie
@ 2011-06-07 10:08               ` Phil Blundell
  1 sibling, 0 replies; 37+ messages in thread
From: Phil Blundell @ 2011-06-07 10:08 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, 2011-06-06 at 19:07 +0000, Otavio Salvador wrote:
> On Mon, Jun 6, 2011 at 19:00, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Mon, 2011-06-06 at 17:31 +0000, Otavio Salvador wrote:
> >> I personally prefer -static. -staticlib seems redundant for me since
> >> we can end with libfoo-staticlib
> >
> > -static doesn't really work well given we already have -static packages
> > meaning something else (e.g. the busybox case).
> 
> Aren't we changing the wrong name? In my opinion then busybox ought to
> be renamed. Like busybox-staticlinked or busybox-nolibs.

I don't think busybox-static even exists in oe-core at the moment so
there may not actually be anything to rename.

p.





^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [CONSOLIDATED PULL 00/20] 05-June-2011
  2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
                   ` (19 preceding siblings ...)
  2011-06-06  6:44 ` [CONSOLIDATED PULL 20/20] tzcode: Update to 2011g Saul Wold
@ 2011-06-07 20:40 ` Richard Purdie
  20 siblings, 0 replies; 37+ messages in thread
From: Richard Purdie @ 2011-06-07 20:40 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, 2011-06-05 at 23:44 -0700, Saul Wold wrote:
> This pulls together a set of changes from the later
> part of last week, these have been built. I have updated
> Nitin's comment about the License change (which was adding
> years).
> 
> This also includes Scott's User Addition code.
> 
> I did not pull Bruce's change due to a known build issue
> with x86-64, I am expecting an update from him.
> 
> Thanks
> 	Sau!
> 
> 
> The following changes since commit 2a52f806f3789f717219651b97dc64fec3881f7f:
> 
>   qmake_base.bbclass: fix lrelease/lupdate binary names (2011-06-02 18:26:19 +0100)
> 
> are available in the git repository at:
>   git://git.openembedded.org/openembedded-core-contrib sgw/stage
>   http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=sgw/stage
> 
> Khem Raj (2):
>   allarch.bbclass: Define BASE_PACKAGE_ARCH = "all"
>   util-linux_2.19.1.bb: Fix compliation on uclibc
> 
> Martin Jansa (1):
>   base.bbclass: add cleansstate task between clean and cleanall
> 
> Nitin A Kamble (3):
>   m4: upgrade from 1.4.15 to 1.4.16
>   autoconf: upgrade from 2.65 to 2.68
>   bison: upgrade from 2.4.3 to 2.5
> 
> Otavio Salvador (4):
>   gnutls: use INC_PR on 2.12.5 version recipe
>   gnutls: add p11tool into gnutls-bin
>   package.bbclass: add support to split Qt translation files
>   xf86-driver-common.inc: remove .la files to avoid unpackaged warning
> 
> Phil Blundell (1):
>   gcc-package-cross: also install the symlinks in libexec with target
>     prefix
> 
> Saul Wold (2):
>   bitbake.conf: Create staticlibs pacakge for static libraries
>   tzcode: Update to 2011g
> 
> Scott Garman (7):
>   shadow: recipe and patch cleanup
>   shadow: add a -native recipe with customized utilities
>   base-passwd: populate the target sysroot with passwd/group/login.defs
>   useradd.bbclass: new class for managing user/group permissions
>   useradd-example: example recipe for using inherit useradd
>   bitbake.conf: set PSEUDO_PASSWD within FAKEROOTENV
>   package_rpm.bbclass: make RPM use on-disk permissions

I merged these except in the two cases where feedback was given or in
the case of the useradd* commits from Scott as I need more time to
review those.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2011-06-07 20:43 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-06  6:44 [CONSOLIDATED PULL 00/20] 05-June-2011 Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 01/20] bitbake.conf: Create staticlibs pacakge for static libraries Saul Wold
2011-06-06  6:55   ` Phil Blundell
2011-06-06 10:50     ` Richard Purdie
2011-06-06 16:50       ` Saul Wold
2011-06-06 17:31         ` Otavio Salvador
2011-06-06 19:00           ` Richard Purdie
2011-06-06 19:07             ` Otavio Salvador
2011-06-06 19:31               ` Richard Purdie
2011-06-07 10:08               ` Phil Blundell
2011-06-06 19:34         ` Koen Kooi
2011-06-06 14:59     ` Saul Wold
2011-06-06 17:03   ` Khem Raj
2011-06-06 19:01     ` Richard Purdie
2011-06-06  6:44 ` [CONSOLIDATED PULL 02/20] m4: upgrade from 1.4.15 to 1.4.16 Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 03/20] autoconf: upgrade from 2.65 to 2.68 Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 04/20] bison: upgrade from 2.4.3 to 2.5 Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 05/20] allarch.bbclass: Define BASE_PACKAGE_ARCH = "all" Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 06/20] util-linux_2.19.1.bb: Fix compliation on uclibc Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 07/20] base.bbclass: add cleansstate task between clean and cleanall Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 08/20] gnutls: use INC_PR on 2.12.5 version recipe Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 09/20] gnutls: add p11tool into gnutls-bin Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 10/20] package.bbclass: add support to split Qt translation files Saul Wold
2011-06-06 17:14   ` Richard Purdie
2011-06-06 17:27     ` Otavio Salvador
2011-06-06 19:29       ` Richard Purdie
2011-06-06  6:44 ` [CONSOLIDATED PULL 11/20] xf86-driver-common.inc: remove .la files to avoid unpackaged warning Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 12/20] gcc-package-cross: also install the symlinks in libexec with target prefix Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 13/20] shadow: recipe and patch cleanup Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 14/20] shadow: add a -native recipe with customized utilities Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 15/20] base-passwd: populate the target sysroot with passwd/group/login.defs Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 16/20] useradd.bbclass: new class for managing user/group permissions Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 17/20] useradd-example: example recipe for using inherit useradd Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 18/20] bitbake.conf: set PSEUDO_PASSWD within FAKEROOTENV Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 19/20] package_rpm.bbclass: make RPM use on-disk permissions Saul Wold
2011-06-06  6:44 ` [CONSOLIDATED PULL 20/20] tzcode: Update to 2011g Saul Wold
2011-06-07 20:40 ` [CONSOLIDATED PULL 00/20] 05-June-2011 Richard Purdie

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.