summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:32 +0000
commit8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch)
tree1fdda006866bca20d41cb206767ea5241e36852f /disk-utils
parentAdding debian version 2.39.3-11. (diff)
downloadutil-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.tar.xz
util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/addpart.86
-rw-r--r--disk-utils/addpart.c4
-rw-r--r--disk-utils/blockdev.811
-rw-r--r--disk-utils/blockdev.8.adoc3
-rw-r--r--disk-utils/blockdev.c38
-rw-r--r--disk-utils/cfdisk.86
-rw-r--r--disk-utils/cfdisk.c45
-rw-r--r--disk-utils/delpart.86
-rw-r--r--disk-utils/delpart.c4
-rw-r--r--disk-utils/fdformat.86
-rw-r--r--disk-utils/fdformat.c4
-rw-r--r--disk-utils/fdisk-list.c12
-rw-r--r--disk-utils/fdisk-menu.c4
-rw-r--r--disk-utils/fdisk.810
-rw-r--r--disk-utils/fdisk.8.adoc4
-rw-r--r--disk-utils/fdisk.c99
-rw-r--r--disk-utils/fdisk.h2
-rw-r--r--disk-utils/fsck.811
-rw-r--r--disk-utils/fsck.8.adoc5
-rw-r--r--disk-utils/fsck.c8
-rw-r--r--disk-utils/fsck.cramfs.86
-rw-r--r--disk-utils/fsck.cramfs.c4
-rw-r--r--disk-utils/fsck.minix.86
-rw-r--r--disk-utils/fsck.minix.c4
-rw-r--r--disk-utils/isosize.86
-rw-r--r--disk-utils/isosize.c4
-rw-r--r--disk-utils/mkfs.86
-rw-r--r--disk-utils/mkfs.bfs.86
-rw-r--r--disk-utils/mkfs.bfs.c4
-rw-r--r--disk-utils/mkfs.c4
-rw-r--r--disk-utils/mkfs.cramfs.86
-rw-r--r--disk-utils/mkfs.cramfs.c36
-rw-r--r--disk-utils/mkfs.minix.86
-rw-r--r--disk-utils/mkfs.minix.c4
-rw-r--r--disk-utils/mkswap.827
-rw-r--r--disk-utils/mkswap.8.adoc15
-rw-r--r--disk-utils/mkswap.c83
-rw-r--r--disk-utils/partx.86
-rw-r--r--disk-utils/partx.c18
-rw-r--r--disk-utils/raw.86
-rw-r--r--disk-utils/raw.8.deps2
-rw-r--r--disk-utils/raw.c4
-rw-r--r--disk-utils/resizepart.86
-rw-r--r--disk-utils/resizepart.c4
-rw-r--r--disk-utils/sfdisk.88
-rw-r--r--disk-utils/sfdisk.8.adoc2
-rw-r--r--disk-utils/sfdisk.c7
-rw-r--r--disk-utils/swaplabel.86
-rw-r--r--disk-utils/swaplabel.c5
49 files changed, 406 insertions, 183 deletions
diff --git a/disk-utils/addpart.8 b/disk-utils/addpart.8
index 74ec624..3e2852d 100644
--- a/disk-utils/addpart.8
+++ b/disk-utils/addpart.8
@@ -2,12 +2,12 @@
.\" Title: addpart
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "ADDPART" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "ADDPART" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/addpart.c b/disk-utils/addpart.c
index 0586104..6bdb336 100644
--- a/disk-utils/addpart.c
+++ b/disk-utils/addpart.c
@@ -29,8 +29,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_("Tell the kernel about the existence of a specified partition.\n"), out);
fputs(USAGE_OPTIONS, out);
- printf(USAGE_HELP_OPTIONS(16));
- printf(USAGE_MAN_TAIL("addpart(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(16));
+ fprintf(out, USAGE_MAN_TAIL("addpart(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/blockdev.8 b/disk-utils/blockdev.8
index 693b1ad..2885d64 100644
--- a/disk-utils/blockdev.8
+++ b/disk-utils/blockdev.8
@@ -2,12 +2,12 @@
.\" Title: blockdev
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-12-01
+.\" Date: 2024-03-27
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "BLOCKDEV" "8" "2023-12-01" "util\-linux 2.39.3" "System Administration"
+.TH "BLOCKDEV" "8" "2024-03-27" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -94,6 +94,11 @@ Get discard zeroes support status.
Get disk sequence number.
.RE
.sp
+\fB\-\-getzonesz\fP
+.RS 4
+Get zone size in 512\-byte sectors.
+.RE
+.sp
\fB\-\-getfra\fP
.RS 4
Get filesystem readahead in 512\-byte sectors.
diff --git a/disk-utils/blockdev.8.adoc b/disk-utils/blockdev.8.adoc
index 16f1562..4eb3b32 100644
--- a/disk-utils/blockdev.8.adoc
+++ b/disk-utils/blockdev.8.adoc
@@ -60,6 +60,9 @@ Get discard zeroes support status.
*--getdiskseq*::
Get disk sequence number.
+*--getzonesz*::
+Get zone size in 512-byte sectors.
+
*--getfra*::
Get filesystem readahead in 512-byte sectors.
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index 9b1a0b4..4a1d4e7 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -18,6 +18,9 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <errno.h>
+#ifdef HAVE_LINUX_BLKZONED_H
+#include <linux/blkzoned.h>
+#endif
#include "c.h"
#include "nls.h"
@@ -183,6 +186,14 @@ static const struct bdc bdcms[] =
.argval = -1,
.help = N_("get disk sequence number")
},{
+#ifdef BLKGETZONESZ
+ IOCTL_ENTRY(BLKGETZONESZ),
+ .name = "--getzonesz",
+ .argtype = ARG_UINT,
+ .argval = -1,
+ .help = N_("get zone size")
+ },{
+#endif
IOCTL_ENTRY(BLKFLSBUF),
.name = "--flushbufs",
.help = N_("flush buffers")
@@ -198,36 +209,36 @@ static void __attribute__((__noreturn__)) usage(void)
size_t i;
fputs(USAGE_HEADER, stdout);
- printf(_(
+ fprintf(stdout, _(
" %1$s [-v|-q] commands devices\n"
" %1$s --report [devices]\n"
" %1$s -h|-V\n"
), program_invocation_short_name);
fputs(USAGE_SEPARATOR, stdout);
- puts( _("Call block device ioctls from the command line."));
+ fputsln( _("Call block device ioctls from the command line."), stdout);
fputs(USAGE_OPTIONS, stdout);
- puts( _(" -q quiet mode"));
- puts( _(" -v verbose mode"));
- puts( _(" --report print report for specified (or all) devices"));
+ fputsln( _(" -q quiet mode"), stdout);
+ fputsln( _(" -v verbose mode"), stdout);
+ fputsln( _(" --report print report for specified (or all) devices"), stdout);
fputs(USAGE_SEPARATOR, stdout);
- printf(USAGE_HELP_OPTIONS(16));
+ fprintf(stdout, USAGE_HELP_OPTIONS(16));
fputs(USAGE_SEPARATOR, stdout);
- puts( _("Available commands:"));
- printf(_(" %-25s get size in 512-byte sectors\n"), "--getsz");
+ fputsln( _("Available commands:"), stdout);
+ fprintf(stdout, _(" %-25s get size in 512-byte sectors\n"), "--getsz");
for (i = 0; i < ARRAY_SIZE(bdcms); i++) {
if (bdcms[i].argname)
- printf(" %s %-*s %s\n", bdcms[i].name,
+ fprintf(stdout, " %s %-*s %s\n", bdcms[i].name,
(int)(24 - strlen(bdcms[i].name)),
bdcms[i].argname, _(bdcms[i].help));
else
- printf(" %-25s %s\n", bdcms[i].name,
+ fprintf(stdout, " %-25s %s\n", bdcms[i].name,
_(bdcms[i].help));
}
- printf(USAGE_MAN_TAIL("blockdev(8)"));
+ fprintf(stdout, USAGE_MAN_TAIL("blockdev(8)"));
exit(EXIT_SUCCESS);
}
@@ -336,8 +347,11 @@ static void do_commands(int fd, char **argv, int d)
if (!strcmp(argv[i], "--getsz")) {
res = blkdev_get_sectors(fd, &llu);
- if (res == 0)
+ if (res == 0) {
+ if (verbose)
+ printf(_("get size in 512-byte sectors: "));
printf("%lld\n", llu);
+ }
else
errx(EXIT_FAILURE,
_("could not get device size"));
diff --git a/disk-utils/cfdisk.8 b/disk-utils/cfdisk.8
index 2e518b7..f54c577 100644
--- a/disk-utils/cfdisk.8
+++ b/disk-utils/cfdisk.8
@@ -2,12 +2,12 @@
.\" Title: cfdisk
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "CFDISK" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "CFDISK" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index fde2029..11b7fae 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -8,7 +8,7 @@
*
* cfdisk.c - Display or manipulate a disk partition table.
*
- * Copyright (C) 2014-2015 Karel Zak <kzak@redhat.com>
+ * Copyright (C) 2014-2023 Karel Zak <kzak@redhat.com>
* Copyright (C) 1994 Kevin E. Martin (martin@cs.unc.edu)
*
* The original cfdisk was inspired by the fdisk program
@@ -23,6 +23,7 @@
#include <assert.h>
#include <libsmartcols.h>
#include <sys/ioctl.h>
+#include <rpmatch.h>
#include <libfdisk.h>
#ifdef HAVE_LIBMOUNT
@@ -2258,7 +2259,8 @@ static int ui_help(void)
" ",
N_("Command Meaning"),
N_("------- -------"),
- N_(" b Toggle bootable flag of the current partition"),
+ N_(" b Toggle bootable flag of the current partition;"),
+ N_(" implemented for DOS (MBR) and SGI labels only"),
N_(" d Delete the current partition"),
N_(" h Print this screen"),
N_(" n Create new partition from free space"),
@@ -2282,7 +2284,7 @@ static int ui_help(void)
N_("Use lsblk(8) or partx(8) to see more details about the device."),
" ",
" ",
- "Copyright (C) 2014-2017 Karel Zak <kzak@redhat.com>"
+ "Copyright (C) 2014-2023 Karel Zak <kzak@redhat.com>"
};
erase();
@@ -2456,18 +2458,17 @@ static int main_menu_action(struct cfdisk *cf, int key)
}
case 'r': /* resize */
{
- struct fdisk_partition *npa, *next;
uint64_t size, max_size, secs;
+ struct fdisk_partition *npa;
if (fdisk_partition_is_freespace(pa) || !fdisk_partition_has_start(pa))
return -EINVAL;
- size = fdisk_partition_get_size(pa);
-
- /* is the next freespace? */
- next = fdisk_table_get_partition(cf->table, cf->lines_idx + 1);
- if (next && fdisk_partition_is_freespace(next))
- size += fdisk_partition_get_size(next);
+ rc = fdisk_partition_get_max_size(cf->cxt,
+ fdisk_partition_get_partno(pa),
+ &size);
+ if (rc)
+ return rc;
size *= fdisk_get_sector_size(cf->cxt);
max_size = size;
@@ -2525,11 +2526,15 @@ static int main_menu_action(struct cfdisk *cf, int key)
if (rc)
warn = _("Failed to write disklabel.");
else {
+ size_t q_idx = 0;
+
if (cf->device_is_used)
fdisk_reread_changes(cf->cxt, cf->original_layout);
else
fdisk_reread_partition_table(cf->cxt);
info = _("The partition table has been altered.");
+ if (menu_get_menuitem_by_key(cf, 'q', &q_idx))
+ ui_menu_goto(cf, q_idx);
}
cf->nwrites++;
break;
@@ -2589,11 +2594,17 @@ static int ui_run(struct cfdisk *cf)
DBG(UI, ul_debug("start cols=%zu, lines=%zu", ui_cols, ui_lines));
if (fdisk_get_collision(cf->cxt)) {
- ui_warnx(_("Device already contains a %s signature; it will be removed by a write command."),
- fdisk_get_collision(cf->cxt));
- fdisk_enable_wipe(cf->cxt, 1);
- ui_hint(_("Press a key to continue."));
- getch();
+ ui_warnx(_("Device already contains a %s signature."), fdisk_get_collision(cf->cxt));
+ if (fdisk_is_readonly(cf->cxt)) {
+ ui_hint(_("Press a key to continue."));
+ getch();
+ } else {
+ char buf[64] = { 0 };
+ rc = ui_get_string(_("Do you want to remove it? [Y]es/[N]o: "), NULL,
+ buf, sizeof(buf));
+ fdisk_enable_wipe(cf->cxt,
+ rc > 0 && rpmatch(buf) == RPMATCH_YES ? 1 : 0);
+ }
}
if (!fdisk_has_label(cf->cxt) || cf->zero_start) {
@@ -2727,9 +2738,9 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -r, --read-only forced open cfdisk in read-only mode\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(26));
+ fprintf(out, USAGE_HELP_OPTIONS(26));
- printf(USAGE_MAN_TAIL("cfdisk(8)"));
+ fprintf(out, USAGE_MAN_TAIL("cfdisk(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/delpart.8 b/disk-utils/delpart.8
index da24ffc..37e5ea6 100644
--- a/disk-utils/delpart.8
+++ b/disk-utils/delpart.8
@@ -2,12 +2,12 @@
.\" Title: delpart
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "DELPART" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "DELPART" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/delpart.c b/disk-utils/delpart.c
index 497dcc9..8506069 100644
--- a/disk-utils/delpart.c
+++ b/disk-utils/delpart.c
@@ -29,8 +29,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_("Tell the kernel to forget about a specified partition.\n"), out);
fputs(USAGE_OPTIONS, out);
- printf(USAGE_HELP_OPTIONS(16));
- printf(USAGE_MAN_TAIL("delpart(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(16));
+ fprintf(out, USAGE_MAN_TAIL("delpart(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/fdformat.8 b/disk-utils/fdformat.8
index e145fdd..e026d23 100644
--- a/disk-utils/fdformat.8
+++ b/disk-utils/fdformat.8
@@ -2,12 +2,12 @@
.\" Title: fdformat
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "FDFORMAT" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "FDFORMAT" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c
index 871bb07..ccd3942 100644
--- a/disk-utils/fdformat.c
+++ b/disk-utils/fdformat.c
@@ -166,8 +166,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -n, --no-verify disable the verification after the format\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(19));
- printf(USAGE_MAN_TAIL("fdformat(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(19));
+ fprintf(out, USAGE_MAN_TAIL("fdformat(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/fdisk-list.c b/disk-utils/fdisk-list.c
index f93ed10..26ae1bd 100644
--- a/disk-utils/fdisk-list.c
+++ b/disk-utils/fdisk-list.c
@@ -449,7 +449,7 @@ void list_available_columns(FILE *out)
termwidth = get_terminal_width(80);
- fprintf(out, USAGE_COLUMNS);
+ fputs(USAGE_COLUMNS, out);
while (fdisk_next_label(cxt, &lb) == 0) {
size_t width = 6; /* label name and separators */
@@ -479,21 +479,24 @@ void list_available_columns(FILE *out)
static int fieldname_to_id(const char *name, size_t namesz)
{
const struct fdisk_field *fl;
- char buf[namesz + 1];
+ char *buf;
assert(name);
assert(namesz);
assert(fields_label);
- memcpy(buf, name, namesz);
- buf[namesz] = '\0';
+ buf = strndup(name, namesz);
+ if (!buf)
+ return -1;
fl = fdisk_label_get_field_by_name(fields_label, buf);
if (!fl) {
warnx(_("%s unknown column: %s"),
fdisk_label_get_name(fields_label), buf);
+ free(buf);
return -1;
}
+ free(buf);
return fdisk_field_get_id(fl);
}
@@ -550,4 +553,3 @@ done:
*n = fields_nids;
return fields_ids;
}
-
diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
index 5cf0002..4c6a918 100644
--- a/disk-utils/fdisk-menu.c
+++ b/disk-utils/fdisk-menu.c
@@ -111,6 +111,7 @@ static const struct menu menu_generic = {
MENU_ENT ('t', N_("change a partition type")),
MENU_BENT_E('v', N_("verify the partition table"), FDISK_DISKLABEL_BSD),
MENU_ENT ('i', N_("print information about a partition")),
+ MENU_ENT ('e', N_("resize a partition")),
MENU_XENT('d', N_("print the raw data of the first sector from the device")),
MENU_XENT('D', N_("print the raw data of the disklabel from the device")),
@@ -686,6 +687,9 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
rc = ask_for_wipe(cxt, partno);
break;
}
+ case 'e':
+ resize_partition(cxt);
+ break;
case 't':
change_partition_type(cxt);
break;
diff --git a/disk-utils/fdisk.8 b/disk-utils/fdisk.8
index e9c7001..7f4b11f 100644
--- a/disk-utils/fdisk.8
+++ b/disk-utils/fdisk.8
@@ -2,12 +2,12 @@
.\" Title: fdisk
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-03-20
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "FDISK" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "FDISK" "8" "2024-03-20" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -161,11 +161,11 @@ The "last sector" dialog accepts partition size specified by number of sectors o
.sp
If the size is prefixed by \*(Aq+\*(Aq then it is interpreted as relative to the partition first sector. If the size is prefixed by \*(Aq\-\*(Aq then it is interpreted as relative to the high limit (last available sector for the partition).
.sp
-In the case the size is specified in bytes than the number may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB".
+In the case the size is specified in bytes, then the number may be followed by the multiplicative suffixes KiB (1024 bytes), MiB (1024*1024 bytes), and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB".
.sp
The relative sizes are always aligned according to device I/O limits. The +/\-<size>{K,B,M,G,...} notation is recommended.
.sp
-For backward compatibility \fBfdisk\fP also accepts the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
+For backward compatibility \fBfdisk\fP also accepts the suffixes KB (1000 bytes), MB (1000*1000 bytes), and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
.SH "SCRIPT FILES"
.sp
\fBfdisk\fP allows reading (by \*(AqI\*(Aq command) \fBsfdisk\fP(8) compatible script files. The script is applied to in\-memory partition table, and then it is possible to modify the partition table before you write it to the device.
diff --git a/disk-utils/fdisk.8.adoc b/disk-utils/fdisk.8.adoc
index 7d9a2a8..d7b863f 100644
--- a/disk-utils/fdisk.8.adoc
+++ b/disk-utils/fdisk.8.adoc
@@ -116,13 +116,13 @@ The "last sector" dialog accepts partition size specified by number of sectors o
//TRANSLATORS: Keep {plus} untranslated.
If the size is prefixed by '{plus}' then it is interpreted as relative to the partition first sector. If the size is prefixed by '-' then it is interpreted as relative to the high limit (last available sector for the partition).
-In the case the size is specified in bytes than the number may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB".
+In the case the size is specified in bytes, then the number may be followed by the multiplicative suffixes KiB (1024 bytes), MiB (1024*1024 bytes), and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB".
//TRANSLATORS: Keep {plus} untranslated.
The relative sizes are always aligned according to device I/O limits. The {plus}/-<size>{K,B,M,G,...} notation is recommended.
-For backward compatibility *fdisk* also accepts the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
+For backward compatibility *fdisk* also accepts the suffixes KB (1000 bytes), MB (1000*1000 bytes), and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
== SCRIPT FILES
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 6bf3efb..c75a7a6 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -636,6 +636,101 @@ void toggle_dos_compatibility_flag(struct fdisk_context *cxt)
fdisk_reset_alignment(cxt); /* reset the current label */
}
+static int strtosize_sectors(const char *str, unsigned long sector_size,
+ uintmax_t *res)
+{
+ size_t len = strlen(str);
+ int insec = 0;
+ int rc;
+
+ if (!len)
+ return 0;
+
+ if (str[len - 1] == 'S' || str[len - 1] == 's') {
+ insec = 1;
+ str = strndup(str, len - 1); /* strip trailing 's' */
+ if (!str)
+ return -errno;
+ }
+
+ rc = strtosize(str, res);
+ if (rc)
+ return rc;
+
+ if (insec) {
+ *res *= sector_size;
+ free((void *)str);
+ }
+
+ return 0;
+}
+
+void resize_partition(struct fdisk_context *cxt)
+{
+ struct fdisk_partition *pa = NULL, *npa = NULL, *next = NULL;
+ char *query = NULL, *response = NULL, *default_size;
+ struct fdisk_table *tb = NULL;
+ uint64_t max_size, size, secs;
+ size_t i;
+ int rc;
+
+ assert(cxt);
+
+ rc = fdisk_ask_partnum(cxt, &i, FALSE);
+ if (rc)
+ goto err;
+
+ rc = fdisk_partition_get_max_size(cxt, i, &max_size);
+ if (rc)
+ goto err;
+
+ max_size *= fdisk_get_sector_size(cxt);
+
+ default_size = size_to_human_string(0, max_size);
+ xasprintf(&query, _("New <size>{K,M,G,T,P} in bytes or <size>S in sectors (default %s)"),
+ default_size);
+ free(default_size);
+
+ rc = fdisk_ask_string(cxt, query, &response);
+ if (rc)
+ goto err;
+
+ size = max_size;
+ rc = strtosize_sectors(response, fdisk_get_sector_size(cxt), &size);
+ if (rc || size > max_size) {
+ fdisk_warnx(cxt, _("Invalid size"));
+ goto err;
+ }
+
+ npa = fdisk_new_partition();
+ if (!npa)
+ goto err;
+
+ secs = size / fdisk_get_sector_size(cxt);
+ fdisk_partition_size_explicit(npa, 1);
+ fdisk_partition_set_size(npa, secs);
+
+ rc = fdisk_set_partition(cxt, i, npa);
+ if (rc)
+ goto err;
+
+ fdisk_info(cxt, _("Partition %zu has been resized."), i + 1);
+
+out:
+ free(query);
+ free(response);
+ fdisk_unref_partition(next);
+ fdisk_unref_partition(pa);
+ fdisk_unref_partition(npa);
+ fdisk_unref_table(tb);
+ return;
+
+err:
+ fdisk_warnx(cxt, _("Could not resize partition %zu: %s"),
+ i + 1, strerror(-rc));
+ goto out;
+}
+
void change_partition_type(struct fdisk_context *cxt)
{
size_t i;
@@ -886,11 +981,11 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -S, --sectors <number> specify the number of sectors per track\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(31));
+ fprintf(out, USAGE_HELP_OPTIONS(31));
list_available_columns(out);
- printf(USAGE_MAN_TAIL("fdisk(8)"));
+ fprintf(out, USAGE_MAN_TAIL("fdisk(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/fdisk.h b/disk-utils/fdisk.h
index e7edc06..d4578e0 100644
--- a/disk-utils/fdisk.h
+++ b/disk-utils/fdisk.h
@@ -63,4 +63,6 @@ extern void toggle_dos_compatibility_flag(struct fdisk_context *cxt);
extern void follow_wipe_mode(struct fdisk_context *cxt);
+extern void resize_partition(struct fdisk_context *cxt);
+
#endif /* UTIL_LINUX_FDISK_H */
diff --git a/disk-utils/fsck.8 b/disk-utils/fsck.8
index 1cb3992..07f8771 100644
--- a/disk-utils/fsck.8
+++ b/disk-utils/fsck.8
@@ -2,12 +2,12 @@
.\" Title: fsck
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-11-21
+.\" Date: 2024-03-20
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "FSCK" "8" "2023-11-21" "util\-linux 2.39.3" "System Administration"
+.TH "FSCK" "8" "2024-03-20" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -223,6 +223,11 @@ enables libmount debug output.
.SH "FILES"
.sp
\fI/etc/fstab\fP
+.SH "NOTES"
+.sp
+During boot, \fBsystemd\fP does not invoke \fBfsck \-A\fP. Instead, it schedules the activation
+of mounts individually, taking into account dependencies on backing devices, networking,
+and other factors. Consequently, \fBfsck\fP is called individually for each device.
.SH "AUTHORS"
.sp
.MTO "tytso\(atmit.edu>" "Theodore Ts\(cqo" ","
diff --git a/disk-utils/fsck.8.adoc b/disk-utils/fsck.8.adoc
index 976e7ff..c2908b0 100644
--- a/disk-utils/fsck.8.adoc
+++ b/disk-utils/fsck.8.adoc
@@ -151,6 +151,11 @@ enables libmount debug output.
_/etc/fstab_
+== NOTES
+During boot, *systemd* does not invoke *fsck -A*. Instead, it schedules the activation
+of mounts individually, taking into account dependencies on backing devices, networking,
+and other factors. Consequently, *fsck* is called individually for each device.
+
== AUTHORS
mailto:tytso@mit.edu>[Theodore Ts'o],
diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c
index 57e0758..c63ce1c 100644
--- a/disk-utils/fsck.c
+++ b/disk-utils/fsck.c
@@ -594,7 +594,7 @@ static int progress_active(void)
*/
static void print_stats(struct fsck_instance *inst)
{
- struct timeval delta;
+ struct timeval delta = { 0 };
if (!inst || !report_stats || noexecute)
return;
@@ -1416,11 +1416,11 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -V explain what is being done\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf( " -?, --help %s\n", USAGE_OPTSTR_HELP);
- printf( " --version %s\n", USAGE_OPTSTR_VERSION);
+ fprintf(out, " -?, --help %s\n", USAGE_OPTSTR_HELP);
+ fprintf(out, " --version %s\n", USAGE_OPTSTR_VERSION);
fputs(USAGE_SEPARATOR, out);
fputs(_("See the specific fsck.* commands for available fs-options."), out);
- printf(USAGE_MAN_TAIL("fsck(8)"));
+ fprintf(out, USAGE_MAN_TAIL("fsck(8)"));
exit(FSCK_EX_OK);
}
diff --git a/disk-utils/fsck.cramfs.8 b/disk-utils/fsck.cramfs.8
index 5946a87..96cd652 100644
--- a/disk-utils/fsck.cramfs.8
+++ b/disk-utils/fsck.cramfs.8
@@ -2,12 +2,12 @@
.\" Title: fsck.cramfs
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "FSCK.CRAMFS" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "FSCK.CRAMFS" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c
index 5446084..b5d64c3 100644
--- a/disk-utils/fsck.cramfs.c
+++ b/disk-utils/fsck.cramfs.c
@@ -128,9 +128,9 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -b, --blocksize <size> use this blocksize, defaults to page size\n"), out);
fputs(_(" --extract[=<dir>] test uncompression, optionally extract into <dir>\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(26));
+ fprintf(out, USAGE_HELP_OPTIONS(26));
- printf(USAGE_MAN_TAIL("fsck.cramfs(8)"));
+ fprintf(out, USAGE_MAN_TAIL("fsck.cramfs(8)"));
exit(FSCK_EX_OK);
}
diff --git a/disk-utils/fsck.minix.8 b/disk-utils/fsck.minix.8
index f6913cd..d91e4b9 100644
--- a/disk-utils/fsck.minix.8
+++ b/disk-utils/fsck.minix.8
@@ -2,12 +2,12 @@
.\" Title: fsck.minix
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "FSCK.MINIX" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "FSCK.MINIX" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/fsck.minix.c b/disk-utils/fsck.minix.c
index 66b46d4..03a4746 100644
--- a/disk-utils/fsck.minix.c
+++ b/disk-utils/fsck.minix.c
@@ -198,8 +198,8 @@ usage(void) {
fputs(_(" -m, --uncleared activate mode not cleared warnings\n"), out);
fputs(_(" -f, --force force check\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(18));
- printf(USAGE_MAN_TAIL("fsck.minix(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(18));
+ fprintf(out, USAGE_MAN_TAIL("fsck.minix(8)"));
exit(FSCK_EX_OK);
}
diff --git a/disk-utils/isosize.8 b/disk-utils/isosize.8
index 40f8c0c..8e8cec2 100644
--- a/disk-utils/isosize.8
+++ b/disk-utils/isosize.8
@@ -2,12 +2,12 @@
.\" Title: isosize
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "ISOSIZE" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "ISOSIZE" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/isosize.c b/disk-utils/isosize.c
index cfcb985..a0b2b87 100644
--- a/disk-utils/isosize.c
+++ b/disk-utils/isosize.c
@@ -113,8 +113,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -d, --divisor=<number> divide the amount of bytes by <number>\n"), stdout);
fputs(_(" -x, --sectors show sector count and size\n"), stdout);
- printf(USAGE_HELP_OPTIONS(25));
- printf(USAGE_MAN_TAIL("isosize(8)"));
+ fprintf(stdout, USAGE_HELP_OPTIONS(25));
+ fprintf(stdout, USAGE_MAN_TAIL("isosize(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/mkfs.8 b/disk-utils/mkfs.8
index d653d63..c17f014 100644
--- a/disk-utils/mkfs.8
+++ b/disk-utils/mkfs.8
@@ -2,12 +2,12 @@
.\" Title: mkfs
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "MKFS" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "MKFS" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/mkfs.bfs.8 b/disk-utils/mkfs.bfs.8
index 16919ab..5496a8b 100644
--- a/disk-utils/mkfs.bfs.8
+++ b/disk-utils/mkfs.bfs.8
@@ -2,12 +2,12 @@
.\" Title: mkfs.bfs
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-11-21
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "MKFS.BFS" "8" "2023-11-21" "util\-linux 2.39.3" "System Administration"
+.TH "MKFS.BFS" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/mkfs.bfs.c b/disk-utils/mkfs.bfs.c
index 06271a7..895a1f2 100644
--- a/disk-utils/mkfs.bfs.c
+++ b/disk-utils/mkfs.bfs.c
@@ -95,9 +95,9 @@ static void __attribute__((__noreturn__)) usage(void)
" -l this option is silently ignored\n"
" --lock[=<mode>] use exclusive device lock (yes, no or nonblock)\n"
));
- printf(USAGE_HELP_OPTIONS(21));
+ fprintf(out, USAGE_HELP_OPTIONS(21));
- printf(USAGE_MAN_TAIL("mkfs.bfs(8)"));
+ fprintf(out, USAGE_MAN_TAIL("mkfs.bfs(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/mkfs.c b/disk-utils/mkfs.c
index 4254ef0..00d224f 100644
--- a/disk-utils/mkfs.c
+++ b/disk-utils/mkfs.c
@@ -62,9 +62,9 @@ static void __attribute__((__noreturn__)) usage(void)
fprintf(out, _(" <size> number of blocks to be used on the device\n"));
fprintf(out, _(" -V, --verbose explain what is being done;\n"
" specifying -V more than once will cause a dry-run\n"));
- printf(USAGE_HELP_OPTIONS(20));
+ fprintf(out, USAGE_HELP_OPTIONS(20));
- printf(USAGE_MAN_TAIL("mkfs(8)"));
+ fprintf(out, USAGE_MAN_TAIL("mkfs(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/mkfs.cramfs.8 b/disk-utils/mkfs.cramfs.8
index 9eef51a..4f39779 100644
--- a/disk-utils/mkfs.cramfs.8
+++ b/disk-utils/mkfs.cramfs.8
@@ -2,12 +2,12 @@
.\" Title: mkfs.cramfs
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-11-21
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "MKFS.CRAMFS" "8" "2023-11-21" "util\-linux 2.39.3" "System Administration"
+.TH "MKFS.CRAMFS" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c
index fcc1314..f4ada90 100644
--- a/disk-utils/mkfs.cramfs.c
+++ b/disk-utils/mkfs.cramfs.c
@@ -128,27 +128,27 @@ struct entry {
static void __attribute__((__noreturn__)) usage(void)
{
fputs(USAGE_HEADER, stdout);
- printf(_(" %s [-h] [-v] [-b blksize] [-e edition] [-N endian] [-i file] [-n name] dirname outfile\n"),
+ fprintf(stdout, _(" %s [-h] [-v] [-b blksize] [-e edition] [-N endian] [-i file] [-n name] dirname outfile\n"),
program_invocation_short_name);
fputs(USAGE_SEPARATOR, stdout);
- puts(_("Make compressed ROM file system."));
+ fputsln(_("Make compressed ROM file system."), stdout);
fputs(USAGE_OPTIONS, stdout);
- puts(_( " -v be verbose"));
- puts(_( " -E make all warnings errors (non-zero exit status)"));
- puts(_( " -b blksize use this blocksize, must equal page size"));
- puts(_( " -e edition set edition number (part of fsid)"));
- printf(_(" -N endian set cramfs endianness (%s|%s|%s), default %s\n"), "big", "little", "host", "host");
- puts(_( " -i file insert a file image into the filesystem"));
- puts(_( " -n name set name of cramfs filesystem"));
- printf(_(" -p pad by %d bytes for boot code\n"), PAD_SIZE);
- puts(_( " -s sort directory entries (old option, ignored)"));
- puts(_( " -z make explicit holes"));
- puts(_( " -l[=<mode>] use exclusive device lock (yes, no or nonblock)"));
- puts(_( " dirname root of the filesystem to be compressed"));
- puts(_( " outfile output file"));
+ fputsln(_( " -v be verbose"), stdout);
+ fputsln(_( " -E make all warnings errors (non-zero exit status)"), stdout);
+ fputsln(_( " -b blksize use this blocksize, must equal page size"), stdout);
+ fputsln(_( " -e edition set edition number (part of fsid)"), stdout);
+ fprintf(stdout, _(" -N endian set cramfs endianness (%s|%s|%s), default %s\n"), "big", "little", "host", "host");
+ fputsln(_( " -i file insert a file image into the filesystem"), stdout);
+ fputsln(_( " -n name set name of cramfs filesystem"), stdout);
+ fprintf(stdout, _(" -p pad by %d bytes for boot code\n"), PAD_SIZE);
+ fputsln(_( " -s sort directory entries (old option, ignored)"), stdout);
+ fputsln(_( " -z make explicit holes"), stdout);
+ fputsln(_( " -l[=<mode>] use exclusive device lock (yes, no or nonblock)"), stdout);
+ fputsln(_( " dirname root of the filesystem to be compressed"), stdout);
+ fputsln(_( " outfile output file"), stdout);
fputs(USAGE_SEPARATOR, stdout);
- printf(USAGE_HELP_OPTIONS(16));
- printf(USAGE_MAN_TAIL("mkfs.cramfs(8)"));
+ fprintf(stdout, USAGE_HELP_OPTIONS(16));
+ fprintf(stdout, USAGE_MAN_TAIL("mkfs.cramfs(8)"));
exit(MKFS_EX_OK);
}
@@ -497,7 +497,7 @@ static unsigned int write_directory_structure(struct entry *entry, char *base, u
if (entry->child) {
if (stack_entries >= stack_size) {
stack_size *= 2;
- entry_stack = xrealloc(entry_stack, stack_size * sizeof(struct entry *));
+ entry_stack = xreallocarray(entry_stack, stack_size, sizeof(struct entry *));
}
entry_stack[stack_entries] = entry;
stack_entries++;
diff --git a/disk-utils/mkfs.minix.8 b/disk-utils/mkfs.minix.8
index a3be59c..2d420dd 100644
--- a/disk-utils/mkfs.minix.8
+++ b/disk-utils/mkfs.minix.8
@@ -2,12 +2,12 @@
.\" Title: mkfs.minix
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "MKFS.MINIX" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "MKFS.MINIX" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 08263ad..f6f2f48 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -152,8 +152,8 @@ static void __attribute__((__noreturn__)) usage(void)
fprintf(out, _(
" --lock[=<mode>] use exclusive device lock (%s, %s or %s)\n"), "yes", "no", "nonblock");
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(25));
- printf(USAGE_MAN_TAIL("mkfs.minix(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(25));
+ fprintf(out, USAGE_MAN_TAIL("mkfs.minix(8)"));
exit(MKFS_EX_OK);
}
diff --git a/disk-utils/mkswap.8 b/disk-utils/mkswap.8
index 3beeecc..dd53233 100644
--- a/disk-utils/mkswap.8
+++ b/disk-utils/mkswap.8
@@ -2,12 +2,12 @@
.\" Title: mkswap
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-12-01
+.\" Date: 2024-03-20
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "MKSWAP" "8" "2023-12-01" "util\-linux 2.39.3" "System Administration"
+.TH "MKSWAP" "8" "2024-03-20" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -31,14 +31,16 @@
mkswap \- set up a Linux swap area
.SH "SYNOPSIS"
.sp
-\fBmkswap\fP [options] \fIdevice\fP [\fIsize\fP]
+\fBmkswap\fP [options] \fIdevice\fP [\fIblocks\fP]
+.sp
+\fBmkswap\fP [options] \-\-size \fIsize\fP \-\-file \fIfile\fP
.SH "DESCRIPTION"
.sp
\fBmkswap\fP sets up a Linux swap area on a device or in a file.
.sp
The \fIdevice\fP argument will usually be a disk partition (something like \fI/dev/sdb7\fP) but can also be a file. The Linux kernel does not look at partition IDs, but many installation scripts will assume that partitions of hex type 82 (LINUX_SWAP) are meant to be swap partitions. (\fBWarning: Solaris also uses this type. Be careful not to kill your Solaris partitions.\fP)
.sp
-The \fIsize\fP parameter is superfluous but retained for backwards compatibility. (It specifies the desired size of the swap area in 1024\-byte blocks. \fBmkswap\fP will use the entire partition or file if it is omitted. Specifying it is unwise \- a typo may destroy your disk.)
+The \fIblocks\fP parameter is superfluous but retained for backwards compatibility. (It specifies the desired size of the swap area in 1024\-byte blocks. \fBmkswap\fP will use the entire partition or file if it is omitted. Specifying it is unwise \- a typo may destroy your disk.)
.sp
After creating the swap area, you need the \fBswapon\fP(8) command to start using it. Usually swap areas are listed in \fI/etc/fstab\fP so that they can be taken into use at boot time by a \fBswapon \-a\fP command in some boot script.
.SH "WARNING"
@@ -55,6 +57,11 @@ However, \fBmkswap\fP refuses to erase the first block on a device with a disk l
Check the device (if it is a block device) for bad blocks before creating the swap area. If any bad blocks are found, the count is printed.
.RE
.sp
+\fB\-F\fP, \fB\-\-file\fP
+.RS 4
+Create a swap file with the appropriate file permissions and populated blocks on disk.
+.RE
+.sp
\fB\-f\fP, \fB\-\-force\fP
.RS 4
Go ahead even if the command is stupid. This allows the creation of a swap area larger than the file or partition it resides on.
@@ -109,6 +116,16 @@ generate a new time\-based UUID
Specify the \fIENDIANNESS\fP to use, valid arguments are \fBnative\fP, \fBlittle\fP or \fBbig\fP. The default is \fBnative\fP.
.RE
.sp
+\fB\-o\fP, \fB\-\-offset\fP \fIoffset\fP
+.RS 4
+Specify the \fIoffset\fP to write the swap area to.
+.RE
+.sp
+\fB\-s\fP, \fB\-\-size\fP \fIsize\fP
+.RS 4
+Specify the size of the created swap file in bytes and may be followed by a multiplicative suffix: KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"). If the file exists and is larger than \fIsize\fP, it will be truncated to this size. This option only makes sense when used with \fB\-\-file\fP.
+.RE
+.sp
\fB\-v\fP, \fB\-\-swapversion 1\fP
.RS 4
Specify the swap\-space version. (This option is currently pointless, as the old \fB\-v 0\fP option has become obsolete and now only \fB\-v 1\fP is supported. The kernel has not supported v0 swap\-space format since 2.5.22 (June 2002). The new version v1 is supported since 2.1.117 (August 1998).)
diff --git a/disk-utils/mkswap.8.adoc b/disk-utils/mkswap.8.adoc
index 904467d..1721243 100644
--- a/disk-utils/mkswap.8.adoc
+++ b/disk-utils/mkswap.8.adoc
@@ -16,7 +16,9 @@ mkswap - set up a Linux swap area
== SYNOPSIS
-*mkswap* [options] _device_ [_size_]
+*mkswap* [options] _device_ [_blocks_]
+
+*mkswap* [options] --size _size_ --file _file_
== DESCRIPTION
@@ -24,7 +26,7 @@ mkswap - set up a Linux swap area
The _device_ argument will usually be a disk partition (something like _/dev/sdb7_) but can also be a file. The Linux kernel does not look at partition IDs, but many installation scripts will assume that partitions of hex type 82 (LINUX_SWAP) are meant to be swap partitions. (*Warning: Solaris also uses this type. Be careful not to kill your Solaris partitions.*)
-The _size_ parameter is superfluous but retained for backwards compatibility. (It specifies the desired size of the swap area in 1024-byte blocks. *mkswap* will use the entire partition or file if it is omitted. Specifying it is unwise - a typo may destroy your disk.)
+The _blocks_ parameter is superfluous but retained for backwards compatibility. (It specifies the desired size of the swap area in 1024-byte blocks. *mkswap* will use the entire partition or file if it is omitted. Specifying it is unwise - a typo may destroy your disk.)
After creating the swap area, you need the *swapon*(8) command to start using it. Usually swap areas are listed in _/etc/fstab_ so that they can be taken into use at boot time by a *swapon -a* command in some boot script.
@@ -41,6 +43,9 @@ However, *mkswap* refuses to erase the first block on a device with a disk label
*-c*, *--check*::
Check the device (if it is a block device) for bad blocks before creating the swap area. If any bad blocks are found, the count is printed.
+*-F*, *--file*::
+Create a swap file with the appropriate file permissions and populated blocks on disk.
+
*-f*, *--force*::
Go ahead even if the command is stupid. This allows the creation of a swap area larger than the file or partition it resides on.
+
@@ -73,6 +78,12 @@ generate a new time-based UUID
*-e*, *--endianness* _ENDIANNESS_::
Specify the _ENDIANNESS_ to use, valid arguments are *native*, *little* or *big*. The default is *native*.
+*-o*, *--offset* _offset_::
+Specify the _offset_ to write the swap area to.
+
+*-s*, *--size* _size_::
+Specify the size of the created swap file in bytes and may be followed by a multiplicative suffix: KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"). If the file exists and is larger than _size_, it will be truncated to this size. This option only makes sense when used with *--file*.
+
*-v*, *--swapversion 1*::
Specify the swap-space version. (This option is currently pointless, as the old *-v 0* option has become obsolete and now only *-v 1* is supported. The kernel has not supported v0 swap-space format since 2.5.22 (June 2002). The new version v1 is supported since 2.1.117 (August 1998).)
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 30c4ea8..9c80b07 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -83,10 +83,13 @@ struct mkswap_control {
int user_pagesize; /* --pagesize */
int pagesize; /* final pagesize used for the header */
+ off_t offset; /* offset of the header in the target */
char *opt_label; /* LABEL as specified on command line */
unsigned char *uuid; /* UUID parsed by libbuuid */
+ unsigned long long filesz; /* desired swap file size */
+
size_t nbad_extents;
enum ENDIANNESS endianness;
@@ -94,7 +97,8 @@ struct mkswap_control {
unsigned int check:1, /* --check */
verbose:1, /* --verbose */
quiet:1, /* --quiet */
- force:1; /* --force */
+ force:1, /* --force */
+ file:1; /* --file */
};
static uint32_t cpu32_to_endianness(uint32_t v, enum ENDIANNESS e)
@@ -201,14 +205,17 @@ static void __attribute__((__noreturn__)) usage(void)
fprintf(out,
_(" -e, --endianness=<value> specify the endianness to use "
"(%s, %s or %s)\n"), "native", "little", "big");
+ fputs(_(" -o, --offset OFFSET specify the offset in the device\n"), out);
+ fputs(_(" -s, --size SIZE specify the size of a swap file in bytes\n"), out);
+ fputs(_(" -F, --file create a swap file\n"), out);
fputs(_(" --verbose verbose output\n"), out);
fprintf(out,
_(" --lock[=<mode>] use exclusive device lock (%s, %s or %s)\n"), "yes", "no", "nonblock");
- printf(USAGE_HELP_OPTIONS(27));
+ fprintf(out, USAGE_HELP_OPTIONS(27));
- printf(USAGE_MAN_TAIL("mkswap(8)"));
+ fprintf(out, USAGE_MAN_TAIL("mkswap(8)"));
exit(EXIT_SUCCESS);
}
@@ -346,17 +353,22 @@ done:
/* return size in pages */
static unsigned long long get_size(const struct mkswap_control *ctl)
{
- int fd;
unsigned long long size;
- fd = open(ctl->devname, O_RDONLY);
- if (fd < 0)
- err(EXIT_FAILURE, _("cannot open %s"), ctl->devname);
- if (blkdev_get_size(fd, &size) < 0)
- err(EXIT_FAILURE, _("cannot determine size of %s"), ctl->devname);
+ if (ctl->file && ctl->filesz)
+ size = ctl->filesz;
+ else {
+ int fd = open(ctl->devname, O_RDONLY);
+ if (fd < 0)
+ err(EXIT_FAILURE, _("cannot open %s"), ctl->devname);
+ if (blkdev_get_size(fd, &size) < 0)
+ err(EXIT_FAILURE, _("cannot determine size of %s"), ctl->devname);
+ if ((unsigned long long) ctl->offset > size)
+ errx(EXIT_FAILURE, _("offset larger than file size"));
+ close(fd);
+ }
+ size -= ctl->offset;
size /= ctl->pagesize;
-
- close(fd);
return size;
}
@@ -377,11 +389,33 @@ static void open_device(struct mkswap_control *ctl)
assert(ctl);
assert(ctl->devname);
- if (stat(ctl->devname, &ctl->devstat) < 0)
- err(EXIT_FAILURE, _("stat of %s failed"), ctl->devname);
- ctl->fd = open_blkdev_or_file(&ctl->devstat, ctl->devname, O_RDWR);
+ if (ctl->file) {
+ if (stat(ctl->devname, &ctl->devstat) == 0) {
+ if (!S_ISREG(ctl->devstat.st_mode))
+ err(EXIT_FAILURE, _("cannot create swap file %s: node isn't regular file"), ctl->devname);
+ if (chmod(ctl->devname, 0600) < 9)
+ err(EXIT_FAILURE, _("cannot set permissions on swap file %s"), ctl->devname);
+ }
+ ctl->fd = open(ctl->devname, O_RDWR | O_CREAT, 0600);
+ } else {
+ if (stat(ctl->devname, &ctl->devstat) < 0)
+ err(EXIT_FAILURE, _("stat of %s failed"), ctl->devname);
+ ctl->fd = open_blkdev_or_file(&ctl->devstat, ctl->devname, O_RDWR);
+ }
if (ctl->fd < 0)
err(EXIT_FAILURE, _("cannot open %s"), ctl->devname);
+ if (ctl->file && ctl->filesz) {
+ if (ftruncate(ctl->fd, ctl->filesz) < 0)
+ err(EXIT_FAILURE, _("couldn't allocate swap file %s"), ctl->devname);
+#ifdef HAVE_POSIX_FALLOCATE
+ errno = posix_fallocate(ctl->fd, 0, ctl->filesz);
+ if (errno)
+ err(EXIT_FAILURE, _("couldn't allocate swap file %s"), ctl->devname);
+#elif defined(HAVE_FALLOCATE)
+ if (fallocate(ctl->fd, 0, 0, ctl->filesz) < 0)
+ err(EXIT_FAILURE, _("couldn't allocate swap file %s"), ctl->devname);
+#endif
+ }
if (blkdev_lock(ctl->fd, ctl->devname, ctl->lockmode) != 0)
exit(EXIT_FAILURE);
@@ -472,11 +506,15 @@ static void wipe_device(struct mkswap_control *ctl)
static void write_header_to_device(struct mkswap_control *ctl)
{
+ off_t offset;
+
assert(ctl);
assert(ctl->fd > -1);
assert(ctl->signature_page);
- if (lseek(ctl->fd, SIGNATURE_OFFSET, SEEK_SET) != SIGNATURE_OFFSET)
+ offset = SIGNATURE_OFFSET + ctl->offset;
+
+ if (lseek(ctl->fd, offset, SEEK_SET) != offset)
errx(EXIT_FAILURE, _("unable to rewind swap-device"));
if (write_all(ctl->fd, (char *) ctl->signature_page + SIGNATURE_OFFSET,
@@ -510,6 +548,9 @@ int main(int argc, char **argv)
{ "swapversion", required_argument, NULL, 'v' },
{ "uuid", required_argument, NULL, 'U' },
{ "endianness", required_argument, NULL, 'e' },
+ { "offset", required_argument, NULL, 'o' },
+ { "size", required_argument, NULL, 's' },
+ { "file", no_argument, NULL, 'F' },
{ "version", no_argument, NULL, 'V' },
{ "help", no_argument, NULL, 'h' },
{ "lock", optional_argument, NULL, OPT_LOCK },
@@ -528,7 +569,7 @@ int main(int argc, char **argv)
textdomain(PACKAGE);
close_stdout_atexit();
- while((c = getopt_long(argc, argv, "cfp:qL:v:U:e:Vh", longopts, NULL)) != -1) {
+ while((c = getopt_long(argc, argv, "cfp:qL:v:U:e:o:s:FVh", longopts, NULL)) != -1) {
err_exclusive_options(c, longopts, excl, excl_st);
@@ -574,6 +615,16 @@ int main(int argc, char **argv)
_("invalid endianness %s is not supported"), optarg);
}
break;
+ case 'o':
+ ctl.offset = str2unum_or_err(optarg,
+ 10, _("Invalid offset"), SINT_MAX(off_t));
+ break;
+ case 's':
+ ctl.filesz = strtosize_or_err(optarg, _("Invalid size"));
+ break;
+ case 'F':
+ ctl.file = 1;
+ break;
case 'V':
print_version(EXIT_SUCCESS);
break;
diff --git a/disk-utils/partx.8 b/disk-utils/partx.8
index c205a03..dee567d 100644
--- a/disk-utils/partx.8
+++ b/disk-utils/partx.8
@@ -2,12 +2,12 @@
.\" Title: partx
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "PARTX" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "PARTX" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index 8078e9c..b0d552c 100644
--- a/disk-utils/partx.c
+++ b/disk-utils/partx.c
@@ -82,14 +82,14 @@ enum {
/* column names */
struct colinfo {
- const char *name; /* header */
- double whint; /* width hint (N < 1 is in percent of termwidth) */
- int flags; /* SCOLS_FL_* */
- const char *help;
+ const char * const name; /* header */
+ double whint; /* width hint (N < 1 is in percent of termwidth) */
+ int flags; /* SCOLS_FL_* */
+ const char *help;
};
/* columns descriptions */
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_PARTNO] = { "NR", 0.25, SCOLS_FL_RIGHT, N_("partition number") },
[COL_START] = { "START", 0.30, SCOLS_FL_RIGHT, N_("start of the partition in sectors") },
[COL_END] = { "END", 0.30, SCOLS_FL_RIGHT, N_("end of the partition in sectors") },
@@ -148,7 +148,7 @@ static inline int get_column_id(int num)
return columns[num];
}
-static inline struct colinfo *get_column_info(int num)
+static inline const struct colinfo *get_column_info(int num)
{
return &infos[ get_column_id(num) ];
}
@@ -681,7 +681,7 @@ static int show_parts(blkid_partlist ls, int scols_flags, int lower, int upper)
scols_table_enable_noheadings(table, !!(scols_flags & PARTX_NOHEADINGS));
for (i = 0; (size_t)i < ncolumns; i++) {
- struct colinfo *col = get_column_info(i);
+ const struct colinfo *col = get_column_info(i);
if (!scols_table_new_column(table, col->name, col->whint, col->flags)) {
warnx(_("failed to allocate output column"));
@@ -783,13 +783,13 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -v, --verbose verbose mode\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(22));
+ fprintf(out, USAGE_HELP_OPTIONS(22));
fputs(USAGE_COLUMNS, out);
for (i = 0; i < NCOLS; i++)
fprintf(out, " %10s %s\n", infos[i].name, _(infos[i].help));
- printf(USAGE_MAN_TAIL("partx(8)"));
+ fprintf(out, USAGE_MAN_TAIL("partx(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/raw.8 b/disk-utils/raw.8
index a0ad860..b37f2ba 100644
--- a/disk-utils/raw.8
+++ b/disk-utils/raw.8
@@ -2,12 +2,12 @@
.\" Title: raw
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "RAW" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "RAW" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/raw.8.deps b/disk-utils/raw.8.deps
index e78010b..de76d6c 100644
--- a/disk-utils/raw.8.deps
+++ b/disk-utils/raw.8.deps
@@ -1 +1 @@
-/home/proj-me/util-linux/util-linux/util-linux-2.39.3/disk-utils/raw.8: /home/proj-me/util-linux/util-linux/man-common/help-version.adoc /home/proj-me/util-linux/util-linux/man-common/bugreports.adoc /home/proj-me/util-linux/util-linux/man-common/footer.adoc \ No newline at end of file
+/home/proj-me/util-linux/util-linux/util-linux-2.40/disk-utils/raw.8: /home/proj-me/util-linux/util-linux/man-common/help-version.adoc /home/proj-me/util-linux/util-linux/man-common/bugreports.adoc /home/proj-me/util-linux/util-linux/man-common/footer.adoc \ No newline at end of file
diff --git a/disk-utils/raw.c b/disk-utils/raw.c
index b44a581..308910c 100644
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -59,8 +59,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(USAGE_OPTIONS, out);
fputs(_(" -q, --query set query mode\n"), out);
fputs(_(" -a, --all query all raw devices\n"), out);
- printf(USAGE_HELP_OPTIONS(16));
- printf(USAGE_MAN_TAIL("raw(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(16));
+ fprintf(out, USAGE_MAN_TAIL("raw(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/resizepart.8 b/disk-utils/resizepart.8
index f969661..2a46754 100644
--- a/disk-utils/resizepart.8
+++ b/disk-utils/resizepart.8
@@ -2,12 +2,12 @@
.\" Title: resizepart
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "RESIZEPART" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "RESIZEPART" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/resizepart.c b/disk-utils/resizepart.c
index 8c34f8a..e29021b 100644
--- a/disk-utils/resizepart.c
+++ b/disk-utils/resizepart.c
@@ -34,8 +34,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_("Tell the kernel about the new size of a partition.\n"), out);
fputs(USAGE_OPTIONS, out);
- printf(USAGE_HELP_OPTIONS(16));
- printf(USAGE_MAN_TAIL("resizepart(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(16));
+ fprintf(out, USAGE_MAN_TAIL("resizepart(8)"));
exit(EXIT_SUCCESS);
}
diff --git a/disk-utils/sfdisk.8 b/disk-utils/sfdisk.8
index 9705eab..5cda4f9 100644
--- a/disk-utils/sfdisk.8
+++ b/disk-utils/sfdisk.8
@@ -2,12 +2,12 @@
.\" Title: sfdisk
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-11-21
+.\" Date: 2024-03-20
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "SFDISK" "8" "2023-11-21" "util\-linux 2.39.3" "System Administration"
+.TH "SFDISK" "8" "2024-03-20" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -527,7 +527,7 @@ This can later be restored by:
.RE
.ll
.sp
-Note that sfdisk completely restores partition types and partition UUIDs. This could potentially become problematic if you duplicate the same layout to different disks, as it may result in duplicate UUIDs within your system.
+Note that \fBsfdisk\fP completely restores partition types and partition UUIDs. This could potentially become problematic if you duplicate the same layout to different disks, as it may result in duplicate UUIDs within your system.
.SS "Full binary backup"
.sp
If you want to do a full binary backup of all sectors where the partition table is stored, then use the \fB\-\-backup\-pt\-sectors\fP command. It writes the sectors to \fI~/sfdisk\-<device>\-<offset>.bak\fP files. The default name of the backup file can be changed with the \fB\-\-backup\-file\fP option. The backup files contain only raw data from the \fIdevice\fP. For example:
diff --git a/disk-utils/sfdisk.8.adoc b/disk-utils/sfdisk.8.adoc
index f586d61..bc3ff9b 100644
--- a/disk-utils/sfdisk.8.adoc
+++ b/disk-utils/sfdisk.8.adoc
@@ -366,7 +366,7 @@ ____
*sfdisk /dev/sda < sda.dump*
____
-Note that sfdisk completely restores partition types and partition UUIDs. This could potentially become problematic if you duplicate the same layout to different disks, as it may result in duplicate UUIDs within your system.
+Note that *sfdisk* completely restores partition types and partition UUIDs. This could potentially become problematic if you duplicate the same layout to different disks, as it may result in duplicate UUIDs within your system.
=== Full binary backup
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 0e85e63..d8dd8d2 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -2105,12 +2105,12 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -u, --unit S deprecated, only sector unit is supported\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf( " -h, --help %s\n", USAGE_OPTSTR_HELP);
- printf( " -v, --version %s\n", USAGE_OPTSTR_VERSION);
+ fprintf(out, " -h, --help %s\n", USAGE_OPTSTR_HELP);
+ fprintf(out, " -v, --version %s\n", USAGE_OPTSTR_VERSION);
list_available_columns(out);
- printf(USAGE_MAN_TAIL("sfdisk(8)"));
+ fprintf(out, USAGE_MAN_TAIL("sfdisk(8)"));
exit(EXIT_SUCCESS);
}
@@ -2474,4 +2474,3 @@ int main(int argc, char *argv[])
DBG(MISC, ul_debug("bye! [rc=%d]", rc));
return rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
-
diff --git a/disk-utils/swaplabel.8 b/disk-utils/swaplabel.8
index 2a889b6..5614b51 100644
--- a/disk-utils/swaplabel.8
+++ b/disk-utils/swaplabel.8
@@ -2,12 +2,12 @@
.\" Title: swaplabel
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
-.\" Date: 2023-10-23
+.\" Date: 2024-01-31
.\" Manual: System Administration
-.\" Source: util-linux 2.39.3
+.\" Source: util-linux 2.40
.\" Language: English
.\"
-.TH "SWAPLABEL" "8" "2023-10-23" "util\-linux 2.39.3" "System Administration"
+.TH "SWAPLABEL" "8" "2024-01-31" "util\-linux 2.40" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c
index 8498d2e..6b50786 100644
--- a/disk-utils/swaplabel.c
+++ b/disk-utils/swaplabel.c
@@ -132,8 +132,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -L, --label <label> specify a new label\n"
" -U, --uuid <uuid> specify a new uuid\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(21));
- printf(USAGE_MAN_TAIL("swaplabel(8)"));
+ fprintf(out, USAGE_HELP_OPTIONS(21));
+ fprintf(out, USAGE_MAN_TAIL("swaplabel(8)"));
exit(EXIT_SUCCESS);
}
@@ -193,4 +193,3 @@ int main(int argc, char *argv[])
}
return rc ? EXIT_FAILURE : EXIT_SUCCESS;
}
-