sfdisk writes empty disk label only when "label:" header specified.
Unfortunately, this feature is ignored when all specified partitions
are ignored
echo -e "label: dos\n0,0,0\n" | sfdisk /dev/sdc
Fixes: https://github.com/karelzak/util-linux/issues/1413
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'chs' of https://github.com/pali/util-linux:
fdisk: Add support for fixing MBR partitions CHS values
libfdisk: (dos) Add function fdisk_dos_fix_chs() for fixing CHS values for all partitions
libfdisk: (dos) Add function dos_partition_sync_chs() for updating CHS values
Add a new extended option 'F' to fdisk which recalculates and fixes CHS
values for each partition in MBR table according to current fdisk settings
for number of heads and sectors per track.
This allows in interactive mode to repair existing partitions to be
compatible with CHS addressing after changing extended option 'h' (number
of heads) or 's' (sectors per track) as these options do not modify content
of existing partitions.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
commit 9147d2ad8a ("blockdev: Don't fail on missing start sector") limits
the size of the start sector to 10 digits.
Multi-terrabyte devices can have partitions with a start sector larger than
10 digits, which will cause an sprintf() to abort due to overflowing the buffer.
It causes:
# blockdev --report /dev/sda4
RO RA SSZ BSZ StartSec Size Device
*** buffer overflow detected ***: terminated
Aborted (core dumped)
The function fdisk_reorder_partitions() is also used in sfdisk and cfdisk
and these commands assume info/warn messages from the library. So move all
messages from fdisk to fdisk_reorder_partitions().
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Option 'f' currently prints following RED error message:
Nothing to do. Ordering is correct already.
Failed to fix partitions order.
This change removes RED error message when ordering is already correct.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* rename MANPAGES_EXTRA= to ADOCFILES_COMMON=
* keep track about individual adoc files by dist_noinst_DATA=
This variable is not effected by automake conditions, so the files
are always distributed.
Signed-off-by: Karel Zak <kzak@redhat.com>
The expert command 'D'ump skips zeros when print label hexdump on
terminal, but for non-terminal it prints all buffer. It seems
better to use the same semantic everywhere and skip zeros.
Signed-off-by: Karel Zak <kzak@redhat.com>
We need to evaluate "include::" directive relatively to project
top-level source directory rather than to the current document
location.
Signed-off-by: Karel Zak <kzak@redhat.com>
The symlinks are generated by asciidoctor and current dist_man_MANS
depends on order (nan page before man link). This solutions is useless
when execute "make -j". The real solution is to keep man pages in
separate variable and use only this variable evaluate what we need to
generate.
Signed-off-by: Karel Zak <kzak@redhat.com>
To build: meson build && ninja -C build
To run tests: ninja -C build check
To install for packaging: DESTDIR=/var/tmp/inst ninja -C build install
To install for realz: sudo ninja -C build install
v2:
- Optional items are now based on the 'feature' feature in meson.
Built libraries which are disabled turn into disabler() objects
and also poison any executables which link to them.
What is there:
- building of the binaries and libs and the python module
- installation of binaries, libs, python module, localization files,
man pages, pkgconfig files
- running of tests
- most options to configure build equivalently to the
./configure settings
Partially implemented:
- disabling of stuff when things missing. In the C code, the defines
are all used, so that should be fine. In the build system, some
files should be skipped, but that is probably not always done properly.
Getting this right might require some testing of various build option
combinations to get the details right.
Not implemented:
- static builds of fdisk and other binaries
- things marked with XXX or FIXME
- ???
Differences:
- .la files are not created. They are useless and everybody hates them.
- Requires.private in pkgconfig files are not present in the
autogenerated .pc file. Not sure if they should be there or not. If
necessary, they can be added by hand.
- man pages and systemd units are installed by the install target. Not
sure why 'make install' doesn't do that.
- the split between / and /usr is probably wrong. But it's all pointless
anyway, so maybe we could simplify things but not implementing it at
all under meson?