Commit Graph

1191 Commits

Author SHA1 Message Date
Mike Fleetwood b77a6be76b Add initial loading of LUKS mapping details (#760080)
Load basic details of active Device-mapper encryption mappings from the
kernel.  Use dmsetup active targets.

    # cryptsetup luksFormat /dev/sdb5
    # cryptsetup luksFormat /dev/sdb6
    # cryptsetup luksOpen /dev/sdb6 sdb6_crypt
    # ls -l /dev/mapper/sdb6_crypt /dev/dm-0
    lrwxrwxrwx. 1 root root 7 Nov 15 09:03 /dev/mapper/sdb6_crypt -> ../dm-0
    brw-rw----. 1 root disk 253, 0 Nov 15 09:03 /dev/dm-0
    # ls -l /dev/sdb6
    brw-rw----. 1 root disk 8, 22 Nov 15 09:02 /dev/sdb6
    # dmsetup table --target crypt
    sdb6_crypt: 0 1044480 crypt aes-cbc-essiv:sha256 0000000000000000000000000000000000000000000000000000000000000000 0 8:22 4096

So far just load the mapping name and underlying block device reference
(path or major, minor pair).

Note that all supported kernels appear to report the underlying block
device as major, minor pair in the dmsetup output.  Underlying block
device paths are added to the cache when found during a search to avoid
stat(2) call on subsequent searches for the same path.

Prints debugging to show results, like this:

    # ./gpartedbin
    ======================
    libparted : 2.4
    ======================
    DEBUG: /dev/sdb5: LUKS closed
    DEBUG: /dev/sdb6: LUKS open mapping /dev/mapper/sdb6_crypt

Bug 760080 - Implement read-only LUKS support
2016-01-29 13:41:40 -07:00
Mike Fleetwood 06b8a3a14a Use pointers to Partitions in PartitionVector class (#759726)
The PartitionVector class is now internally using pointers to Partition
objects and taking on management of their lifetimes.  It therefore has
to implement the Big 3: destructor, copy constructor and copy assignment
operator [1][2].  This is because the implicitly-defined copy
constructor and assignment operator perform memberwise "shallow copying"
and the destructor does nothing.  This not correct for classes which
contain non-class types such as raw pointers.

The semantics of the interface still copies each Partition object into
the PartitionVector when they are added with push_back() and insert().

Note that a PartitionVector object is explicitly copy assigned in
Win_GParted::Refresh_Visual().  They are also implicitly copied when
(1) the implementing vector is resized larger to allow it to hold more
pointers to Partition objects than it previously had capacity for; and
(2) a Partition object is copied including the logicals PartitionVector
member.

[1] The rule of three/five/zero
    http://en.cppreference.com/w/cpp/language/rule_of_three
[2] Rule of Three
    https://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29

Bug 759726 - Implement Partition object polymorphism
2016-01-26 10:11:35 -07:00
Aurimas Černius 1c916f9906 Updated Lithuanian translation 2016-01-23 18:19:17 +02:00
Muhammet Kara c535cf3642 Updated Turkish translation 2016-01-13 00:20:09 +00:00
Necdet Yücel 94c1ec1305 Updated Turkish translation 2016-01-13 00:16:54 +00:00
hanniedu fc4152d4b4 Updated Dutch translation 0.25.0 2016-01-12 12:31:18 +01:00
Sveinn í Felli b14afdae15 Updated Icelandic translation 2016-01-11 19:07:17 +00:00
Мирослав Николић ae4adfcbb7 Updated Serbian translation 2015-12-30 10:51:51 +01:00
Curtis Gedak de5019caf7 Fix missing "old end" value in detail log of en_CA translation (#756878)
The Canadian English translation po file incorrectly changed the
following string with a parameter from %1 to %2:

   msgid "old end: %1"
   msgstr "old end: %2"

The error resulted in a missing "old end:" numerical value in the
gparted details log.

This error was introduced back in 2011-09-06 with the following
commit:

   06eeaafc8c
   Updated Canadian English translation.

Bug 756878 - GParted - Fix missing "old end" value in detail log of
             en_CA translation
2015-11-16 14:15:29 -07:00
Mike Fleetwood 5f02bcf463 Detect Linux SWRaid members by querying mdadm (#756829)
Detection of Linux SWRaid members currently fails in a number of cases:

1)  Arrays which use metadata type 0.90 or 1.0 store the super block at
    the end of the partition.  So file system signatures in at least
    linear and mirrored arrays occur at the same offsets in the
    underlying partitions.  As libparted only recognises file systems
    this is what is detected, rather than an SWRaid member.

    # mdadm -E -s -v
    ARRAY /dev/md/1  level=raid1 metadata=1.0 num-devices=2 UUID=15224a42:c25bbcd9:15db6000:4e5fe53a name=chimney:1
       devices=/dev/sda1,/dev/sdb1
    ...
    # wipefs /dev/sda1
    offset               type
    ----------------------------------------------------------------
    0x438                ext4   [filesystem]
                         LABEL: chimney-boot
                         UUID:  10ab5f7d-7d8a-4171-8b6a-5e973b402501

    0x1fffe000           linux_raid_member   [raid]
                         LABEL: chimney:1
                         UUID:  15224a42-c25b-bcd9-15db-60004e5fe53a

    # parted /dev/sda print
    Model: ATA VBOX HARDDISK (scsi)
    Disk /dev/sda: 34.4GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number  Start   End     Size    Type      File system  Flags
     1      1049kB  538MB   537MB   primary   ext4         boot, raid
    ...

2)  Again with metadata type 0.90 or 1.0 arrays blkid may report the
    contained file system instead of an SWRaid member.  Have a single
    example of this configuration with a mirrored array containing the
    /boot file system.  Blkid reports one member as ext4 and the other as
    SWRaid!

    # blkid | egrep 'sd[ab]1'
    /dev/sda1: UUID="10ab5f7d-7d8a-4171-8b6a-5e973b402501" TYPE="ext4" LABEL="chimney-boot"
    /dev/sdb1: UUID="15224a42-c25b-bcd9-15db-60004e5fe53a" UUID_SUB="0a095e45-9360-1b17-0ad1-1fe369e22b98" LABEL="chimney:1" TYPE="linux_raid_member"

    Bypassing the blkid cache gets the correct result.

    # blkid -c /dev/null /dev/sda1
    /dev/sda1: UUID="15224a42-c25b-bcd9-15db-60004e5fe53a" UUID_SUB="d0460f90-d11a-e80a-ee1c-3d104dae7e5d" LABEL="chimney:1" TYPE="linux_raid_member"

    However this can't be used because if a user has a floppy configured
    in the BIOS but no floppy attached, GParted will wait for minutes as
    the kernel tries to access non-existent hardware on behalf of the
    blkid query.  See commit:
        18f863151c
        Fix long scan problem when BIOS floppy setting incorrect

3)  Old versions of blkid don't recognise SWRaid members at all so always
    report the file system when found.  Occurs with blkid v1.0 on
    RedHat / CentOS 5.

The only way I can see how to fix all these cases is to use the mdadm
command to query the configured arrays.  Then use this information for
first choice when detecting partition content, making the order: SWRaid
members, libparted, blkid and internal.

GParted shell wrapper already creates temporary blank udev rules to
prevent Linux Software RAID arrays being automatically started when
GParted refreshes its device information[1].  However an administrator
could manually stop or start arrays or change their configuration
between refreshes so GParted must load this information every refresh.
On my desktop with 4 internal hard drives and 3 testing Linux Software
RAID arrays, running mdadm adds between 0.20 and 0.30 seconds to the
device refresh time.

[1] a255abf343
    Prevent GParted starting stopped Linux Software RAID arrays (#709640)

Bug 756829 - SWRaid member detection enhancements
2015-11-02 10:03:45 -07:00
Wolfgang Stöggl cf48f07038 Updated German translation 2015-10-26 04:40:40 +00:00
Daniel Korostil f09249750f Updated Ukrainian translation 2015-10-22 17:13:01 +03:00
Anders Jonsson 8a27b073b7 Updated Swedish translation 2015-10-21 21:53:34 +00:00
Daniel Mustieles bcb3628ab6 Updated Spanish translation 2015-10-21 14:29:03 +00:00
Alexandre Franke d9c76be725 Updated French translation 2015-10-21 08:41:41 +00:00
Jiri Grönroos 27f3b6c9a0 Updated Finnish translation 2015-10-21 07:28:33 +00:00
Milo Casagrande 459144eeff Updated Italian translation 2015-10-20 17:08:22 +00:00
Daniel Șerbănescu 8fd4043d8f Updated Romanian Translation 2015-10-20 18:56:12 +02:00
Rafael Fontenelle 3ec385142d Updated Brazilian Portuguese translation 2015-10-20 16:29:18 +00:00
Jiri Grönroos 27a12d82d1 Updated Finnish translation 2015-10-07 13:55:59 +00:00
Seong-ho Cho 5367af04a6 Updated Korean translation 2015-10-05 01:37:05 +09:00
Pedro Albuquerque 5c852e5415 Updated Portuguese translation 2015-09-26 10:14:21 +00:00
Pedro Albuquerque fe47d7a46a Updated Portuguese translation 2015-09-26 10:11:57 +00:00
Stas Solovey b4fe2f608e Updated Russian translation 2015-09-20 20:54:07 +00:00
Andika Triwidada 2d55b74699 Updated Indonesian translation 2015-09-20 06:28:30 +00:00
Aurimas Černius 681acdfd2c Updated Lithuanian translation 2015-09-19 18:17:05 +03:00
Piotr Drąg 8b8dbabc73 Updated Polish translation 2015-09-19 09:52:20 +02:00
Dušan Kazik a85a91aacd Updated Slovak translation 2015-09-17 16:31:05 +00:00
Balázs Úr c7120ba975 Updated Hungarian translation 2015-09-17 15:01:30 +00:00
Marek Černocký 7f9503eb8f Updated Czech translation 2015-09-17 09:54:23 +02:00
Aurimas Černius d4a8e21578 Updated Lithuanian translation 2015-09-09 17:35:40 +03:00
Kjartan Maraas 32aba0c39a Updated Norwegian bokmål translation from ProjectX. 2015-09-07 21:59:32 +02:00
Seong-ho Cho 0916a50cbe Updated Korean translation 2015-09-08 02:34:33 +09:00
Piotr Drąg 68a162ab68 Updated Polish translation 2015-09-04 00:18:34 +02:00
Anders Jonsson ee26d4fffc Updated Swedish translation 2015-08-10 18:23:18 +00:00
Rūdolfs Mazurs 226f7ee8e8 Updated Latvian translation 2015-08-03 21:07:35 +03:00
Wolfgang Stöggl 14e6b7639a Updated German translation 2015-07-31 22:14:55 +00:00
Milo Casagrande 48a9d7eec7 Updated Italian translation 2015-07-31 07:13:47 +00:00
A S Alam 574ac285c5 Punjabi Translation updated 2015-07-27 22:59:12 -05:00
Enrico Nicoletto b23092ae77 Updated Brazilian Portuguese translation 2015-07-27 16:06:04 +00:00
Josef Andersson c3f865e10f Updated Swedish translation 2015-07-26 19:01:00 +00:00
Alexandre Franke 8a7b3d23b4 Updated French translation 2015-07-26 17:26:05 +00:00
Baurzhan Muftakhidinov 12b2fc4237 Updated Kazakh translation 2015-07-26 15:42:19 +00:00
Daniel Șerbănescu 1b562ad1dd Updated Romanian Translation 2015-07-26 17:40:36 +02:00
Dušan Kazik b4084db410 Updated Slovak translation 2015-07-23 18:02:31 +00:00
Marek Černocký 8dff5af807 Updated Czech translation 2015-07-21 19:30:27 +02:00
Balázs Úr 72f9a2a3c8 Updated Hungarian translation 2015-07-17 14:09:29 +00:00
Daniel Mustieles 0adc0a0bda Updated Spanish translation 2015-07-13 14:07:51 +02:00
Stas Solovey 4e19422312 Updated Russian translation 2015-07-13 11:14:04 +00:00
Piotr Drąg fef569552c Updated Polish translation 2015-07-05 20:28:07 +02:00
Gábor Kelemen 7090866b2a Updated Hungarian translation 2015-06-01 14:27:03 +00:00
Daniel Șerbănescu aaddc15295 Updated Romanian Translation 2015-04-24 08:39:45 +02:00
Sveinn í Felli 5aa58519b6 Updated Icelandic translation 2015-04-22 10:15:44 +00:00
Sveinn í Felli 1002864e4c Updated Icelandic translation 2015-04-22 10:09:25 +00:00
Jordi Mas 6630320b0d Fixes to Catalan translation 2015-04-18 20:07:17 +02:00
Akom Chotiphantawanon ec910b9699 Updated Thai translation 2015-04-07 12:46:02 +07:00
Dušan Kazik b549a48640 Updated Slovak translation 2015-04-01 18:25:44 +00:00
Piotr Drąg 038274c9fd Updated Polish translation 2015-03-29 21:00:27 +02:00
GNOME Translation Robot 4baaf4436f Updated Scottish Gaelic translation 2015-03-28 11:23:27 +00:00
GNOME Translation Robot a76289046a Updated Scottish Gaelic translation 2015-03-27 10:16:19 +00:00
Marek Černocký c83e37fe0e Updated Czech translation 2015-03-26 00:41:59 +01:00
Stas Solovey 33bce8cdbc Updated Russian translation 2015-03-25 19:47:31 +00:00
Cheng-Chia Tseng 44c4091d3f Updated Chinese (Taiwan) translation 2015-03-19 14:13:38 +00:00
Stas Solovey ed2a5437da Updated Russian translation 2015-03-18 18:10:12 +00:00
Daniel Mustieles 3cf0e86e2c Updated Spanish translation 2015-03-16 11:19:43 +01:00
Piotr Drąg ad0dbcf2ab Updated Polish translation 2015-03-15 22:48:45 +01:00
Aurimas Černius 7f1c89beeb Updated Lithuanian translation 2015-03-15 21:18:33 +02:00
Alexandre Franke e7093db4e5 Updated French translation 2015-03-15 18:45:44 +00:00
Balázs Úr 7e089ad5b2 Updated Hungarian translation 2015-03-14 20:15:20 +00:00
Milo Casagrande 2d03024fc4 Updated Italian translation 2015-03-14 16:20:21 +00:00
Wolfgang Stöggl 31aa755b1a Updated German translation 2015-03-14 14:53:27 +00:00
Daniel Korostil 5c5b4ff0e0 Updated Ukrainian translation 2015-03-14 12:03:43 +02:00
Samir Ribic 6778629aca Added Bosnian translation 2015-03-13 23:44:37 +00:00
Enrico Nicoletto 219cfdd69a Updated Brazilian Portuguese translation 2015-03-13 16:27:31 +00:00
hanniedu ada359a210 Updated Dutch translation Master 3.16 2015-03-13 16:59:06 +01:00
Sveinn í Felli d3c8603b3d Updated Icelandic translation 2015-03-13 15:37:31 +00:00
Marek Černocký 7e0efc16b7 Updated Czech translation 2015-03-11 18:24:38 +01:00
Baurzhan Muftakhidinov 6770872a8b Updated Kazakh translation 2015-03-11 06:51:02 +00:00
Dušan Kazik f3d5b819b2 Updated Slovak translation 2015-03-10 09:56:12 +00:00
Stas Solovey 2dd504654a Updated Russian translation 2015-03-05 23:07:30 +00:00
Marco Ciampa 43913debaf Updated italian translation 2015-03-03 07:42:38 +01:00
Balázs Úr 40243fe6f3 Updated Hungarian translation 2015-03-01 16:31:30 +00:00
Γιάννης Κουτσούκος a615e9f0bf Updated Greek translation 2015-02-27 12:32:02 +00:00
Dušan Kazik e79faf7bdf Updated Slovak translation 2015-02-22 08:07:40 +00:00
Muhammet Kara 18c6116059 Updated Turkish translation 2015-02-16 13:15:50 +00:00
Enrico Nicoletto 5f9ca11da7 Updated Brazilian Portuguese translation 2015-02-11 15:33:06 +00:00
Piotr Drąg 78b7286753 Updated Polish translation 2015-02-08 14:12:18 +01:00
Marek Černocký 900e0b7300 Updated Czech translation 2015-02-03 19:27:47 +01:00
Marek Černocký 7ab366af50 Updated Czech translation 2015-02-03 08:56:59 +01:00
Michael Zimmermann 1f5841b4ad Add support for GPT partition names (#741424)
Embedded devices (Android) use GPT partition names to identify
partitions, instead of file system labels.  Add support for viewing and
changing them.

As partition names are used to provide unique identification they are
never copied when copying the contents of one partition to another.

Note that GNU/Linux uses file system labels, UUIDs or device names for
identification during the boot process and afterwards so while partition
names can be used, they are optional and purely for user information.

Bug 741424 - Add support for GPT partition names
2015-02-01 10:08:23 -07:00
Mike Fleetwood e1dc89cd11 Rename class to Dialog_FileSystem_Label (#741424)
class Dialog_Partition_Label   -> Dialog_FileSystem_Label
file Dialog_Partition_Label.h  -> Dialog_FileSystem_Label.h
file Dialog_Partition_Label.cc -> Dialog_FileSystem_Label.cc

Bug 741424 - Add support for GPT partition names
2015-02-01 10:08:23 -07:00
Mike Fleetwood 04450c577c Rename class to OperationLabelFileSystem (#741424)
class OperationLabelPartition   -> OperationLabelFileSystem
file OperationLabelPartition.h  -> OperationLabelFileSystem.h
file OperationLabelPartition.cc -> OperationLabelFileSystem.cc

Bug 741424 - Add support for GPT partition names
2015-02-01 10:08:23 -07:00
Alexandre Franke a4d06f0a6b Updated French translation 2015-01-23 01:30:42 +00:00
Anders Jonsson 3fecfdd2c9 Updated Swedish translation 2015-01-22 21:40:29 +00:00
Milo Casagrande f3e5103282 Updated Italian translation 2015-01-20 07:32:46 +00:00
Wolfgang Stöggl 7227181afd Updated German translation 2015-01-19 13:12:44 +00:00
Daniel Korostil 4fe21b1e93 Updated Ukrainian translation 2015-01-19 04:14:06 +02:00
Daniel Mustieles c97a462e7c Updated Spanish translation 2015-01-12 19:17:20 +01:00
Rafael Ferreira 853d5d6d2d Updated Brazilian Portuguese translation 2015-01-03 22:07:37 +00:00
Мирослав Николић fc331eafde Updated Serbian translation 2014-12-27 15:32:50 +01:00