diff -Nru nvme-cli-1.9/debian/changelog nvme-cli-1.9/debian/changelog --- nvme-cli-1.9/debian/changelog 2019-11-23 13:40:40.000000000 +0000 +++ nvme-cli-1.9/debian/changelog 2020-08-31 18:04:43.000000000 +0000 @@ -1,3 +1,13 @@ +nvme-cli (1.9-1ubuntu0.1) focal; urgency=medium + + * d/control, d/rules, d/nvme-cli.postinst: + - wrap-and-sort -ast + - add uuid-dev build dep so 'gen-hostnqn' command works + - add uuid-runtime as postinst may call uuidgen + - generate /etc/nvme/host* files at install not build (LP: #1867366) + + -- Dan Streetman Mon, 31 Aug 2020 14:04:43 -0400 + nvme-cli (1.9-1) unstable; urgency=medium * New upstream release diff -Nru nvme-cli-1.9/debian/control nvme-cli-1.9/debian/control --- nvme-cli-1.9/debian/control 2019-11-23 13:40:09.000000000 +0000 +++ nvme-cli-1.9/debian/control 2020-08-31 18:04:43.000000000 +0000 @@ -3,12 +3,21 @@ Section: admin Priority: optional Standards-Version: 4.1.1 -Build-Depends: debhelper (>= 9), libudev-dev, python3-nose, pci.ids, uuid-runtime +Build-Depends: + debhelper (>= 9), + libudev-dev, + pci.ids, + python3-nose, + uuid-dev, + uuid-runtime, Homepage: https://github.com/linux-nvme/nvme-cli Package: nvme-cli Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + uuid-runtime, Description: userspace tooling to control NVMe drives NVMe is a fast, scalable, direct attached storage interface, accessing solid state drives through PCIe. diff -Nru nvme-cli-1.9/debian/nvme-cli.postinst nvme-cli-1.9/debian/nvme-cli.postinst --- nvme-cli-1.9/debian/nvme-cli.postinst 1970-01-01 00:00:00.000000000 +0000 +++ nvme-cli-1.9/debian/nvme-cli.postinst 2020-08-31 18:04:43.000000000 +0000 @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ]; then + if [ "$2" = "1.9-1" ]; then + # the hostid was hardcoded into the binary package, so if the + # local file matches the 1.9-1 version hardcoded value, + # remove the file so it is properly generated below + if [ -s /etc/nvme/hostid ] && [ "$(cat /etc/nvme/hostid)" = "9ce77162-5a3e-439b-a73f-cdf2449521b6" ]; then + echo "REMOVING non-unique /etc/nvme/hostid value" + rm -f /etc/nvme/hostid + fi + + # bug in 1.9-1 build caused hostnqn to contain only a newline, + # which fails the "! -s" check below, so just remove the almost-empty + # file, so it is properly generated below + if [ -s /etc/nvme/hostnqn ] && [ -z "$(cat /etc/nvme/hostnqn)" ]; then + rm -f /etc/nvme/hostnqn + fi + fi + + if [ ! -s /etc/nvme/hostnqn ]; then + nvme gen-hostnqn > /etc/nvme/hostnqn + fi + + if [ ! -s /etc/nvme/hostid ]; then + uuidgen > /etc/nvme/hostid + fi +fi + +#DEBHELPER# diff -Nru nvme-cli-1.9/debian/rules nvme-cli-1.9/debian/rules --- nvme-cli-1.9/debian/rules 2018-08-06 16:12:32.000000000 +0000 +++ nvme-cli-1.9/debian/rules 2020-08-31 18:00:17.000000000 +0000 @@ -7,6 +7,10 @@ override_dh_auto_install: dh_auto_install -- PREFIX=/usr + # Remove build-time unique id files, instead these will be + # generated by the postinst script + rm -f debian/nvme-cli/etc/nvme/hostid + rm -f debian/nvme-cli/etc/nvme/hostnqn override_dh_auto_test: # Overriding auto test, since the tests require that the build machine