Use padding to indent the legend narrative to better show hierarchy and
association with the "Legend" category as recommended in the:
GNOME HIG 2.2.3 / Visual Design / Window Layout
https://developer.gnome.org/hig-book/stable/design-window.html.en
Padding the legend narrative widget also deliberately increases the
spacing to the legend icons too.
Bug #342682 - too much information in 'features' dialog
Make the legend always shown, ready for when the dialog is resizable.
Change the widget containing the legend from an expander to a frame
widget. Set the frame to be borderless using a bold label as
recommended in the GNOME Human Interface Guidelines 2.2.1 / Controls /
Frames and Separators.
https://developer.gnome.org/hig-book/2.32/controls-frames.html.en
Bug #342682 - too much information in 'features' dialog
The DialogFeatures::DialogFeatures() constructor used four levels of
nested code blocks and reused the same variable names at multiple
levels. The variable hbox was used at three of the four levels. This
was done by commit:
91b971691d
Bug #634090: Change some attributes to local variables
In my opinion this made the code hard to understand. Give every local
variable a unique and meaningful name and remove the nested code blocks.
This is part of parent bug:
Bug #721455 - Obsolete info in license text on multiple modules
and GNOME Goal:
https://wiki.gnome.org/Initiatives/GnomeGoals/Proposals
* verify all source files to make sure they have a license and a
copyright, and that both are up-to-date
Bug #721565 - License text contains obsolete FSF postal address
Write a loop partition table to a disk and then try to create a new
partition on that disk crashes GParted.
Analysis:
1) Loop partition table, actually just the signature / label
"GNU Parted Loopback 0", is written to the disk.
2) create_partition() calls ped_disk_app_partition() to create the
partition which, arguably erroneously, clears the loop signature.
3) In erase_filesystem_signatures(), get_device_and_disk() fails because
there's no longer a loop signature for libparted to recognise. This
leaves lp_device, lp_disk and lp_partition = NULL, but incorrectly
overall_success = true.
4) Overall_success = true allows the signature erasure loop to run and
evaluate lp_device->sector_size, dereferencing a NULL pointer and
crashing GParted.
Fix erase_filesystem_signatures() to correctly handle failure from
get_device_and_disk(), broken by this commit:
246e05559d
Clear btrfs file system super block mirror copies too (#705426)
Bug #721988 - Crash when creating new partition on disk with loop label
In the Create Partition Table dialog display the entries in the combobox
in order.
Previously the default of MSDOS or GPT was moved to the first item in
the combobox. Now the partition table types remain in order with just
either MSDOS or GPT being selected as as the default as required.
The partition table types are displayed in the order supplied by
libparted, which is alphabetic except with "loop" last.
Bug #711098 - Default partition table can not handle > 2 TiB disks
MSDOS partition table is limited to addressing 2^32 sectors, limiting
disks using 512 byte sectors to 2 TiB in size. Fdisk reports the
following warning on disks 2 TiB and larger.
# truncate -s 2T /var/tmp/loop-2T
# losetup /dev/loop0 /var/tmp/loop-2T
# fdisk /dev/loop0
WARNING: The size of this disk is 2.2 TB (2199023255552 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).
(Fdisk arguably reports this warning one sector too early. Anyway for
safety and consistency GParted will use this limit too). Continue to
use MSDOS as the default partition table type for disks smaller than 2
TiB and use GPT as the default for disks 2 TiB and larger. This
maximises compatibility.
Also remove the advanced expander and always show the partition table
list box.
Bug #711098 - Default partition table can not handle > 2 TiB disks
When the kernel version as stated in /proc/version did not have at least
three numbers separated by periods, the version would fail to be read.
Sample /proc/version to demonstrate problem:
Linux version 3.10-3-686-pae ...
The Linux kernel will always have a major number and a minor number
separated by a period. There is likely also a patch version number too
that would be preceded by a period. This enhancement will read 2 and 3
component Linux kernel versions.
GParted doesn't report extended partitions as busy if it contains only
busy LVM2 PV or SWRAID logical partitions. Libparted's
ped_partition_is_busy() only detects mounted file systems and swap space
as busy, not active LVM2 PVs or SWRAID members. This is as of libparted
3.1 and earlier.
Fix by determining the busy status of an extended partition based solely
on the busy status of the logical partitions it contains. This makes it
unnecessary to check for mounted DMRAID logical partitions or call
ped_partition_is_busy() for extended partitions.
Bug #712533 - Partitions not detected as busy inside Software RAID on
some distros
In this unusual setup of having one Linux Software RAID array
partitioned and a second array not partitioned, /dev/md1p1 partition in
the first array is falsely reported as busy when the file system filling
the second array /dev/md2 is mounted.
Partition RAID File System Mount mount
--------- ----------------- ---------------- -----------
/dev/sdb1 SWRAID /dev/md1
/dev/md1p1 ext4,Label=test1 (Unmounted)
/dev/sdb2 SWRAID /dev/md2 ext4,Label=test2 /mnt/2
This again affects Debian 6, Debian 7 and RHEL/CentOS 6.x and is as a
result of the this bug fixed in libparted 2.4:
http://git.savannah.gnu.org/cgit/parted.git/commit/?id=db52898c214310dab4ed84e6cb2f9ffc8c3aa502
linux: also detect "in-use" dmraid and scsi-Nth (N>=16) partition
Fix by not using libparted's ped_partition_is_busy() to determine if a
normal or logical partition is busy.
Bug #712533 - Partitions not detected as busy inside Software RAID on
some distros
On some distributions GParted doesn't detect when a file system is busy
and mounted when the partition is within a Linux Software RAID array.
Affected distributions include: Debian 6, Debian 7 and RHEL/CentOS 6.x.
This is because of a bug in libparted 2.3 and earlier. It was fixed by
this change in libparted 2.4:
http://git.savannah.gnu.org/cgit/parted.git/commit/?id=db52898c214310dab4ed84e6cb2f9ffc8c3aa502
linux: also detect "in-use" dmraid and scsi-Nth (N>=16) partition
Ubuntu 13.10 with libparted 2.3 is not affected because it contains a
distribution specific patch to correct it.
Fix by using GParted's internal mounted partitions map, mount_info, to
determine if a partition is busy, in addition to using libparted's
ped_partition_is_busy().
Bug #712533 - Partitions not detected as busy inside Software RAID on
some distros
Many file systems are capable of growing while mounted, and a few can
even shrink. This support must be explicitly enabled at configure time
with the --enable-online-resize flag and depends on a patched libparted.
Also requires kernel >= 3.6 for partition resizing, even if the
partition is in use (BLKPG_RESIZE_PARTITION).
Thanks to Mike Fleetwood for double check mark idea instead of a second
column to show the online grow/shrink.
Bug #694622 - Add support for online resize
In the Create New Partition dialog use ext4 as the default choice for
new file systems. It has been the preferred file system of
distributions for many years. Use ext3 and ext2 as second and third
choice defaults. This handles RHEL/CentOS 5.x which doesn't support
ext4.
Bug #711114 - Change default fs to ext4
Allow all partition warning messages to be selectable and copied. Merge
all the messages into a single Gtk::Label widget so that they can be
selected together.
Use a blank line between individual messages so that each message can be
distinguished. Therefore each message should be formatted as one or more
non-blank lines, with an optional trailing new line. This is true of
GParted internal messages and probably all external messages and errors
from libparted and executed commands too.
Bug #705596 - Partition Information Dialog - let user copy warnings
Applying operations or just scanning the partitions in GParted was
causing all stopped Linux Software RAID arrays to be automatically
started. This is not new with this patch set, but as a result of the
following behaviour which has existed for a long time. Chain of events
goes likes this:
1) Gparted calls commit_to_os() to update the kernel with the new
partition table;
2) Libparted calls ioctl() BLKPG_DEL_PARTITION on every partition to
delete every partition from the kernel. Succeeds on non-busy
partitions only;
3) Kernel emits udev partition remove event on every removed partition;
4) Libparted calls ioctl() BLKPG_ADD_PARTITION on every non-busy
partition to re-add the partition to the kernel;
5) Kernel emits udev partition add event on every added partition;
6) Udev rule:
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
RUN+="/sbin/mdadm -I $tempnode"
from either /lib/udef/rules.d/64-md-raid.rules or
.../65-md-incremental.rules incrementally starts the member in a
Linux Software RAID array.
Fix by temporarily adding blank override rules files which does nothing,
so that when the udev add and remove events for Linux Software RAID
array member partitions fire nothing is done; but only when required.
Note that really old versions of udev don't have rules to incrementally
start array members and some distributions comment out such rules.
Bug #709640 - Linux Swap Suspend and Software RAID partitions not
recognised
Read the contents of /proc/mdstat file to determine if a device is a
member of of an active RAID array.
$ cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sda1[2] sdb1[3]
524224 blocks super 1.0 [2/2] [UU]
md2 : active raid1 sdb2[2] sda2[3](F)
5238720 blocks super 1.1 [2/1] [U_]
md3 : active raid1 sdb3[1]
10477440 blocks super 1.1 [2/1] [_U]
bitmap: 1/1 pages [4KB], 65536KB chunk
md4 : inactive sda4[0](S)
1048564 blocks super 1.2
unused devices: <none>
There are 5 example Linux Software RAID arrays, md1 to md5. All are
RAID1 mirrors with 2 members, in various states.
Array Members Status
md1 sda1, sdb2 Fully operational.
md2 sda2, sdb2 Member sda2 marked as faulty. (Device sda2 is
still in use).
md3 sda3, sdb3 Member sda3 has been removed. (Device sda3 is
not in use).
md4 sda4, sdb4 Incremental start of member sda4 only. (Neither
member devices is in use).
md5 sda5, sdb5 Array stopped. (Neither member device is in
use).
Also disable "Unmount" in the partition menu for active RAID array
members.
Bug #709640 - Linux Swap Suspend and Software RAID partitions not
recognised
Recognise in kernel, Linux Swap Suspend partitions. (When hibernated
the kernel write the RAM out to swap space and changes the magic string
from swap space to suspend). Recognition required either
libparted >= 1.8.8.1 or blkid from util-linux >= 2.15 or before that
blkid from e2fsprogs >= 1.39.
Recognise Linux Software RAID partitions. Recognition requires blkid
from util-linux >= 2.15.
Example:
# blkid /dev/sda10 /dev/sda11
/dev/sda10: ... TYPE="swsuspend"
/dev/sda11: ... TYPE="linux_raid_member"
# parted /dev/sda print
Model: ATA SAMSUNG HM500JI (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
...
10 361GB 362GB 1074MB logical swsusp
11 362GB 363GB 1074MB logical raid
Bug #709640 - Linux Swap Suspend and Software RAID partitions not
recognised
Step 3 of 3:
Now that all label widgets are created with ALIGN_LEFT and ALIGN_CENTER
alignment remove the x_align and y_align parameters from mk_label() and
always use this alignment. Also specify this alignment via floats
rather than enumerators, one of which was deprecated.
Bug #652044 - uses deprecated APIs
Step 2 of 3:
ALIGN_RIGHT was only used for the size figures in the GParted > Devices
device selector with radio buttons. Change to ALIGN_LEFT and adjust the
widget packing to maintain appearance.
Bug #652044 - uses deprecated APIs