All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Fixes and improvements from O.S. Systems
@ 2011-10-21  3:31 Otavio Salvador
  2011-10-21  3:31 ` [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building Otavio Salvador
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21  3:31 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 99da9a4e65f9dffb04efc3ad60125194c476d6b3:

  distro-tracking-fields: update fields for tzdata and gst-plugins-good (2011-10-20 13:07:16 +0100)

are available in the git repository at:
  git://github.com/OSSystems/oe-core master
  https://github.com/OSSystems/oe-core/tree/HEAD

Otavio Salvador (4):
  bootimg.bbclass: add support to disable HDD image building
  useradd.bbclass: check if a group already exists manually
  base-passwd: move initial criation of group and passwd to preinst
  dbus: use useradd class to allow use in read-only filesystems

 meta/classes/bootimg.bbclass                       |   44 +++++++++---------
 meta/classes/useradd.bbclass                       |    8 +++-
 .../recipes-core/base-passwd/base-passwd_3.5.22.bb |    4 +-
 meta/recipes-core/dbus/dbus.inc                    |   48 +++++++++-----------
 4 files changed, 53 insertions(+), 51 deletions(-)

-- 
1.7.2.5




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

* [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building
  2011-10-21  3:31 [PATCH 0/4] Fixes and improvements from O.S. Systems Otavio Salvador
@ 2011-10-21  3:31 ` Otavio Salvador
  2011-10-21  6:07   ` Khem Raj
  2011-10-21  3:31 ` [PATCH 2/4] useradd.bbclass: check if a group already exists manually Otavio Salvador
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21  3:31 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index a5ba3cf..eecc2bf 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu"
 inherit syslinux
 		
 build_boot_bin() {
-	install -d ${HDDDIR}
-	install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
-	${HDDDIR}/vmlinuz
+	# Create an HDD image
+	if [ "${NOHDD}" != "1" ] ; then
+		install -d ${HDDDIR}
+		install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
+		${HDDDIR}/vmlinuz
 
-	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then 
-    		install -m 0644 ${INITRD} ${HDDDIR}/initrd
-	fi
+		if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
+				install -m 0644 ${INITRD} ${HDDDIR}/initrd
+		fi
 
-	if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then 
-    		install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
-	fi
+		if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+				install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
+		fi
 
-	install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
+		install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
 
-	# Do a little math, bash style
-	#BLOCKS=`du -s ${HDDDIR} | cut -f 1`
-	BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
-	SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`	
+		# Do a little math, bash style
+		BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
+		SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
 
-	mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
-	-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE 
+		mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
+		-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
 
-	syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-	chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+		syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+		chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
 
-	cd ${DEPLOY_DIR_IMAGE}
-	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
-	ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
+		cd ${DEPLOY_DIR_IMAGE}
+		rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
+		ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
+	fi
 	
 	#Create an ISO if we have an INITRD
 	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
-- 
1.7.2.5




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

* [PATCH 2/4] useradd.bbclass: check if a group already exists manually
  2011-10-21  3:31 [PATCH 0/4] Fixes and improvements from O.S. Systems Otavio Salvador
  2011-10-21  3:31 ` [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building Otavio Salvador
@ 2011-10-21  3:31 ` Otavio Salvador
  2011-10-21  3:41   ` Scott Garman
  2011-10-21  3:31 ` [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst Otavio Salvador
  2011-10-21  3:31 ` [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems Otavio Salvador
  3 siblings, 1 reply; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21  3:31 UTC (permalink / raw)
  To: openembedded-core

The use of groupadd -f makes much more difficult to figure when a
group is not add. This was the case of the class not working for our
usage and this being caused by the lack of '/etc/group' file but
unnoticed as groupadd wasn't failing according.

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

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 1e03a04..fb70b3e 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -37,7 +37,13 @@ if test "x$GROUPADD_PARAM" != "x"; then
 	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
+		groupname=`echo "$opts" | awk '{ print $NF }'`
+		group_exists=`grep "^$groupname:" $SYSROOT/etc/group || true`
+		if test "x$group_exists" = "x"; then
+			eval $PSEUDO groupadd  $OPT $opts
+		else
+			echo "Note: group $groupname already exists, not re-creating it"
+		fi
 
 		if test "x$opts" = "x$remaining"; then
 			break
-- 
1.7.2.5




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

* [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst
  2011-10-21  3:31 [PATCH 0/4] Fixes and improvements from O.S. Systems Otavio Salvador
  2011-10-21  3:31 ` [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building Otavio Salvador
  2011-10-21  3:31 ` [PATCH 2/4] useradd.bbclass: check if a group already exists manually Otavio Salvador
@ 2011-10-21  3:31 ` Otavio Salvador
  2011-10-21  3:41   ` Scott Garman
  2011-10-21  6:52   ` Phil Blundell
  2011-10-21  3:31 ` [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems Otavio Salvador
  3 siblings, 2 replies; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21  3:31 UTC (permalink / raw)
  To: openembedded-core

To allow use and manipulation of users and groups at rootfs building
time, the '/etc/passwd' and '/etc/group' needs to be available as soon
as possible.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 .../recipes-core/base-passwd/base-passwd_3.5.22.bb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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 137512d..9f81ba3 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,7 +1,7 @@
 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 = "r3"
+PR = "r4"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
 
@@ -37,7 +37,7 @@ do_install () {
 	install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
 }
 
-pkg_postinst_${PN} () {
+pkg_preinst_${PN} () {
 	set -e
 
 	if [ ! -e $D${sysconfdir}/passwd ] ; then
-- 
1.7.2.5




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

* [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems
  2011-10-21  3:31 [PATCH 0/4] Fixes and improvements from O.S. Systems Otavio Salvador
                   ` (2 preceding siblings ...)
  2011-10-21  3:31 ` [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst Otavio Salvador
@ 2011-10-21  3:31 ` Otavio Salvador
  2011-10-21  6:54   ` Phil Blundell
  3 siblings, 1 reply; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21  3:31 UTC (permalink / raw)
  To: openembedded-core

Move creation of required user/groups to useradd class thus allowing
use with read-only filesystems and booting the initial boot.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-core/dbus/dbus.inc |   48 +++++++++++++++++----------------------
 1 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index a8ecda8..2a97c02 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -10,15 +10,22 @@ DEPENDS = "expat virtual/libintl ${@base_contains('DISTRO_FEATURES', 'x11', '${X
 DEPENDS_virtclass-native = "expat-native virtual/libintl-native"
 DEPENDS_virtclass-nativesdk = "expat-nativesdk virtual/libintl-nativesdk virtual/libx11"
 
+PR = "r1"
+
 SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
            file://tmpdir.patch; \
            file://dbus-1.init"
 
-inherit autotools pkgconfig gettext update-rc.d
+inherit useradd autotools pkgconfig gettext update-rc.d
 
 INITSCRIPT_NAME = "dbus-1"
 INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
 
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-r netdev"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
+                       --no-create-home --user-group messagebus"
+
 CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
 
 DEBIANNAME_${PN} = "dbus-1"
@@ -44,32 +51,7 @@ RRECOMMENDS_${PN}-lib = "${PN}"
 FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
 
 pkg_postinst_dbus() {
-	# can't do adduser stuff offline
-	if [ "x$D" != "x" ]; then
-		exit 1
-	fi
-
-	MESSAGEUSER=messagebus
-	MESSAGEHOME=/var/run/dbus
-	UUIDDIR=/var/lib/dbus
-
-	mkdir -p $MESSAGEHOME
-	mkdir -p $UUIDDIR
-	chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup "$MESSAGEUSER"
-	chown "$MESSAGEUSER":"$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || \
-		adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password \
-			--ingroup "$MESSAGEUSER" "$MESSAGEUSER"
-
-	chown "$MESSAGEUSER":"$MESSAGEUSER" "$UUIDDIR"
-
-	grep -q netdev: /etc/group || addgroup netdev
-
-	chown root:"$MESSAGEUSER" /usr/libexec/dbus-daemon-launch-helper
-	chmod 4754 /usr/libexec/dbus-daemon-launch-helper
-
-	# add volatile after new user/grp are created
-	echo "d messagebus messagebus 0755 /var/run/dbus none" > /etc/default/volatiles/99_dbus
-	if [ -e /etc/init.d/populate-volatile.sh ] ; then
+	if [ -z "${D}" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
 		/etc/init.d/populate-volatile.sh update
 	fi
 }
@@ -92,6 +74,18 @@ do_install() {
 	install -d ${D}${sysconfdir}/init.d
 	install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
 
+	install -d ${D}${sysconfdir}/default/volatiles
+	echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
+	     > ${D}${sysconfdir}/default/volatiles/99_dbus
+
+
+	mkdir -p ${D}${localstatedir}/run/dbus ${D}${localstatedir}/lib/dbus
+
+	chown messagebus:messagebus ${D}${localstatedir}/run/dbus ${D}${localstatedir}/lib/dbus
+
+	chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
+	chmod 4754 ${D}${libexecdir}/dbus-daemon-launch-helper
+
 	# disable dbus-1 sysv script on systemd installs
 	# nearly all distros call the initscript plain 'dbus', but OE-core is different
 	ln -sf /dev/null ${D}/${base_libdir}/systemd/system/dbus-1.service
-- 
1.7.2.5




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

* Re: [PATCH 2/4] useradd.bbclass: check if a group already exists manually
  2011-10-21  3:31 ` [PATCH 2/4] useradd.bbclass: check if a group already exists manually Otavio Salvador
@ 2011-10-21  3:41   ` Scott Garman
  0 siblings, 0 replies; 15+ messages in thread
From: Scott Garman @ 2011-10-21  3:41 UTC (permalink / raw)
  To: openembedded-core

On 10/20/2011 08:31 PM, Otavio Salvador wrote:
> The use of groupadd -f makes much more difficult to figure when a
> group is not add. This was the case of the class not working for our
> usage and this being caused by the lack of '/etc/group' file but
> unnoticed as groupadd wasn't failing according.
>
> Signed-off-by: Otavio Salvador<otavio@ossystems.com.br>

Thanks for getting to the bottom of this!

Acked-by: Scott Garman <scott.a.garman@intel.com>

> ---
>   meta/classes/useradd.bbclass |    8 +++++++-
>   1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
> index 1e03a04..fb70b3e 100644
> --- a/meta/classes/useradd.bbclass
> +++ b/meta/classes/useradd.bbclass
> @@ -37,7 +37,13 @@ if test "x$GROUPADD_PARAM" != "x"; then
>   	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
> +		groupname=`echo "$opts" | awk '{ print $NF }'`
> +		group_exists=`grep "^$groupname:" $SYSROOT/etc/group || true`
> +		if test "x$group_exists" = "x"; then
> +			eval $PSEUDO groupadd  $OPT $opts
> +		else
> +			echo "Note: group $groupname already exists, not re-creating it"
> +		fi
>
>   		if test "x$opts" = "x$remaining"; then
>   			break


-- 
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center



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

* Re: [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst
  2011-10-21  3:31 ` [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst Otavio Salvador
@ 2011-10-21  3:41   ` Scott Garman
  2011-10-21  6:52   ` Phil Blundell
  1 sibling, 0 replies; 15+ messages in thread
From: Scott Garman @ 2011-10-21  3:41 UTC (permalink / raw)
  To: openembedded-core

On 10/20/2011 08:31 PM, Otavio Salvador wrote:
> To allow use and manipulation of users and groups at rootfs building
> time, the '/etc/passwd' and '/etc/group' needs to be available as soon
> as possible.
>
> Signed-off-by: Otavio Salvador<otavio@ossystems.com.br>

Acked-by: Scott Garman <scott.a.garman@intel.com>

> ---
>   .../recipes-core/base-passwd/base-passwd_3.5.22.bb |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> 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 137512d..9f81ba3 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,7 +1,7 @@
>   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 = "r3"
> +PR = "r4"
>   LICENSE = "GPLv2+"
>   LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
>
> @@ -37,7 +37,7 @@ do_install () {
>   	install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
>   }
>
> -pkg_postinst_${PN} () {
> +pkg_preinst_${PN} () {
>   	set -e
>
>   	if [ ! -e $D${sysconfdir}/passwd ] ; then


-- 
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center



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

* Re: [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building
  2011-10-21  3:31 ` [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building Otavio Salvador
@ 2011-10-21  6:07   ` Khem Raj
  2011-10-21 12:27     ` Otavio Salvador
  0 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2011-10-21  6:07 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Thu, Oct 20, 2011 at 8:31 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
>  1 files changed, 23 insertions(+), 21 deletions(-)
>
> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
> index a5ba3cf..eecc2bf 100644
> --- a/meta/classes/bootimg.bbclass
> +++ b/meta/classes/bootimg.bbclass
> @@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu"
>  inherit syslinux
>
>  build_boot_bin() {
> -       install -d ${HDDDIR}
> -       install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
> -       ${HDDDIR}/vmlinuz
> +       # Create an HDD image
> +       if [ "${NOHDD}" != "1" ] ; then

please document this new variable NOHDD somewhere so people know how
and when to use it

> +               install -d ${HDDDIR}
> +               install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
> +               ${HDDDIR}/vmlinuz
>
> -       if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
> -               install -m 0644 ${INITRD} ${HDDDIR}/initrd
> -       fi
> +               if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
> +                               install -m 0644 ${INITRD} ${HDDDIR}/initrd
> +               fi
>
> -       if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
> -               install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
> -       fi
> +               if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
> +                               install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
> +               fi
>
> -       install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
> +               install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
>
> -       # Do a little math, bash style
> -       #BLOCKS=`du -s ${HDDDIR} | cut -f 1`
> -       BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
> -       SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
> +               # Do a little math, bash style
> +               BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
> +               SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
>
> -       mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
> -       -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
> +               mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
> +               -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
>
> -       syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
> -       chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
> +               syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
> +               chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
>
> -       cd ${DEPLOY_DIR_IMAGE}
> -       rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
> -       ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
> +               cd ${DEPLOY_DIR_IMAGE}
> +               rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
> +               ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
> +       fi
>
>        #Create an ISO if we have an INITRD
>        if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
> --
> 1.7.2.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



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

* Re: [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst
  2011-10-21  3:31 ` [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst Otavio Salvador
  2011-10-21  3:41   ` Scott Garman
@ 2011-10-21  6:52   ` Phil Blundell
  2011-10-21 12:05     ` Otavio Salvador
  1 sibling, 1 reply; 15+ messages in thread
From: Phil Blundell @ 2011-10-21  6:52 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2011-10-21 at 03:31 +0000, Otavio Salvador wrote:
> @@ -37,7 +37,7 @@ do_install () {
>  	install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
>  }
>  
> -pkg_postinst_${PN} () {
> +pkg_preinst_${PN} () {
>  	set -e
>  
>  	if [ ! -e $D${sysconfdir}/passwd ] ; then

Doesn't this break on-target installs (or, more generally, installs
where preinst runs before unpacking)?

p.





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

* Re: [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems
  2011-10-21  3:31 ` [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems Otavio Salvador
@ 2011-10-21  6:54   ` Phil Blundell
  2011-10-21  7:05     ` Koen Kooi
  0 siblings, 1 reply; 15+ messages in thread
From: Phil Blundell @ 2011-10-21  6:54 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2011-10-21 at 03:31 +0000, Otavio Salvador wrote:
> +USERADD_PACKAGES = "${PN}"
> +GROUPADD_PARAM_${PN} = "-r netdev"
> +USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
> +                       --no-create-home --user-group messagebus"

Why does dbus need "netdev"?

p.





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

* Re: [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems
  2011-10-21  6:54   ` Phil Blundell
@ 2011-10-21  7:05     ` Koen Kooi
  0 siblings, 0 replies; 15+ messages in thread
From: Koen Kooi @ 2011-10-21  7:05 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer


Op 21 okt. 2011, om 08:54 heeft Phil Blundell het volgende geschreven:

> On Fri, 2011-10-21 at 03:31 +0000, Otavio Salvador wrote:
>> +USERADD_PACKAGES = "${PN}"
>> +GROUPADD_PARAM_${PN} = "-r netdev"
>> +USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
>> +                       --no-create-home --user-group messagebus"
> 
> Why does dbus need "netdev"?


A little digging on the internet shows that some applications using dbus use netdev and as a result dbus will complain about a missing netdev group. Dbus itself doesn't seem to need it. A handfull of searchresults imply that not dbus but e.g. networkmanager and wpa-supplicant should create the group, but:

root@beagleboard:/etc/dbus-1/system.d# ls
ConsoleKit.conf           org.freedesktop.PolicyKit1.conf
NetworkManager.conf       org.freedesktop.UDisks.conf
avahi-dbus.conf           org.freedesktop.UPower.conf
bluetooth.conf            org.freedesktop.hostname1.conf
dbus-wpa_supplicant.conf  org.freedesktop.locale1.conf
gdm.conf                  org.freedesktop.login1.conf
nm-avahi-autoipd.conf     org.freedesktop.systemd1.conf
nm-dhcp-client.conf       org.freedesktop.timedate1.conf
nm-dispatcher.conf        org.gnome.GConf.Defaults.conf

root@beagleboard:/etc/dbus-1/system.d# grep netdev *
root@beagleboard:/etc/dbus-1/system.d# 

So it seems (but I am not certain!) that netdev is a relic of the past and can go away. What I would propose:

1) convert the existing *inst to useradd.bbclass
2) bump PR, remove netdev

That should give us a nice bisectable stack of commits.

regards,

Koen


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

* Re: [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst
  2011-10-21  6:52   ` Phil Blundell
@ 2011-10-21 12:05     ` Otavio Salvador
  0 siblings, 0 replies; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21 12:05 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, Oct 21, 2011 at 04:52, Phil Blundell <philb@gnu.org> wrote:
> On Fri, 2011-10-21 at 03:31 +0000, Otavio Salvador wrote:
>> @@ -37,7 +37,7 @@ do_install () {
>>       install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
>>  }
>>
>> -pkg_postinst_${PN} () {
>> +pkg_preinst_${PN} () {
>>       set -e
>>
>>       if [ ! -e $D${sysconfdir}/passwd ] ; then
>
> Doesn't this break on-target installs (or, more generally, installs
> where preinst runs before unpacking)?

It does indeed. I will fix it and send a new patch for it.

-- 
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] 15+ messages in thread

* Re: [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building
  2011-10-21  6:07   ` Khem Raj
@ 2011-10-21 12:27     ` Otavio Salvador
  2011-10-21 15:57       ` Khem Raj
  0 siblings, 1 reply; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21 12:27 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, Oct 21, 2011 at 04:07, Khem Raj <raj.khem@gmail.com> wrote:
> On Thu, Oct 20, 2011 at 8:31 PM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
>>  1 files changed, 23 insertions(+), 21 deletions(-)
>>
>> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
>> index a5ba3cf..eecc2bf 100644
>> --- a/meta/classes/bootimg.bbclass
>> +++ b/meta/classes/bootimg.bbclass
>> @@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu"
>>  inherit syslinux
>>
>>  build_boot_bin() {
>> -       install -d ${HDDDIR}
>> -       install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
>> -       ${HDDDIR}/vmlinuz
>> +       # Create an HDD image
>> +       if [ "${NOHDD}" != "1" ] ; then
>
> please document this new variable NOHDD somewhere so people know how
> and when to use it

What do you suggests.

-- 
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] 15+ messages in thread

* Re: [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building
  2011-10-21 12:27     ` Otavio Salvador
@ 2011-10-21 15:57       ` Khem Raj
  0 siblings, 0 replies; 15+ messages in thread
From: Khem Raj @ 2011-10-21 15:57 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, Oct 21, 2011 at 5:27 AM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Fri, Oct 21, 2011 at 04:07, Khem Raj <raj.khem@gmail.com> wrote:
>> On Thu, Oct 20, 2011 at 8:31 PM, Otavio Salvador
>> <otavio@ossystems.com.br> wrote:
>>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>>> ---
>>>  meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
>>>  1 files changed, 23 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
>>> index a5ba3cf..eecc2bf 100644
>>> --- a/meta/classes/bootimg.bbclass
>>> +++ b/meta/classes/bootimg.bbclass
>>> @@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu"
>>>  inherit syslinux
>>>
>>>  build_boot_bin() {
>>> -       install -d ${HDDDIR}
>>> -       install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
>>> -       ${HDDDIR}/vmlinuz
>>> +       # Create an HDD image
>>> +       if [ "${NOHDD}" != "1" ] ; then
>>
>> please document this new variable NOHDD somewhere so people know how
>> and when to use it
>
> What do you suggests.

Either OE manual or local.conf.sample.extended may be

>
> --
> 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
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



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

* [PATCH 2/4] useradd.bbclass: check if a group already exists manually
  2011-10-21 14:10 [PATCH 0/4 v2] Fixes and improvements Otavio Salvador
@ 2011-10-21 14:10 ` Otavio Salvador
  0 siblings, 0 replies; 15+ messages in thread
From: Otavio Salvador @ 2011-10-21 14:10 UTC (permalink / raw)
  To: openembedded-core

The use of groupadd -f makes much more difficult to figure when a
group is not add. This was the case of the class not working for our
usage and this being caused by the lack of '/etc/group' file but
unnoticed as groupadd wasn't failing according.

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

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 1e03a04..fb70b3e 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -37,7 +37,13 @@ if test "x$GROUPADD_PARAM" != "x"; then
 	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
+		groupname=`echo "$opts" | awk '{ print $NF }'`
+		group_exists=`grep "^$groupname:" $SYSROOT/etc/group || true`
+		if test "x$group_exists" = "x"; then
+			eval $PSEUDO groupadd  $OPT $opts
+		else
+			echo "Note: group $groupname already exists, not re-creating it"
+		fi
 
 		if test "x$opts" = "x$remaining"; then
 			break
-- 
1.7.2.5




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

end of thread, other threads:[~2011-10-21 16:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-21  3:31 [PATCH 0/4] Fixes and improvements from O.S. Systems Otavio Salvador
2011-10-21  3:31 ` [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building Otavio Salvador
2011-10-21  6:07   ` Khem Raj
2011-10-21 12:27     ` Otavio Salvador
2011-10-21 15:57       ` Khem Raj
2011-10-21  3:31 ` [PATCH 2/4] useradd.bbclass: check if a group already exists manually Otavio Salvador
2011-10-21  3:41   ` Scott Garman
2011-10-21  3:31 ` [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst Otavio Salvador
2011-10-21  3:41   ` Scott Garman
2011-10-21  6:52   ` Phil Blundell
2011-10-21 12:05     ` Otavio Salvador
2011-10-21  3:31 ` [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems Otavio Salvador
2011-10-21  6:54   ` Phil Blundell
2011-10-21  7:05     ` Koen Kooi
2011-10-21 14:10 [PATCH 0/4 v2] Fixes and improvements Otavio Salvador
2011-10-21 14:10 ` [PATCH 2/4] useradd.bbclass: check if a group already exists manually Otavio Salvador

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.