[meta-virtualization] [m-c-s][PATCH] libvirt: fix GROUPADD_PARAM override conflict

ddu dengke.du at windriver.com
Thu Mar 7 18:44:24 PST 2019


在 2019/3/7 下午10:00, Mark Hatle 写道:
> On 3/6/19 8:58 PM, Dengke Du wrote:
>> The libvirt recipe in meta-virtualization already define the GROUPADD_PARAM,
>> so we should append it, not override.
>>
>> Signed-off-by: Dengke Du <dengke.du at windriver.com>
>> ---
>>   meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend b/meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend
>> index b55f9a9..0b0f011 100644
>> --- a/meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend
>> +++ b/meta-openstack/recipes-extended/libvirt/libvirt_4.%.bbappend
>> @@ -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.

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 "x`echo $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.

>
> --Mark
>
>>   do_install_append() {
>>   	sed -e "s:^#unix_sock_group =:unix_sock_group =:g" -i ${D}/etc/libvirt/libvirtd.conf
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-virtualization/attachments/20190308/391054ee/attachment.html>


More information about the meta-virtualization mailing list