Your message dated Thu, 29 Aug 2019 15:52:39 +0000
with message-id <[email protected]>
and subject line Bug#929679: fixed in fai 5.8.5
has caused the Debian Bug report #929679,
regarding fai-client: fai-kvm allow to pass arguments down to qemu-kvm
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
929679: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=929679
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: fai-client
Version: 5.8.4
Severity: normal

Dear Maintainer,

fai-kvm does not currently allow to pass arguments to the underlying
qemu-kvm process which could come in handy on certain scenarios (ie: if
you want to setup yubikeys from fai, you need usb passthrough to kvm for
testing).

I attach two proposed patches (from my limited bash kung-fu):
- double dash enables the "standard" syntax:
fai-kvm [fai-kvm args] -- [args passed to qemu-kvm]
- shift abuse enables the syntax:
fai-kvm [fai-kvm args] [args passed to qemu-kvm]

They are named based on how they're coded. Double dash is a few lines
longer, but the syntax is way more clear on what programs handles which
parameters. I personally prefer that one.

Hope this can be implemented in future releases of fai!

marc


-- System Information:
Debian Release: 10.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-5-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages fai-client depends on:
ii  debconf-utils        1.5.71
ii  file                 1:5.35-4
ii  iproute2             4.20.0-2
ii  libapt-pkg-perl      0.1.34+b1
ii  libfile-lchown-perl  0.02-2+b5
ii  perl                 5.28.1-6

Versions of packages fai-client recommends:
ii  fdisk          2.33.1-0.1
ii  libgraph-perl  1:0.9704-1
ii  util-linux     2.33.1-0.1

Versions of packages fai-client suggests:
pn  logtail  <none>

-- Configuration Files:
/etc/fai/fai.conf [Errno 2] No such file or directory: '/etc/fai/fai.conf'
(sorry, I have /etc/fai inside /srv/fai! but I don't think the file is
needed for this).

-- no debconf information
--- /usr/bin/fai-kvm    2019-03-27 22:44:02.000000000 +0100
+++ ./fai-kvm   2019-05-28 16:18:20.466019544 +0200
@@ -24,26 +24,28 @@
 
   # boot from disk
     [ -n "$1" ] && disk=$1
+    shift
     case "$disk" in
        *.raw) f=",format=raw" ;;
     esac
     set -x
-    kvm $gopt -boot order=c $net -drive file=$disk,if=virtio$f
+    kvm $gopt -boot order=c $net -drive file=$disk,if=virtio$f $*
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - -
 boot_pxe() {
 
   # PXE boot
   set -x
-  kvm $gopt -boot order=nc $net $disk
+  kvm $gopt -boot order=nc $net $disk $*
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - -
 boot_cd() {
 
   [ -n "$1" ] && cdimage=$1
+  shift
   # boot fai-cd
   set -x
-  kvm $gopt -boot order=cd $net $disk -cdrom $cdimage
+  kvm $gopt -boot order=cd $net $disk -cdrom $cdimage $*
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - -
 die() {
@@ -155,10 +157,31 @@
   done
 fi
 
-case "$1" in
-    pxe) boot_pxe ;;
-    cd) boot_cd $2 ;;
-    disk) boot_disk $2 ;;
+# Loop through parameters until '--' to pass the remainder to kvm.
+# The preceding parameters are stored in $param1 & $param2
+# param1 = cd|pxe|pxe ; param2 = diskimage | imagename
+param1=""
+param2=""
+while test ${#} -gt 0
+do
+  echo "param... $1"
+  if [ "$1" = "--" ]; then
+         shift
+         break
+  fi
+  param1="$param2"
+  param2="$1"
+  shift
+done
+if [ -z "$param1" ]; then
+  param1="$param2" 
+  param2=""
+fi
+
+case "$param1" in
+    pxe) boot_pxe $*;;
+    cd) boot_cd $param2 $*;;
+    disk) boot_disk $param2 $* ;;
     *)
         echo "Missing argument." >&2
         usage
--- /usr/bin/fai-kvm    2019-03-27 22:44:02.000000000 +0100
+++ ./fai-kvm   2019-05-28 16:22:12.634678582 +0200
@@ -23,27 +23,29 @@
 boot_disk() {
 
   # boot from disk
-    [ -n "$1" ] && disk=$1
+    [ -n "$2" ] && disk=$2
+    shift; shift
     case "$disk" in
        *.raw) f=",format=raw" ;;
     esac
     set -x
-    kvm $gopt -boot order=c $net -drive file=$disk,if=virtio$f
+    kvm $gopt -boot order=c $net -drive file=$disk,if=virtio$f $*
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - -
 boot_pxe() {
-
+  shift
   # PXE boot
   set -x
-  kvm $gopt -boot order=nc $net $disk
+  kvm $gopt -boot order=nc $net $disk $*
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - -
 boot_cd() {
 
-  [ -n "$1" ] && cdimage=$1
+  [ -n "$2" ] && cdimage=$2
+  shift; shift
   # boot fai-cd
   set -x
-  kvm $gopt -boot order=cd $net $disk -cdrom $cdimage
+  kvm $gopt -boot order=cd $net $disk -cdrom $cdimage $*
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - -
 die() {
@@ -156,9 +158,9 @@
 fi
 
 case "$1" in
-    pxe) boot_pxe ;;
-    cd) boot_cd $2 ;;
-    disk) boot_disk $2 ;;
+    pxe) boot_pxe $*;;
+    cd) boot_cd $*;;
+    disk) boot_disk $* ;;
     *)
         echo "Missing argument." >&2
         usage

--- End Message ---
--- Begin Message ---
Source: fai
Source-Version: 5.8.5

We believe that the bug you reported is fixed in the latest version of
fai, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Thomas Lange <[email protected]> (supplier of updated fai package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 29 Aug 2019 17:08:49 +0200
Source: fai
Architecture: source
Version: 5.8.5
Distribution: unstable
Urgency: high
Maintainer: Thomas Lange <[email protected]>
Changed-By: Thomas Lange <[email protected]>
Closes: 926693 928981 929679 931451 933185
Changes:
 fai (5.8.5) unstable; urgency=high
 .
   [ Thomas Lange ]
   * fai-make-nfsroot, add conf/fai-project.gpg:
     add key for fai-project.org repository, Closes: #933185
   * fai-make-nfsroot: use long key ID
   * subroutines: remove wait_for_jobs() and jobrunning(), prevent
     undefined variable
     umount /run/dev in target, Closes: #928981
   * fai-mirror: allow packages without .deb suffix
   * fai-chboot: better info messages
   * fai-kvm: allow kvm options after --, Closes: #929679
   * fai-cd: make first partition bootable, Closes: #926693
   * Makefile: use sed instead of perl
   * add fai-server.maintscript
   * compat: use debhelper compat level 11
   * rules: use dh instead of dh_ tools
   * setup-storage: use internal variable name when in debug mode
   * Commands.pm: always set boot flag for /boot/efi, Closes: #931451
   * fai-cd.8: add option -V
   * fai-guide.txt: fix a lot of small typos
   * task_sysinfo: remove init.d call which does not exists any more
   * fai-mk-network: detect default network device
   * fai-guide.txt: update kernel version and some newer output examples
   * grub.cfg.autodiscover: drop unused option
   * check-cross-arch: add test if qemu static is needed in target
 .
   [ Donovan Keohane ]
   * Commands.pm: fixes creating btrfs subvolumes
     https://github.com/faiproject/fai/pull/81
 .
   [ mroelandts ]
   * fai-cd: add option -V
Checksums-Sha1:
 d7e939efd941cf97e48f816e9250304e6f73103f 1914 fai_5.8.5.dsc
 99b63539cea0e817bc9c6f500df59ea743aa86dd 315156 fai_5.8.5.tar.xz
 53632317c81d673fcf6aeee3dcf862ec3dba9435 12951 fai_5.8.5_amd64.buildinfo
Checksums-Sha256:
 ee06a547c0ba8882ca1ff699beb92cc397b4cdea3695a61382f5b668989b5887 1914 
fai_5.8.5.dsc
 72e39d2d66f256212ae8a01c2cbaf2545205fd95f879495f65e5cd76ffed5c88 315156 
fai_5.8.5.tar.xz
 871b9e12e8d79e632b45a6dff06d3789fb4eb92e2a6da1ab710157d3a51f45a4 12951 
fai_5.8.5_amd64.buildinfo
Files:
 d1cd8407fa0a0bae8638f0bc13201b24 1914 admin optional fai_5.8.5.dsc
 e1c04f70f2193f5bb7181a03c02b68bf 315156 admin optional fai_5.8.5.tar.xz
 1dcf3c4ddd948558a6b0939f0c958885 12951 admin optional fai_5.8.5_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEEsR7jJz9rLetSjJPaK/jZ/gdLzeQFAl1n7FoRHGxhbmdlQGRl
Ymlhbi5vcmcACgkQK/jZ/gdLzeQLkRAAnBcFIxaqlvqidMT4W6OQn3h66EpigXZf
15rrzTzqVVV1nBvLiB9eQ+GuVgrn+J+zLF8JM2LVGaou4y8L/ocwXkpv/VsF9zIG
VWKFUQfdDJGYF4X9BE9/xGM/oL63eacZohgZ7rpwQmR+e5uTUumMiIwCasXpHx+V
kY9t59Emvale3FXoWt1zRPVbTVzBCkvZKbVCUowP9es4gx21uuJhlBRZWXi80CgK
7zZoyuD/2v6rPNZkU21+tc2hp6Am4aIXmoh51RuF2SXGLbKen1JTRgmL4MpKsyaz
EIhURH+eX9yeGgPtnrZVP3/X0qFeK7h5HkG9gSC7OtA2xxHKzUkxWynU+wzEDcPa
0Pmw3D2PuXcIO+QmEybfUsc3Vox1dR+beIYvGv9N/2jSlsIYlLIN6OhC4ppDSDLR
jdxxW0Zm0Dr89c2L3LawcExnihcpb+3DSfvaheXMW9IbSJylo6ZY8O4g026PQQPs
RryE/FdMT8p2E/XTVbTeiUQF1GeS+znLgCyVnIP3Ss4Ga0fSW7aU3WX+hRpWPtgE
mY1gJ/036eI3cattiwYRbQJQxdMRz2N5WTzukXzN/NyepgTH5Z5MC0oudMOB3WZB
7c/C+MjAQeYllyklLHO4TP9IPQ5Q0zUj+tB7MRHDl2qXv6FXSAkOio74H9okUAxL
Ptt7MyBGI48=
=jXfB
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to