diff -Nru util-linux-2.36/debian/changelog util-linux-2.36/debian/changelog --- util-linux-2.36/debian/changelog 2020-08-01 19:14:53.000000000 +0000 +++ util-linux-2.36/debian/changelog 2020-08-30 19:31:17.000000000 +0000 @@ -1,3 +1,25 @@ +util-linux (2.36-3ubuntu1) groovy; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Build hwclock with audit support. + - Drop debian/hwclock.rules and debian/util-linux.hwclock.default, recent + kernels sync the RTC automatically. + - Add sulogin-fallback-static-sh.patch: Add support for /bin/static-sh as + fallback if the regular shell fails to execute. Patch ported from + sysvinit. (see LP #505887) + - Add sulogin-lockedpwd.patch: Make sure file systems can be fixed on + machines with locked root accounts (as Ubuntu does by default). Don't + require --force for sulogin. + - Clean up weekly fstrim cron file, now a systemd timer unit. + + -- Gianfranco Costamagna Sun, 30 Aug 2020 21:31:17 +0200 + +util-linux (2.36-3) unstable; urgency=medium + + * Fix sfdisk regression with upstream patch (Closes: #966992) + + -- Chris Hofstaedtler Sat, 29 Aug 2020 12:32:39 +0000 + util-linux (2.36-2ubuntu1) groovy; urgency=medium * Merge from Debian unstable. Remaining changes: diff -Nru util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified.patch util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified.patch --- util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified.patch 1970-01-01 00:00:00.000000000 +0000 +++ util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified.patch 2020-08-29 12:32:39.000000000 +0000 @@ -0,0 +1,39 @@ +From 4fe7f9b614e2b5bb97f6d89af02acb867cffccc1 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 10 Aug 2020 11:37:32 +0200 +Subject: [PATCH] libfdisk: fix last free sector detection if partition size + specified + +We need to skip useless gaps between partition if the gap is no large +enough for a new partition. Unfortunately, the current code checks +size of the gap, but does not care for location of the gap -- this is +good enough for dialog driven partitioning, but it's pretty bad if +start of the partition is explicitly specified (e.g. sfdisk). + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1860461 +Signed-off-by: Karel Zak +--- + libfdisk/src/dos.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c +index 176969883..890e33a26 100644 +--- a/libfdisk/src/dos.c ++++ b/libfdisk/src/dos.c +@@ -1274,14 +1274,14 @@ static int add_partition(struct fdisk_context *cxt, size_t n, + fdisk_sector_t last; + + rc = find_last_free(cxt, is_logical, start, limit, &last); +- + if (rc == 0 && last - start + 1 < fdisk_partition_get_size(pa)) { + DBG(LABEL, ul_debug("DOS: area <%ju,%ju> too small [wanted=%ju aval=%ju]", + (uintmax_t) start, (uintmax_t) last, + fdisk_partition_get_size(pa), + last - start)); + +- if (fdisk_partition_has_start(pa)) ++ if (fdisk_partition_has_start(pa) ++ && fdisk_partition_get_start(pa) <= last) + rc = -ENOSPC; + else { + start = last + 1; diff -Nru util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified-test.patch util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified-test.patch --- util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified-test.patch 1970-01-01 00:00:00.000000000 +0000 +++ util-linux-2.36/debian/patches/libfdisk-fix-last-free-sector-detection-if-partition-size-specified-test.patch 2020-08-29 12:32:39.000000000 +0000 @@ -0,0 +1,67 @@ +From dc4816142c7f628e2828b09b7634e1c65be7e823 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 10 Aug 2020 12:00:17 +0200 +Subject: [PATCH] tests: add sfdisk test for + 4fe7f9b614e2b5bb97f6d89af02acb867cffccc1 + +Signed-off-by: Karel Zak +--- + tests/expected/sfdisk/dos-sizes-vs-gaps | 26 +++++++++++++++++++++++++ + tests/ts/sfdisk/dos | 13 +++++++++++++ + 2 files changed, 39 insertions(+) + create mode 100644 tests/expected/sfdisk/dos-sizes-vs-gaps + +diff --git a/tests/expected/sfdisk/dos-sizes-vs-gaps b/tests/expected/sfdisk/dos-sizes-vs-gaps +new file mode 100644 +index 000000000..a3eb79020 +--- /dev/null ++++ b/tests/expected/sfdisk/dos-sizes-vs-gaps +@@ -0,0 +1,26 @@ ++Checking that no-one is using this disk right now ... OK ++ ++Disk : 50 MiB, 52428800 bytes, 102400 sectors ++Disk model: scsi_debug ++Units: sectors of 1 * 512 = 512 bytes ++Sector size (logical/physical): 512 bytes / 4096 bytes ++I/O size (minimum/optimal): 4096 bytes / bytes ++ ++>>> Created a new disklabel. ++1: Created a new partition . ++2: Created a new partition . ++3: Created a new partition . ++4: Done. ++ ++New situation: ++Disklabel type: dos ++Disk identifier: ++ ++Device Boot Start End Sectors Size Id Type ++1 2048 3070 1023 511.5K 83 Linux ++2 4096 8190 4095 2M 83 Linux ++3 8192 16382 8191 4M 83 Linux ++ ++The partition table has been altered. ++Calling ioctl() to re-read partition table. ++Syncing disks. +diff --git a/tests/ts/sfdisk/dos b/tests/ts/sfdisk/dos +index a2fd72885..4aa155ce0 100755 +--- a/tests/ts/sfdisk/dos ++++ b/tests/ts/sfdisk/dos +@@ -260,4 +260,17 @@ udevadm settle + ts_finalize_subtest + + ++ts_init_subtest "sizes-vs-gaps" ++$TS_CMD_WIPEFS -a ${TS_DEVICE} &> /dev/null ++udevadm settle ++$TS_CMD_SFDISK ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <