Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package google-guest-configs for 
openSUSE:Factory checked in at 2021-04-01 14:17:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/google-guest-configs (Old)
 and      /work/SRC/openSUSE:Factory/.google-guest-configs.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "google-guest-configs"

Thu Apr  1 14:17:54 2021 rev:3 rq:882393 version:20210317.00

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/google-guest-configs/google-guest-configs.changes    
    2020-08-29 20:33:01.709229822 +0200
+++ 
/work/SRC/openSUSE:Factory/.google-guest-configs.new.2401/google-guest-configs.changes
      2021-04-01 14:19:19.608157111 +0200
@@ -1,0 +2,20 @@
+Wed Mar 31 12:55:08 UTC 2021 - John Paul Adrian Glaubitz 
<[email protected]>
+
+- Update to version 20210317.00 (bsc#1183414, bsc#1183415)
+  * dracut.conf wants spaces around values (#19)
+  * make the same change for debian (#18)
+  * change path back for google_nvme_id (#17)
+  * move google_nvme_id to /usr/bin (#16)
+  * correct udev rule syntax (#15)
+  * prune el6 spec (#13)
+  * Updated udev rules (#11)
+- Remove empty %{_sbindir} from %install and %files section
+
+-------------------------------------------------------------------
+Tue Jan  5 20:26:01 UTC 2021 - Robert Schweikert <[email protected]>
+
+- Remove service files (bsc#1180304)
+  + google-optimize-local-ssd.service, google-set-multiqueue.service
+    scripts are called from within the guest agent
+
+-------------------------------------------------------------------

Old:
----
  google-guest-configs-20200731.00.tar.gz
  google-optimize-local-ssd.service
  google-set-multiqueue.service

New:
----
  google-guest-configs-20210317.00.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ google-guest-configs.spec ++++++
--- /var/tmp/diff_new_pack.YbxPhn/_old  2021-04-01 14:19:20.144157826 +0200
+++ /var/tmp/diff_new_pack.YbxPhn/_new  2021-04-01 14:19:20.144157826 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package google-guest-configs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,13 @@
 
 
 Name:           google-guest-configs
-Version:        20200731.00
+Version:        20210317.00
 Release:        0
 Summary:        Google Cloud Guest Configs
 License:        Apache-2.0
 Group:          System/Daemons
 URL:            https://github.com/GoogleCloudPlatform/guest-configs
 Source0:        %{name}-%{version}.tar.gz
-Source1:        google-optimize-local-ssd.service
-Source2:        google-set-multiqueue.service
 BuildRequires:  systemd-rpm-macros
 %if 0%{?suse_version} && 0%{?suse_version} <= 1315
 BuildRequires:  pkgconfig(udev)
@@ -50,27 +48,10 @@
 cp -av src/etc/rsyslog.d/* %{buildroot}%{_sysconfdir}/rsyslog.d/
 mkdir -p %{buildroot}%{_sysconfdir}/sysctl.d
 cp -av src/etc/sysctl.d/* %{buildroot}%{_sysconfdir}/sysctl.d/
-mkdir -p %{buildroot}%{_unitdir}
-cp -av %{SOURCE1} %{buildroot}%{_unitdir}/
-cp -av %{SOURCE2} %{buildroot}%{_unitdir}/
 mkdir -p %{buildroot}%{_udevrulesdir}
 cp -av src/lib/udev/rules.d/* %{buildroot}%{_udevrulesdir}/
 mkdir -p %{buildroot}%{_bindir}
 cp -av src/usr/bin/* %{buildroot}%{_bindir}/
-mkdir -p %{buildroot}%{_sbindir}
-for srv_name in %{buildroot}%{_unitdir}/*.service; do rc_name=$(basename -s 
'.service' $srv_name); ln -s service %{buildroot}%{_sbindir}/rc$rc_name; done
-
-%pre
-%service_add_pre google-optimize-local-ssd.service 
google-set-multiqueue.service
-
-%preun
-%service_del_preun google-optimize-local-ssd.service 
google-set-multiqueue.service
-
-%post
-%service_add_post google-optimize-local-ssd.service 
google-set-multiqueue.service
-
-%postun
-%service_del_postun google-optimize-local-ssd.service 
google-set-multiqueue.service
 
 %files
 %defattr(0644,root,root,0755)
@@ -85,8 +66,7 @@
 %config %{_sysconfdir}/modprobe.d/gce-blacklist.conf
 %config %{_sysconfdir}/rsyslog.d/*
 %config %{_sysconfdir}/sysctl.d/*
-%{_sbindir}/*
+%{_bindir}/*
 %{_udevrulesdir}/*
-%{_unitdir}/*
 
 %changelog

++++++ google-guest-configs-20200731.00.tar.gz -> 
google-guest-configs-20210317.00.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/guest-configs-20200731.00/packaging/debian/control 
new/guest-configs-20210317.00/packaging/debian/control
--- old/guest-configs-20200731.00/packaging/debian/control      2020-07-31 
19:51:13.000000000 +0200
+++ new/guest-configs-20210317.00/packaging/debian/control      2021-02-04 
20:22:37.000000000 +0100
@@ -10,6 +10,7 @@
 Architecture: all
 Depends: google-compute-engine-oslogin,
          google-guest-agent,
+         nvme-cli,
          ${misc:Depends}
 Recommends: rsyslog | system-log-daemon
 Provides: irqbalance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/guest-configs-20200731.00/packaging/debian/install 
new/guest-configs-20210317.00/packaging/debian/install
--- old/guest-configs-20200731.00/packaging/debian/install      2020-07-31 
19:51:13.000000000 +0200
+++ new/guest-configs-20210317.00/packaging/debian/install      2021-02-04 
20:22:37.000000000 +0100
@@ -3,4 +3,5 @@
 etc/rsyslog.d/*
 etc/sysctl.d/*
 lib/udev/rules.d/*
+lib/udev/*
 usr/bin/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20200731.00/packaging/google-compute-engine.el6.spec 
new/guest-configs-20210317.00/packaging/google-compute-engine.el6.spec
--- old/guest-configs-20200731.00/packaging/google-compute-engine.el6.spec      
2020-07-31 19:51:13.000000000 +0200
+++ new/guest-configs-20210317.00/packaging/google-compute-engine.el6.spec      
1970-01-01 01:00:00.000000000 +0100
@@ -1,70 +0,0 @@
-# Copyright 2020 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-Name: google-compute-engine
-Epoch: 1
-Version: %{_version}
-Release: g1.el6
-Summary: Google Compute Engine guest environment.
-License: ASL 2.0
-Url: https://github.com/GoogleCloudPlatform/compute-image-packages
-Source0: %{name}_%{version}.orig.tar.gz
-Requires: curl
-Requires: google-compute-engine-oslogin
-Requires: google-guest-agent
-Requires: rsyslog
-# Old packages.
-Obsoletes: google-compute-engine-init
-Obsoletes: google-config
-Obsoletes: google-startup-scripts
-
-BuildArch: noarch
-
-# Allow other files in the source that don't end up in the package.
-%define _unpackaged_files_terminate_build 0
-
-%description
-This package contains scripts, configuration, and init files for features
-specific to the Google Compute Engine cloud environment.
-
-%prep
-%autosetup
-
-%install
-cp -a src/{etc,usr,sbin} %{buildroot}
-install -d %{buildroot}/lib/
-cp -a src/lib/udev %{buildroot}/lib
-mkdir -p %{buildroot}/etc/dhcp
-ln -sf /usr/bin/google_set_hostname %{buildroot}/etc/dhcp/dhclient-exit-hooks
-
-%files
-%defattr(0644,root,root,0755)
-%attr(0755,-,-) %{_bindir}/*
-%attr(0755,-,-) /sbin/google-dhclient-script
-/lib/udev/rules.d/*
-/etc/dhcp/dhclient-exit-hooks
-%config /etc/modprobe.d/*
-%config /etc/rsyslog.d/*
-%config /etc/sysctl.d/*
-
-%pre
-if [ $1 -gt 1 ] ; then
-  # This is an upgrade. Stop services previously owned by this package, if any.
-  for svc in google-ip-forwarding-daemon google-network-setup \
-    google-network-daemon google-accounts-daemon google-clock-skew-daemon; do
-      if initctl status $svc >/dev/null 2>&1; then
-        initctl stop ${svc} || :
-      fi
-  done
-fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20200731.00/packaging/google-compute-engine.spec 
new/guest-configs-20210317.00/packaging/google-compute-engine.spec
--- old/guest-configs-20200731.00/packaging/google-compute-engine.spec  
2020-07-31 19:51:13.000000000 +0200
+++ new/guest-configs-20210317.00/packaging/google-compute-engine.spec  
2021-02-04 20:22:37.000000000 +0100
@@ -30,6 +30,7 @@
 Requires: google-compute-engine-oslogin
 Requires: google-guest-agent
 Requires: rsyslog
+Requires: nvme-cli
 
 BuildArch: noarch
 
@@ -47,12 +48,14 @@
 cp -a src/{etc,usr} %{buildroot}
 install -d %{buildroot}/%{_udevrulesdir}
 cp -a src/lib/udev/rules.d/* %{buildroot}/%{_udevrulesdir}
+cp -a src/lib/udev/google_nvme_id %{buildroot}/%{_udevrulesdir}/../
 
 %files
 %defattr(0644,root,root,0755)
 %attr(0755,-,-) %{_bindir}/*
 %attr(0755,-,-) /etc/dhcp/dhclient.d/google_hostname.sh
 %{_udevrulesdir}/*
+%{_udevrulesdir}/../google_nvme_id
 %config /etc/dracut.conf.d/*
 %config /etc/modprobe.d/*
 %config /etc/rsyslog.d/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20200731.00/src/etc/dracut.conf.d/gce.conf 
new/guest-configs-20210317.00/src/etc/dracut.conf.d/gce.conf
--- old/guest-configs-20200731.00/src/etc/dracut.conf.d/gce.conf        
2020-07-31 19:51:13.000000000 +0200
+++ new/guest-configs-20210317.00/src/etc/dracut.conf.d/gce.conf        
2021-02-04 20:22:37.000000000 +0100
@@ -1,2 +1,2 @@
 # Include NVMe driver in initrd to boot on NVMe devices.
-force_drivers+="nvme"
+force_drivers+=" nvme "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20200731.00/src/lib/udev/google_nvme_id 
new/guest-configs-20210317.00/src/lib/udev/google_nvme_id
--- old/guest-configs-20200731.00/src/lib/udev/google_nvme_id   1970-01-01 
01:00:00.000000000 +0100
+++ new/guest-configs-20210317.00/src/lib/udev/google_nvme_id   2021-02-04 
20:22:37.000000000 +0100
@@ -0,0 +1,245 @@
+#!/bin/bash
+# Copyright 2020 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Used to generate symlinks for PD-NVMe devices using the disk names reported 
by
+# the metadata server
+
+# Locations of the script's dependencies
+readonly nvme_cli_bin=/usr/sbin/nvme
+
+# Bash regex to parse device paths and controller identification
+readonly NAMESPACE_NUMBER_REGEX="/dev/nvme[[:digit:]]+n([[:digit:]]+).*"
+readonly 
PARTITION_NUMBER_REGEX="/dev/nvme[[:digit:]]+n[[:digit:]]+p([[:digit:]]+)"
+readonly PD_NVME_REGEX="sn[[:space:]]+:[[:space]]+nvme_card-pd"
+
+# Globals used to generate the symlinks for a PD-NVMe disk.  These are 
populated
+# by the identify_pd_disk function and exported for consumption by udev rules.
+ID_SERIAL=''
+ID_SERIAL_SHORT=''
+
+#######################################
+# Helper function to log an error message to stderr.
+# Globals:
+#   None
+# Arguments:
+#   String to print as the log message
+# Outputs:
+#   Writes error to STDERR
+#######################################
+function err() {
+  echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2
+}
+
+#######################################
+# Retrieves the device name for an NVMe namespace using nvme-cli.
+# Globals:
+#   Uses nvme_cli_bin
+# Arguments:
+#   The path to the nvme namespace (/dev/nvme0n?)
+# Outputs:
+#   The device name parsed from the JSON in the vendor ext of the ns-id 
command.
+# Returns:
+#   0 if the device name for the namespace could be retrieved, 1 otherwise
+#######################################
+function get_namespace_device_name() {
+  local nvme_json
+  nvme_json="$("$nvme_cli_bin" id-ns -b "$1" | xxd -p -seek 384 | xxd -p -r)"
+  if [[ $? -ne 0 ]]; then
+    return 1
+  fi
+
+  if [[ -z "$nvme_json" ]]; then
+    err "NVMe Vendor Extension disk information not present"
+    return 1
+  fi
+
+  local device_name
+  device_name="$(echo "$nvme_json" | grep device_name | sed -e 
's/.*"device_name":[  \t]*"\([a-zA-Z0-9_-]\+\)".*/\1/')"
+
+  # Error if our device name is empty
+  if [[ -z "$device_name" ]]; then
+    err "Empty name"
+    return 1
+  fi
+
+  echo "$device_name"
+  return 0
+}
+
+#######################################
+# Retrieves the nsid for an NVMe namespace
+# Globals:
+#   None
+# Arguments:
+#   The path to the nvme namespace (/dev/nvme0n*)
+# Outputs:
+#   The namespace number/id
+# Returns:
+#   0 if the namespace id could be retrieved, 1 otherwise
+#######################################
+function get_namespace_number() {
+  local dev_path="$1"
+  local namespace_number
+  if [[ "$dev_path" =~ $NAMESPACE_NUMBER_REGEX ]]; then
+    namespace_number="${BASH_REMATCH[1]}"
+  else
+    return 1
+  fi
+
+  echo "$namespace_number"
+  return 0
+}
+
+#######################################
+# Retrieves the partition number for a device path if it exists
+# Globals:
+#   None
+# Arguments:
+#   The path to the device partition (/dev/nvme0n*p*)
+# Outputs:
+#   The value after 'p' in the device path, or an empty string if the path has
+#   no partition.
+#######################################
+function get_partition_number() {
+  local dev_path="$1"
+  local partition_number
+  if [[ "$dev_path" =~ $PARTITION_NUMBER_REGEX ]]; then
+    partition_number="${BASH_REMATCH[1]}"
+    echo "$partition_number"
+  else
+    echo ''
+  fi
+  return 0
+}
+
+#######################################
+# Generates a symlink for a PD-NVMe device using the metadata's disk name.
+# Primarily used for testing but can be used if the script is directly invoked.
+# Globals:
+#   Uses ID_SERIAL_SHORT (can be populated by identify_pd_disk)
+# Arguments:
+#   The device path for the disk
+#######################################
+function gen_symlink() {
+  local dev_path="$1"
+  local partition_number="$(get_partition_number "$dev_path")"
+
+  if [[ -n "$partition_number" ]]; then
+    ln -s "$dev_path" 
/dev/disk/by-id/google-"$ID_SERIAL_SHORT"-part"$partition_number" > /dev/null 
2>&1
+  else
+    ln -s "$dev_path" /dev/disk/by-id/google-"$ID_SERIAL_SHORT" > /dev/null 
2>&1
+  fi
+
+  return 0
+}
+
+#######################################
+# Populates the ID_* global variables with a disk's device name and namespace
+# Globals:
+#   Populates ID_SERIAL_SHORT, and ID_SERIAL
+# Arguments:
+#   The device path for the disk
+# Returns:
+#   0 on success and 1 if an error occurrs
+#######################################
+function identify_pd_disk() {
+  local dev_path="$1"
+  local dev_name
+  dev_name="$(get_namespace_device_name "$dev_path")"
+  if [[ $? -ne 0 ]]; then
+    return 1
+  fi
+
+  ID_SERIAL_SHORT="$dev_name"
+  ID_SERIAL="Google_PersistentDisk_${ID_SERIAL_SHORT}"
+  return 0
+}
+
+function print_help_message() {
+  echo "Usage: google_nvme_id [-s] [-h] -d device_path"
+  echo "  -d <device_path> (Required): Specifies the path to generate a name"
+  echo "        for.  This needs to be a path to an nvme device or namespace"
+  echo "  -s: Create symbolic link for the disk under /dev/disk/by-id."
+  echo "        Otherwise, the disk name will be printed to STDOUT"
+  echo "  -h: Print this help message"
+}
+
+function main() {
+  local opt_gen_symlink='false'
+  local device_path=''
+
+  while getopts :d:sh flag; do
+    case "$flag" in
+      d) device_path="$OPTARG";;
+      s) opt_gen_symlink='true';;
+      h) print_help_message
+         return 0
+         ;;
+      :) echo "Invalid option: ${OPTARG} requires an argument" 1>&2
+         return 1
+         ;;
+      *) return 1
+    esac
+  done
+
+  if [[ -z "$device_path" ]]; then
+    echo "Device path (-d) argument required. Use -h for full usage." 1>&2
+    exit 1
+  fi
+
+  # Ensure the nvme-cli command is installed
+  command -v "$nvme_cli_bin" > /dev/null 2>&1
+  if [[ $? -ne 0 ]]; then
+    err "The nvme utility (/usr/sbin/nvme) was not found. You may need to run \
+with sudo or install nvme-cli."
+    return 1
+  fi
+
+  # Ensure the passed device is actually an NVMe device
+  "$nvme_cli_bin" id-ctrl "$device_path" &>/dev/null
+  if [[ $? -ne 0 ]]; then
+    err "Passed device was not an NVMe device.  (You may need to run this \
+script as root/with sudo)."
+    return 1
+  fi
+
+  # Detect the type of attached nvme device
+  local controller_id
+  controller_id=$("$nvme_cli_bin" id-ctrl "$device_path")
+  if [[ ! "$controller_id" =~ nvme_card-pd ]] ; then
+    err "Device is not a PD-NVMe device"
+    return 1
+  fi
+
+  # Fill the global variables for the id command for the given disk type
+  # Error messages will be printed closer to error, no need to reprint here
+  identify_pd_disk "$device_path"
+  if [[ $? -ne 0 ]]; then
+    return $?
+  fi
+
+  # Gen symlinks or print out the globals set by the identify command
+  if [[ "$opt_gen_symlink" == 'true' ]]; then
+    gen_symlink "$device_path"
+  else
+    # These will be consumed by udev
+    echo "ID_SERIAL_SHORT=${ID_SERIAL_SHORT}"
+    echo "ID_SERIAL=${ID_SERIAL}"
+  fi
+
+  return $?
+
+}
+main "$@"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20200731.00/src/lib/udev/rules.d/64-gce-disk-removal.rules 
new/guest-configs-20210317.00/src/lib/udev/rules.d/64-gce-disk-removal.rules
--- 
old/guest-configs-20200731.00/src/lib/udev/rules.d/64-gce-disk-removal.rules    
    2020-07-31 19:51:13.000000000 +0200
+++ 
new/guest-configs-20210317.00/src/lib/udev/rules.d/64-gce-disk-removal.rules    
    2021-02-04 20:22:37.000000000 +0100
@@ -14,4 +14,4 @@
 #
 # When a disk is removed, unmount any remaining attached volumes.
 
-ACTION=="remove", SUBSYSTEM=="block", KERNEL=="sd*|vd*", RUN+="/bin/sh -c 
'/bin/umount -fl /dev/$name && /usr/bin/logger -p daemon.warn -s WARNING: 
hot-removed /dev/$name that was still mounted, data may have been corrupted'"
+ACTION=="remove", SUBSYSTEM=="block", KERNEL=="sd*|vd*|nvme*", RUN+="/bin/sh 
-c '/bin/umount -fl /dev/$name && /usr/bin/logger -p daemon.warn -s WARNING: 
hot-removed /dev/$name that was still mounted, data may have been corrupted'"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-configs-20200731.00/src/lib/udev/rules.d/65-gce-disk-naming.rules 
new/guest-configs-20210317.00/src/lib/udev/rules.d/65-gce-disk-naming.rules
--- old/guest-configs-20200731.00/src/lib/udev/rules.d/65-gce-disk-naming.rules 
2020-07-31 19:51:13.000000000 +0200
+++ new/guest-configs-20210317.00/src/lib/udev/rules.d/65-gce-disk-naming.rules 
2021-02-04 20:22:37.000000000 +0100
@@ -21,9 +21,12 @@
 KERNEL=="sd*|vd*", IMPORT{program}="scsi_id --export --whitelisted -d 
$tempnode"
 
 # NVME Local SSD naming
-KERNEL=="nvme*n*", ATTRS{model}=="nvme_card", PROGRAM="/bin/sh -c 'echo 
$((%n-1))'", ENV{ID_SERIAL_SHORT}="local-nvme-ssd-%c"
+KERNEL=="nvme*n*", ATTRS{model}=="nvme_card", PROGRAM="/bin/sh -c 'echo 
$$((%n-1))'", ENV{ID_SERIAL_SHORT}="local-nvme-ssd-%c"
 KERNEL=="nvme*", ATTRS{model}=="nvme_card", 
ENV{ID_SERIAL}="Google_EphemeralDisk_$env{ID_SERIAL_SHORT}"
 
+# NVME Persistent Disk Naming
+KERNEL=="nvme*n*", ATTRS{model}=="nvme_card-pd", 
IMPORT{program}="google_nvme_id -d $tempnode"
+
 # Symlinks
 KERNEL=="sd*|vd*|nvme*", ENV{DEVTYPE}=="disk", 
SYMLINK+="disk/by-id/google-$env{ID_SERIAL_SHORT}"
 KERNEL=="sd*|vd*|nvme*", ENV{DEVTYPE}=="partition", 
SYMLINK+="disk/by-id/google-$env{ID_SERIAL_SHORT}-part%n"

Reply via email to