From nobody Sun Feb 8 01:33:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569582746; cv=none; d=zoho.com; s=zohoarc; b=kX/8c6Zmbqyx6w8PMOh88pzskyfJyc400kK1UTu6E5Sc+NrAsQPWrUZM8LuLIC2020dxArcXXzPGvUpGtxKuQUraR9dnnuBORgPf8beHa+X0WSYZNtxdOJZTOiwT+bbzmrWiujun93+94urm4Xm77Y1gTnB1UqSsMa9pc/s62Io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582746; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0+EkJl7IKHU2ps/J0m6q6A0eOabvzGwd3CSs51NyD3Q=; b=njGdQde5OICH8eqMebkPlGsKLHEfTzE5SCPovxITgrsX8x7XZEpsWO0AjiDet8j8m1NFX1GfPxCMOdUS+tAzZ67dVn5CW3HPthjVNwy+VPPHL5t29alUK5lr854ejBfizsDtBA2HqI0la4l2NcNZG64rEzS6vZGppfY9hgH5flA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582746023354.9908097004178; Fri, 27 Sep 2019 04:12:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A14B6445D; Fri, 27 Sep 2019 11:12:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14AFC60BF3; Fri, 27 Sep 2019 11:12:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C68C3180BA9E; Fri, 27 Sep 2019 11:12:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCHCT028283 for ; Fri, 27 Sep 2019 07:12:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5585360C18; Fri, 27 Sep 2019 11:12:17 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A26C60BF3; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:57 +0100 Message-Id: <20190927111158.20653-11-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 10/11] build: use meson for building virt-login-shell X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 27 Sep 2019 11:12:24 +0000 (UTC) Switch over to using meson for building the virt-login-shell tool Signed-off-by: Daniel P. Berrang=C3=A9 --- m4/virt-login-shell.m4 | 43 ------------------------------- meson.build | 2 ++ meson_options.txt | 1 + tools/Makefile.am | 35 -------------------------- tools/meson.build | 57 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 78 deletions(-) delete mode 100644 m4/virt-login-shell.m4 diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4 deleted file mode 100644 index 713c488599..0000000000 --- a/m4/virt-login-shell.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl . - -AC_DEFUN([LIBVIRT_ARG_LOGIN_SHELL], [ - LIBVIRT_ARG_WITH([LOGIN_SHELL], [build virt-login-shell], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOGIN_SHELL], [ - if test "x$with_login_shell" !=3D "xno"; then - if test "x$with_linux" !=3D "xyes"; then - if test "x$with_login_shell" =3D "xyes"; then - AC_MSG_ERROR([virt-login-shell is supported on Linux only]) - else - with_login_shell=3Dno; - fi - else - with_login_shell=3Dyes; - fi - fi - - if test "x$with_login_shell" =3D "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_LOGIN_SHELL], 1, [whether virt-login-shell = is built]) - fi - AM_CONDITIONAL([WITH_LOGIN_SHELL], [test "$with_login_shell" =3D "yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LOGIN_SHELL], [ - LIBVIRT_RESULT([virt-login-shell], [$with_login_shell]) -]) diff --git a/meson.build b/meson.build index 4e759d147b..bda0ee0373 100644 --- a/meson.build +++ b/meson.build @@ -13,11 +13,13 @@ project( prefix =3D get_option('prefix') bin_dir =3D get_option('bindir') lib_dir =3D get_option('libdir') +libexec_dir =3D get_option('libexecdir') sys_conf_dir =3D get_option('sysconfdir') data_dir =3D get_option('datadir') local_state_dir =3D get_option('localstatedir') pkg_data_dir =3D data_dir / meson.project_name() pkg_doc_dir =3D data_dir / 'doc' / meson.project_name() + '-' + meson.proj= ect_version() +pkg_sys_conf_dir =3D sys_conf_dir / 'libvirt' =20 public_inc_dir =3D include_directories('include') gnulib_inc_dir =3D include_directories('gnulib/lib') diff --git a/meson_options.txt b/meson_options.txt index 92062f5d63..d092f30ba7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -23,3 +23,4 @@ option('with-driver-secret', type: 'boolean', value: true= , description: 'Enable option('with-driver-storage', type: 'boolean', value: true, description: '= Enable storage driver') =20 option('with-tools-host-validate', type: 'boolean', value: true, descripti= on: 'Enable virt-host-validate tool') +option('with-tools-login-shell', type: 'boolean', value: true, description= : 'Enable virt-login-shell tool') diff --git a/tools/Makefile.am b/tools/Makefile.am index 749eaa12ff..94146632cb 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -53,7 +53,6 @@ ICON_FILES =3D \ =20 PODFILES =3D \ virt-admin.pod \ - virt-login-shell.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ virt-xml-validate.pod \ @@ -62,7 +61,6 @@ PODFILES =3D \ =20 MANINFILES =3D \ virt-admin.1.in \ - virt-login-shell.1.in \ virt-pki-validate.1.in \ virt-sanlock-cleanup.8.in \ virt-xml-validate.1.in \ @@ -76,7 +74,6 @@ EXTRA_DIST =3D \ virt-pki-validate.in \ virt-sanlock-cleanup.in \ libvirt-guests.sysconf \ - virt-login-shell.conf \ virsh-edit.c \ bash-completion/vsh \ libvirt_recover_xattrs.sh \ @@ -107,13 +104,6 @@ man8_MANS =3D virt-sanlock-cleanup.8 DISTCLEANFILES +=3D virt-sanlock-cleanup endif WITH_SANLOCK =20 -if WITH_LOGIN_SHELL -conf_DATA +=3D virt-login-shell.conf -bin_PROGRAMS +=3D virt-login-shell -libexec_PROGRAMS =3D virt-login-shell-helper -man1_MANS +=3D virt-login-shell.1 -endif WITH_LOGIN_SHELL - virt-xml-validate: virt-xml-validate.in Makefile $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \ -e 's|[@]VERSION@|$(VERSION)|g' \ @@ -150,31 +140,6 @@ libvirt_shell_la_SOURCES =3D \ vsh-table.c vsh-table.h =20 =20 -# virt-login-shell will be setuid, and must not link to anything -# except glibc. It wil scrub the environment and then invoke the -# real virt-login-shell-helper binary. -virt_login_shell_SOURCES =3D \ - virt-login-shell.c - -virt_login_shell_CPPFLAGS =3D $(STANDALONE_CPPFLAGS) - -virt_login_shell_helper_SOURCES =3D \ - virt-login-shell-helper.c - -virt_login_shell_helper_LDFLAGS =3D \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -virt_login_shell_helper_LDADD =3D \ - ../src/libvirt.la \ - ../src/libvirt-lxc.la \ - ../gnulib/lib/libgnu.la - -virt_login_shell_helper_CFLAGS =3D \ - $(AM_CFLAGS) \ - $(NULL) - virsh_SOURCES =3D \ virsh.c virsh.h \ virsh-checkpoint.c virsh-checkpoint.h \ diff --git a/tools/meson.build b/tools/meson.build index fdc3549411..6349dec2fb 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -6,6 +6,11 @@ if not (with_driver_qemu or with_driver_lxc or with_driver= _bhyve) with_tools_host_validate =3D false endif =20 +with_tools_login_shell =3D get_option('with-tools-login-shell') +if not with_driver_lxc + with_tools_login_shell =3D false +endif + if with_tools_host_validate virt_host_validate_src =3D [ 'virt-host-validate.c', @@ -59,3 +64,55 @@ if with_tools_host_validate install_dir : join_paths(get_option('mandir'), 'man1') ) endif + +if with_tools_login_shell + virt_login_shell_inc =3D [ + top_inc_dir, + ] + virt_login_shell_src =3D [ + 'virt-login-shell.c', + ] + virt_login_shell =3D executable( + 'virt-login-shell', + install: true, + sources: virt_login_shell_src, + include_directories: virt_login_shell_inc, + # We'll let downstream turn on setuid bit if they + # feel it is justified for their needs + #install_mode: ['rwsr-x---', 'root', 'root'], + ) + + virt_login_shell_helper_src =3D [ + 'virt-login-shell-helper.c', + ] + virt_login_shell_helper_inc =3D common_inc_dir + virt_login_shell_helper_libs =3D [libvirt_dep, libvirt_lxc_dep, libxml_d= ep, gnulib_dep] + virt_login_shell_helper =3D executable( + 'virt-login-shell-helper', + install: true, + install_dir: libexec_dir, + sources: virt_login_shell_helper_src, + include_directories: virt_login_shell_helper_inc, + dependencies: virt_login_shell_helper_libs + ) + + install_data( + 'virt-login-shell.conf', + install_dir: pkg_sys_conf_dir, + ) + + virt_login_shell_man =3D custom_target( + 'virt_login_shell_man', + output : 'virt-login-shell.1', + input : 'virt-login-shell.pod', + command : [ + pod2man, + '--section=3D1', + '--center=3DVirtualization Support', + '--release=3Dlibvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') + ) +endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list