diff -Nru open-iscsi-2.0.874/debian/changelog open-iscsi-2.0.874/debian/changelog --- open-iscsi-2.0.874/debian/changelog 2020-05-10 22:27:31.000000000 -0300 +++ open-iscsi-2.0.874/debian/changelog 2022-04-06 16:19:56.000000000 -0300 @@ -1,3 +1,12 @@ +open-iscsi (2.0.874-5ubuntu2.11) bionic; urgency=medium + + * d/extra/initramfs.local-{top,bottom}: move removal of open-iscsi.interface + file from local-top to local-bottom, and fix shell quoting issue that + would result in /run/initramfs/open-iscsi.interface always being removed + (LP: #1872813) + + -- Jorge Merlino Wed, 06 Apr 2022 19:19:56 +0000 + open-iscsi (2.0.874-5ubuntu2.10) bionic; urgency=medium [ Ben Swartzlander ] diff -Nru open-iscsi-2.0.874/debian/extra/initramfs.local-bottom open-iscsi-2.0.874/debian/extra/initramfs.local-bottom --- open-iscsi-2.0.874/debian/extra/initramfs.local-bottom 2020-05-10 22:27:31.000000000 -0300 +++ open-iscsi-2.0.874/debian/extra/initramfs.local-bottom 2022-04-06 16:19:03.000000000 -0300 @@ -7,4 +7,24 @@ --name iscsiuio --exec /sbin/iscsiuio || : fi +# Remove the interface file if no disks are present +if [ -f /run/initramfs/open-iscsi.interface ] ; then + found=0 + for disk in /dev/disk/by-path/*-iscsi-*; do + if [ ! -e "$disk" ] ; then + # If we have no matches, we stil go through the for loop once with + # the pattern as a string + continue + fi + if ! readlink -f "$disk" > /dev/null ; then + continue + fi + found=1 + break; + done + if [ $found = 0 ] ; then + rm /run/initramfs/open-iscsi.interface + fi +fi + exit 0 diff -Nru open-iscsi-2.0.874/debian/extra/initramfs.local-top open-iscsi-2.0.874/debian/extra/initramfs.local-top --- open-iscsi-2.0.874/debian/extra/initramfs.local-top 2020-05-10 22:27:31.000000000 -0300 +++ open-iscsi-2.0.874/debian/extra/initramfs.local-top 2022-04-06 16:19:03.000000000 -0300 @@ -381,19 +381,4 @@ done fi -# Remove the interface file if no disks are present -if [ -f /run/initramfs/open-iscsi.interface ] ; then - found=0 - for disk in /dev/disk/by-path/*-iscsi-*; do - if ! "$(readlink -f "$disk")" ; then - continue - fi - found=1 - break; - done - if [ $found = 0 ] ; then - rm /run/initramfs/open-iscsi.interface - fi -fi - exit 0