Skip to contentSkip to conversation

libvirt: fix GROUPADD_PARAM override conflict

PATCH In review Dengke Du 3 participants 11 messages Mar 7, 2019 – Mar 17, 2019

lore
Share & tools
lore

Dengke Du

author
#0 lore raw

PATCH 1/1 libvirt: fix GROUPADD_PARAM override conflict

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
 meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
index b55f9a9..0b0f011 100644
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
 inherit useradd
 USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"
 
 do_install_append() {
 	sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
 meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 8

Quoted 5 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
 inherit useradd
 USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"

The __append should be fine then, but why the ';'? That part looks wrong, since typically the PARAM is the parameters passed directly to the groupadd program. I don't believe ';' is a valid parameter.

--Mark

Quoted 3 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
 do_install_append() {
 	sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf
 
author
#2 lore raw
Quoted 15 lines · Mark Hatle
Quoted 14 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
Quoted 7 lines

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 8

Quoted 4 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"

The __append should be fine then, but why the ';'? That part looks wrong, since typically the PARAM is the parameters passed directly to the groupadd program. I don't believe ';' is a valid parameter.

First, adding ';' or not adding ';' are the same for building libvirt, the group: qemu, kvm, libvirt are all created successfully.

Second, adding ';' just according to some processing rule from the link:

https://git.openembedded.org/openembedded-core/tree/meta/classes/useradd.bbclass#n54

-----------------------------------------------------------------------------------------------------------------------

if test "xecho $GROUPADD_PARAM | tr -d '[:space:]'" != "x"; then

	echo "Running groupadd commands..."
	# Invoke multiple instances of groupadd for parameter lists
	# separated by ';'
	opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
	remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
	while test "x$opts" != "x"; do
		perform_groupadd "$SYSROOT" "$OPT $opts"
		if test "x$opts" = "x$remaining"; then
			break
		fi
		opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
		remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
	done

fi

-----------------------------------------------------------------------------------------------------------------------

Maybe in order to let the codes see more orderly.

Quoted 7 lines

--Mark

Quoted 3 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
  do_install_append() {
  	sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf
 
author
#3 lore raw
Quoted 48 lines · ddu
Quoted 15 lines · Mark Hatle
Quoted 14 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
Quoted 7 lines

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 8

Quoted 4 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"

The __append should be fine then, but why the ';'? That part looks wrong, since typically the PARAM is the parameters passed directly to the groupadd program. I don't believe ';' is a valid parameter.

First, adding ';' or not adding ';' are the same for building libvirt, the group: qemu, kvm, libvirt are all created successfully.

Second, adding ';' just according to some processing rule from the link:

https://git.openembedded.org/openembedded-core/tree/meta/classes/useradd.bbclass#n54

-----------------------------------------------------------------------------------------------------------------------

if test "xecho $GROUPADD_PARAM | tr -d '[:space:]'" != "x"; then

	echo "Running groupadd commands..."
	# Invoke multiple instances of groupadd for parameter lists
	# separated by ';'
	opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
	remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
	while test "x$opts" != "x"; do
		perform_groupadd "$SYSROOT" "$OPT $opts"
		if test "x$opts" = "x$remaining"; then
			break
		fi
		opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
		remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
	done
Quoted 6 lines

fi

-----------------------------------------------------------------------------------------------------------------------

Maybe in order to let the codes see more orderly.

Please ignore this. Thanks.

Quoted 7 lines
Quoted 6 lines

--Mark

Quoted 3 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
  do_install_append() {
  	sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf
 
author
#4 lore raw
In reply to Mark Hatle
Quoted 15 lines · Mark Hatle
Quoted 14 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
Quoted 7 lines

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 8

Quoted 4 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"

The __append should be fine then, but why the ';'? That part looks wrong, since typically the PARAM is the parameters passed directly to the groupadd program. I don't believe ';' is a valid parameter.

Hi Mark

The GROUPADD_PARAM in useradd.bbclass using ';' to create pieces, and pass each piece to groupadd command,

https://git.openembedded.org/openembedded-core/tree/meta/classes/useradd.bbclass#n54

such as "-r qemu; -r kvm; --system libvirt" into

'-r qemu'

'-r kvm'

'--system libvirt'

to groupadd command.

If we don't use the ';'  like this:

'-r qemu -r kvm --system libvirt' pass to groupadd command will fail.

So we should add ';'

Quoted 7 lines

--Mark

Quoted 3 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
  do_install_append() {
  	sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf
 
author
#5 lore raw
Quoted 11 lines · ddu
Quoted 9 lines · Mark Hatle
Quoted 8 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap 
Quoted 8 lines

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 8

Quoted 5 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
 libvirtd udev yajl \

    inherit useradd
  USERADD_PACKAGES = "${PN}"

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"

The __append should be fine then, but why the ';'?  That part looks wrong, since typically the PARAM is the parameters passed directly to the groupadd program. I don't believe ';' is a valid parameter.

Hi Mark

Do you have any questions on this still?

Quoted 31 lines

Hi Mark

The GROUPADD_PARAM in useradd.bbclass using ';' to create pieces, and pass each piece to groupadd command,

https://git.openembedded.org/openembedded-core/tree/meta/classes/useradd.bbclass#n54

such as "-r qemu; -r kvm; --system libvirt" into

'-r qemu'

'-r kvm'

'--system libvirt'

to groupadd command.

If we don't use the ';'  like this:

'-r qemu -r kvm --system libvirt' pass to groupadd command will fail.

So we should add ';'

Quoted 7 lines

--Mark

Quoted 3 lines

  do_install_append() {
      sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf

author
#6 lore raw
In reply to Dengke Du

Ping.

Quoted 21 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
index b55f9a9..0b0f011 100644
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"
 
  do_install_append() {
  	sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf
#7 lore raw

I'm waiting for Mark to reply to your explanation. He had the open question, I'm waiting for him to ack it.

Bruce

Quoted 30 lines · ddu

Ping.

Quoted 13 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 11

Quoted 8 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"
 
  do_install_append() {
      sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#8 lore raw
Quoted 2 lines · Bruce Ashfield

I'm waiting for Mark to reply to your explanation. He had the open question, I'm waiting for him to ack it.

Sorry, I had nothing to add.. I was satisfied with the answer.

Ack.

--Mark

Quoted 36 lines

Bruce

Quoted 30 lines · ddu

Ping.

Quoted 13 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 11

Quoted 8 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"
 
  do_install_append() {
      sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

#9 lore raw
Quoted 8 lines · Mark Hatle
Quoted 2 lines · Bruce Ashfield

I'm waiting for Mark to reply to your explanation. He had the open question, I'm waiting for him to ack it.

Sorry, I had nothing to add.. I was satisfied with the answer.

Ack.

ok. Sounds good. I'm traveling tomorrow, so I'll take care of outstanding merges over the weekend.

Bruce

Quoted 40 lines

--Mark

Quoted 36 lines

Bruce

Quoted 30 lines · ddu

Ping.

Quoted 13 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 11

Quoted 8 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"
 
  do_install_append() {
      sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#10 lore raw

This is now merged

Bruce

Quoted 62 lines · Bruce Ashfield
Quoted 8 lines · Mark Hatle
Quoted 2 lines · Bruce Ashfield

I'm waiting for Mark to reply to your explanation. He had the open question, I'm waiting for him to ack it.

Sorry, I had nothing to add.. I was satisfied with the answer.

Ack.

ok. Sounds good. I'm traveling tomorrow, so I'll take care of outstanding merges over the weekend.

Bruce

Quoted 40 lines

--Mark

Quoted 36 lines

Bruce

Quoted 30 lines · ddu

Ping.

Quoted 13 lines · Dengke Du

The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM, so we should append it, not override.

---
  meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +0 -0
index b55f9a9..0b0f011 100644

meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \ · line 11

Quoted 8 lines
meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend +1 -1
@@ -5,7 +5,7 @@ PACKAGECONFIG ?= "qemu lxc test remote macvtap libvirtd udev yajl \
 
  inherit useradd
  USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system libvirt"
+GROUPADD_PARAM_${PN}_append = " ;--system libvirt"
 
  do_install_append() {
      sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II