The system libtool program has architecture dependent behaviour. It is
therefore unavailable in cross build environments. The only place it was
used in util-linux is autogen.sh to determine the availability of
libtool. All other places correctly use libtoolize or
$(top_builddir)/libtool.
Signed-off-by: Helmut Grohne <helmut@subdivi.de>
* this patch add to dos driver support for fdisk_partition->size_explicit
to avoid unexpected last sector alignment for sizes explicitly specified
in sectors
* add support for small "first LBA", the current default is to use
1MiB offset for the first partition and for each EBR. This is not
backwardly compatible and it makes impossible to apply sfdisk
scripts/dumps from old systems, because original offset can be
smaller than 2048 sectors (old sfdisk default is 1 sector).
The solution is on the fly to detect this situation and change
fdisk_context->first_lba to 1 sector. Nasty.
Signed-off-by: Karel Zak <kzak@redhat.com>
regular disk label:
# sfdisk --list /dev/sdb
..
Disklabel type: gpt
Disk identifier: 9DF9A9F1-0654-4E7A-9A5E-36E66D60FD79
Device Start End Sectors Size Type
/dev/sdb1 2048 22527 20480 10M Linux filesystem
/dev/sdb2 22528 43007 20480 10M Linux swap
/dev/sdb3 43008 204766 161759 79M Linux filesystem
nested (PMBR):
# sfdisk --list --label-nested dos /dev/sdb
...
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdb1 1 204799 204799 100M ee GPT
and for example:
# sfdisk --label-nested dos /dev/sdb <<EOF
1, 2047, ee
, 10M, L
, 10M, S
,,
creates hybrid GPT (PMBR partitions point to the same location as GPT)
Signed-off-by: Karel Zak <kzak@redhat.com>
The option --backup force sfdisk to store *all* fragments of the
partition table (including MBR partition tables store in the
extended partitions) to
$HOME/sfdisk-<devname>-<offset>.bak
The options -O, -backup-file <path> allows to override the default
path, but sfdisk still appends <devname>-<offset>.bak to the <path>.
The backup files always contain only raw data from the device, so it's
possible to use dd(1) to restore original data on the device.
The original sfdisk also supported -O <file>, but semantic was little
bit different:
- all was based on 512-byte sectors
- all sectors was stored to the one file in format
<offset>|<sector>|<offset>|...
this original concept makes the backup files specific to sfdisk and with
dependence on sector size.
The new concept is the same we already use for wipefs(8) backup files.
Example (disk with GPT):
# sfdisk /dev/sda --backup
Welcome to sfdisk (util-linux 2.25.202-f4deb-dirty).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Backup files:
PMBR (offset 0, size 512): /root/sfdisk-sda-0x00000000.bak
GPT Header (offset 512, size 512): /root/sfdisk-sda-0x00000200.bak
GPT Entries (offset 1024, size 16384): /root/sfdisk-sda-0x00000400.bak
Signed-off-by: Karel Zak <kzak@redhat.com>
The sfdisk does not care about compatibility with classic DOS
partitioning, and it does not warn about incompatibility with DOS at
all. It means that --Linux is default and it's unnecessary to use
this option.
It's the same situation like with "--unit S", these options are very
probably often used in scripts, and these all is default now. So for
backward compatibility new sfdisk accepts these options on command
line, but prints "option is deprecated" warning message.
Signed-off-by: Karel Zak <kzak@redhat.com>
Note that original sfdisk implementation suppressed warning
messages for --quiet.
Now we keep warning and error messages visible, but suppress
extra info messages only (for example to make it more usable in
scripts). IMHO suppress warnings is bad idea.
Signed-off-by: Karel Zak <kzak@redhat.com>