Commit 0f24b094 authored by Andreas Henriksson's avatar Andreas Henriksson

New upstream version 2.29.1

parents 1088477c 9ebc8a7a
......@@ -128,6 +128,7 @@ CONTRIBUTORS:
Bernardo Innocenti <bernie@codewiz.org>
Bernhard Voelker <mail@bernhard-voelker.de>
Bernhard Walle <bwalle@suse.de>
Bert van Hall <bert.vanhall@avionic-design.de>
Bill Pemberton <wfp5p@virginia.edu>
Bill Pemberton <wfp5p@worldbroken.com>
Bill Reynolds <bill@goshawk.lanl.gov>
......@@ -142,6 +143,7 @@ CONTRIBUTORS:
B Watson <yalhcru@gmail.com>
Cai Qian <qcai@redhat.com>
Carlos Maiolino <cmaiolino@redhat.com>
Carlos Santos <casantos@datacom.ind.br>
Casper Ti. Vector <caspervector@gmail.com>
Chandan B Rajenda <chandan@linux.vnet.ibm.com>
chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
......@@ -370,6 +372,7 @@ CONTRIBUTORS:
Michael Bunk <bunk@iat.uni-leipzig.de>
Michael Forney <mforney@mforney.org>
Michael Glad <glad@daimi.aau.dk>
Michael Kerrisk <mtk.manpages@gmail.com>
Michael Marineau <michael.marineau@coreos.com>
Michael Piefel <piefel@informatik.hu-berlin.de>
Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com>
......@@ -393,6 +396,7 @@ CONTRIBUTORS:
M.S.Colclough <m.s.colclough@bham.ac.uk>
Namhyung Kim <namhyung@gmail.com>
Natanael Copa <ncopa@alpinelinux.org>
Nate Clark <nate@neworld.us>
Nathan Rossi <nathan.rossi@xilinx.com>
Neil Horman <nhorman@tuxdriver.com>
nick black <nick.black@sprezzatech.com>
......@@ -403,6 +407,7 @@ CONTRIBUTORS:
Nikolay Sivov <nsivov@codeweavers.com>
Nilgün Belma Bugüner <nilgun@buguner.name.tr>
Norbert Buchmuller <norbi@nix.hu>
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Oliver Falk <oliver@linux-kernel.at>
Olivier Blin <blino@mandriva.com>
Olivier Mengué <dolmen@cpan.org>
......@@ -500,6 +505,7 @@ CONTRIBUTORS:
Stefan Krah <stefan@bytereef.org>
Stef Walter <stefw@redhat.com>
Stepan Kasal <skasal@redhat.com>
Stéphane Aulery <lkppo@free.fr>
Stephan Maka <stephan@spaceboyz.net>
Stephan Müller <fruktopus@gmail.com>
Stephen Gallimore
......
See version control history.
http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=log;h=2.29
http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=log;h=2.29.1
util-linux 2.29.1 Release Notes
===============================
build-sys:
- cleanup UL_NCURSES_CHECK [Karel Zak]
- don't clean *.img files [Ruediger Meier]
- fix compilation with ncurses and uClibc or musl libc [Carlos Santos]
- fix empty package release number [Ruediger Meier]
- prefer pkg-config for ncurses [Karel Zak]
- update package release number during development [Ruediger Meier]
- use MATH_LIBS for hwclock [Karel Zak]
chrt:
- default to SCHED_RR policy [Andreas Henriksson]
chsh:
- use -h as shorthand for --help instead of -u [Andreas Henriksson]
disk-utils/mkfs.minix:
- Set ninodes after checking max [Nate Clark]
docs:
- add cross reference to namespaces(7) [Michael Kerrisk (man-pages)]
- ionice(1) SEE ALSO add ioprio_set(2) [Michael Kerrisk]
- kill(1) Add more detail on use of SIGTERM vs SIGKILL [Michael Kerrisk]
- kill(1) Fix section reference for sigqueue(3) and add to SEE ALSO [Michael Kerrisk]
- kill(1) Formatting fixes [Michael Kerrisk]
- kill(1) Rework notes on thread groups [Michael Kerrisk]
- kill(1) Wording fix [Michael Kerrisk]
- last(1) Eliminate oddball formatting [Michael Kerrisk]
- last(1) SEE ALSO add reference to wtmp(5) [Michael Kerrisk]
- lsns(8) SEE ALSO add namespaces(7) [Michael Kerrisk]
- mount(8) Wording fix [Michael Kerrisk]
- namei(1) SEE ALSO add symlink(7) [Michael Kerrisk]
- nsenter(1) Describe the 'file' argument used by namespace options [Michael Kerrisk]
- nsenter(1) Formatting fix [Michael Kerrisk]
- nsenter(1) add missing 'see also' for --user [Karel Zak]
- renice(1) Add SEE ALSO entry for sched(7) [Michael Kerrisk]
- renice(1) Add credentials(7) to SEE ALSO [Michael Kerrisk]
- renice(1) Remove obsolete BUGS text [Michael Kerrisk]
- renice(1) Rework discussion of unprivileged users, [Michael Kerrisk]
- taskset(1) Wording fix [Michael Kerrisk]
- update AUTHORS file [Karel Zak]
- update v2.29.1-ReleaseNotes [Karel Zak]
- various pages Format pathnames as italic (.I) [Michael Kerrisk]
- various pages Use "ID" not "id" in man pages [Michael Kerrisk]
- various pages Use "PID" not "pid" in man-pages [Michael Kerrisk]
- various pages Use "system call" not "syscall" [Michael Kerrisk]
- various pages Use 'UID" and "GID", not "uid" and "gid" in man pages [Michael Kerrisk]
- various pages Use consistent terminology (set-user-ID and set-group-ID) [Michael Kerrisk]
fdisk:
- don't be silent when list non-existing device [Karel Zak]
findmnt:
- error on --target /non-exist [Karel Zak]
hwclock:
- don't check for permissions [Karel Zak]
lib/linux_version:
- fix stupid typo [Karel Zak]
libblkid/minix:
- Match minix superblock types [Nate Clark]
- Sanity check superblock s_state for v 1 and 2 [Nate Clark]
- Use same checks for version 3 [Nate Clark]
libfdisk:
- (gpt) make calculations more robust [Karel Zak]
- recount size when apply user device properties [Karel Zak]
libsmartcols:
- add scols_cell_get_alignment() [Karel Zak]
lscpu:
- add aarch64 specific names [Karel Zak]
lsns:
- Fix parser for /proc/<pid>/stat which is including space in comm [OGAWA Hirofumi]
man:
- chfn(1) add chsh and login.defs to SEE ALSO [Andreas Henriksson]
- chsh(1) add login.defs to SEE ALSO [Andreas Henriksson]
more:
- avoid double free() on exit [Karel Zak]
po:
- merge changes [Karel Zak]
- update da.po (from translationproject.org) [Joe Hansen]
- update fr.po (from translationproject.org) [Stéphane Aulery]
- update pt_BR.po (from translationproject.org) [Rafael Fontenelle]
runuser:
- add "--" to SYNOPSIS [Karel Zak]
sfdisk:
- cleanup --dump error messages [Karel Zak]
- don't be silent when list non-existing device [Karel Zak]
su, runuser:
- fix typo in the /etc/default path [Karel Zak]
sulogin:
- bail out from getpasswd(...) on timeout [Andreas Henriksson]
- make getpasswd(...) return NULL on ^D [Andreas Henriksson]
term-utils/script:
- fix typo leading to syntax error [Bert van Hall]
tests:
- (build-sys) don't link -lm by default [Karel Zak]
- Correctly format page cross references [Michael Kerrisk (man-pages)]
- Fix formatting errors in page cross references [Michael Kerrisk (man-pages)]
- Fix page cross references [Michael Kerrisk (man-pages)]
- Fix reference for scheduling discussion [Michael Kerrisk (man-pages)]
- Fix section number in lockf() page xref [Michael Kerrisk (man-pages)]
- Fix typo in page cross reference (capabilities(7), not, capability(7)) [Michael Kerrisk (man-pages)]
- IPC namespaces also isolate POSIX message queues [Michael Kerrisk (man-pages)]
- If mtab support is disabled, disable ro/rw mtab checks [Stanislav Brabec]
- Place SEE ALSO entries in order [Michael Kerrisk (man-pages)]
- Provide better cross references for namespace concepts [Michael Kerrisk (man-pages)]
- Replace reference to sigvec(2) with sigaction(2) [Michael Kerrisk (man-pages)]
This diff is collapsed.
util-linux 2.29.1: Jan 20 2017
* see Documentation/releases/v2.29.1-ReleaseNotes or the complete changelog at
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.29/v2.29.1-ChangeLog
util-linux 2.29: Nov 8 2016
* see Documentation/releases/v2.29-ReleaseNotes or the complete changelog at
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.29/v2.29-ChangeLog
......
......@@ -148,6 +148,9 @@
/* Define to 1 if you have the `iopl' function. */
#undef HAVE_IOPL
/* Define to 1 if you have the `isnan' function. */
#undef HAVE_ISNAN
/* Define to 1 if you have the `jrand48' function. */
#undef HAVE_JRAND48
......
This diff is collapsed.
......@@ -23,14 +23,12 @@ dnl version details from <major>.<minor>[-<suffix>]
PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
| awk -F- '{print $1}')
PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{print $3}' \
| sed 's/.*@<:@^@<:@:digit:@:>@@:>@.*/0/')
PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
sub("-.*","",$3); print $3 ~ /^@<:@[0-9]@:>@+$/ ? $3 : 0}')
dnl libblkid version
LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
LIBBLKID_DATE="08-Nov-2016"
LIBBLKID_DATE="20-Jan-2017"
LIBBLKID_LT_MAJOR=1
LIBBLKID_LT_MINOR=1
LIBBLKID_LT_MICRO=0
......@@ -429,6 +427,12 @@ AC_CHECK_FUNCS([reboot], [have_reboot=yes],[have_reboot=no])
AM_CONDITIONAL([HAVE_OPENAT], [test "x$have_openat" = xyes])
AC_CHECK_FUNCS([isnan], [],
[AC_CHECK_LIB([m], [isnan], [MATH_LIBS="-lm"])]
)
AC_SUBST([MATH_LIBS])
dnl lib/mononotic.c may require -lrt
AC_CHECK_FUNCS([clock_gettime], [],
[AC_CHECK_LIB([rt], [clock_gettime], [REALTIME_LIBS="-lrt"])]
......
......@@ -22,7 +22,7 @@ cfdisk \- display or manipulate a disk partition table
.B cfdisk
is a curses-based program for partitioning any block device.
The default device is
.BR /dev/sda .
.IR /dev/sda .
Note that
.B cfdisk
......@@ -189,10 +189,10 @@ use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH "SEE ALSO"
.BR fdisk (8),
.BR sfdisk (8),
.BR parted (8),
.BR partprobe (8),
.BR partx (8)
.BR partx (8),
.BR sfdisk (8)
.SH AUTHOR
Karel Zak <kzak@redhat.com>
.PP
......
......@@ -64,9 +64,9 @@ Display version information and exit.
Display help text and exit.
.SH "SEE ALSO"
.BR fd (4),
.BR setfdprm (8),
.BR emkfs (8),
.BR mkfs (8),
.BR emkfs (8)
.BR setfdprm (8)
.SH AUTHOR
Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
.SH AVAILABILITY
......
......@@ -359,9 +359,9 @@ use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH "SEE ALSO"
.BR cfdisk (8),
.BR sfdisk (8),
.BR mkfs (8),
.BR partx (8)
.BR partx (8),
.BR sfdisk (8)
.SH AVAILABILITY
The fdisk command is part of the util-linux package and is available from
......
......@@ -944,12 +944,16 @@ int main(int argc, char **argv)
if (argc > optind) {
int k;
int ct = 0;
for (k = optind; k < argc; k++) {
for (rc = 0, k = optind; k < argc; k++) {
if (ct)
fputs("\n\n", stdout);
rc += print_device_pt(cxt, argv[k], 1, 0);
ct++;
print_device_pt(cxt, argv[k], 1, 0);
}
if (rc)
return EXIT_FAILURE;
} else
print_all_devices_pt(cxt, 0);
break;
......
......@@ -36,7 +36,7 @@ If no filesystems are specified on the command line, and the
option is not specified,
.B fsck
will default to checking filesystems in
.B /etc/fstab
.I /etc/fstab
serially. This is equivalent to the
.B \-As
options.
......@@ -160,13 +160,13 @@ They must have the format
If an options specifier is present, then only filesystems which contain
.I fs-option
in their mount options field of
.B /etc/fstab
.I /etc/fstab
will be checked. If the options specifier is prefixed by a negation
operator, then only
those filesystems that do not have
.I fs-option
in their mount options field of
.B /etc/fstab
.I /etc/fstab
will be checked.
.sp
For example, if
......@@ -174,7 +174,7 @@ For example, if
appears in
.IR fslist ,
then only filesystems listed in
.B /etc/fstab
.I /etc/fstab
with the
.B ro
option will be checked.
......@@ -261,7 +261,7 @@ normally does not check whether the device actually exists before
calling a filesystem specific checker. Therefore non-existing
devices may cause the system to enter filesystem repair mode during
boot if the filesystem specific checker returns a fatal error. The
.B /etc/fstab
.I /etc/fstab
mount option
.B nofail
may be used to have
......@@ -373,7 +373,7 @@ environment variable is used to find filesystem checkers.
.B FSTAB_FILE
This environment variable allows the system administrator
to override the standard location of the
.B /etc/fstab
.I /etc/fstab
file. It is also useful for developers who are testing
.BR fsck .
.TP
......@@ -392,13 +392,13 @@ or
or
.BR e2fsck (8),
.BR cramfsck (8),
.BR fsck.minix (8),
.BR fsck.msdos (8),
.BR fsck.jfs (8),
.BR fsck.nfs (8),
.BR fsck.minix (8),
.BR fsck.msdos (8),
.BR fsck.vfat (8),
.BR fsck.xfs (8),
.BR reiserfsck (8).
.BR reiserfsck (8)
.ad
.SH AUTHORS
.nf
......
......@@ -158,8 +158,8 @@ Russell King
.BR fsck (8),
.BR fsck.ext2 (8),
.BR mkfs (8),
.BR mkfs.minix (8),
.BR mkfs.ext2 (8),
.BR mkfs.minix (8),
.BR reboot (8)
.SH AVAILABILITY
The fsck.minix command is part of the util-linux package and is available from
......
......@@ -81,8 +81,8 @@ operation error, such as unable to allocate memory
.PD
.RE
.SH "SEE ALSO"
.BR mount (8),
.BR fsck.cramfs (8)
.BR fsck.cramfs (8),
.BR mount (8)
.SH AVAILABILITY
The example command is part of the util-linux package and is available from
.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
......
......@@ -81,8 +81,8 @@ Operational error
.IP 16
Usage or syntax error
.SH "SEE ALSO"
.BR mkfs (8),
.BR fsck (8),
.BR mkfs (8),
.BR reboot (8)
.SH AVAILABILITY
The mkfs.minix command is part of the util-linux package and is available from
......
......@@ -534,9 +534,9 @@ static void setup_tables(const struct fs_control *ctl) {
if (fs_version == 3)
Super3.s_ninodes = inodes;
else {
Super.s_ninodes = inodes;
if (inodes > MINIX_MAX_INODES)
inodes = MINIX_MAX_INODES;
Super.s_ninodes = inodes;
}
super_set_map_blocks(ctl, inodes);
if (MINIX_MAX_INODES < first_zone_data())
......
......@@ -560,6 +560,7 @@ static int write_changes(struct sfdisk *sf)
*/
static int command_list_partitions(struct sfdisk *sf, int argc, char **argv)
{
int fail = 0;
fdisk_enable_listonly(sf->cxt, 1);
if (argc) {
......@@ -568,13 +569,14 @@ static int command_list_partitions(struct sfdisk *sf, int argc, char **argv)
for (i = 0; i < argc; i++) {
if (ct)
fputs("\n\n", stdout);
if (print_device_pt(sf->cxt, argv[i], 0, sf->verify) == 0)
ct++;
if (print_device_pt(sf->cxt, argv[i], 1, sf->verify) != 0)
fail++;
ct++;
}
} else
print_all_devices_pt(sf->cxt, sf->verify);
return 0;
return fail;
}
/*
......@@ -582,6 +584,7 @@ static int command_list_partitions(struct sfdisk *sf, int argc, char **argv)
*/
static int command_list_freespace(struct sfdisk *sf, int argc, char **argv)
{
int fail = 0;
fdisk_enable_listonly(sf->cxt, 1);
if (argc) {
......@@ -590,13 +593,14 @@ static int command_list_freespace(struct sfdisk *sf, int argc, char **argv)
for (i = 0; i < argc; i++) {
if (ct)
fputs("\n\n", stdout);
if (print_device_freespace(sf->cxt, argv[i], 0) == 0)
ct++;
if (print_device_freespace(sf->cxt, argv[i], 1) != 0)
fail++;
ct++;
}
} else
print_all_devices_freespace(sf->cxt);
return 0;
return fail;
}
/*
......@@ -946,13 +950,16 @@ static int command_dump(struct sfdisk *sf, int argc, char **argv)
if (rc)
err(EXIT_FAILURE, _("cannot open %s"), devname);
if (!fdisk_has_label(sf->cxt))
errx(EXIT_FAILURE, _("%s: does not contain a recognized partition table"), devname);
dp = fdisk_new_script(sf->cxt);
if (!dp)
err(EXIT_FAILURE, _("failed to allocate dump struct"));
rc = fdisk_script_read_context(dp, NULL);
if (rc)
err(EXIT_FAILURE, _("failed to dump partition table"));
errx(EXIT_FAILURE, _("%s: failed to dump partition table"), devname);
if (sf->json)
fdisk_script_enable_json(dp, 1);
......
......@@ -53,7 +53,7 @@ will truncate it and print a warning message.
Specify a new \fIUUID\fR for the device.
The \fI UUID\fR
must be in the standard 8-4-4-4-12 character format, such as is output by
.BR uuidgen (1) .
.BR uuidgen (1).
.PP
.SH AUTHOR
.B swaplabel
......@@ -65,6 +65,6 @@ enables libblkid debug output.
The swaplabel command is part of the util-linux package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
.SH SEE ALSO
.BR uuidgen (1),
.BR mkswap (8),
.BR swapon (8),
.BR uuidgen (1)
.BR swapon (8)
......@@ -20,5 +20,5 @@ int get_linux_version (void)
if (n < 1 || n > 3)
return kver = 0;
return kver = KERNEL_VERSION(x, y, y);
return kver = KERNEL_VERSION(x, y, z);
}
......@@ -170,11 +170,11 @@ Any other use of the hash character is not interpreted as introducing
a comment.
.SH FILES
.B $XDG_CONFIG_HOME/terminal-colors.d
.I $XDG_CONFIG_HOME/terminal-colors.d
.br
.B $HOME/.config/terminal-colors.d
.I $HOME/.config/terminal-colors.d
.br
.B /etc/terminal-colors.d
.I /etc/terminal-colors.d
.SH ENVIRONMENT
.IP TERMINAL_COLORS_DEBUG=all
......
......@@ -224,10 +224,17 @@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NCURSES5_CONFIG = @NCURSES5_CONFIG@
NCURSES6_CONFIG = @NCURSES6_CONFIG@
NCURSESW5_CONFIG = @NCURSESW5_CONFIG@
NCURSESW6_CONFIG = @NCURSESW6_CONFIG@
NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
NCURSESW_LIBS = @NCURSESW_LIBS@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_LIBS = @NCURSES_LIBS@
NM = @NM@
......
......@@ -30,8 +30,8 @@
extern "C" {
#endif
#define BLKID_VERSION "2.29."
#define BLKID_DATE "08-Nov-2016"
#define BLKID_VERSION "2.29.1"
#define BLKID_DATE "20-Jan-2017"
/**
* blkid_dev:
......
......@@ -87,12 +87,15 @@ static int probe_minix(blkid_probe pr,
if (version < 1)
return 1;
unsigned long zones, ninodes, imaps, zmaps;
off_t firstz;
size_t zone_size;
if (version <= 2) {
struct minix_super_block *sb = (struct minix_super_block *) data;
int zones, ninodes, imaps, zmaps, firstz;
if (sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0 ||
sb->s_log_zone_size != 0)
uint16_t state = minix_swab16(swabme, sb->s_state);
if ((state & (MINIX_VALID_FS | MINIX_ERROR_FS)) != state)
return 1;
zones = version == 2 ? minix_swab32(swabme, sb->s_zones) :
......@@ -101,19 +104,30 @@ static int probe_minix(blkid_probe pr,
imaps = minix_swab16(swabme, sb->s_imap_blocks);
zmaps = minix_swab16(swabme, sb->s_zmap_blocks);
firstz = minix_swab16(swabme, sb->s_firstdatazone);
/* sanity checks to be sure that the FS is really minix */
if (imaps * MINIX_BLOCK_SIZE * 8 < ninodes + 1)
return 1;
if (zmaps * MINIX_BLOCK_SIZE * 8 < zones - firstz + 1)
return 1;
zone_size = sb->s_log_zone_size;
} else if (version == 3) {
struct minix3_super_block *sb = (struct minix3_super_block *) data;
if (sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0)
return 1;
zones = minix_swab32(swabme, sb->s_zones);
ninodes = minix_swab32(swabme, sb->s_ninodes);
imaps = minix_swab16(swabme, sb->s_imap_blocks);
zmaps = minix_swab16(swabme, sb->s_zmap_blocks);
firstz = minix_swab16(swabme, sb->s_firstdatazone);
zone_size = sb->s_log_zone_size;
}
/* sanity checks to be sure that the FS is really minix.
* see disk-utils/fsck.minix.c read_superblock
*/
if (zone_size != 0 || ninodes == 0 || ninodes == UINT32_MAX)
return 1;
if (imaps * MINIX_BLOCK_SIZE * 8 < ninodes + 1)
return 1;
if (firstz > (off_t) zones)
return 1;
if (zmaps * MINIX_BLOCK_SIZE * 8 < zones - firstz + 1)
return 1;
/* unfortunately, some parts of ext3 is sometimes possible to
* interpreted as minix superblock. So check for extN magic
* string. (For extN magic string and offsets see ext.c.)
......
......@@ -224,10 +224,17 @@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NCURSES5_CONFIG = @NCURSES5_CONFIG@
NCURSES6_CONFIG = @NCURSES6_CONFIG@
NCURSESW5_CONFIG = @NCURSESW5_CONFIG@
NCURSESW6_CONFIG = @NCURSESW6_CONFIG@
NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
NCURSESW_LIBS = @NCURSESW_LIBS@
NCURSES_CFLAGS = @NCURSES_CFLAGS@
NCURSES_LIBS = @NCURSES_LIBS@
NM = @NM@
......
......@@ -335,10 +335,19 @@ int fdisk_apply_user_device_properties(struct fdisk_context *cxt)
if (cxt->user_pyh_sector)
cxt->phy_sector_size = cxt->user_pyh_sector;
if (cxt->user_log_sector)
if (cxt->user_log_sector) {
uint64_t old_total = cxt->total_sectors;
uint64_t old_secsz = cxt->sector_size;
cxt->sector_size = cxt->min_io_size =
cxt->io_size = cxt->user_log_sector;
if (cxt->sector_size != old_secsz) {
cxt->total_sectors = (old_total * (old_secsz/512)) / (cxt->sector_size >> 9);
DBG(CXT, ul_debugobj(cxt, "new total sectors: %ju", cxt->total_sectors));
}
}
if (cxt->user_geom.heads)
cxt->geom.heads = cxt->user_geom.heads;
if (cxt->user_geom.sectors)
......
......@@ -491,7 +491,8 @@ static void gpt_mknew_header_common(struct fdisk_context *cxt,
header->alternative_lba = cpu_to_le64(cxt->total_sectors - 1ULL);
header->partition_entry_lba = cpu_to_le64(2ULL);
} else { /* backup */
uint64_t esz = le32_to_cpu(header->npartition_entries) * sizeof(struct gpt_entry);
uint64_t esz = (uint64_t) le32_to_cpu(header->npartition_entries)
* sizeof(struct gpt_entry);
uint64_t esects = (esz + cxt->sector_size - 1) / cxt->sector_size;
header->alternative_lba = cpu_to_le64(GPT_PRIMARY_PARTITION_TABLE_LBA);
......@@ -564,7 +565,7 @@ static struct gpt_header *gpt_copy_header(struct fdisk_context *cxt,
if (res->my_lba == GPT_PRIMARY_PARTITION_TABLE_LBA)
res->partition_entry_lba = cpu_to_le64(2ULL);
else {
uint64_t esz = le32_to_cpu(src->npartition_entries) * sizeof(struct gpt_entry);
uint64_t esz = (uint64_t) le32_to_cpu(src->npartition_entries) * sizeof(struct gpt_entry);
uint64_t esects = (esz + cxt->sector_size - 1) / cxt->sector_size;
res->partition_entry_lba = cpu_to_le64(cxt->total_sectors - 1ULL - esects);
......@@ -826,13 +827,13 @@ static struct gpt_entry *gpt_read_entries(struct fdisk_context *cxt,
assert(cxt);
assert(header);
sz = le32_to_cpu(header->npartition_entries) *
sz = (ssize_t) le32_to_cpu(header->npartition_entries) *
le32_to_cpu(header->sizeof_partition_entry);
ret = calloc(1, sz);
if (!ret)
return NULL;
offset = le64_to_cpu(header->partition_entry_lba) *
offset = (off_t) le64_to_cpu(header->partition_entry_lba) *