diff -Nru walinuxagent-2.2.46/debian/changelog walinuxagent-2.2.46/debian/changelog --- walinuxagent-2.2.46/debian/changelog 2022-02-16 17:37:33.000000000 +0000 +++ walinuxagent-2.2.46/debian/changelog 2022-05-02 11:04:50.000000000 +0000 @@ -1,3 +1,10 @@ +walinuxagent (2.2.46-0ubuntu5.1) jammy; urgency=medium + + * Add patch to fix handling of gen2 disks + w/ udev rules. (LP: #1971141) + + -- Utkarsh Gupta Mon, 02 May 2022 16:34:50 +0530 + walinuxagent (2.2.46-0ubuntu5) jammy; urgency=medium * No-change rebuild to update maintainer scripts, see LP: 1959054 diff -Nru walinuxagent-2.2.46/debian/patches/fix-udev-rules-for-azure.patch walinuxagent-2.2.46/debian/patches/fix-udev-rules-for-azure.patch --- walinuxagent-2.2.46/debian/patches/fix-udev-rules-for-azure.patch 1970-01-01 00:00:00.000000000 +0000 +++ walinuxagent-2.2.46/debian/patches/fix-udev-rules-for-azure.patch 2022-05-02 11:04:50.000000000 +0000 @@ -0,0 +1,63 @@ +From d33f1f810728dbe4e2891149936195d1ec7aaa27 Mon Sep 17 00:00:00 2001 +From: Thomas Stringer +Date: Mon, 20 Jul 2020 14:24:22 -0400 +Subject: [PATCH] Fix handling of gen2 disks with udev rules (#1954) + +--- + config/66-azure-storage.rules | 40 ++++++++++++++++++++--------------- + 1 file changed, 23 insertions(+), 17 deletions(-) + +--- a/config/66-azure-storage.rules ++++ b/config/66-azure-storage.rules +@@ -1,28 +1,34 @@ +-ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_VENDOR}=="Msft", ENV{ID_MODEL}=="Virtual_Disk", GOTO="azure_disk" +-GOTO="azure_end" ++# Azure specific rules. ++ACTION!="add|change", GOTO="walinuxagent_end" ++SUBSYSTEM!="block", GOTO="walinuxagent_end" ++ATTRS{ID_VENDOR}!="Msft", GOTO="walinuxagent_end" ++ATTRS{ID_MODEL}!="Virtual_Disk", GOTO="walinuxagent_end" + +-LABEL="azure_disk" +-# Root has a GUID of 0000 as the second value +-# The resource/resource has GUID of 0001 as the second value +-ATTRS{device_id}=="?00000000-0000-*", ENV{fabric_name}="root", GOTO="azure_names" +-ATTRS{device_id}=="?00000000-0001-*", ENV{fabric_name}="resource", GOTO="azure_names" +-ATTRS{device_id}=="?00000001-0001-*", ENV{fabric_name}="BEK", GOTO="azure_names" +-# Wellknown SCSI controllers ++# Match the known ID parts for root and resource disks. ++ATTRS{device_id}=="?00000000-0000-*", ENV{fabric_name}="root", GOTO="wa_azure_names" ++ATTRS{device_id}=="?00000000-0001-*", ENV{fabric_name}="resource", GOTO="wa_azure_names" ++ ++# Gen2 disk. + ATTRS{device_id}=="{f8b3781a-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi0", GOTO="azure_datadisk" ++# Create symlinks for data disks attached. + ATTRS{device_id}=="{f8b3781b-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi1", GOTO="azure_datadisk" + ATTRS{device_id}=="{f8b3781c-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi2", GOTO="azure_datadisk" + ATTRS{device_id}=="{f8b3781d-1e82-4818-a1c3-63d806ec15bb}", ENV{fabric_scsi_controller}="scsi3", GOTO="azure_datadisk" +-GOTO="azure_end" ++GOTO="walinuxagent_end" + +-# Retrieve LUN number for datadisks ++# Parse out the fabric n ame based off of scsi indicators. + LABEL="azure_datadisk" +-ENV{DEVTYPE}=="partition", PROGRAM="/bin/sh -c 'readlink /sys/class/block/%k/../device|cut -d: -f4'", ENV{fabric_name}="$env{fabric_scsi_controller}/lun$result", GOTO="azure_names" +-PROGRAM="/bin/sh -c 'readlink /sys/class/block/%k/device|cut -d: -f4'", ENV{fabric_name}="$env{fabric_scsi_controller}/lun$result", GOTO="azure_names" +-GOTO="azure_end" ++ENV{DEVTYPE}=="partition", PROGRAM="/bin/sh -c 'readlink /sys/class/block/%k/../device|cut -d: -f4'", ENV{fabric_name}="$env{fabric_scsi_controller}/lun$result" ++ENV{DEVTYPE}=="disk", PROGRAM="/bin/sh -c 'readlink /sys/class/block/%k/device|cut -d: -f4'", ENV{fabric_name}="$env{fabric_scsi_controller}/lun$result" ++ ++ENV{fabric_name}=="scsi0/lun0", ENV{fabric_name}="root" ++ENV{fabric_name}=="scsi0/lun1", ENV{fabric_name}="resource" ++# Don't create a symlink for the cd-rom. ++ENV{fabric_name}=="scsi0/lun2", GOTO="walinuxagent_end" + +-# Create the symlinks +-LABEL="azure_names" ++# Create the symlinks. ++LABEL="wa_azure_names" + ENV{DEVTYPE}=="disk", SYMLINK+="disk/azure/$env{fabric_name}" + ENV{DEVTYPE}=="partition", SYMLINK+="disk/azure/$env{fabric_name}-part%n" + +-LABEL="azure_end" ++LABEL="walinuxagent_end" diff -Nru walinuxagent-2.2.46/debian/patches/series walinuxagent-2.2.46/debian/patches/series --- walinuxagent-2.2.46/debian/patches/series 2020-04-21 14:10:35.000000000 +0000 +++ walinuxagent-2.2.46/debian/patches/series 2022-05-02 11:04:50.000000000 +0000 @@ -1,2 +1,3 @@ disable_import_test.patch disable_udev_overrides.patch +fix-udev-rules-for-azure.patch