Skip to contentSkip to conversation

Add shutdown to group by default

PATCH In review Saul Wold 1 participant 4 messages Sep 24, 2013

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

cover Add shutdown to group by default

Recently sysvinit added the useradd bbclass to add a shutdown group, this caused shadow to be added to the core-image-minimal increasing it's size by about 1.3M.

Saul Wold (2):
sysvinit: don't use useradd
base-passwd: add shutdown group

 .../base-passwd/base-passwd-3.5.26/add_shutdown.patch | 19 +++++++++++++++++++
 meta/recipes-core/base-passwd/base-passwd_3.5.26.bb   |  4 +++-
 meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb        |  7 ++-----
 3 files changed, 24 insertions(+), 6 deletions(-)
 create mode 100644 meta/recipes-core/base-passwd/base-passwd-3.5.26/add_shutdown.patch
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/2 sysvinit: don't use useradd

It causes shadow to be used in core-image-minimal and increase the size by 1.5M. We will add the shutdown user to group via base-passwd Ensure that sysvinit depends on base-passwd for the group chown.

[YOCTO #5230]

---
 meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb +2 -5
index 97ecc51..9ec92e2 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
                     file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
 PR = "r11"
 
-RDEPENDS_${PN} = "${PN}-inittab"
+RDEPENDS_${PN} = "${PN}-inittab base-passwd"
 
 SRC_URI = "http://download.savannah.gnu.org/releases-noredirect/sysvinit/sysvinit-${PV}.tar.bz2 \
            file://install.patch \
@@ -24,7 +24,7 @@ SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5
 S = "${WORKDIR}/sysvinit-${PV}"
 B = "${S}/src"
 
-inherit update-alternatives useradd
+inherit update-alternatives
 DEPENDS_append = " update-rc.d-native"
 
 ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last mesg utmpdump wall"
@@ -53,9 +53,6 @@ ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
 ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
 ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
 
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system shutdown"
-
 PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
 FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
 FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5"
Signature · 1 line
1.8.3.1
author
#2 lore raw

Re: [PATCH 1/2] sysvinit: don't use useradd

Quoted 16 lines · Saul Wold

It causes shadow to be used in core-image-minimal and increase the size by 1.5M. We will add the shutdown user to group via base-passwd Ensure that sysvinit depends on base-passwd for the group chown.

[YOCTO #5230]

---
  meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb +0 -0
index 97ecc51..9ec92e2 100644

meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ · line 11

Quoted 6 lines
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb +1 -1
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
                      file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
  PR = "r11"
 
-RDEPENDS_${PN} = "${PN}-inittab"
+RDEPENDS_${PN} = "${PN}-inittab base-passwd"
 

This should be in DEPENDS, RP has this already patched.

Thanks
Sau!

Quoted 22 lines
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb +1 -4
  SRC_URI = "http://download.savannah.gnu.org/releases-noredirect/sysvinit/sysvinit-${PV}.tar.bz2 \
             file://install.patch \
@@ -24,7 +24,7 @@ SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5
  S = "${WORKDIR}/sysvinit-${PV}"
  B = "${S}/src"
 
-inherit update-alternatives useradd
+inherit update-alternatives
  DEPENDS_append = " update-rc.d-native"
 
  ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last mesg utmpdump wall"
@@ -53,9 +53,6 @@ ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
  ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
  ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
 
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system shutdown"
-
  PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
  FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
  FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5"
author
#3 lore raw

PATCH 2/2 base-passwd: add shutdown group

In reply to Saul Wold

Since using useradd in sysvinit causes core-image-minimal to gain shadow utilites instead of using busybox, we add the shutdown group directly.

[YOCTO #5230]

---
 .../base-passwd/base-passwd-3.5.26/add_shutdown.patch | 19 +++++++++++++++++++
 meta/recipes-core/base-passwd/base-passwd_3.5.26.bb   |  4 +++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/base-passwd/base-passwd-3.5.26/add_shutdown.patch
meta/recipes-core/base-passwd/base-passwd-3.5.26/add_shutdown.patch new file +19 -0
new file mode 100644
index 0000000..eb75559
@@ -0,0 +1,19 @@
+
+We need to have a shutdown group to allow the shutdown icon
+to work correctly. Any users that want to use shutdown like
+the xuser should be added to this group.
+
+Upstream-Status: Inapporpriate [Embedded]
+
+Signed-off-by: Saul Wold <[email protected]>
+Index: base-passwd-3.5.26/group.master
+===================================================================
+--- base-passwd-3.5.26.orig/group.master
++++ base-passwd-3.5.26/group.master
+@@ -36,5 +36,6 @@ sasl:*:45:
+ plugdev:*:46:
+ staff:*:50:
+ games:*:60:
++shutdown:*:70:
+ users:*:100:
+ nogroup:*:65534:
meta/recipes-core/base-passwd/base-passwd_3.5.26.bb +3 -1
index 1c7e6b0..2181ac7 100644
@@ -7,7 +7,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
            file://nobash.patch \
-           file://input.patch"
+           file://input.patch \
+           file://add_shutdown.patch \
+          "
 
 SRC_URI[md5sum] = "74245e5c21dc74d9675c77cd8dfa02e6"
 SRC_URI[sha256sum] = "258a78317aa563143d10375c6e1e63a60898e503887f00fffd70b6b297c1b429"
Signature · 1 line
1.8.3.1