gparted-1.0.0/0000775000175000017500000000000013473526470010154 500000000000000gparted-1.0.0/config.h.in0000664000175000017500000000621413473526405012120 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 when help documentation is built */ #undef ENABLE_HELP_DOC /* Define to 1 to enable deletion of old partitions before creating a loop table workaround */ #undef ENABLE_LOOP_DELETE_OLD_PTNS_WORKAROUND /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS /* Define to 1 if online resize is enabled */ #undef ENABLE_ONLINE_RESIZE /* description */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if gtkmm provides Gtk::Label::set_xalign() method. */ #undef HAVE_LABEL_SET_XALIGN /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the `parted' library (-lparted). */ #undef HAVE_LIBPARTED /* Define to 1 if have libparted fs resize capability */ #undef HAVE_LIBPARTED_FS_RESIZE /* Define to 1 if you have the `uuid' library (-luuid). */ #undef HAVE_LIBUUID /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if gtkmm provides Gtk::ScrolledWindow::set_propagate_natural_width() method. */ #undef HAVE_SET_PROPAGATE_NATURAL_WIDTH /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 to use native libparted /dev/mapper dmraid support */ #undef USE_LIBPARTED_DMRAID /* Version number of package */ #undef VERSION gparted-1.0.0/README0000664000175000017500000003065613451230437010755 00000000000000GPARTED ======= Gparted is the GNOME Partition Editor for creating, reorganizing, and deleting disk partitions. A hard disk is usually subdivided into one or more partitions. These partitions are normally not re-sizable (making one smaller and the adjacent one larger.) Gparted makes it possible for you to take a hard disk and change the partition organization, while preserving the partition contents. More specifically, Gparted enables you to create, destroy, resize, move, check, label, and copy partitions, and the file systems contained within. This is useful for creating space for new operating systems, reorganizing disk usage, and mirroring one partition with another (disk imaging). Gparted can also be used with storage devices other than hard disks, such as USB flash drives, and memory cards. Visit https://gparted.org for more information. LICENSING --------- GParted is released under the General Public License version 2, or (at your option) any later version. (GPLv2+). All files are released under the GPLv2+ unless explicitly licensed otherwise. The GParted Manual is released under the GNU Free Documentation License version 1.2 or any later version. (GFDLv1.2+). Google Test C++ test framework is released under the 3-Clause BSD License. (BSD-3-Clause). See these files for more details: COPYING - GNU General Public License version 2 COPYING-DOCS - GNU Free Documentation License version 1.2 lib/gtest/LICENSE - 3-Clause BSD License NEWS ---- Information about changes to this release, and past releases can be found in the file: NEWS INSTALL ------- a. Pre-built Binary Many GNU/Linux distributions already provide a pre-built binary package for GParted. Instructions on how to install GParted on some distributions is given below: CentOS/RHEL ----------- su - yum install gparted Debian or Ubuntu ---------------- sudo apt-get install gparted Fedora ------ su - dnf install gparted OpenSUSE -------- sudo zypper install gparted b. Building from Source Briefly, build and install GParted into the default location of /usr/local using: ./configure make sudo make install sudo install -m 644 org.gnome.gparted.policy \ /usr/share/polkit-1/actions/org.gnome.gparted.local.policy This assumes all the dependencies are already installed, builds the default configuration and polkit is being used as the graphical su program. The following dependencies are required to build GParted from source: g++ make parted gnome-common gtkmm3 gettext intltool yelp-tools - required if help documentation is to be built On CentOS/RHEL, these dependencies may be obtained by running the following command as root: yum install gnome-common yelp-tools glib2-devel intltool gcc-c++ \ libuuid-devel parted-devel gtkmm30-devel make On Debian or Ubuntu, these dependencies may be obtained by running one of the following commands: Either; sudo apt-get build-dep gparted Or; sudo apt-get install build-essential gnome-common yelp-tools \ libglib2.0-dev uuid-dev libparted-dev \ libgtkmm-3.0-dev On Fedora, these dependencies may be obtained by running the following command as root: dnf install gnome-common yelp-tools glib2-devel intltool gcc-c++ \ parted-devel gtkmm30-devel make On openSUSE, these dependencies may be obtained by running the following commands: sudo zypper install gnome-common gcc-c++ libuuid-devel \ parted-devel gtkmm3-devel make Again, build GParted with the default configuration and install into the default location of /usr/local using: ./configure make sudo make install If you wish to build this package without the help documentation use the --disable-doc flag: E.g., ./configure --disable-doc If you wish to build this package to use native libparted /dev/mapper dmraid support use the --enable-libparted-dmraid flag: E.g., ./configure --enable-libparted-dmraid If you wish to build this package with online resize support then the following is required: a) Linux kernel version 3.6 or higher. b) Libparted with online resize support. Either: i) Libparted version 3.2 or later which includes online resize support as standard. In this case GParted is automatically built with online resize support. ii) Online resize support back ported into an earlier version of libparted. This is only known to be included in Debian and derived distributions with parted version 2.3-14 and higher. In this case online resize support must be specifically enabled with the --enable-online-resize flag: E.g., ./configure --enable-online-resize If you wish to build GParted to allow it to use xhost to grant root access to the X11 server use the --enable-xhost-root flag. This is required to allow GParted to display under Wayland. ./configure --enable-xhost-root Please note that more than one configure flag can be used: E.g., ./configure --disable-doc --enable-libparted-dmraid The INSTALL file contains further GNU installation instructions. c. Installing polkit's Action File GParted needs to run as root therefore it needs a graphical switch user program to allow normal users to run it. Most desktops now use polkit as their preferred authorisation mechanism. Therefore ./configure looks for polkit's pkexec as the first choice with fallbacks in order being: gksudo, gksu, kdesudo and finally xdg-su. Also polkit reads action files only from directory /usr/share/polkit-1/actions. Therefore it is likely that a polkit action file will need to be installed into this directory. To determine if polkit's pkexec program is being used as the graphical privilege escalation program examine the output from ./configure. These lines report that pkexec is being used: checking for pkexec >= 0.102... 0.112 found Where as either of these lines of ./configure output report that pkexec is not being used because either it was too old a version or it was not found: checking for pkexec >= 0.102... 0.96 found checking for pkexec >= 0.102... not found When GParted is configured with prefix /usr (using command ./configure --prefix=/usr) then make install will automatically install the polkit action file into the correct directory and no further steps need to be taken. This is typically the case for distribution builds of GParted. However when GParted is configured with the default prefix of /usr/local, or any prefix other than /usr, then the polkit action file has to be manually installed into the correct directory. Also it should have a unique file name to avoid overwriting the action file from the distribution's package. Install the polkit action file with a unique name including an extra ".local" in the name: sudo install -m 644 org.gnome.gparted.policy \ /usr/share/polkit-1/actions/org.gnome.gparted.local.policy d. Building using a Specific (lib)parted Version 1) Download the parted version you wish to use (e.g., 3.2) from: http://ftp.gnu.org/gnu/parted/ 2) Build and install parted. Extract parted tarball, configure, make, and sudo make install. Note that by default this will install into /usr/local. 3) Set environment variables to inform the GParted build system to use libparted from /usr/local: export CPPFLAGS=-I/usr/local/include export LDFLAGS=-L/usr/local/lib export LD_RUN_PATH=/usr/local/lib export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 4) Build gparted using steps listed above in "Building from Source". Note that when you run ./configure you should see the specific version of parted listed in the check for libparted >= 1.7.1. You will also see the libparted version listed when running gparted from the command line. DIRECTORIES ------------ data - contains desktop icons doc - contains manual page documentation help - contains GParted Manual and international translations include - contains source header files lib/gtest - contains Google Test C++ test framework libraries m4 - contains macro files po - contains international language translations src - contains C++ source code DISTRIBUTION NOTES ------------------ GParted uses GNU libparted to detect and manipulate devices and partition tables. The blkid command is also required to detect those file systems which libparted doesn't detect. (The blkid command should be considered a mandatory requirement). GParted also queries and manipulates the file systems within those devices and partitions. When available, it uses each file system's specific commands. The following optional file system specific packages provide this support: btrfs-progs / btrfs-tools e2fsprogs f2fs-tools dosfstools mtools - required to read and write FAT16/32 volume labels and UUIDs hfsutils hfsprogs jfsutils nilfs-utils ntfs-3g / ntfsprogs reiser4progs reiserfsprogs / reiserfs-utils / reiserfs udftools util-linux - required to create and check MINIX file systems xfsprogs, xfsdump For dmraid support, the following packages are required: dmsetup - removes /dev/mapper entries dmraid - lists dmraid devices and creates /dev/mapper entries For GNU/Linux distribution dmraid support, the following are required: - kernel built with Device Mapping and Mirroring built. From menuconfig, it is under Device Drivers -> (RAID & LVM). - dmraid drive arrays activated on boot (e.g., dmraid -ay). For LVM2 Physical Volume support the following command is required: lvm - LVM2 administration tool And device-mapper support in the kernel. For accurate detection and reporting of Linux Software RAID Arrays the following command is required: mdadm - SWRaid administration tool For LUKS support the following commands are required: cryptsetup - LUKS volume administration tool dmsetup - Device-mapper administration tool For attempt data rescue for lost partitions, the following package is required: gpart - guesses PC-type hard disk partitions Several more commands are optionally used by GParted if found on the system. These commands include: blkid - [mandatory requirement] used to detect file systems libparted doesn't, read UUIDs and volume labels hdparm - used to query disk device serial numbers udisks - used to prevent automounting of file systems devkit-disks - used to prevent automounting of file systems {filemanager} - used in attempt data rescue to display discovered file systems. (e.g., nautilus, pcmanfm) hal-lock - used to prevent automounting of file systems pkexec - used to acquire root privileges in gparted shell script wrapper, but only if available when gparted source is configured gksudo - alternatively used to acquire root privileges in gparted shell script wrapper, second choice if available when gparted source is configured gksu - alternatively used to acquire root privileges in gparted shell script wrapper, third choice if available when gparted source is configured kdesudo - alternatively used to acquire root privileges in gparted shell script wrapper, fourth choice if available when gparted source is configured xdg-su - alternatively used to acquire root privileges in gparted shell script wrapper, last choice if available when gparted source is configured udevinfo - used in dmraid to query udev name udevadm - used in dmraid to query udev name yelp - used to display help manual xhost - used to grant root access to the X11 server, only when configured to do so gparted-1.0.0/depcomp0000755000175000017500000005601613473526406011456 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gparted-1.0.0/ChangeLog0000664000175000017500000470354513473526470011670 00000000000000# Generated by Makefile. Do not edit. 2019-05-29 Curtis Gedak ========== gparted-1.0.0 ========== 2019-05-29 Curtis Gedak Update copyright years 2019-05-28 Claude Paroz Update French translation 2019-05-24 Mike Fleetwood Fix reading NTFS usage after resize (#57) After an NTFS file system has been resized the command GParted currently uses to read the file system usage fails like this: # ntfsinfo --mft /dev/sdb1 Volume is scheduled for check. Please boot into Windows TWICE, or use the 'force' option. NOTE: If you had not scheduled check and last time accessed this volume using ntfsmount and shutdown system properly, then init scripts in your distribution are broken. Please report to your distribution developers (NOT to us!) that init scripts kill ntfsmount or mount.ntfs-fuse during shutdown instead of proper umount. Failed to open '/dev/sdb1'. Fix by added the '--force' flag as described in the error message. Closes #57 - NTFS Resize results in Partition Information Warning on Refresh 2019-05-24 Mike Fleetwood Report errors correctly on failure to read NTFS usage (#57) GParted uses ntfsinfo to read the NTFS file system usage. However when ntfsinfo fails with a non-zero exit status GParted reports stdout twice, rather than stdout and stderr. Correct this. Closes #57 - NTFS Resize results in Partition Information Warning on Refresh 2019-05-26 Anders Jonsson Update Swedish translation 2019-05-26 Anders Jonsson Update Swedish translation 2019-05-25 Trần Ngọc Quân Updated Vietnamese translation Signed-off-by: Trần Ngọc Quân 2019-05-22 Jiri Grönroos Update Finnish translation 2019-05-22 Claude Paroz Update French translation 2019-05-22 Rafael Fontenelle Update Brazilian Portuguese translation 2019-05-22 Sveinn í Felli Update Icelandic translation 2019-05-03 Luca Bacci Set the xalign property for Gtk::Labels (!40) With the same case as from the previous commit, the very long "Mounted on ..." text is now wrapped, but the text may not be left justified. Slowly adjust the dialog width and see how the text wrapping is updated to fit the size adjustment but the text is centred rather than left justified. This is because setting the halign property to Gtk::ALIGN_START does not guarantee left alignment of text for wrapped or ellipsized Gtk::Labels. Use the xalign property instead. To set the xalign property there is a method in the GtkMisc (Gtk::Misc) base class: gtk_misc_set_alignment (Gtk::Misc::set_alignment) However, GtkMisc (Gtk::Misc) was deprecated in Gtk 3.14 (Gtkmm 3.14) and in Gtk 3.16 (gtkmm 3.16) set_alignment() was replaced with the introduction of two new methods: gtk_label_set_xalign (Gtk::Label::set_xalign) gtk_label_set_yalign (Gtk::Label::set_yalign) Add a check for Gtkmm method Gtk::Label::set_xalign() in configure.ac and use it when available. References: [1] Gtk3 Reference Documentation - gtk_misc_set_alignment() https://developer.gnome.org/gtk3/stable/GtkMisc.html#gtk-misc-set-alignment "gtk_misc_set_alignment has been deprecated since version 3.14 and should not be used in newly-written code. Use GtkWidget's alignment ("halign" and "valign") and margin properties or GtkLabel's "xalign" and "yalign" properties." [2] Gtkmm 3.16 Gtk::Misc Class Reference, set_alignment() method https://developer.gnome.org/gtkmm/3.16/classGtk_1_1Misc.html#a52b2675874cf46a3097938756b9fe9e8 [3] GNOME BugZilla - EmptyBoxes: instructions_label's alignment is off https://bugzilla.gnome.org/show_bug.cgi?id=735841 [4] Gtk commit from 2014-09-16: GtkLabel: add x/yalign properties https://gitlab.gnome.org/GNOME/gtk/commit/d39424fc [5] Gtk3 Reference Documentation - gtk_label_set_xalign() https://developer.gnome.org/gtk3/stable/GtkLabel.html#gtk-label-set-xalign [6] Gtkmm 3.16 Gtk::Label Class Reference, set_xalign() method https://developer.gnome.org/gtkmm/3.16/classGtk_1_1Label.html#acee7d4e87d7cc14080a7b8ded5f84e5e Closes !40 - Limit wrapping labels 2019-05-01 Luca Bacci Set a default max_width_chars for wrapping Gtk::Labels (!40) Opening the Partition Information dialog for a file system mounted on a very long mount point, or on openSUSE which mounts the OS from 10 btrfs subvolumes from the same partition, will cause the dialog to be very wide as the "Mounted on ..." text is not wrapped. Back in Gtk2, when width_chars / max_width_chars were not set, wrapping labels had a default width beyond which text wrapped onto a new line [1]. For Gtk3 this default width was first reworked a bit [2], and then was removed for the very early Gtk3 3.0.10 release [3]. It is recommended that applications explicitly set default values, otherwise wrapping labels never wrap when requesting their natural allocation. References: [1] Gtk 2.24.32 source code - gtk/gtklabel.c:2975 https://gitlab.gnome.org/GNOME/gtk/blob/2.24.32/gtk/gtklabel.c#L2975 "This long string gives a good enough length for any line to have." [2] Gtk commit from 2010-04-21: https://gitlab.gnome.org/GNOME/gtk/commit/680d7762baabb71aa77aeec793e3c70a2013d3b8 Make sure not to base the minimum size on "max-width-chars", only the natural size. "This string is just about long enough." [3] Gtk commit from 2011-04-17: https://gitlab.gnome.org/GNOME/gtk/commit/c8ce1106c11361f8b47dd4e9a08db571c7d66d82 label: Don't try to guess a label's size People should use window default sizes or label width-chars/max-width-chars to find the ideal layout for a label instead of relying on magic. Closes !40 - Limit wrapping labels 2019-05-01 Luca Bacci Request natural width in Gtk::ScrolledWindows for Gtk >= 3.22 (!39) Before Gtk 3.22 GtkScrolledWindow propagated natural size to its Children and so on to descendants. In Gtk 3.22 this was changed to always request the minimum size. This was done because it is believed to be a safer default (gives a better behaviour) in case of dynamic content inside the scrolled window, that is, content that may change allocated size. [1][2][3] When the scrolled window content is not dynamic the natural size is preferable because it gives a better looking layout and without any downside. In the case of GParted content which is not dynamic, so request the scrolled windows to allocate children at natural sizes for Gtk >= 3.22. The benefits of natural size allocation are evident in presence of wrapping labels (for example inside the "Partition Info" dialog), that with the minimum size request likely end up taking a very small width. References: [1] Gtk commit from 2016-08-31: GtkScrolledWindow: Make propagation of natural child sizes optional https://gitlab.gnome.org/GNOME/gtk/commit/0984d1622d022bf67207f985f7842b6299818e20 "Making propagation of child natural sizes mandatory (or default, even) was evidently a mistake as this causes dynamic content in a scrolled window to resize it's parent when the scrolled window is competing for space with an adjacent widget." [2] Gtk 3.22 Reference Documentation - gtk_scrolled_window_set_propagate_natural_width https://developer.gnome.org/gtk3/3.22/GtkScrolledWindow.html#gtk-scrolled-window-set-propagate-natural-width [3] Gtkmm 3.24 Gtk::ScrolledWindow Class Reference, set_propagate_natural_width() method https://developer.gnome.org/gtkmm/3.24/classGtk_1_1ScrolledWindow.html#a2d4cb945688ecb8739efd70b18742779 [4] Gtkmm 3.21.6 NEWS https://gitlab.gnome.org/GNOME/gtkmm/blob/3.21.6/NEWS "ScrolledWindow: Added get/set_propagate_natural_height/width() and the properties." Closes !39 - Always request natural size inside Gtk::ScrolledWindow 2019-05-10 Rafael Fontenelle Update Brazilian Portuguese translation 2019-05-01 Yuras Shumovich Update Belarusian translation 2019-04-30 Seong-ho Cho Update Korean translation 2018-05-09 Mike Fleetwood Replace deprecated get_vbox() with get_content_area() (!25) get_vbox() was deprecated in gtkmm 3.1.6 [1][2]. Switch to the get_content_area() replacement. Note that GParted already requires gtkmm >= 3.4 as set in configure.ac. [1] Gtkmm 3.1.6 NEWS https://gitlab.gnome.org/GNOME/gtkmm/blob/3.1.6/NEWS "Dialog: Deprecate get_vbox(), replacing with get_content_area(), to match the C function name." [2] Gtkmm commit from 2011-06-13: Dialog: Deprecate get_vbox(), replacing with get_content_area(). https://git.gnome.org/browse/gtkmm/commit/?id=5ccc289fa8e9b046c07f5ea234f5ced8c6356fc1 Closes !25 - Modern Gtk3 - part 1 2019-03-13 Luca Bacci Use Gtk::Grid for Dialog_Partition_Info (!25) Gtk::Table was deprecated in Gtk 3.4.0. Replace with Gtk::Grid. This commit makes the change for Dialog_Partition_Info. Closes !25 - Modern Gtk3 - part 1 2019-03-07 Luca Bacci Use Gtk::Grid for Win_GParted pt2 (!25) Gtk::Table was deprecated in Gtk 3.4.0. Replace with Gtk::Grid. This commit makes the change for Win_GParted / pt2. Closes !25 - Modern Gtk3 - part 1 2019-03-06 Luca Bacci Use Gtk::Grid for Win_GParted pt1 (!25) Gtk::Table was deprecated in Gtk 3.4.0. Replace with Gtk::Grid. This commit makes the change for Win_GParted / pt1. Closes !25 - Modern Gtk3 - part 1 2019-03-06 Luca Bacci Use Gtk::Grid for Dialog_Base_Partition (!25) Gtk::Table was deprecated in Gtk 3.4.0. Replace with Gtk::Grid. This commit makes the change for Dialog_Base_Partition. Closes !25 - Modern Gtk3 - part 1 2019-03-06 Luca Bacci Use Gtk::Grid for Dialog_Partition_New (!25) Gtk::Table was deprecated in Gtk 3.4.0 [1]. Replace with Gtk::Grid. Note that the meaning of the attachment parameters changed between Gtk::Table::attach() [2] from left, right, top, bottom and Gtk::Grid::attach() [3] to left, top, width, height. This commit makes the change for Dialog_Base_Partition. [1] Gtkmm 3.4 NEWS file (actually first included in gtkmm 3.3.2 unstable) https://gitlab.gnome.org/GNOME/gtkmm/blob/3.4.0/NEWS#L162 * Deprecate Gtk::Table in favour of Gtk::Grid. [2] Gtkmm 3.4 Gtk::Table Class Reference, attach() method https://developer.gnome.org/gtkmm/3.4/classGtk_1_1Table.html#a28b6926e68337a51ba29f2b4dd69f087 Deprecated: 3.4: Use Gtk::Grid::attach() with Gtk:Grid. Note that the attach argument differ between those two function. [3] Gtkmm 3.4 Gtk::Grid Class Reference, attach() method https://developer.gnome.org/gtkmm/3.4/classGtk_1_1Grid.html#a9c425e95660daff60a77fc0cafc18115 Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Separator (!25) Gtk::HSeparator was deprecated in Gtkmm 3.2. Replace with plain Gtk::Separator. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Paned (!25) Gtk::HPaned and Gtk::VPaned were deprecated in Gtkmm 3.2. Replace with plain Gtk::Paned. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Dialog_Progress (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for Dialog_Progress.cc. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Dialog_Rescue_Data (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for Dialog_Rescue_Data.cc. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for DialogPasswordEntry (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for DialogPasswordEntry.cc. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Dialog_Partition_Name (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for Dialog_Partition_Name.cc. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Dialog_FileSystem_Label (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for Dialog_FileSystem_Label.cc. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for DialogFeatures (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for DialogFeatures.cc. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Dialog_DiskLabel (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for Dialog_DiskLabel.cc. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Dialog_Partition_Info (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for Dialog_Partition_Info.{h,cc}. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Dialog_Base_Partition (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for Dialog_Base_Partition.{h,cc}. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for HBoxOperations (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2. Replace with plain Gtk::Box. This commit makes the change for HBoxOperations.{h,cc}. Closes !25 - Modern Gtk3 - part 1 2019-02-27 Luca Bacci Use Gtk::Box for Win_GParted (!25) Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2 [1]. Replace with plain Gtk::Box. This commit makes the change for Win_GParted.{h,cc}. [1] Gtkmm 3.2.0 NEWS file (actually first included in gtkmm 3.1.6 unstable) https://gitlab.gnome.org/GNOME/gtkmm/blob/3.2.0/NEWS#L91 Gtk: * All H* or V* specialized classes have been deprecated, to match the deprecations in the GTK+ C API. You should now set the orientation instead. This includes HBox, VBox, HButtonBox, VButtonBox, HPaned, VPaned, HScale, VScale, HSeparator, VSeparator, HScrollbar and VScrollbar. Closes !25 - Modern Gtk3 - part 1 2019-02-20 Luca Bacci Use Gdk::RGBA (!25) The Gdk::RGBA data type was introduced to replace Gdk::Color in Gtkmm 3.0 [1], with Gdk::Color being deprecated in Gtkmm 3.10 [2]. With this commit we make the change to Gdk::RGBA data type which is the modern replacement to Gdk::Color. Gdk::RGBA can be used almost as a drop in replacement because it keeps most of the Gdk::Color interface. Also, this commit removes the C Gtk call introduced during the port-to-gtk3 patchset by commit: 53793527668a344fe54ceb61a1afdc39c24c5c45 repare-for-gtk3: Prepare for removal of Gtk::Widget::modify_fg() (#7) [1] Gtkmm 3.0.1 NEWS file https://gitlab.gnome.org/GNOME/gtkmm/blob/3.0.1/NEWS#L48 * RGBA replaces Color, though Color still exists because it is used by TextView. We hope to deprecated Color completely in gtkmm 3.2. [2] Gtkmm 3.10.0 NEWS file https://gitlab.gnome.org/GNOME/gtkmm/blob/3.10.0/NEWS#L127 Gdk: * Deprecate Color. Closes !25 - Modern Gtk3 - part 1 2019-04-20 Mike Fleetwood Update includes in DialogFeatures.h and .cc Mostly add, but also remove, #includes so both DialogFeatures.h and .cc include exactly the header files each needs to get the definitions they use. Header file #include guards are there to specifically enable this. 2019-04-19 Mike Fleetwood Rename method to DialogFeatures::load_one_filesystem() To better reflect that it is loading the supported actions for one file system into the treeview, just like it's parent load_filesystems() is initiating the loading for all the file systems. 2019-04-19 Mike Fleetwood Fix available Partition menu options not being updated on rescan (!38) Select a partition and look at the available actions in the Partition menu. Then add or remove some commands which that particular file system uses and rescan to detect those changes. Open the Partition menu again. It doesn't reflect the changes of supported actions seen in the File System Support dialog. Select a different partition and then select the original partition again. Now the available actions in the Partition menu reflect the changes of supported actions. Have been testing by adding and removing /sbin/e2label to add and remove EXT2/3/4 file system labelling support just because that feature has existed for a very long time and EXT2/3/4 are displayed near the top of the File System Support dialog. Tested this minor issue existed as far back as GParted 0.3.7. Fix by simply also refreshing the valid operations to update the Partition menu after updating the found file system specific commands. Closes !38 - Fixes for minor issues with File System Support rescanning 2019-04-17 Mike Fleetwood Fix File System Support dialog not showing changes after rescan (!38) Open the File System Support dialog, either add or remove some file system specific commands used by GParted and press the [Rescan For Supported Actions] button. The supported actions don't change. However after just closing and reopening the dialog, the supported actions do reflect the added or removed file system specific commands. Bisected to this commit: 4d6d46466478f656ce2ebb3c6b5a88cf0657667f Display "other" in the File System Support dialog (!13) The problem is that commit made a subset copy of the GParted_Core::FILESYSTEMS vector, obtained from get_filesystems(), so when the rescan ran and the FILESYSTEMS vector was updated with new supported actions, the dialog still displayed the original subset copy, so didn't reflect the changed supported actions. Fix by passing a reference to the GParted_Core::FILESYSTEMS vector, obtained from get_filesystems(), and perform the necessary filtering inside the dialog, like before the above faulty commit. Additionally finding and adding "other" file system to the end of the list. Closes !38 - Fixes for minor issues with File System Support rescanning 2019-04-15 Mike Fleetwood Stop checking for 'ntfslabel --new-serial' support The oldest supported distributions have these versions of ntfs-3g / ntfsprogs. Distro EOL ntfs-3g / ntfsprogs - Debian 8 2020-Jun 2014.2.16AR.2 - RHEL / CentOS 7 2024-Jun 2017.3.23 - Ubuntu 14.04 LTS 2019-Apr 2013.1.13AR.1 The oldest version of ntfs-3g / ntfsprogs on Ubuntu 14.04 LTS includes support for the --new-serial option. $ ntfslabel -V ntfslabel v2013.1.13AR.1 (libntfs-3g) - Display, or set, the label for an NTFS Volume. $ ntfslabel --help | grep -- --new-serial --new-serial Set a new serial number Therefore it is no longer necessary to check for this option as it is always available. The worst case scenario is that some how an old version of ntfslabel is used which doesn't support this option. In such a case GParted goes from not supporting changing the UUID to claiming support, but presumably it would fail with an error reporting unknown option when applied. Arguably better from an end user support point of view. 2019-04-14 Mike Fleetwood Consolidate common if have ntfsresize command conditions 2019-04-14 Mike Fleetwood Switch to faster ntfsinfo to read NTFS usage (#47) A user reported GParted was slow to refresh and timing ntfsresize to query his file systems found that it was taking 4.7 seconds and 9.2 seconds for sizes 31.7 GiB and 49 GiB NTFS file systems respectively. Almost 14 seconds just to read the usage. Created a 4 GiB NTFS and filled it with as many 4 KiB files as possible, just over 800,000 files. # df -k /mnt/2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdb2 4194300 4193860 440 100% /mnt/2 # df -i /mnt/2 Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sdb2 819640 808591 11049 99% /mnt/2 Testing perform of ntfsresize: # time ntfsresize --info --force --no-progress-bar /dev/sdb2 | \ > egrep 'Current volume size|resize at|Cluster size' Cluster size : 4096 bytes Current volume size: 4294963712 bytes (4295 MB) You might resize at 4294516736 bytes (freeing 450560 bytes). real 0m5.231s user 0m2.072s sys 0m3.014s Computation of figures: Clusters per volume = 4294963712 / 4096 = 1048575.125 Free clusters = (4294963712 - 4294516736) / 4096 = 109.125 Testing performance of ntfscluster, as used before this commit [1] from GParted 0.3 in 2006: # time ntfscluster --force /dev/sdb2 | \ > egrep 'bytes per cluster|bytes per volume|clusters per volume|clusters of free space' ... bytes per cluster : 4096 bytes per volume : 4294963200 clusters per volume : 131071 clusters of free space : 110 real 0m4.243s user 0m1.629s sys 0m2.587s Note that the clusters per volume figure reported by ntfscluster is wrong. 4294963200 / 4096 = 1048575, not 131071. Testing performance using ntfsinfo: # time ntfsinfo --mft /dev/sdb2 | \ egrep 'Cluster Size|Volume Size in Clusters|Free Clusters' Cluster Size: 4096 Volume Size in Clusters: 1048575 Free Clusters: 110 (0.0%) real 0m0.022s user 0m0.012s sys 0m0.018s Repeating the above tests while also using 'btrace /dev/sdb2' and Ctrl-C around each test via a separate terminal, reports these numbers of I/Os being performed: Command Read requests Read bytes - ntfsresize 2,695 1116 MiB - ntfscluster 2,685 1116 MiB - ntfsinfo 13 2208 KiB No wonder that ntfsresize and ntfscluster take a long time, they read just over 1 GiB of data from the 4 GiB file system, where as ntfsinfo only reads just over 2 MiB. Switch to using ntfsinfo to report file system usage. [1] 9d956594d6acf0d983ae9105df2f3772194a5404 replaced ntfscluster with ntfsresize (see #350789) Closes #47 - GParted is slow refreshing NTFS file systems 2019-04-17 Daniel Mustieles Updated Spanish translation 2019-04-17 Daniel Mustieles Update Spanish translation 2019-04-13 Mike Fleetwood Prefer enum to string comparison in set_partition_type() 2019-04-13 Mike Fleetwood Stop trying unneeded alternative libparted linux-swap names With that same commit in parted 1.9 [1], libparted only recognised these linux-swap names via deprecated aliases: linux-swap(old) linux-swap(new) but does accept this name as a current alias: linux-swap for: linux-swap(v1) Demonstration: # parted -v parted (GNU parted) 2.1 ... # parted /dev/sdc mkfs yes 1 "linux-swap(new)" unit s print ... [0] filesys.c:148 (ped_file_system_type_get(): File system alias linux-swap(new) is deprecated ... Number Start End Size Type File system Flags 1 2048s 2099199s 2097152s primary linux-swap(v1) # parted /dev/sdc mkfs yes 1 "linux-swap" unit s print ... Number Start End Size Type File system Flags 1 2048s 2099199s 2097152s primary linux-swap(v1) Again as GParted now requires libparted 2.2 or later: 1) Stop using alternative "linux-swap(new)" name as that is deprecated by libparted. 2) Also stop using alternative "linux-swap(v1)" name as that code is never used because libparted recognised the GParted "linux-swap" name as a current alias. [1] http://git.savannah.gnu.org/cgit/parted.git/commit/?id=cfafa4394998a11f871a0f8d172b13314f9062c2 Rationalise linux-swap fs names, and add a "linux-swap" alias 2019-04-13 Mike Fleetwood Stop recognising retired libparted linux-swap names With this commit in parted 1.8.3 [1], libparted changed from reporting the name of Linux swap as: linux-swap to reporting either: linux-swap(old) linux-swap(new) Later with this commit in parted 1.9 [2], libparted stopped reporting those names and reported these instead: linux-swap(v0) linux-swap(v1) Demonstration: # mkswap /dev/sdc1 Setting up swapspace version 1, size = 1048572 KiB no label, UUID=a2010834-003d-4bf2-9e94-58383fe20a26 # blkid /dev/sdc1 /dev/sdc1: UUID="a2010834-003d-4bf2-9e94-58383fe20a26" TYPE="swap" # parted -v parted (GNU parted) 2.1 ... # parted /dev/sdc unit s print ... Number Start End Size Type File system Flags 1 2048s 2099199s 2097152s primary linux-swap(v1) As GParted now requires libparted 2.2 or later [3], remove recognition for those no longer libparted reported linux-swap names. Note that the "swap" name is reported by blkid. [1] http://git.savannah.gnu.org/cgit/parted.git/commit/?id=98a53fd115ca012edf226525b8d4be628454f99e Enable support for swsusp partitions, and the ability to differentiate between old and new versions of linux-swap partitions. Changed the swap_init signature and removed extra ped_geometry_read from _swap*_open. [2] http://git.savannah.gnu.org/cgit/parted.git/commit/?id=cfafa4394998a11f871a0f8d172b13314f9062c2 Rationalise linux-swap fs names, and add a "linux-swap" alias [3] 8df975c7d1b5d69897f286bfc5574c51cf58c9d5 Increase minimum required libparted to 2.2 (!22) 2019-04-13 Mike Fleetwood Set partition type when formatting to cleared (!36) Formatting a partition to cleared over the top of LVM2 PV leaves the "lvm" flag set on the partition; where as formatting with an actual file system over the top of an LVM2 PV clears the "lvm" flag. This is true for both MSDOS and GPT partitioned drives. Fix by setting the partition type when formatting to cleared too. Closes !36 - Set partition type when clearing partition contents 2019-04-15 Stas Solovey Update Russian translation 2019-04-14 Piotr Drąg Update Polish translation 2019-04-04 Mike Fleetwood Remove unnecessary #include from GParted_Core.cc 2019-04-10 Mike Fleetwood Rename Dialog_Progress member variable to m_curr_op Having a member variable named 't' which is used to share state in a Dialog_Progress object between on_signal_show() and on_cancel() methods is horrible. Rename to something more meaningful. Also initialise m_curr_op in the constructor's initialisation list, rather than later when first used in on_signal_show(). Not strictly required, but avoids this POD (Plain Old Data) member variable being undefined in the Dialog_Progress object between construction and when on_signal_show() previously assigned to it for the first time and started using it. * C++ FAQ / Should my constructors use "initialization lists" or "assignment"? https://isocpp.org/wiki/faq/ctors#init-lists 2019-04-10 Mike Fleetwood Rename for loop counter variables to normative 'i' in Dialog_Progress Several for loops created counter variable t, hiding member variable of the same name. Rename those loop counter variables to the normative name 'i'. * Why do most of us use 'i' as a loop counter variable? https://softwareengineering.stackexchange.com/questions/86904/why-do-most-of-us-use-i-as-a-loop-counter-variable 2019-04-07 Mike Fleetwood Use CSS to turn off table borders once in saved details HTML 2019-04-07 Mike Fleetwood Rename method to Dialog_Progress::write_operation_details() And update comment about replacing '\n' to reflect what the code actually does. 2019-04-05 Mike Fleetwood Additionally write partition information to saved details (#639176) Bug 639176 - Save partition layout to gparted_details.htm 2019-04-05 Mike Fleetwood Write starting device overview information to saved details (#639176) Writes the starting device overview information of all known devices to the top of the saved details HTML. This is so that hopefully we don't need to additionally ask users for their disk layouts via 'fdisk -l', 'parted print' and 'lsblk' when the saved details file is provided. Also moves the equals separators "==================" from below to above each operation so the each section is separated. Bug 639176 - Save partition layout to gparted_details.htm 2019-03-27 Luca Bacci Ensure icon sizes (#39) Some icon themes only provide large icons for stock items. This can cause problems like overly large icons appearing in the GParted UI. Found on Kubuntu 16.04 LTS with default breeze icon theme. Be compatible with these icon themes by forcing scaling of stock icons to the requested size. Icons are used either by Gtk::Image widgets, or Gtk::CellRendererPixbuf objects for comboboxes/treeviews. For Gtk::Image widgets we add Utils::mk_image() that constructs Gtk::Image widgets and then sets the pixel-size property. For Gtk::CellRendererPixbuf we add Utils::mk_pixbuf() that first loads a Gdk::Pixbuf and then scales if needed. Closes #39 - After GTK3 port icons are too big on KDE 2019-03-31 Mike Fleetwood Update distro specific package installation instructions - Back in Fedora 22 the distribution switched from using yum to dnf for package installation, while CentOS / RHEL continues to use yum. Separate out package instructions. - Update package dependencies for what is required on current versions of the documented distributions. 2019-03-31 Mike Fleetwood Also write "Root privileges are required ..." message to stderr (!34) To further help in diagnosing root authorisation issues by reporting the error message to the terminal too. Also set a failure exit status when terminating with this error. Example: $ ./gpartedbin GParted 0.33.0-git configuration --enable-online-resize libparted 3.2 Root privileges are required for running GParted $ echo $? 1 Closes !34 - Display more version and configuration information 2019-03-31 Mike Fleetwood Print new info before "Root privileges are required ..." dialog (!34) So that the new version and configuration information is displayed even if the gpartedbin executable is run as a non-root user. To help with diagnosing root authorisation issues with the gparted shell wrapper script. Closes !34 - Display more version and configuration information 2019-03-30 Mike Fleetwood Remove now unused Dialog_Progress::signal_get_libparted_version (!34) ... and related GParted_Core::get_libparted_version() method. Closes !34 - Display more version and configuration information 2019-03-30 Mike Fleetwood Report the same information into saved operation details (!34) For consistency save the 3 same lines of information into the saved operation details. None of the new 3 lines are subject to translation. As this information is really for our benefit when supporting users leaving them as English is OK. Also "GParted" and "Libparted", as previously used, are proper nouns so they were never changed as part of any language translation. See with: egrep -r '"(GParted|Libparted)"' po/ Closes !34 - Display more version and configuration information 2019-03-30 Mike Fleetwood Display more version and configuration info to stdout when starting (!34) So that we might get more information from users when helping them. Starting GParted from the command line now looks like this: # ./gpartedbin GParted 0.33.0-git configuration --enable-online-resize libparted 3.2 Closes !34 - Display more version and configuration information 2019-03-09 Mike Fleetwood Rename local variable to meaningful benchmark_copysize 2019-03-29 Mike Fleetwood Stop trying to access device '/dev/mapper/No RAID disks' (#786031) Running GParted on AltLinux with dmraid installed but with no configured RAID arrays produces this error: # gparted ... Could not stat device /dev/mapper/No RAID disks - No such file or directory. Most distributions use dmraid 1.0.0.rc16 which reports no raid disks like this: # dmraid -sa -c no raid disks # echo $? 1 However AltLinux had the slightly older version, dmraid 1.0.0.rc14, which reported no raid disks like this: # dmraid -sa -c No RAID disks # echo $? 0 So because dmraid 1.0.0.rc14 reported success, exit status 0, and the "No RAID disks" message was not in lower case, that text was considered a disk device in a DMRaid array. Fix by checking for "no raid disks" in any case. Bug 786031 - Could not stat device /dev/mapper/No RAID disks - No such file or directory 2019-03-28 Mike Fleetwood Pass constant parameter by reference to load_operations() (#788814) It is common C++ practice to pass a constant object by reference to avoid constructing a duplicate object for pass by value [1]. [1] How to pass objects to functions in C++? https://stackoverflow.com/questions/2139224/how-to-pass-objects-to-functions-in-c/2139254#2139254 Bug 788814 - gparted-0.30.0/include/HBoxOperations.h:37]: performance problem 2019-03-26 Luca Bacci Always show menu images (!32) There is a GtkSetting [1] that controls whether images in menus are shown or not. On some distributions / desktops it is enabled by default and on others it is disabled by default. To force show images in menus set the 'always-show-image' property to true in Gtk::ImageMenuItems [2]. References: [1] Gtk3 Reference Documentation - Settings/gtk-menu-images https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-menu-images [2] Gtk3 Reference Documentation - GtkImageMenuItem https://developer.gnome.org/gtk3/stable/GtkImageMenuItem.html#gtk-image-menu-item-set-always-show-image Closes !32 - Always show menu images 2019-03-25 Mike Fleetwood Drop compose subdir (#46) It's no longer used so drop it. Closes #46 - Drop compose subdir 2019-03-25 Mike Fleetwood Replace String::ucompose() with Glibmm equivalent (#46) Glibmm has implemented a ustring::compose() set of methods [1] since Glibmm 2.16, circa 2008. So replace String::ucompose(). Note that GParted already requires glibmm >= 2.32 as set in configure.ac. This commit just replaces all the method calls. Edit created by: sed -i 's|String::ucompose *|Glib::ustring::compose|' src/*.cc [1] Glibmm Reference Manual, Glib::ustring Class, compose() method https://developer.gnome.org/glibmm/2.32/classGlib_1_1ustring.html#a64ff7ac3d9e9899c2910f1d831f8d500 Closes #46 - Drop compose subdir 2019-03-23 Mike Fleetwood Recognise contribution by Antoine Viallon 2019-03-17 Mike Fleetwood Raise the maximum F2FS label size to 127 characters (!29) Fix to make mkfs.f2fs properly handle labels longer than 16 characters was included in f2fs-tools 1.2.0 [1]. The oldest supported distributions now include this release: Distro EOL f2fs-tools - Debian 8 2020-Jun 1.4.0 - RHEL / CentOS 7 2024-Jun 1.4.1 - SLES 12 2027-Oct Unknown - Ubuntu 14.04 LTS 2019-Apr 1.2.0 Note that on Ubuntu 14.04 LTS blkid from util-linux 2.20.1 is too old to recognise F2FS file systems, as 2.23 is required for F2FS support [2]. mkfs.f2fs claims the maximum label length is less than 512 characters, but actually accepts 512 characters. # label=`head -c 1024 < /dev/zero | tr '\0' 'A'` # mkfs.f2fs -l `echo -n "$label" | cut -c1-513` /dev/sdb10 F2FS-tools: mkfs.f2fs Ver: 1.4.0 (2014-09-18) Error: Volume Label should be less than 512 characters Usage: mkfs.f2fs [options] device [sectors] [options]: -a heap-based allocation [default:1] -d debug level [default:0] -e [extension list] e.g. "mp3,gif,mov" -l label -o overprovision ratio [default:5] -s # of segments per section [default:1] -z # of sections per zone [default:1] -t 0: nodiscard, 1: discard [default:1] sectors: number of sectors. [default: determined by device size] # echo $? 1 # mkfs.f2fs -l `echo -n "$label" | cut -c1-512` /dev/sdb10 F2FS-tools: mkfs.f2fs Ver: 1.4.0 (2014-09-18) Info: Label = AAAAAAAAAAAA...[trimmed from 512 "A"s]...AAAAAAAAAAAA Info: sector size = 512 Info: total sectors = 1048576 (in 512bytes) Info: zone aligned segment0 blkaddr: 256 Info: Discarding device Info: This device doesn't support TRIM Info: format successful # echo $? 0 # blkid -V blkid from util-linux 2.25.2 (libblkid 2.25.0, 24-Oct-2014) # blkid /dev/sdb /dev/sdb10: LABEL="AAAAAAAAAAAA...[only 127 "A"s]...AAAAAAAAAAAA" UUID="f47f3fdc-dd91-4616-bb6d-0d643a884265" TYPE="f2fs" PARTUUID="3bb4bef8-9494-4e82-8dda-5d8edd9c60d9" As blkid only reports the first 127 characters and is the only command used for reading the label of an F2FS file system, use this as the new increased limit. [1] https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=9799d6364dc93e1fd259d812d4a50ed984a6456b mkfs: handle labels longer than 16 characters [2] https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.23/v2.23-ReleaseNotes "add Flash-Friendly File System (f2fs) support [Alejandro Martinez Ruiz]" Closes !29 - Enhance F2FS support 2019-03-19 Mike Fleetwood Drop fsck.f2fs -y option not available before f2fs-tools 1.10.0 (!29) On CentOS 7 with f2fs-tools 1.4.1, checking an F2FS file system fails like this: # fsck.f2fs -f -y -a /dev/sdb3 Info: Force to fix corruption fsck.f2fs: invalid option -- 'y' Error: Unknown option ? Usage: fsck.f2fs [options] device [options]: -a check/fix potential corruption, reported by f2fs -d debug level default:0] -f check/fix entire partition -t show directory tree [-d -1] # echo $? 1 Turns out that the '-y' option was not available until f2fs-tools 1.10.0 and is identical to the existing '-f' option anyway [1], which GParted already uses. Just remove the '-y' option passed to fsck.f2fs. [1] https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=55ee9e7202f84168f868d863da8ed1c4995a0e6d fsck.f2fs: add -y for generic fsck Closes !29 - Enhance F2FS support 2019-03-19 Mike Fleetwood Handle missing FS size information before f2fs-tools 1.5.0 (!29) Before this commit [1] first included in f2fs-tools 1.5.0, dump.f2fs didn't report the total space used by the file system. This causes F2FS file system usage not be reported on older distributions, including RHEL/CentOS 7 and Debian 8. On CentOS 7: # rpm -q f2fs-tools f2fs-tools-1.4.1-2.el7.nux.x86_64 # dump.f2fs -d 1 /dev/sdb3 | egrep 'sector size =|total.*sectors =' Info: sector size = 512 Info: total sectors = 2097152 (in 512 bytes) On Fedora 28: # rpm -q f2fs-tools f2f2-tools-1.10.0-1.fc28.x86_64 # dump.f2fs -d 1 /dev/sdb2 | egrep -a 'sector size =|total.*sectors =' Info: sector size = 512 Info: total sectors = 3145728 (1536 MB) Info: total FS sectors = 2621440 (1280 MB) "total sectors" reports the size of the partition. "total FS sectors" reports the size of the file system. Cope with the file system size being missing. Pass -1 as the file system size to partition.set_sector_usage() in this case. Note that this means GParted won't be able to detect and report unallocated space within the partition when using f2fs-tools < 1.5.0. [1] https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=fea6162a6db9af527648262d9fbb0335a0cc5460 fsck.f2fs: show total sectors consumed by filesystem Closes !29 - Enhance F2FS support 2019-03-19 Mike Fleetwood Make F2FS usage parsing handle NULs in dump.f2fs output (!29) On Fedora 28 with f2fs-tools 1.10.0, dump.f2fs is producing NUL characters in it's output and this completely breaks the parsing code in f2fs::set_used_sectors(). Glib::Regex, as used by Utils::regexp_label(), just doesn't match any text after the first NUL character from the output. # dump.f2fs -d 1 /dev/sdb1 Info: Debug level = 1 Info: [/dev/sdb1] Disk Model: VBOX HARDDISK 1.0 ^@^@^@^@^@^@^@^... Info: Segments per section = 1 Info: Sections per zone = 1 Info: sector size = 512 Info: total sectors = 2097152 (1024 MB) ... Grep thinks the output is binary too: # dump.f2fs -d 1 /dev/sdb1 | \ > egrep 'valid_block_count|user_block_count|log_blocksize|sector size =|total FS sectors =' Binary file (standard input) matches # dump.f2fs -d 1 /dev/sdb1 | \ > egrep --text 'valid_block_count|user_block_count|log_blocksize|sector size =|total FS sectors =' Info: sector size = 512 log_blocksize [0x c : 12] Info: total FS sectors = 2097152 (1024 MB) user_block_count [0x 36400 : 222208] valid_block_count [0x 2 : 2] Re-write set_used_sectors() using string find() and sscanf() to be similar to how a number of the other set_used_sectors() are written for other file systems. Closes !29 - Enhance F2FS support 2019-03-15 Antoine Viallon Enhance F2FS support (!29) - Adds reading of file system usage - Adds resize (grow) support - Adds verify support Closes !29 - Enhance F2FS support 2019-02-18 Mike Fleetwood Go back to symbolic label widget alignment constants Now that GParted requires Gtk3 there is no need to use floating point numbers for compatibility with Gtk <= 2.22. Replace with symbolic alignment constants. Relevant commit history: * 6efa6234012b5fa112af4db08e0b89238d53981a Add optional yalign argument to Utils::mk_label() method * be2689ad25c104e3cb97e7d5d1f7627dbb137b19 Stop using deprecated widget alignment enumerators (#652044) 2019-03-23 Mike Fleetwood Pass message parameters by reference to 2 Partition methods (#788813) Note that this almost certainly has no performance benefit what so ever because the methods are implicitly defined as inline [1][2] and the compiler will have simply inlined the method bodies thus avoiding having to construct copies of the passed parameters. Do this anyway as constant objects are typically passed by reference [3]. Also C++'s std::vector::push_back() [4] takes a const reference parameter so update the kind of equivalent push_back_message() to take a const reference parameter too. [1] C++ reference / inline specifier https://en.cppreference.com/w/cpp/language/inline A function defined entirely inside a class/struct/union definition, whether it's a member function or a non-member friend function, is implicitly an inline function. [2] When should I write the keyword 'inline' for a function/method? https://stackoverflow.com/questions/1759300/when-should-i-write-the-keyword-inline-for-a-function-method/1759575#1759575 [3] How to pass objects to functions in C++? https://stackoverflow.com/questions/2139224/how-to-pass-objects-to-functions-in-c/2139254#2139254 [4] C++ reference / std::vector::push https://en.cppreference.com/w/cpp/container/vector/push_back void push_back(const T& value); Bug 788813 - gparted-0.30.0/include/Partition.h:137]: performance problem 2019-03-12 Mike Fleetwood Stop checking for 'btrfs filesystem label' support (!26) btrfs-progs 3.12 includes 'btrfs filesystem label /dev/PTN NEWLABEL' functionality so stop checking for this before enabling setting the label. $ btrfs version Btrfs v3.12 $ btrfs filesystem label --help usage: btrfs filesystem label [|] [] Get or change the label of a filesystem With one argument, get the label of filesystem on . If is passed, set the filesystem label on . $ echo $? 0 Worst case scenario is that some how an old version of the btrfs command is used which doesn't support the labelling functionality. Then this commit would change GParted from disallowing labelling of a btrfs, to allowing it, but presumably it would fail with an error from the btrfs command reporting so. Arguably better from a support point of view. Closes !26 - Remove support for btrfs-progs < 3.12 2019-03-11 Mike Fleetwood Replace use of deprecated btrfsck (!26) In btrfs-progs 3.12, btrfsck is a hard link to the multi-tool btrfs executable. When run as 'btrfsck' it just implements 'btrfs check' [1][2][3][4]. In btrfs-progs 3.14.2 the btrfsck man page is re-added as a symlink to the btrfs-check man page and reports that btrfsck is deprecated [5]. Therefore replace use of 'btrfsck' with 'btrfs check'. [1] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=fac45410e9a783c187ae83d993d3bf3350d05149 Btrfs-progs: Rename btrfsck.c -> cmds-check.c [2] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=5956f752c66d5259bbb17a2dd47ee8c8cc0e5f4f Btrfs-progs: add btrfsck functionality to btrfs [3] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=d5d2046ae3b216af22a8a37c940f2412ba519b6e Btrfs-progs: add btrfsck name detection to btrfs [4] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=e31f6172aa1d6ec5d562f56086819a0f4bc8a914 btrfs-progs: build btrsfck to keep compatibility [5] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=fddeecb7d424d5bb1a93a19a5e537057a4a7f597 btrfs-progs: doc: link btrfsck to btrfs-check Closes !26 - Remove support for btrfs-progs < 3.12 2019-03-11 Mike Fleetwood Stop using removed btrfsctl (!26) That commit [1] also removed btrfsctl from btrfs-progs 3.12 so also stop using it as a fallback. [1] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=f243fcd1b2aa55ffadfbcc032c66dedbee56e79e Removing btrfsctl, btrfs-vol, btrfs-show Closes !26 - Remove support for btrfs-progs < 3.12 2019-03-11 Mike Fleetwood Finish removal of btrfs-show (!26) Remove use of btrfs-show from everywhere else in the btrfs module. Closes !26 - Remove support for btrfs-progs < 3.12 2019-03-11 Mike Fleetwood Stop using removed btrfs-show to read the label (!26) This commit [1] from btrfs-progs 3.12 removed the previously deprecated programs btrfsctl and btrfs-show. As btrfs-progs 3.12 is now the minimum requirement, remove support for those removed programs. This commit is just removing the use of btrfs-show as a fallback to read the label. Note that 'btrfs-show /dev/PTN' didn't distinguish between a label of "none" and no label. Hence the logic in btrfs::read_label() to do with matching the label "none", or matching the label with or without single quotes. Unfortunately as identified in this commit [2] 'btrfs filesystem show /dev/PTN' is subject to the same issue, but only when the file system is mounted and only for btrfs-progs 3.12. This was fixed by this commit [3] from btrfs-progs 3.14. [1] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=f243fcd1b2aa55ffadfbcc032c66dedbee56e79e Removing btrfsctl, btrfs-vol, btrfs-show [2] eca732fb0cefe35db76a7ac96145e2004e8eed08 Update parsing of btrfs filesystem show for the label (#733601) [3] https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=a156b967ed9bd606afa8dc402451abcf07226c17 btrfs-progs: make filesystem show by label work Closes !26 - Remove support for btrfs-progs < 3.12 2019-03-11 Mike Fleetwood Remove old workaround for btrfs resizing on Linux < 3.2 (!26) PATCHSET OVERVIEW The oldest supported distributions have these versions of the Linux kernel and btrfs-progs: Distro EOL kernel btrfs-progs - RHEL / CentOS 7 2024-Jun 3.10.0 4.9.1 - Ubuntu 14.04 LTS 2019-Apr 4.4.0 3.12 - Debian 8 2020-Jun 3.16.0 3.17 - SLES 12 2027-Oct 3.12.28 3.16 Making the oldest supported packages be kernel 3.10 and btrfs-progs 3.12 allows the btrfs support code to be simplified by removing backward compatibility. THIS CHANGE Remove old workaround for ignoring the error when resizing a btrfs to the same size on Linux kernel < 3.2. Also now that only exit status 0 is considered successful from btrfs resize, the EXEC_CHECK_STATUS flag to execute_command() can be used, rather than having to separately call set_status() afterwards. Relevant commit history: * 11d044dba0c07a5c51843beec6ff38f0c55303d8 Don't ignore any errors resizing btrfs on Linux >= 3.2 (#669389) * a580abbc30e88cb1895af342d43dcbb98183a9d5 Use newer btrfs multi-tool control command first Closes !26 - Remove support for btrfs-progs < 3.12 2019-03-14 Mike Fleetwood Set title of Resize/Move dialog for an extended partition (#44) The title has never been set in this case, and defaulted to the name of the executable 'gpartedbin'. Fix this. Closes #44 - Title not set in Resize/Move dialog for extended partitions 2019-03-03 Trần Ngọc Quân Updated Vietnamese translation Signed-off-by: Trần Ngọc Quân 2019-02-28 Mike Fleetwood Initialise local POD 'launched' variable in show_help() 'launched' local POD (Plain Old Data) variable was left uninitialised, but was set in both the try and catch clauses. Best practice is to initialise when defined, so do that instead. Cosmetic change. 2019-02-28 Mike Fleetwood Rename Win_GParted method to show_help() It is not creating a dialog (a pop-up window managed by GParted code itself). It is launching independent yelp program to display the help, so remove the "_dialog" from the name to avoid any possible confusion. 2019-02-27 Mike Fleetwood Restore specific error message on failure to launch yelp Originally, if the yelp command was not installed, attempting to display help produced an error dialog with this message: Failed to execute child process "yelp" (No such file or directory) However since this commit during the Gtk 3 port [1] the error message became this less useful one: Operation not supported Two attempts are made to display the GParted Manual, first using gtk_show_uri() and second by executing the yelp command directly. Prior to the aforementioned commit [1] both methods returned the failure reason using the same 'error' variable. Hence reported the message "Failed to execute child process "yelp" ..." from the second attempt. However that commit had to re-code the second method as part of the Gtk 3 port and use a different error returning mechanism, thus the use of different variable 'e'. But the dialog was left reporting the message from the original 'error' variable, thus reporting "Operation not supported" message from the first attempt using gtk_show_uri(). Fix by again displaying the message from the second failure into the error dialog. Also make it very clear there are two error returning variables by naming them 'error1' and 'error2_msg'. [1] 2953778a4c0e61d8fe49c7a6d707add8a9eb0634 port-to-gtk3: Use Gdk::AppLaunchContext to launch yelp (#7) 2019-02-25 Mike Fleetwood Remove deprecated PKG_NAME from autogen.sh Use of PKG_NAME is deprecated in GNOME 3 and produced this warning: $ ./autogen.sh /usr/bin/gnome-autogen.sh /usr/bin/yelp-build ***Warning*** PKG_NAME is deprecated, you may remove it from autogen.sh ... Now that GParted is a GNOME 3 application with GNOME 3 yelp-tools managed documentation this is redundant and can be removed. Previous further analysis: GNOME Bugzilla, Bug 743318, comment 18 https://bugzilla.gnome.org/show_bug.cgi?id=743318#c18 " PKG_NAME is still used in GNOME 2.28's gnome-autogen.sh in error messages. (GNOME 3's gnome-autogen.sh queries it from configure.ac instead of requiring it to be set). " Also confirmed that it makes no difference by running ./autogen.sh with and without PKG_NAME being set. The produced GParted build trees were the same. Therefore the release and executable can't be affected. 2019-02-24 Mike Fleetwood Drop now unnecessary editing of xmllint command line in CI tests (!24) GNOME 3's yelp doesn't use scrollkeeper or the OMF catalog, so the constructed Makefile doesn't use xmllint to validate the scrollkeeper DTD file. Therefore remove attempted sed edit of that line which no longer exists in the Makefile. Note that help/Makefile.am's @YELP_HELP_RULES@ automake macro expansion comes from /usr/share/aclocal/yelp.m4 [1]. Commit which previously needed to add the sed edit: cbb25a2511ec9e355b4dbba288689bbc00b7af65 Stop xmllint scrollkeeper-omf.dtd fetch failure breaking CI tests (#9) [1] Yelp > Yelp Tools > yelp.m4 http://yelp.io/tools/yelp.m4.html Closes !24 - Port to GNOME 3 yelp-tools documentation infrastructure 2019-02-24 Mike Fleetwood Launch help from GParted using the new GNOME 3 help: prefix (!24) Update GParted to specify the GParted Manual using the new GNOME 3 way with the 'help:' prefix to avoid yelp reporting this error: Document Not Found The URI 'ghelp:gparted' does not point to a valid page. Closes !24 - Port to GNOME 3 yelp-tools documentation infrastructure 2019-02-24 Mike Fleetwood Allow GNOME 3 yelp to display the GParted Manual (!24) Now with GNOME 3 style help installed, running 'yelp help:gparted' results in this error being displayed in yelp: Page Not Found The requested page was not found in the document 'help:gparted'. Where as running 'yelp help:gparted/gparted' correctly displays the GParted Manual. Fix by renaming the article tag to the default 'index' that yelp is expecting when using the new GNOME 3 'help:' prefix. Closes !24 - Port to GNOME 3 yelp-tools documentation infrastructure 2019-02-23 Mike Fleetwood Add use of new GNOME 3 yelp-tools documentation infrastructure (!24) Second part is to use yelp-tools to build and install the documentation. Have to rename the help Manual from help/C/gparted.xml to help/C/index.docbook in accordance with this note from the GNOME Goal: Port to New Documentation Infrastructure [1]: IMPORTANT: If this is for a DocBook document, the top-level DocBook file MUST be renamed to index.docbook. Do a "git mv" and include index.docbook in HELP_FILES. Commits from gucharmap [4] and totem [5], projects which have DocBook documentation, making this same change are also useful references. [1] GNOME Goal: Port To New Documentation Infrastructure https://wiki.gnome.org/Initiatives/GnomeGoals/NewDocumentationInfrastructure [2] Yelp > Yelp Tools > yelp.m4 http://yelp.io/tools/yelp.m4.html [3] GNOME application developement overview / User help / Set up your build system https://developer.gnome.org/platform-overview/stable/dev-help-build.html.en [4] gucharmap commit "Port to new documentation infrastructure" https://gitlab.gnome.org/GNOME/gucharmap/commit/3e1526c0568f0b395fce68f9d9e09431dfcaef35 [5] totem commit "Use new documentation infrastructure" https://gitlab.gnome.org/GNOME/totem/commit/59a6bd6064fe7dd047f7b61642aba73e0ba72acf Closes !24 - Port to GNOME 3 yelp-tools documentation infrastructure 2019-02-21 Mike Fleetwood Remove use of GNOME 2 gnome-doc-utils documentation infrastructure (!24) Details of old GNOME 2 gnome-doc-utils: Migrating your documentation to gnome-doc-utils https://wiki.gnome.org/Projects/GnomeDocUtils/MigrationHowTo First part is to stop using gnome-doc-utils to build and install the documentation. Also since updating the OMF catalog was only needed for GNOME 2 yelp, use of scrollkeeper is completely removed too. Closes !24 - Port to GNOME 3 yelp-tools documentation infrastructure 2013-07-31 Jeremy Bicha Fix FDL help link for gnome-desktop 3.5+ (!24) I generated this by running: find ./ -type f -exec sed -i 's/ghelp:fdl/help:fdl/g' {} \; By updating the translations at the same time, it should be easier on the translators as there's no reason to invalidate these strings. https://bugzilla.gnome.org/show_bug.cgi?id=704634#c8 [Mike Fleetwood: Explain the underlying cause and distro versions.] This gnome-desktop commit, first included in version 3.5.5, switched the package from using gnome-doc-utils to yelp-tools so changed the installed location of the GNU FDL license file from /usr/share/gnome/help/fdl/C/fdl.xml to /usr/share/help/C/fdl/index.docbook, thus changing the yelp URI from 'ghelp:fdl' to 'help:fdl': https://gitlab.gnome.org/GNOME/gnome-desktop/commit/8b7e059e2c01ec67d8aaf33133e695efae2173f8 Port to new documentation infrastructure The oldest supported distributions with Gtk/GNOME 3 all have at least 3.10, therefore use this fix unconditionally. Distribution EOL Gtk/GNOME 3 RHEL / CentOS 7 2024-Jun 3.22 Ubuntu 14.04 LTS 2019-Apr 3.10 Ubuntu 16.04 LTS 2021-Apr 3.18 Debian 8 2023-Apr 3.14 SLES 12 2027-Oct 3.10 Closes !24 - Port to GNOME 3 yelp-tools documentation infrastructure 2019-02-15 Mike Fleetwood Remove redundant file help/C/Makefile.am (!24) The file has been redundant since it was first added [1]. It was never listed in configure.ac (or configure.in) in AC_CONFIG_FILES. Therefore autoconf has never produced help/C/Makefile.in and ./configure has never produced help/C/Makefile. Therefore it isn't used during the build and install of GParted. Remove it. [1] 46ca7c74dca80b4b6ec8f6596832510cdc7f714b Added code hooks to prepare for GParted Manual Closes !24 - Port to GNOME 3 yelp-tools documentation infrastructure 2019-02-28 Kukuh Syafaat Update Indonesian translation 2019-02-26 Nathan Follens Update Dutch translation 2019-02-15 Mike Fleetwood Remove left behind configuration summary lines (!22) These lines in the final configuration report from ./configure were left behind [1] when determination of the underlying definitions were remove. So they no longer report 'yes' or 'no' like the other lines in the file configuration report. Need partition table re-read workaround? : Supports large sector sizes (> 512 bytes)? : Remove them now. [1] 8df975c7d1b5d69897f286bfc5574c51cf58c9d5 Increase minimum required libparted to 2.2 (!22) Closes !22 - Increase minimums to libparted 2.2 and glibmm 2.32 2019-02-01 Mike Fleetwood Remove left behind commented #includes from fat16.cc According to the GIT history the lines were added by this commit: 8d808c0b62a8387ba1703a0493746add5785fff5 gparted-0.3.6 - code recreation from Source Forge Looking at the SVN history this commit actually fleshed out the implementations of fat16::get_label() and fat32::get_label() and added the commented #includes: https://sourceforge.net/p/gparted/svn/118 Added read label support for fat16 and fat32 using mtools mlabel command 2008-02-12 Then this SVN commit moved the mtools temporary file handling code into Utils.cc, leaving behind the commented #includes: https://sourceforge.net/p/gparted/svn/124 Added MTools temporary file handling functions 2008-02-19 Finally this commit removed fat32.cc by merging the code with fat16.cc: 519af1a7c08667c53e602012e2a49cbf5301f40c Combine duplicate code for fat16/32 So remove the left behind commented #includes from fat16.cc. 2019-02-09 Mike Fleetwood Enable online resizing of extended partitions (!23) A forum user had a case where they wanted to grow their in use root, ext4 file system. GParted supports this, but the partition was a logical partition inside an extended partition and GParted doesn't support resizing an extended partition while any contained logical partitions are busy. Example layout: Partition File System Mount Point /dev/sdb1 ntfs /dev/sdb2 [busy] /dev/sdb5 [busy] ext4 / unallocated unallocated So just allow extended partitions to be resized online when online partition resizing is available via libparted. NOTE: The block device that the Linux kernel provides for an extended partition just maps to the first 1 KiB of the extended partition where the Extended Boot Record is stored, and does not include any of the contained logical partitions. Therefore no application can care that the extended partition is resized while a logical partition is in use because it can't use the extended partition block device to access any data. The on disk layout looks like this: # fdisk -l /dev/sdb Disk /dev/sdb: 8589 MB, 8589934592 bytes, 16777216 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0007650e Device Boot Start End Blocks Id System /dev/sdb1 2048 1050623 524288 7 HPFS/NTFS/exFAT /dev/sdb2 1050624 2101247 525312 5 Extended /dev/sdb5 1052672 2101247 524288 83 Linux # parted /dev/sdb unit s print free Model: ATA VBOX HARDDISK (scsi) Disk /dev/sdb: 16777216s Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 63s 2047s 1985s Free Space 1 2048s 1050623s 1048576s primary ntfs 2 1050624s 2101247s 1050624s extended 5 1052672s 2101247s 1048576s logical ext4 2101248s 16777215s 14675968s Free Space The kernel's partition sizes from /sys/block/sdb/sdb${N}/{start,size} shows extended partition 2 has a size of only 2 sectors: # for N in 1 2 5 > do > echo -e "/dev/sdb${N}\tstart=`cat /sys/block/sdb/sdb${N}/start`\tsize=`cat /sys/block/sdb/sdb${N}/size`" > done /dev/sdb1 start=2048 size=1048576 /dev/sdb2 start=1050624 size=2 /dev/sdb5 start=1052672 size=1048576 The EBR read from the whole of extended partition 2 block device: # hexdump -C /dev/sdb2 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 86 |................| 000001c0 06 41 83 cb 09 82 00 08 00 00 00 00 10 00 00 00 |.A..............| 000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| 00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000400 Closes !23 - Enable online resizing of extended partitions 2019-02-11 Mike Fleetwood Recognise contribution by Luca Bacci 2019-01-22 Luca Bacci Prevent the legend text making the features dialog too wide (#7) With the Gtk3 port the File System Support dialog has become too wide because the legend text is no longer wrapped. Set the max-width-chars property to specify the natural size of the widget in terms of characters [1]. It is converted to pixels using the average character width in the current font. Also use PACK_EXPAND_WIDGET when adding the label to the box so that if the dialog is resized extra space is used to increase the size of this child widget [2]. [1] GNOME HowDoI / Labels https://wiki.gnome.org/HowDoI/Labels [2] Gtkmm 3.0 Enums and Flags, enum Gtk::PackOptions "PACK_EXPAND_WIDGET Space is expanded, with extra space filled by increasing the child widget size." https://developer.gnome.org/gtkmm/3.0/group__gtkmmEnums.html#ga83727a1b6fed51566dfd5c8e58890dba Closes #7 - Port to Gtk3 2019-01-22 Luca Bacci Enable display of progress bar text when applying operations (#7) In Gtk2 progress bars show optional text superimposed over the bar. In Gtk3 the text is not displayed by default, so set the show-text property to re-enable this [1]. Also note that since Gtk 3.14.0 the optional text is not superimposed over the progress bar, but instead displayed just above it [2][3][4]. References: [1] Gtkmm 3.0 Gtk::ProgressBar Class Reference, set_show_text() "Sets whether the progressbar will show text superimposed over the bar." https://developer.gnome.org/gtkmm/3.0/classGtk_1_1ProgressBar.html#a0bfa6042f5d4b3509967abc2d8af57fe [2] Commit - Update the design for progress bars https://gitlab.gnome.org/GNOME/gtk/commit/74405cc964e405ea00cfac22856a62fea5ec648e [3] Bug 748784 - GtkProgressBar text cannot be superimposed on the progress bar https://bugzilla.gnome.org/show_bug.cgi?id=748784 [4] Gtkmm 3.18 Gtk:ProgressBar Class Reference, set_show_text() "Set whether the progress bar will show text next to the bar." https://developer.gnome.org/gtkmm/3.18/classGtk_1_1ProgressBar.html#a0bfa6042f5d4b3509967abc2d8af57fe Closes #7 - Port to Gtk3 2019-01-22 Luca Bacci Ensure SpinButtons have space to display 7 digits (#7) In Gtk2 the up and down buttons in a SpinButton were smaller leaving space for 7 digits before scrolling the entry. In Gtk3 the up and down buttons are much larger leaving only space for 4 digits. This occurs in the SpinButtons in the Dialog_Base_Partition class as displayed in the New Partition, Paste and Resize/Move dialogs. Set width-chars property of all Gtk::SpinButtons to ensure 7 digits can be displayed before scrolling the entry. Closes #7 - Port to Gtk3 2019-01-22 Luca Bacci Change Gtk::ProgressBar appearance by providing custom CSS (#7) In Gtk3 the progress bar height is fixed and defined by the CSS theme in use. Changing the widget allocation size does nothing, it is always rendered the same way. In many themes, including Adwaita, the progressbar is very, very thin. Provide custom CSS to specify a height of 8 pixels. The CSS source string has to be differentiated for Gtk pre and post 3.20, because Gtk 3.20 introduced some breaking changes in the way CSS is handled. References: [1] Migrating from GTK+ 2.x to GTK+ 3 - Parsing of custom resources https://developer.gnome.org/gtk3/stable/gtk-migrating-GtkStyleContext-parsing.html [2] Gtk3 Reference Documentation - Changes in GTK+ 3.20 https://developer.gnome.org/gtk3/stable/ch32s10.html [3] Gnome/HowDoI - Custom Style https://wiki.gnome.org/HowDoI/CustomStyle Closes #7 - Port to Gtk3 2018-08-28 Luca Bacci Change packing of pulsebar in statusbar (#7) The pulsebar looks very small and needs to be widened. The pulsebar is packed inside the statusbar so that it displays activity text on the left side and the pulsebar on the right side. Ideally we want the space to be evenly divided for the textual messages and for the pulsebar activity indicator. For this we just have to set the 'homogeneous' property to TRUE for the statusbar (note that GtkStatusBar inherits from GtkBox). Also vertically align the pulsebar to the center of the statusbar. This is achieved setting the 'valign' property to Gtk::ALIGN_CENTER for the pulsebar widget. Closes #7 - Port to Gtk3 2018-08-30 Luca Bacci Work around Gtk3 Gtk-CRITICAL messages when closing some dialogs (#7) There is a bug affecting Gtk+ 3.22.8 to 3.22.30 in which destroying a GtkComboBox when it is not hidden results in this message: Gtk-CRITICAL **: gtk_widget_is_drawable: assertion 'GTK_IS_WIDGET (widget)' failed This happens in GParted when some dialogs are closed, for example the Create New Partition and Create Partition Table dialogs. To work around the issue we call Gtk::Dialog::hide() in the destructors of our dialog classes. The issue was fixed in Gtk 3.24.0. * Gtk 3.22.8 was released in February 2017. * Gtk 3.24.0 was released in September 2018. References: [1] Gtk Issue - GtkComboBox::private::popup_window can be NULL https://gitlab.gnome.org/GNOME/gtk/issues/125 [2] Gtk commit - combobox: popdown() the menu during unmap() https://gitlab.gnome.org/GNOME/gtk/commit/7401794de6b084fea469af297b7c144724b8492c [3] Gtk commit - Check for NULL priv->popup_window in gtk_combo_box_popdown() https://gitlab.gnome.org/GNOME/gtk/commit/aa5d926c843aca2af576c38cf25ebdb4d3da2c26 Closes #7 - Port to Gtk3 2018-11-21 Luca Bacci Work around Gtkmm3 issue where menu accelerators are not shown (#7) There is a bug in Gtkmm3 when setting accelerator keys on a Gtk::MenuItem, the accelerator keys work but are not displayed when the menu is drawn. This happens for Gtk::MenuItems, including derived objects, that are constructed with a non-default constructor. All non-default constructors of Gtk::MenuItem, and subclasses, work by creating themselves a Gtk::AccelLabel and packing it inside the menu item. But in Gtk3 GtkMenuItem are created with a GtkAccelLabel already packed in as a child and that accel label should be used instead. To workaround the issue we only use the default constructor for Gtk::MenuItem and subclasses. This is easy to do because we only have to change the wrappers in MenuHelpers.cc. This bug affects Gtkmm version 3.0.0 to 3.22.2 and was fixed in Gtkmm 3.22.3. * Gtkmm 3.0.0 was released in April 2011 * Gtkmm 3.22.3 was released in November 2018 References: [1] Bug Report on the Gtkmm mailing list https://mail.gnome.org/archives/gtkmm-list/2018-February/msg00006.html [2] Commit - Gtk::MenuItem: Fix add_accel_label() https://gitlab.gnome.org/GNOME/gtkmm/commit/e5c8c2df67d0d7ec255055984e8f07d0f0fa0862 Closes #7 - Port to Gtk3 2018-08-13 Luca Bacci Simplify code using Gtk::Container::get_children() (#7) GParted uses Gtk::Container::get_children(). In Gtkmm2 Gtk::Container::get_children() returns a Glibmm intermediate container [1]. Gtkmm3 dropped the use of Glibmm intermediate containers in favour of STL containers [2][3]. Now that Gtk::Container::get_children() directly returns a std::vector<> simplify the code. References: [1] Gtkmm 2.24 Gtk::Container Class Reference "Glib::ListHandle Gtk::Container::get_children()" https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Container.html#acd2f9b9ac16ba96178d3f5169b07f4d0 [2] Gtkmm 3.0 Gtk::Container Class Reference "std::vector Gtk::Container::get_children()" https://developer.gnome.org/gtkmm/3.0/classGtk_1_1Container.html#a3a2111e255cb5b72bd91a3be087cff27 [1] Programming with gtkmm3 / Changes in gtkmm3 "11. We now use std::vector in several methods instead of the intermediate *Handle types to make the API clearer." https://developer.gnome.org/gtkmm-tutorial/3.0/changes-gtkmm3.html.en Closes #7 - Port to Gtk3 2018-09-05 Luca Bacci port-to-gtk3: Block Gtk::TreeSelection changed handler on tree model clear (#7) Now GParted compiles with Gtkmm3, but we get a failed assertion doing the following: * Select a device with more than 1 partition * Select a partition * Activate 'Refresh Devices' (or do any operation that causes it, like mount/unmount etc.) This is the failed assertion: ** ERROR:Win_GParted.cc:1152:void GParted::Win_GParted::set_valid_operations(): assertion failed: (valid_display_partition_ptr( selected_partition_ptr )) Aborted (core dumped) Where is the problem? Win_GParted::Refresh_Visual() calls TreeView_Detail::load_partitions() to clear and refill the treeview. The problem is in GParted::TreeView_Detail::load_partitions() at TreeView_Detail.cc:91: treestore_detail->clear(); This activates TreeView_Detail::on_selection_changed() which in turn activates Win_GParted::on_partition_selected() passing an old, stale pointer as an argument. This triggers the failed assertion. Why does this happen with Gtk3 and not with Gtk2? First a bit of background of GtkTreeView: What happens to the selection in a GtkTreeView when the selected row is removed? With Gtk2 the selection simply becomes empty, so nothing is selected afterwards. With Gtk3 this was changed [1] and selection moves to an adjacent row. gtk_tree_store_clear() removes rows one by one. While removing rows the selection changed signal is emitted. With Gtk2 it is emitted only one time, to indicate that selection has become empty. With Gtk3 it is instead emitted several times, each time indicating that selection has moved to the adjacent row. The handler TreeView_Detail::on_selection_changed() only takes action when the selection is not empty. So with Gtk3 it really takes action and activates Win_GParted::on_partition_selected() with a pointer to old data. What's the purpose of TreeView_Detail::on_selection_changed()? Its task is to update the selection in the drawing area above the TreeViewDetail, the DrawingAreaVisualDisk, so that the selected partition stays in sync on the two widgets. Fix by blocking the signal handler during the treeview clear. Reference: [1] Commit - treeview: Handle the case where the cursor row gets deleted https://gitlab.gnome.org/GNOME/gtk/commit/1a2932ba2915c34171581a85afba39311e9c3ac6 Closes #7 - Port to Gtk3 2018-08-09 Luca Bacci port-to-gtk3: Use Gdk::AppLaunchContext to launch yelp (#7) gdk_spawn_command_line_on_screen() is not present in Gtk3. The documentation from Gtkmm 2.24 states [1]: gdk_spawn_command_line_on_screen has been deprecated since version 2.24 and should not be used in newly-written code. This function is being removed in 3.0. Use either g_spawn_command_line_sync(), g_spawn_command_line_async() or GdkAppLaunchContext instead. g_spawn_command_line_sync() and g_spawn_command_line_async() are screen / display agnostic, as such we would loose functionality. There is a workaround, which involves setting the DISPLAY environment variable [2], but it's a weak solution (and I don't know if it works on backends other than X11). GdkAppLaunchContext is an implementation of GIO's GAppLaunchContext that handles launching an application in a graphical context [3]. Therefore use GdkAppLaunchContext and GIO's GAppInfo. GdkAppLaunchContext was introduced in Gtk2 version 2.14. The C++ wrapper Gdk::AppLaunchContext was introduced only in Gtkmm3 version 3.4 [4]. Bump the minimum required version of Gtkmm to 3.4.0 for this requirement. GAppInfo was introduced in GLib version 2.16. The C++ wrapper Gio::AppInfo was introduced in Giomm version 2.16. Note that the minimum required version for glibmm is already 2.32. [1] GDK 2 Reference Manual, GdkScreen, gdk_spawn_on_screen() https://developer.gnome.org/gdk2/2.24/GdkScreen.html#gdk-spawn-on-screen [2] Migrating from GTK+ 2.x to GTK+ 3 - "Use GIO for launching applications" https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#id-1.6.3.3.7 [3] GDK 3 Reference Manual - "Application launching" https://developer.gnome.org/gdk3/stable/gdk3-Application-launching.html [4] Gtkmm 3.4 Gdk::AppLaunchContext Class Reference, Detailed Description https://developer.gnome.org/gtkmm/3.4/classGdk_1_1AppLaunchContext.html#details Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci port-to-gtk3: Use Gtk::CellLayout::get_cells() (#7) GParted uses Gtk::TreeViewColumn::get_cell_renderers(). This is not present in Gtkmm3. Now Gtk::TreeViewColumn inherits from Gtk::CellLayout and we have to use Gtk::CellLayout::get_cells() instead. GtkCellLayout was introduced in Gtk2 version 2.18 as the common interface for containers of cell renderers. The C++ wrapper Gtk::CellLayout was introduced in Gtkmm2 version 2.18, but Gtk::TreeViewColumn was never made to inherit from Gtk::CellLayout to avoid breaking the API / ABI. That change was made for Gtkmm3. This is an excerpt from gtkmm/treeviewcolumn.h header in Gtkmm2: // TODO: Should be deprecated, but we cannot derive from CellLayout // without breaking API and ABI. /** Returns a list of all the cell renderers in the column, * in no particular order. * * @return A list of Gtk::CellRenderers. */ Glib::ListHandle get_cell_renderers(); Replace Gtk::TreeViewColumn::get_cell_renderers() with base class method Gtk::CellLayout::get_cells(). Reference: [1] Commit - "Deprecate get_cell_renderers implementations" https://gitlab.gnome.org/GNOME/gtk/commit/6abc52a29d2b15c255ada7d199b703a95f8c565b Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci port-to-gtk3: Use draw signal in the partition resizer (#7) In Gtk2 widgets draw themselves in response to the expose event signal. In Gtk3 widgets draw themselves in response to the GtkWidget::draw signal, and the signal handler gets a Cairo context as an argument. Convert Gtk::DrawingArea rendering code to respond to the GtkWidget::draw signal. This commit is specific to the drawing area in the Create new Partition dialog and the Resize/Move dialog. Reference: [1] Migrating from GTK+ 2.x to GTK+ 3 - "The GtkWidget::draw signal": https://developer.gnome.org/gtk3/stable/ch26s02.html#id-1.6.3.4.11 Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci port-to-gtk3: Use draw signal in the partition visualizer (#7) In Gtk2 widgets draw themselves in response to the expose event signal. In Gtk3 widgets draw themselves in response to the GtkWidget::draw signal, and the signal handler gets a Cairo context as an argument. Convert Gtk::DrawingArea rendering code to respond to the GtkWidget::draw signal. This commit is specific to the drawing area contained in the main application window (also called the DrawingAreaVisualDisk). Reference: [1] Migrating from GTK+ 2.x to GTK+ 3 - "The GtkWidget::draw signal": https://developer.gnome.org/gtk3/stable/ch26s02.html#id-1.6.3.4.11 Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci port-to-gtk3: Use draw signal in the partition info dialog (#7) In Gtk2 widgets draw themselves in response to the expose event signal. In Gtk3 widgets draw themselves in response to the GtkWidget::draw signal, and the signal handler gets a Cairo context as an argument. Convert Gtk::DrawingArea rendering code to respond to the GtkWidget::draw signal. This commit is specific to the drawing area in the Partition Info dialog. Reference: [1] Migrating from GTK+ 2.x to GTK+ 3 - "The GtkWidget::draw signal": https://developer.gnome.org/gtk3/stable/ch26s02.html#id-1.6.3.4.11 Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci port-to-gtk3: Use Gtk::Widget::render_icon_pixbuf() (#7) In Gtk3/C, gtk_widget_render_icon() was deprecated in Gtk 3.0 [1]. In Gtkmm3/C++, Gtk::Widget::render_icon() was abruptly removed from Gtkmm 3.0 and replaced with Gtk::Widget::render_icon_pixbuf() [2]. Gtk::Widget::render_icon() [3] had an optional 3rd parameter which GParted never used. Replace with Gtk::Widget::render_icon_pixbuf() [4]. References: [1] GTK+ 3 Reference Manual, GtkWidget https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-render-icon "gtk_widget_render_icon has been deprecated since version 3.0 and should not be used in newly-written code." [2] Gtkmm 3.0.0 NEWS file "... Removed render_icon(), adding render_icon_pixbuf()." https://gitlab.gnome.org/GNOME/gtkmm/blob/3.0.0/NEWS#L187 [3] Gtkmm 2.24 Gtk::Widget Class Reference, render_icon() https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Widget.html#a91efd1b5aed7c184506ddd5721710584 [4] Gtkmm 3.0 Gtk::Widget Class Reference, render_icon_pixbuf() https://developer.gnome.org/gtkmm/3.0/classGtk_1_1Widget.html#a28bbbd0c1717e58343df56f7f422b106 Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci port-to-gtk3: Use Gdk::Cursor via Glib::RefPtr<> (#7) Starting from Gtkmm3 Gdk::Cursor objects cannot be constructed directly, but instead you have to get a smart pointer to an instance by calling the static member function Gdk::Cursor::create(). Gdk::Cursor::create() returns a Glib::RefPtr object. Gtkmm3 always uses Glib::RefPtr in its interface and never plain Gdk::Cursor. Reference: [1] Programming with gtkmm3, Changes in gtkmm3: https://developer.gnome.org/gtkmm-tutorial/3.24/changes-gtkmm3.html.en "... Gdk::Cursor are now used via Glib::RefPtr." Closes #7 - Port to Gtk3 2018-08-29 Luca Bacci port-to-gtk3: Rework Gtk header includes (#7) In Gtk3 individual headers cannot be included directly in application code, only the header can be included (with a few exceptions for some platform specific headers). This has always been considered good practice even for Gtk2, though was not a hard requirement. In Gtk3 this is enforced by preprocessor checks. Failure to do so yields a preprocessor error and compilation fails: "error: Only can be included directly." Change specific Gtk header includes to: #include References: [1] Migrating from GTK+ 2.x to GTK+ 3 - "Do not include individual headers" https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#id-1.6.3.3.3 [2] Commit - "Remove all traces of GDK_PIXBUF/GTK_DISABLE_SINGLE_INCLUDES" https://gitlab.gnome.org/GNOME/gtk/commit/5e29973773d4e2177f234675cc2a2b2016aa9fbc Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci port-to-gtk3: Rework Gtkmm header includes (#7) Now that we are compiling against Gtkmm3 there are missing declarations of Gtkmm identifiers due to changes in Gtkmm internal header structure. All we have to do is bring back the declarations by including the appropriate headers where needed. Add necessary Gtkmm header includes. Closes #7 - Port to Gtk3 2018-12-04 Luca Bacci port-to-gtk3: Rework Glibmm header includes (#7) Now that we are compiling against Gtkmm3 there are missing declarations of Glibmm identifiers due to changes in Gtkmm internal header structure. All we have to do is bring back the declarations by including the appropriate headers where needed. Add necessary Glibmm header includes. Closes #7 - Port to Gtk3 2018-08-27 Luca Bacci port-to-gtk3: Switch to Gtkmm3 (#7) Switch to Gtkmm3 in configure.ac. Require version 3.0.0. Also update the build instructions in README and the package list in .gitlab-ci.yml. Starting from version 3.18.0 Gtkmm requires C++11 compilation [1][2][3]. Add a check for Gtkmm >= 3.18.0 in configure.ac and enable C++11 compilation accordingly. References: [1] Gtkmm 3.18.1 NEWS "Changes in 3.18 ... Use, and require C++11, ..." https://gitlab.gnome.org/GNOME/gtkmm/blob/3.18.1/NEWS#L35 [2] Murray's Blog - "gtkmm now uses C++11" https://www.murrayc.com/permalink/2015/07/31/gtkmm-now-uses-c11 [3] Murray's Blog - "gtkmm 3.18 and glibmm 2.46" https://www.murrayc.com/permalink/2015/09/25/gtkmm-3-18-and-glibmm-2-46 Closes #7 - Port to Gtk3 2018-08-09 Luca Bacci prepare-for-gtk3: Prepare for removal of Gtk::Widget::modify_fg() (#7) The Gtk::Widget::modify_fs() API was removed in Gtkmm3 [1] and also there is no direct replacement. GParted uses this in one place. So instead use the C gtk_widget_modify_fg() version that is still present in Gtk3. This is just a temporary change to port GParted to Gtk3. In future this will be replaced as part of the switch from Gdk::Color to Gtk::RGBA, since Gdk::Color was deprecated in Gtkmm 3.10 [2]. Reference: [1] https://gitlab.gnome.org/GNOME/gtkmm/commit/ee432e21901c8ee7f68f6562c46f9e5e6ef17de7 commit message "... Remove the modify_*() methods, ..." [2] Gtkmm 3.10 Gdk::Color Class Reference https://developer.gnome.org/gtkmm/3.10/classGdk_1_1Color.html#details Deprecated: Use Gdk::RGBA instead. Closes #7 - Port to Gtk3 2018-08-02 Luca Bacci prepare-for-gtk3: Prepare for removal of Gtk::Menu_Helpers::MenuList (#7) GParted uses Gtk::Menu_Helpers::MenuList helper class to access individual menu items. This helper class made it easy to navigate menu items by index. Gtk::Menu_Helpers::MenuList was removed in the switch from Gtkmm2 to Gtkmm3 [1]. Instead, use a separate std::map to keep track of individual Gtk::MenuItem objects. Reference: [1] Gtkmm 3 commit "MenuShell: Remove items()." removed the code https://gitlab.gnome.org/GNOME/gtkmm/commit/c8e47b0db5505db0e10e74ce1d7286c2230958b5 Closes #7 - Port to Gtk3 2018-07-31 Luca Bacci prepare-for-gtk3: Prepare for removal of Gtk::Menu_Helpers::Element (#7) Gtk::Menu_Helpers::Element class and subclasses help in Gtk::MenuItem widgets and also automate tasks like registering keyboard accelerators when parented to a top-level window [1][2]. Gtk::Menu_Helpers::Element class and subclasses were removed in Gtkmm3 [3]. Provide compatible implementations under the namespace GParted::Menu_Helpers. References: [1] gtkmm: Gtk::Menu_Helpers Namespace Reference https://developer.gnome.org/gtkmm/2.24/namespaceGtk_1_1Menu__Helpers.html [2] gtkmm: Gtk::Menu_Helpers::Element Class Reference https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Menu__Helpers_1_1Element.html [3] Gtkmm 3 commit "MenuShell: Remove items()." removed the code https://gitlab.gnome.org/GNOME/gtkmm/commit/c8e47b0db5505db0e10e74ce1d7286c2230958b5 Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci prepare-for-gtk3: Replace deprecated GDK_ constants (#7) During the switch from Gtk2 to Gtk3 keyname constants were renamed from GDK_ to GDK_KEY_ [1]. This was done to avoid name clashes in gobject-introspection and language bindings. The new constant names were also backported to Gtk 2.22 [2]. Make use of the new constant names. References: [1] Migrating from GTK+ 2.x to GTK+ 3 - "Replace GDK_ with GDK_KEY_" https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#id-1.6.3.3.6 [2] Commit - "gdk: Prefix keys with _KEY by default" https://gitlab.gnome.org/GNOME/gtk/commit/750c81f43dda6c783372b983e630ecd30b776d7e Closes #7 - Port to Gtk3 2018-08-03 Luca Bacci prepare-for-gtk3: Remove calls to Gtk::Dialog::set_has_separator() (#7) Originally in Gtk2, by default, dialogs showed a horizontal separator between the content area and the action area (buttons). GParted explicitly called Gtk::Dialog::set_has_separator(false) for all it's dialogs to remove the separator. In Gtk2/Gtkmm2 2.22, separators were deprecated [1]. In Gtk3/Gtkmm3 separators in dialogs were removed altogether, including all the related APIs [2][3][4]. Therefore remove all calls. References: [1] Commit - "Document separator-related api in GtkDialog as deprecated" https://gitlab.gnome.org/GNOME/gtk/commit/6f6650e6cff06ff7c7e70db634ab10510a80c04c [2] Commit - "Remove separators from dialogs" https://gitlab.gnome.org/GNOME/gtk/commit/d433a606111d89727530f71d7b956ba40655bcbf [3] GTK+ 3.0.0 NEWS file https://gitlab.gnome.org/GNOME/gtk/blob/3.0.0/NEWS#L779 " Overview of Changed from GTK+ 2.90.6 to 2.90.7 ============================================== * Various deprecated APIs have been removed: ... - GtkDialog separators, including the GtkDialog::has-separator property, including setter/getter, the GTK_DIALOG_NO_SEPARATOR flag and the GtkMessageDialog::use-separator style property " [4] Gtkmm 3.0.0 NEWS file https://gitlab.gnome.org/GNOME/gtkmm/blob/3.0.0/NEWS#406 " * Dialog: - Remove get/set_has_separator() and property. - Constructors: Remove use_separator parameters. " Closes #7 - Port to Gtk3 2019-01-28 Balázs Úr Update Hungarian translation 2019-01-20 Mike Fleetwood Update to Google Test 1.8.1 Update to Google Test C++ test framework from release 1.8.0 to 1.8.1. Replace the following files and directories from Google Test 1.8.1: LICENSE README.md include/ src/ Note the LICENSE file is identical, where as the other files changed. Also see commit which initially added Google Test: 87f7170a55e1a04aeca5412ebb97e0fe0bfe7b4c Add Google Test 1.8.0 files (#781978) 2019-01-20 Mike Fleetwood Remove custom main() from test_PipeCapture (!22) After removing Glib::thread_init() from test_PipeCapture's main() all it does is exactly what the built in Google Test main() does [1][2]. So use that instead like the other unit test programs do. [1] Google Test, Primer, Writing the main() Function https://github.com/google/googletest/blob/master/googletest/docs/primer.md#writing-the-main-function [2] Google Test 1.8.0, gtest_main.cc::main() file: lib/gtest/src/gtest_main.cc https://github.com/google/googletest/blob/release-1.8.0/googletest/src/gtest_main.cc#L34 Closes !22 - Increase minimums to libparted 2.2 and glibmm 2.32 2018-12-24 Mike Fleetwood Remove deprecated Glib::thread_init() (!22) Use of Glib::thread_init() was deprecated in glibmm 2.32 [1]. The oldest supported distributions have these versions: Debian 8 glibmm 2.42.0 RHEL / CentOS 7 glibmm 2.56.0 SLES 12 glibmm 2.38.1 Ubuntu 14.04 LTS glibmm 2.39.93 Checking further the glibmm 2.32 reference manual says this about Glib::thread_init() [2]: Initializes the GLib thread system. Deprecated: Calling thread_init() is no longer necessary and no longer has any effect. However only some of the glibmm example programs had Glib::thread_init() removed, others had it replaced by Glib::init() [3]. Again the glibmm 2.32 reference manual says this about Glib::init() [4]: Initialize glibmm. You may call this more than once. You do not need to call this if you are using Glib::MainLoop or Gtk::Main, because they call it for you. GParted does call Gtk::Main and test_PipeCapture does call Glib::MainLoop. Therefore just raise the minimum version to glibmm 2.32 and remove both calls to Glib::thread_init(). [1] Glibmm 2.32 NEWS file https://gitlab.gnome.org/GNOME/glibmm/blob/2.32.0/NEWS#L207 [2] glibmm 2.32, glibmm: Glib Namespace Reference, Glib::thread_init() https://developer.gnome.org/glibmm/2.32/namespaceGlib.html#ab26d01c776801f1fff00753e97af4fc7 [3] glibmm commit "Avoid use of deprecates API in tests and examples." https://gitlab.gnome.org/GNOME/glibmm/commit/3e0fbb22c0d4814de4174d32e12a45cbad79980e [4] glibmm 2.32, glibmm: Glib Namespace Reference, Glib::init() https://developer.gnome.org/glibmm/2.32/namespaceGlib.html#ac90aee10d0b90e3d8a96a86b5394f87b Closes !22 - Increase minimums to libparted 2.2 and glibmm 2.32 2018-12-18 Mike Fleetwood Increase minimum required libparted to 2.2 (!22) Raise the minimum required version of GNU Parted from 1.7.1 to 2.2, released 2010-02-16 [1][2]. The oldest supported distributions, also with gtkmm >= 2.24, since commit [3], are: Debian 8 parted 3.2 RHEL / CentOS 7 parted 3.1 SLES 12 parted 3.1 Ubuntu 14.04 LTS parted 2.3 Raising the minimum required version allows removal of optional code associated with these definitions: * USE_LIBPARTED_LARGE_SECTOR_SUPPORT Fallback code reporting ignored device with logical sector size other than 512 bytes. * ENABLE_PT_REREAD_WORKAROUND Fallback code re-attempting to inform the kernel of partition changes. [1] GNU Parted 2.2 release announcement http://lists.gnu.org/archive/html/info-gnu/2010-02/msg00016.html [2] NEWS file from GNU Parted 2.2 http://git.savannah.gnu.org/cgit/parted.git/tree/NEWS?h=v2.2 [3] 8b42bab1eea572a2a43e99e3d86fe93920675599 modern-gtk2: Require Gtkmm version 2.24 (!17) Closes !22 - Increase minimums to libparted 2.2 and glibmm 2.32 2019-01-20 Carmen Bianca BAKKER Update Esperanto translation 2019-01-02 Anders Jonsson Update Swedish translation 2018-12-28 Yuras Shumovich Add Belarusian translation 2018-12-13 Curtis Gedak Update name typo in NEWS file 2018-12-13 Curtis Gedak Append -git to version for continuing development 2018-12-13 Curtis Gedak ========== gparted-0.33.0 ========== 2018-12-11 Milo Casagrande Update Italian translation 2018-12-09 Baurzhan Muftakhidinov Update Kazakh translation 2018-12-06 Daniel Șerbănescu Update Romanian translation 2018-12-06 Daniel Șerbănescu Update Romanian translation 2018-12-05 Kristjan SCHMIDT Update Esperanto translation 2018-10-14 Mike Fleetwood Strip unnecessary scope from GParted::STAT_* (!20) The code inconsistently uses GParted:: scope in front of STAT_*. $ fgrep 'GParted::STAT_' src/*.cc | wc -l 3 $ egrep '[^:]STAT_' src/*.cc | wc -l 41 GParted:: scope resolution is unnecessary as all the code is inside the GParted scope, except for main(). So remove it. Closes !20 - Minor namespace and scope operator tidy-ups 2018-10-14 Mike Fleetwood Strip unnecessary scope from GParted::TYPE_* (!20) The code inconsistently uses GParted:: scope in front of TYPE_*. $ fgrep 'GParted::TYPE_' src/*.cc | wc -l 35 $ egrep '[^:]TYPE_' src/*.cc | wc -l 83 GParted:: scope resolution is unnecessary as all the code is inside the GParted scope, except for main(). So remove it. Closes !20 - Minor namespace and scope operator tidy-ups 2018-10-14 Mike Fleetwood Strip unnecessary scope from GParted::FS_* (!20) The code inconsistently uses GParted:: scope in front of FS_*. $ fgrep 'GParted::FS_' src/*.cc | wc -l 41 $ egrep '[^:]FS_' src/*.cc | wc -l 441 GParted:: scope resolution is unnecessary as all the code is inside the GParted namespace, except for main(). So remove it. Closes !20 - Minor namespace and scope operator tidy-ups 2018-10-13 Mike Fleetwood Strip unnecessary scope from GParted::FS::* (!20) The code inconsistency uses GParted::FS::* and FS::*. $ fgrep 'GParted::FS::' src/*.cc | wc -l 97 $ egrep '[^:]FS::' src/*.cc | wc -l 152 GParted:: scope resolution is unnecessary as all the code is inside the GParted namespace, except for main(). So remove it. Closes !20 - Minor namespace and scope operator tidy-ups 2018-11-22 Mike Fleetwood Put Frame_Resizer_{Base,Extended} modules into GParted namespace (!20) All the other modules are in the GParted namespace, except for main() which has to be in the global namespace, so put these in the GParted namespace too. Closes !20 - Minor namespace and scope operator tidy-ups 2018-11-25 Aurimas Černius Updated Lithuanian translation 2018-11-18 Mike Fleetwood Fix false usage figures for busy SWRAID members (#27) Create an active Linux Software RAID member which is larger than /dev virtual file system and GParted will report the usage figure of the /dev virtual file system for the SWRAID member. # df -h /dev Filesystem Size Used Avail Use% Mounted on devtmpfs 732M 0 732M 0% /dev # sgdisk -n 1:1M:+1G /dev/sdb # mdadm --create --verbose /dev/md1 --level=linear --raid-devices=1 --force /dev/sdb1 mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md1 started. GParted reports the usage of /dev/sdb1 as: Partition Mount Point Size Used Unused Unallocated /dev/sdb1 /dev/md1 1.00GiB 0.00B 731.04MiB 292.96MiB However GParted should have reported the usage as "---" for unknown because it isn't coded to query the size of the SWRAID member within a partition. The fault has been bisected to this commit: Extend un/mounting and usage reporting to unsupported file systems (!13) 95903efb1f284f3d6819f38e894dc6c3464b2183 What happens for busy Linux Software RAID array members: * GParted_Core::is_busy() has custom code to identify busy members. * GParted_Core::set_mountpoints() has custom code to add the array device name as the "mount point" of the member. * GParted_Core::set_used_sectors() falls into the else not a supported file system (because SWRAID doesn't have a derived FileSystem implementation class). * GParted_Core::mounted_set_used_sectors() is called to get the file system usage of mounted, but unsupported file systems, such as UFS and any others. * Utils::get_mounted_filesystem_usage() is called which queries the kernel using statvfs() and gets the file system usage of the /dev virtual file system because the array device name will always start /dev. Fix by ensuring that GParted only asks the kernel for the usage of paths which it knows are mount points of mounted file systems. (As read from /proc/mounts and cached in the Mount_Info module). Also rename the method, by inserting "_fs", to mounted_fs_set_used_sectors() to remind us that it is for mounted *file systems* only. Closes #27 - GParted may report incorrect usage for SWRAID partitions instead of unknown S 2018-10-30 Mike Fleetwood Recognise contribution by Luca Bacci 2018-08-02 Luca Bacci modern-gtk2: Use Cairo for drawing the partition visualizer (!17) Third commit in a series to convert Gdk::GC based drawing to Cairo based drawing. This specific commit makes the transition for the graphical partition visualizer widget that is used in the main application window. Closed !17 - Gtk2 modernisation 2018-08-02 Luca Bacci modern-gtk2: Use Cairo for drawing the partition info (!17) Second commit in a series to convert Gdk::GC based drawing to Cairo based drawing. This specific commit makes the transition for the graphical partition info widget that is used in the "Information about" dialog. Closes !17 - Gtk2 modernisation 2018-08-02 Luca Bacci modern-gtk2: Use Cairo for drawing the partition resizer (!17) GdkGC has been deprecated in the underlying C / GTK+ 2.22 library. It is less clearly stated but Gdk::GC is also deprecated in C++ / gtkmm. Cairo based rendering should be used instead. https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html https://gitlab.gnome.org/GNOME/gtk/blob/2.22.0/NEWS#L124 https://developer.gnome.org/gtkmm/2.24/classGdk_1_1GC.html First commit in a series to convert Gdk::GC based drawing to Cairo based drawing. This specific commit makes the transition for the graphical partition resizing widget that is used in the "Create New Partition", "Paste" creating new partition and "Resize/Move" dialogs. Cairo is not pixel based but instead uses a continuous coordinate space. To draw in a pixel aligned way follow the guidance in the Cairo FAQ. https://www.cairographics.org/FAQ/#sharp_lines Additional references: https://developer.gnome.org/gdk2/stable/gdk2-Drawing-Primitives.html#gdk-draw-line https://developer.gnome.org/gdk2/stable/gdk2-Drawing-Primitives.html#gdk-draw-rectangle Closes !17 - Gtk2 modernisation 2018-10-27 Luca Bacci modern-gtk2: Delay construction of Gtk::TreeModel* objects (!17) C++ initialises static member variables before main() is called. Therefore the static members of: struct Slots { static Gtk::TreeModelColumn text; static Gtk::TreeModelColumn sensitive; private: static Gtk::TreeModel::ColumnRecord record_; }; are constructed before Gtk::Main() is called in main(). However the Gtkmm documentation specifically says that they must be constructed afterwards [1]. Resolve this by using the Construct On First Use Idiom [2] to delay initialisation until the slots are first used. Normally this idiom uses static local objects, however it is being applied to class static objects here because the objects are accessed in many methods. The downside of this approach is that the objects are never destructed, which memory analysers like Valgrind could see as a memory leak, but that is actually deliberate. That leak can be removed once we can use C++11 and std::unique_ptr. [1] gtkmm: Gtk::TreeModelColumnRecord Class Reference https://developer.gnome.org/gtkmm/2.24/classGtk_1_1TreeModelColumnRecord.html#details "Neither TreeModel::ColumnRecord nor the TreeModelColumns contain any real data - they merely describe what C++ type is stored in which column of a TreeModel, and save you from having to repeat that type information in several places. Thus TreeModel::ColumnRecord can be made a singleton (as long as you make sure it's instantiated after Gtk::Main), even when creating multiple models from it. " [2] C++ FAQ / How do I prevent the "static initialization order problem"? https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use Closes !17 - Gtk2 modernisation 2018-08-03 Luca Bacci modern-gtk2: Rename callback after OptionComboBox class switch (!17) Final part in a series of commits to replace Gtk::OptionMenu widgets with GParted::OptionComboBox. This specific commit renames the signal handler callback to match the previously renamed combobox widget variable names. Closes !17 - Gtk2 modernisation 2018-07-31 Luca Bacci modern-gtk2: Use OptionComboBox class for file system combobox (!17) Third part in a series of commits to replace Gtk::OptionMenu widgets with GParted::OptionComboBox. This specific commit is about file system combobox. Closes !17 - Gtk2 modernisation 2018-07-31 Luca Bacci modern-gtk2: Use OptionComboBox class for partition type combobox (!17) Second part in a series of commits to replace Gtk::OptionMenu widgets with GParted::OptionComboBox. This specific commit is about partition type combobox. Closes !17 - Gtk2 modernisation 2018-07-31 Luca Bacci modern-gtk2: Use OptionComboBox class for alignment combobox (!17) First part in a series of commits to replace Gtk::OptionMenu widgets with GParted::OptionComboBox. This specific commit is about partition alignment combobox. Closes !17 - Gtk2 modernisation 2018-07-30 Luca Bacci modern-gtk2: Introduce OptionComboBox class (!17) Gtk::OptionMenu is a combobox type widget that is constructed from a Gtk::Menu rather than a Gtk::TreeModel. However Gtk::OptionMenu was deprecated in gtkmm 2.4.1. In GParted the Gtk::OptionMenu widget is used for: - partition alignment combobox - partition type combobox - file system combobox While they consist only of text we cannot use Gtk::ComboBoxText because it doesn't expose functionality in its interface to make items inactive. Create OptionComboBox helper class that builds a combobox consisting of only text items, much like Gtk::ComboBoxText, but has the added functionality to set items as inactive. References: https://developer.gnome.org/gtkmm/2.24/classGtk_1_1OptionMenu.html#details https://gitlab.gnome.org/GNOME/gtkmm/blob/GTKMM_2_10_1/ChangeLog#L3515 https://gitlab.gnome.org/GNOME/gtkmm/commit/bba503b0473413e474d9b6d297226479d29fd47f https://developer.gnome.org/gtkmm/2.24/classGtk_1_1ComboBoxText.html Closes !17 - Gtk2 modernisation 2018-08-13 Luca Bacci modern-gtk2: Use Gtk::Widget::set_tooltip_text() (!17) GParted was using Gtk::Tooltips widgets for tooltips, but they were deprecated in gtkmm 2.12 in favour of Gtk::Tooltip widgets. (Note the spelling difference, with and without a trailing 's'). As GParted's tooltips are all text only continue to use the shortcut, which is now Gtk::Widget::set_tooltip_text(). References: https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Tooltips.html#details https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Tooltip.html#details https://gitlab.gnome.org/GNOME/gtkmm/blob/2.20.0/NEWS#L740 Closes !17 - Gtk2 modernisation 2018-08-13 Luca Bacci modern-gtk2: Use Gtk::MenuItem::unset_submenu() (!17) Gtk::MenuItem::remove_submenu() was deprecated in gtkmm 2.12. Replace with Gtk::MenuItem::unset_submenu() introduced in gtkmm 2.22. References: https://developer.gnome.org/gtkmm/2.24/classGtk_1_1MenuItem.html https://gitlab.gnome.org/GNOME/gtkmm/blob/2.22.0/NEWS#L24 Closes !17 - Gtk2 modernisation 2018-08-11 Luca Bacci modern-gtk2: Use Gtk::AboutDialog::set_program_name() (!17) Gtk::AboutDialog::set_name() was deprecated in gtkmm 2.12. Replace with Gtk::AboutDialog::set_program_name(). References: https://developer.gnome.org/gtkmm/2.24/classGtk_1_1AboutDialog.html https://gitlab.gnome.org/GNOME/gtkmm/blob/2.20.0/NEWS#L741 Closes !17 - Gtk2 modernisation 2018-08-10 Luca Bacci modern-gtk2: Use Gtk::AlignmentEnum::ALIGN_START (!17) Gtkmm 2.22 deprecated Gtk::AlignmentEnum::ALIGN_{LEFT,RIGHT,TOP,BOTTOM} replacing with Gtk::AlignmentEnum::ALIGN_{START,END}. References: https://developer.gnome.org/gtkmm/2.24/group__gtkmmEnums.html#ga98983d4e80f67ffa5148dd554706ffac https://gitlab.gnome.org/GNOME/gtkmm/blob/2.22.0/NEWS#L14 Closes !17 - Gtk2 modernisation 2018-08-10 Luca Bacci modern-gtk2: Use Gtk::TreeView::Column::get_first_cell() (!17) Gtk::TreeView::Column::get_first_cell_renderer() was deprecated in gtkmm 2.24. Replace with Gtk::TreeView::Column::get_first_cell(). References: https://developer.gnome.org/gtkmm/2.24/classGtk_1_1TreeViewColumn.html https://gitlab.gnome.org/GNOME/gtkmm/blob/2.24.0/NEWS#L64 Closes !17 - Gtk2 modernisation 2018-08-10 Luca Bacci modern-gtk2: Use Gtk::ComboBoxText::append() (!17) Gtk::ComboBoxText::append_text() was deprecated in gtkmm 2.24. Replace with Gtk::ComboBoxText::append(). References: https://developer.gnome.org/gtkmm/2.24/classGtk_1_1ComboBoxText.html https://gitlab.gnome.org/GNOME/gtkmm/blob/2.24.0/NEWS#L20 Closes !17 - Gtk2 modernisation 2018-08-27 Luca Bacci modern-gtk2: Always use Gtk::MessageDialog::get_message_area() (!17) Remove check for Gtk::Messagedialog::get_message_area() and associated fallback code as it is always available from gtkmm 2.22. Reference: https://gitlab.gnome.org/GNOME/gtkmm/blob/2.22.0/NEWS#L25 Closes !17 - Gtk2 modernisation 2018-08-26 Luca Bacci modern-gtk2: Require Gtkmm version 2.24 (!17) Require the latest minor version of gtkmm2, released back in 2011 [1]. This is the first step in porting to Gtk3 [2]. This drops GParted support for very old but still supported distributions: Distribution EOL Gtkmm RHEL / CentOS 6 2020-Nov 2.18.2 SLES 11 2022-Mar 2.14.1 References: [1] ANNOUNCE: gtkmm 2.24.0 https://mail.gnome.org/archives/gtkmm-list/2011-February/msg00038.html [2] Migrating from GTK+ 2.x to GTK+ 3 / Preparation in GTK+ 2.x https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#id-1.6.3.3 Closes !17 - Gtk2 modernisation 2018-08-27 Luca Bacci Use Gtk::Viewport wrapper class There is a GtkViewport wrapper class in gtkmm, Gtk::Viewport. Make use of that class instead of direct gtk calls. Reference: https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Viewport.html 2018-07-30 Luca Bacci .gitignore: Do not track compile script Automake 1.14 also now always creates the 'compile' script. http://git.savannah.gnu.org/cgit/automake.git/tree/NEWS?h=v1.14#n110 2018-11-11 Mike Fleetwood Enhance comment about the 3 levels of file system support Add a little extra explaining how the file systems' supported actions are determined. 2018-10-28 Mike Fleetwood Improve translation help for "unformatted" file system type 2018-11-10 Mike Fleetwood Adjust shades of aquamarine, cyan and orange The shades of aquamarine, cyan and orange didn't fit with the GNOME 32-colour palette. Create a set of aquamarine, cyan and orange shades which match the GNOME palette shades and update the colours of the relevant file systems accordingly. Aquamarine Hilight (#97DFC7) - Aquamarine Medium (#70D2B1) - NTFS Aquamarine Dark (#3EA281) - REFS Aquamarine Shadow (#1F7258) - Cyan Hilight (#95E3E5) - EXTENDED Cyan Medium (#6FCECE) - Cyan Dark (#3C9899) - Cyan Shadow (#166F70) - Orange Hilight (#E59F6A) - Orange Medium (#E58749) - BTRFS Orange Dark (#C26825) - ZFS Orange Shadow (#984F18) - Note that the hues of aquamarine and cyan are quite close and for the thin outlines of partitions used in GParted they aren't easy to distinguish. Hence also using different lightness to additionally separate the colour for extended partitions from NTFS and ReFS file systems. 2018-11-07 Mike Fleetwood Recognise APFS (Apple File System) (#23) Just add detection of APFS using GParted's internal magic string detection. It just matches 1 byte of the 2 byte object type and the 4 byte magic field found in the super block [1]. See code comment for more details. Blkid has just gained recognition of APFS with util-linux v2.33 released 06-Nov-2018 [2]. This will write enough for GParted's simple internal detection to find APFS: # python -c ' import sys sys.stdout.write("\0"*24 + "\1\0" + "\0"*6 + "NXSB") ' > /dev/sdb1 [1] Apple File System Reference https://developer.apple.com/support/apple-file-system/Apple-File-System-Reference.pdf [2] [ANNOUNCE] util-linux v2.33 https://marc.info/?l=linux-fsdevel&m=154150400305928&w=2 Closes #23 - GParted doesn't detect APFS (Apple File System) 2018-11-10 Mike Fleetwood Switch HFS and HFS Plus colours to a magenta range (#23) Currently Linux Swap, Linux Suspend, and HFS use reds from the GNOME 32-colour palette with HFS Plus using serene red outside that palette. HFSPLUS - Serene Red HFS - Red Hilight LINUX_SWAP - Red Medium LINUX_SUSPEND - Red Dark - Red Shadow Apple have a new file system, APFS (Apple File System), which is a successor to HFS Plus [1][2]. With HFS Plus using a colour outside the GNOME 32-colour palette and there not being enough distinct reds available for a new file system, create a new range of magenta colours which fit with the GNOME palette and use them for the group of Apple file systems. Magenta Hilight (#D59FD4) - HFS Magenta Medium (#B173B0) - HFSPLUS Magenta Dark (#874986) - APFS Magenta Shadow (#662C64) - This commit just moves HFS and HFS Plus to their new magenta colours. [1] About Apple File System https://developer.apple.com/documentation/foundation/file_system/about_apple_file_system "Overview Apple File System replaces HFS Plus as the default file system for iOS 10.3 and later, and for macOS High Sierra and later. Apple File System offers improved file system fundamentals as well as several new features, including cloning, snapshots, space sharing, fast directory sizing, atomic safe-save, and sparse files. " [2] Apple File System Reference https://developer.apple.com/support/apple-file-system/Apple-File-System-Reference.pdf "About Apple File System Apple File System is the default file format used on Apple platforms. Apple File System is the successor to HFS Plus, so some aspects of its design intentionally follow HFS Plus to enable data migration from HFS Plus to Apple File System. Other aspects of its design address limitations with HFS Plus and enable features such as cloning files, snapshots, encryption, and sharing free space between volumes. " Closes #23 - GParted doesn't detect APFS (Apple File system) 2018-11-02 Daniel Mustieles Updated Spanish translation 2018-11-02 Alan Mortensen Updated Danish translation 2018-10-21 Emin Tufan Çetin Update Turkish translation 2018-10-08 Curtis Gedak Update GParted appdata file (#12) Closes #12 - Appstream metadata needs valid license 2018-10-05 Rafael Fontenelle Update Brazilian Portuguese translation 2018-10-04 Stas Solovey Update Russian translation 2018-09-20 Mike Fleetwood Update GParted appdata file (#12) Update appdata file to be inline with the current AppStream specification [1]. Start by running: appstream-util upgrade gparted.appdata.xml.in and then editing the appdata as wanted. Ensure that the file passes validation: appstream-util validate-relax --nonet gparted.appdata.xml.in When Richard Hughes added the appdata file he licensed it under the GFDL but assigned the copyright to Curtis Gedak [3]. Now change the license to CC0-1.0 [4] as that is what most appdata files are licensed under [5][6]. Curtis Gedak agrees to this by reviewing this change and being the committer of this commit. [1] AppStream specification https://www.freedesktop.org/software/appstream/docs/ [2] Fedora Packaging Guidelines for AppData Files https://fedoraproject.org/wiki/Packaging:AppData [3] 640f92790b7cc5e91f367dfaa01a02a7497afbb4 Add an AppData file (#709164) [4] CC0 1.0 Universal (CC0 1.0) Public Domain Dedication https://creativecommons.org/publicdomain/zero/1.0/ [5] Issue #12 - Appstream metadata needs valid license https://gitlab.gnome.org/GNOME/gparted/issues/12 [6] Merge Request !15, note 331954 - Update GParted appdata file https://gitlab.gnome.org/GNOME/gparted/merge_requests/15#note_331954 Closes #12 - Appstream metadata needs valid license 2018-09-23 Piotr Drąg Update Polish translation 2018-09-22 gogo Update Croatian translation 2018-09-22 Marek Černocký Updated Czech translation 2018-09-21 Bernd Homuth Update German translation 2018-09-19 Mike Fleetwood Disallow resizing btrfs if any of it's mount points are read-only (#10) No other file system allows this, but btrfs allows simultaneous mounting with different read-write permission. Further, btrfs allows resizing via read-write mounts, but not via read-only mounts. # mkfs.btrfs /dev/sdb1 btrfs-progs v4.15.1 ... Filesystem size: 512.00MiB ... Number of devices: 1 Devices: ID SIZE PATH 1 512.00MiB /dev/sdb1 # mount -o ro /dev/sdb1 /mnt/1 # mount -o rw /dev/sdb1 /mnt/2 # grep sdb1 /proc/mounts /dev/sdb1 /mnt/1 btrfs ro,relatime,space_cache,subvolid=5,subvol=/ 0 0 /dev/sdb1 /mnt/2 btrfs rw,relatime,space_cache,subvolid=5,subvol=/ 0 0 # btrfs filesystem resize 1:500M /mnt/1 Resize '/mnt/1' of '1:500M' ERROR: unable to resize '/mnt/1': Read-only file system # echo $? 1 # btrfs file system resize 1:500M /mnt/2 Resize '/mnt/2' of '1:500M' # echo $? 0 # btrfs filesystem show /dev/sdb1 Label: none uuid: 74ccd37a-e665-4f25-b77e-a305b8a025e9 Total devices 1 FS bytes used 128.00KiB devid 1 size 500.00MiB used 88.00MiB path /dev/sdb1 Also with the above order of the read-only mount listed in /proc/mounts first and the read-write mount second, GParted again allows a resize operational to be tried, but if fails just like before: Grow /dev/sdb1 from 512.00 MiB to 1.0 GiB (ERROR) * calibrate /dev/sdb1 (SUCCESS) * grow partition from 512.00 MiB to 1.00 GiB (SUCCESS) * grow filesystem to fill the partition (ERROR) * btrfs filesystem resize 1:max '/mnt/1' (ERROR) Resize '/mnt/1 to '1:max' ERROR: unable to resize '/mnt/1': Read-only file system What happened is that the Mount_Info module only stores single read-only flag against the mounted block device, not for each mount point, and as the first and second sdb1 lines from /proc/mounts were processed, the MountEntry became: 1st) mount_info[BS("/dev/sdb1")] -> {true , ["/mnt/1"] 2nd) mount_info[BS("/dev/sdb1")] -> {false, ["/mnt/1", "/mnt/2"] So GParted thought the file system was mounted read-write, but used the first mount point, /mnt/1, which was mounted read-only. This is a very unusual situation so unlikely to be encountered by users. Fix simply and safely by treating the mounted block device as mounted read-only if any of the mount points are mounted read-only, rather than just the last processed mount point. Closes #10 - Gparted fails to resize btrfs partition that is mounted read-only 2018-09-17 Mike Fleetwood Prevent online resizing of file systems mounted read-only (#10) Resizing a file system mounted read-only fails. Example: # mkfs.btrfs /dev/sdb1 # mount -o ro /dev/sdb1 /mnt/1 In GParted try to resize partition sdb1. The operation fails like this: Grow /dev/sdb1 from 512.00 MiB to 1.00 GiB (ERROR) * calibrate /dev/sdb1 (SUCCESS) * grow partition from 512.00 MiB to 1.00 GiB (SUCCESS) * grow filesystem to fill the partition (ERROR) * btrfs filesystem resize 1:max '/mnt/1' (ERROR) Resize '/mnt/1' of '1:max' ERROR: unable to resize '/mnt/1': Read-only file system See GitLab issue for the testing results of attempting to online resize all supporting file system while mounted read-only. No file system allows online resizing while mounted read-only, except for reiserfs. Issue #10 - Gparted fails to resize btrfs partition that is mounted read-only https://gitlab.gnome.org/GNOME/gparted/issues/10 Fix by preventing online resizing of *all* file systems mounted read-only, including reiserfs. Instead of displaying the resize dialog in this case, display an information dialog explaining why the partition can't be resized. This is similar to what happens when attempting to create a new partition on a disk without a partition table. The new dialog looks like: (!) Unable to resize read-only file system /dev/sdb1 The file system can not be resized while it is mounted read-only. Either unmount the file system or remount it read-write. [ OK ] Closes #10 - Gparted fails to resize btrfs partition that is mounted read-only 2018-09-17 Mike Fleetwood Add and set read-only mount flag in the Partition object (#10) Set the partition read-only mount flag at the same time as setting the file system mount points. Closes #10 - Gparted fails to resize btrfs partition that is mounted read-only 2018-09-17 Mike Fleetwood Add parsing of read-only mount option into mount maps (#10) Parse file system mount options string from file and mount command output, extracting the setting for the read-only flag and storing in the mount maps. Read-only flag for swap space gets the struct MountEntry constructor default of false. Closes #10 - Gparted fails to resize btrfs partition that is mounted read-only 2018-09-17 Mike Fleetwood Add read-only flag to mounted file system entries (#10) Just updates the 2 maps in the Mount_Info module so that they also have a read-only flag for each mount. Ensure that when a struct MountEntry is created the readonly bool POD (Plain Old Data) type is initialised by the constructor. Nothing yet sets or uses the flag. Closes #10 - Gparted fails to resize btrfs partition that is mounted read-only 2018-09-19 gogo Update Croatian translation 2018-09-18 Mario Blättermann Update German translation 2018-09-18 Marek Cernocky Updated Czech translation 2018-09-11 Mike Fleetwood White space tidy-up of Utils::get_filesystem_string() Use smart tab alignment, list cases in enumeration order and update translation help for unallocated space. 2018-09-05 Mike Fleetwood Replace open coding FS unknown usage check in prepare_new_partition() Back when unallocated space handling was being added, this case was not converted from open coding to using the provided method to check for unknown file system usage. Specifically this commit missed using Partition::sector_usage_known() in Dialog_Base_Partition::prepare_new_partition(): 7ebedc4bb3b81e85fb4c628a2a05308ada147d68 Don't show intrinsic unallocated space (#499202) Fix it now. 2018-09-10 Mike Fleetwood Refactor get_filesystem_object() The function was using std::map::count() [1] to test if the file system entry existed in the map before looking up the value using std::map::operator[] to avoid having operator[] inserting elements which don't exist [2]. Rewrite using std::map::find() [3] so that map is only searched once, and so that it is more obvious what is happening without having to know the subtleties of std::map::count() and ::operator[]. [1] std::map::count() http://www.cplusplus.com/reference/map/map/count/ "Searches the container for elements with a key equivalent to k and returns the number of matches. Because all elements in a map container are unique, the function can only return 1 (if the element is found) or zero (otherwise). " [2] std::map::operator[] http://www.cplusplus.com/reference/map/map/operator[]/ "If k does not match the key of any element in the container, the function inserts a new element with that key and returns a reference to its mapped value. Notice that this always increases the container size by one, even if no mapped value is assigned to the element (the element is constructed using its default constructor). " [3] std::map::find http://www.cplusplus.com/reference/map/map/find/ "Searches the container for an element with a key equivalent to k and returns an iterator to it if found, otherwise it returns an iterator to map::end. " 2018-09-07 Mike Fleetwood Re-assign UFS to be a basic supported file system (!13) There is no prospect of there being ufs-tools on Linux. The was a project which did release ufs-tools version 0.1 in 2004, but has been inactive since then. http://ufs-linux.sourceforge.net/ Copying and moving is now implemented for file systems in the basic supported category. Also mounting and unmounting of unsupported file system and reporting their usage while mounted has been added. This is all the support that GParted has ever implemented for UFS. Therefore re-assign UFS as a basic supported file system as it looses no functionality. Closes !13 - Support copying and moving of unsupported partition content 2018-09-06 Mike Fleetwood Extend un/mounting and usage reporting to unsupported file systems (!13) For unsupported (including basic supported) file systems, also record the mount point(s) when mounted and from /etc/fstab when not. This allows mounted unsupported file systems to be unmounted and ones with /etc/fstab entries to be mounted, just like fully supported file systems. Also for unsupported (again including basic supported) mounted file systems query the kernel for the usage, just like is already done for supported file systems. Closes !13 - Support copying and moving of unsupported partition content 2018-09-04 Mike Fleetwood Correctly preview unknown FS usage when pasting into an existing partition (!13) When previewing copying a partition of unknown file system usage into an existing partition, the usage still shows that of the overwritten file system. This affects existing supported file systems EXFAT, F2FS, MINIX and UFS and the new basic supported one too, all for which GParted can't read the file system usage. Handle the case of the source file system usage being unknown and explicitly set the copied usage to unknown too. Closes !13 - Support copying and moving of unsupported partition content 2018-09-03 Mike Fleetwood Correctly preview unknown FS usage when pasting into a new partition (!13) GParted previews copying a partition of unknown file system usage into a new partition as 100% used. This affects existing supported file systems EXFAT, F2FS, MINIX and UFS and the new basic supported ones too, all for which GParted can't read the file system usage. When preparing the working new_partition object in the Copy / Paste dialog, the maths for the known file system usage happened to convert the figures of used = -1 and unused = -1 into set_sector_usage(-1, 0). Those values passed to set_sector_usage() mean unable to query the file system size so assume it fills the partition and unused is 0, hence 100% used. Fix this by specifically handling the copying of file systems with unknown usage, setting the pasted file system usage to unknown too, used = -1 and unused = -1. Closes !13 - Support copying and moving of unsupported partition content 2018-09-08 Mike Fleetwood Display "other" in the File System Support dialog (!13) To display the supported actions for all basic supported file systems to the users. Prepare the list of file system actions in Win_GParted because calling get_fs() for the "other" actions requires the gparted_core object and load_filesystems() currently doesn't have access to it. One alternative would have been to make get_fs() and FILESYSTEMS static members of GParted_Core class. Another alternative would have been to pass the gparted_core object to load_filesystems(). The chosen way seemed simplest. Closes !13 - Support copying and moving of unsupported partition content 2018-09-07 Mike Fleetwood Add "other" file system type (!13) Want a single term under which the supported actions for all basic supported file systems are displayed in the File System Support dialog. "Unknown" isn't the correct adjective because the group includes unknown, but also includes: BitLocker, GRUB2 core image, ISO9660, Linux SWRaid, Linux Suspend, REFS and ZFS. Add "other" file system type just for displaying in the dialog. Closes !13 - Support copying and moving of unsupported partition content 2018-09-10 Mike Fleetwood Enable copy and move for basic supported file systems (!13) Add copy and move supported action set for each basic supported file system. Closes !13 - Support copying and moving of unsupported partition content 2018-09-10 Mike Fleetwood Limit FILESYSTEM_MAP entries to supported and basic supported FSs (!13) Introduce a third category of basic file system support to go along with the existing full and none. Use the file system's entry in FILESYSTEM_MAP to determine the level of support. See comment in GParted_Core::init_filesystems() for details. Add and remove FILESYSTEM_MAP NULL pointer entries as required, so that only the file system types intended to have basic support have such entries. Closes !13 - Support copying and moving of unsupported partition content 2018-09-10 Mike Fleetwood Separate unknown file system type from unsupported actions (!13) PATCHSET OVERVIEW: Forum user wanted to be able to move a partition with unknown content: Topic: Can't move/rezise partition on android device (unknown format) http://gparted-forum.surf4.info/viewtopic.php?id=17742 While GParted isn't going to be able to run any sort of file system check on the unknown content there isn't any reason why such a partition can't be copied or moved so long as the partition stays the same size. GParted can just use it's existing internal block copy routine it uses for copying and moving most partition content. This is no different to a few of the already supported file system types which don't have a check-repair tool: exfat, f2fs, nilfs2, udf, ufs. This patchset introduces a third category called basic file system support to go along with the existing full and unsupported categories. Basic supported file systems will just use GParted's inbuilt capabilities to perform actions so they won't need a derived FileSystem implementation class. Unknown file systems along with all other recognised, but otherwise unsupported, file systems will be assigned to this new basic supported category. THIS PATCH: FS_UNKNOWN is used when GParted is unable to identify the contents of a partition. FS_UNKNOWN is also used to generate a file system support set with no supported actions, in the FileSystem::FS::FS() constructor and in GParted_Core::get_fs(). As support for operations on partitions with unknown content is being added, the second usage will be confusing or even wrong. FS( FS_UNKNOWN ) constructs the no supported actions set, yet GParted will support some actions for the FS_UNKNOWN file system type. Therefore add FS_UNSUPPORTED for the second usage. Closes !13 - Support copying and moving of unsupported partition content 2018-09-17 Marek Cernocky Updated Czech help translation 2018-09-07 Alan Mortensen Updated Danish translation 2018-09-07 Marek Cernocky Updated Czech translation 2018-09-05 Anders Jonsson Update Swedish translation 2018-09-04 Efstathios Iosifidis Update Greek translation 2018-09-02 gogo Update Croatian translation 2018-09-01 Rafael Fontenelle Update Brazilian Portuguese translation 2018-09-01 Rafael Fontenelle Update Brazilian Portuguese translation 2018-09-01 Rafael Fontenelle gparted.xml: closed -> closes The Open and Close pages use third person present tense for the "Choose:" paragraph. On the Close instruction, it had "closed" next to a "refreshes". So this commit simply applies present tense to "closed". 2018-08-28 Emin Tufan Çetin Update Turkish translation 2018-08-27 Kukuh Syafaat Update Indonesian translation 2018-08-26 Piotr Drąg Update Polish translation 2018-08-25 Mario Blättermann Update German translation 2018-08-24 Mike Fleetwood White space tidy-up of Utils::get_color() No functional change. The code layout is old and a mess, not lining up vertically. Use more common code layout and spaces to align text vertically. List cases in enumeration order. Identify each colour choice as either in the GNOME palette (no marking), an extended shade to a colour in the GNOME palette [+], or a colour outside the GNOME palette [*]. There's lots of other switch statements just in Utils.cc which could do with tidying up, but this is the one I am looking at now. 2018-08-06 Mike Fleetwood Switch FAT16/32 colours to Accent Greens from the GNOME palette FAT16 was a fully saturated green (RGB #00FF00) and FAT32 was a little darker. These are out of character with the colours from the GNOME palette for other file systems. Change the colours to use near alternative Accent Greens from the GNOME colour palette. So now we have the following file system colours, from light to dark: FAT16 - Accent Green Hilight FAT32 - Accent Green EXFAT - Accent Green Dark UDF - Accent Green Shadow Strictly speaking only Accent Green and Accent Green Dark are part of the GNOME palette. Accent Green Hilight and Accent Green Shadow are extensions expanding the range of Accent Greens. GNOME Human Interface Design 2.2.1 / Visual Design / colour / https://developer.gnome.org/hig-book/2.32/design-color.html.en "Guidelines * Use the GNOME color palette. If you need a darker or lighter shade, start from one of the colors from the palette and darken or lighten as needed. " 2018-08-19 Mike Fleetwood Add support for minix file system (!12) Util-linux package, at least as far back as version 2.23.2 as found on CentOS 7, provides the mkfs.minix and fsck.minix commands. Also blkid from the same package, recognises minix file systems. Create version 3 file systems because MINIX 3 [1] is the only supported version and that reportedly uses version 3 of the file system [2]. [1] MINIX 3 / History https://en.wikipedia.org/wiki/MINIX_3#History [2] Regarding MINIX 3 file system https://groups.google.com/forum/#!topic/minix3/3-TeHR_23X8 "MINIX 3 uses Minix File System (MFS). More precisely MFS V3." Closes !12 - Add minix file system support 2018-08-20 Mike Fleetwood Use one shade darker blue for EXT2/3/4 file systems (!12) I see the MINIX file system as a kind of forerunner to EXT* because of it's history [1]. No body uses the original EXT file system any more, however the MINIX file system is still used by the MINIX 3 operating system. So use the same range of colours for MINIX and EXT2/3/4. Use one shade darker blue for EXT2/3/4, allowing MINIX to use the lightest blue. After adding MINIX support in the next patch, the colours will become: MINIX - Blue Hilight EXT2 - Blue Medium EXT3 - Blue Dark EXT4 - Blue Shadow [1] MINIX file system / History https://en.wikipedia.org/wiki/MINIX_file_system#History "When Linus Torvalds first started writing his Linux operating system kernel (1991), he was working on a machine running MINIX, and adopted its file system layout. This soon proved problematic, since MINIX restricted filename lengths to fourteen characters (thirty in later versions), it limited partitions to 64 megabytes, and the file system was designed for teaching purposes, not performance. The Extended file system (ext; April 1992) was developed to replace MINIX's, but it was only with the second version of this, ext2, that Linux obtained a commercial-grade file system. As of 1994, the MINIX file system was "scarcely in use" among Linux users. " Closes !12 - Add minix file system support 2018-08-24 Mike Fleetwood Update bug links in the UI translation files too (!11) The translations which have been updated for the 0.32.0 release, and since the migration to GitLab hosting, have been updated with the new GitLab issue bug reporting URL. Update all the remaining translation files to match. Closes !11 - Update bugzilla references 2018-08-22 Curtis Gedak Update bug links from Bugzilla to GitLab issues (!11) - Bugzilla has disabled reporting of new bugs. - Existing Bugzilla bug reports permit new comments only. - New bugs are to be created on GitLab issues. Reference: [GitLab] IMPORTANT: Mass migration plan https://mail.gnome.org/archives/desktop-devel-list/2018-March/msg00023.html Closes !11 - Update bugzilla references 2018-08-22 Curtis Gedak Fix broken XML tag in Romanian translation of help manual 2018-08-22 Curtis Gedak Append -git to version for continuing development 2018-08-22 Curtis Gedak ========== gparted-0.32.0 ========== 2018-08-22 A S Alam Update Punjabi translation 2018-08-21 صفا الفليج Update Arabic translation 2018-08-20 Fabio Tomat Add Friulian translation 2018-08-20 Alan Mortensen Updated Danish translation 2018-08-19 Daniel Șerbănescu Update Romanian translation 2018-08-19 Daniel Șerbănescu Update Romanian translation 2018-08-18 Mario Blättermann Update German translation 2018-08-18 Jiri Grönroos Update Finnish translation 2018-08-18 Hannie Dumoleyn Update Dutch translation 2018-08-17 Mario Blättermann Update German translation 2018-08-17 Aurimas Černius Updated Lithuanian translation 2018-08-17 Baurzhan Muftakhidinov Update Kazakh translation 2018-08-17 Trần Ngọc Quân Updated Vietnamese translation Signed-off-by: Trần Ngọc Quân 2018-08-16 Anders Jonsson Update Swedish translation 2018-08-16 Claude Paroz Updated French translation 2018-08-16 Anders Jonsson Update Swedish translation 2018-08-16 Emin Tufan Çetin Update Turkish translation 2018-08-09 Mike Fleetwood Update help manual with opening and closing encrypted partitions (#795617) Bug 795617 - Implement opening and closing of LUKS mappings 2018-08-13 Yi-Jyun Pan Update Chinese (Taiwan) translation 2018-07-28 Mike Fleetwood Update Autoconf macro AX_CXX_COMPILE_STDCXX_11 to latest serial 18 Update to the latest version of the AX_CXX_COMPILE_STDCXX_11 macro from the Autoconf Archive, Note that the macro now depends on AX_CXX_COMPILE_STDCXX so this macro has to be included too. 2018-07-09 Mike Fleetwood Remove unused member Win_GParted::menu_item Usage of menu_item was removed in this commit from 2006. fb672f5219c5cceaae26246fb2c914478b8d2bbd happy new year ;) fixed some alignment issues removed confirmation dialogs 2018-07-09 Mike Fleetwood Remove unused members Win_GParted::label_device_info[12] Usage of members label_device_info1 and label_device_info2 was removed in this commit from 2004. 8ae5ebb2e6d91e2671851e25659e19a90925d65c several (mostly) i18n related fixes/cleanups 2018-07-30 Mike Fleetwood Re-add getting EXT2/3/4 free space from dumpe2fs as a fallback (#8) If an EXT2/3/4 file system needs checking, then resize2fs will report an error, rather than report the minimum file system size. # mkfs.ext4 /dev/sdb11 # resize2fs -P /dev/sdb11 resize2fs 1.42.9 (28-Dec-2013) Estimated minimum size of the filesystem: 17012 # debugfs -w -R "ssv state 0" /dev/sdb11 # resize2fs -P /dev/sdb11 resize2fs 1.42.9 (28-Dec-2013) Please run 'e2fsck -f /dev/sdb11' first. # echo $? 1 This will prevent GParted reading the file system usage and in turn GParted won't allow the file system to be shrunk. Re-add the previous method of reading the free space from dumpe2fs output as a fallback. With this change, the worst case scenario is that GParted allows the user to attempt to shrink an unclean EXT4 file system, smaller that that which resize2fs allows and gets an error telling them so. As part of the failed shrink operation GParted will have checked the file system so on refresh GParted will get the correct minimum size next time. This scenario only seems to apply to unclean EXT4 file systems because resize2fs has a larger minimum size that the free blocks would suggest because of extra space requirements when resizing EXT4 file systems [1]. [1] e2fsprogs 1.44.3, resize/resize2fs.c:calculate_minimum_resize_size() https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/resize/resize2fs.c?h=v1.44.3#n2946 /* * For ext4 we need to allow for up to a flex_bg worth of * inode tables of slack space so the resize operation can be * guaranteed to finish. */ /* * We need to reserve a few extra blocks if extents are * enabled, in case we need to grow the extent tree. The more * we shrink the file system, the more space we need. * * The absolute worst case is every single data block is in * the part of the file system that needs to be evacuated, * with each data block needs to be in its own extent, and * with each inode needing at least one extent block. */ Closes #8 - Shrinking an EXT4 partition does not respect resize2fs limits 2018-07-19 Mike Fleetwood Use resize2fs -P to get minimum EXT2/3/4 FS size (#8) A user reported GParted failed to shrink an EXT4 file system because GParted tried to shrink it smaller than resize2fs reported minimum size. Operation details were: Shrink /dev/sdc1 from 931.51 GiB to 605.00 GiB (ERROR) calibrate /dev/sdc1 (SUCCESS) path: /dev/sdc1 (partition) start: 63 end: 1953520064 size: 1953520002 (931.51 GiB) check file system on /dev/sdc1 for errors and (if poss...(SUCCESS) e2fsck -f -y -v -C 0 '/dev/sdc1' (SUCCESS) ... 158165624 blocks are used (64.77% of 244190000) ... shrink file system (ERROR) resize2fs -p '/dev/sdc1' 634389176K (ERROR) resize2fs 1.44.2 (14-May-2018) resize2fs: New size smaller than minimum (171882113) The GParted figures: * Partition size = 1953520064 (512b sectors) = 976760032 KiB * FS size = 244190000 (4K blocks) = 976760000 KiB * Used FS size = 158165624 (4K blocks) = 632662496 KiB * Requested FS size = 634389176 KiB The resize2fs figure: * Minimum FS size = 171882113 (4K blocks) = 687528452 KiB GParted uses the number of free blocks in the file system to determine the minimum size it can shrink a file system to. However resize2fs uses it's own internally calculated minimum size and won't shrink a file system below that size, as seen in the above details. Resize2fs does have a force flag, (-f) which overrides some safety checks which are normally enforced, to allow it to try to shrink a file system smaller than it's calculated minimum. GParted currently doesn't use the force flag and it seems unwise for it to start to do so. So for unmounted EXT2/3/4 file systems, change GParted to use 'resize2fs -P' to get the minimum file system size, rather than using the number of free blocks direct from the super block, as reported by 'dumpe2fs -h'. Mounted file systems still use statvfs() to provide file system usage. As mounted EXT2/3/4 file systems can't be shrunk the fact that statvfs() produces different, possibly smaller than minimum, figures than those from 'resize2fs -P' doesn't matter. Closes #8 - Shrinking an EXT4 partition does not respect resize2fs limits 2018-07-30 Mike Fleetwood Work in FS blocks until later while reading EXT2/3/4 usage (#8) No functional change. Just work in FS block sized units until as late as possible in ext2::set_used_sectors(), before converting to device sector size units. This is to make the following change simpler and easier to understand. Closes #8 - Shrinking an EXT4 partition does not respect resize2fs limits 2018-07-24 Mike Fleetwood Stop xmllint scrollkeeper-omf.dtd fetch failure breaking CI tests (#9) The GitLab Continuous Integration test stage jobs can fail like this: $ make check ... Making check in help make[1]: Entering directory `/builds/mfleetwo/gparted/help' ... xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' gparted-C.omf warning: failed to load external entity "http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd" Could not parse DTD http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' gparted-cs.omf ... make[1]: *** [check-doc-omf] Error 2 make[1]: Leaving directory `/builds/mfleetwo/gparted/help' make: *** [check-recursive] Error 1 ERROR: Job failed: exit code 1 It fails when the scrollkeeper.sourceforge.net site reports that SourceForge is undergoing maintenance or is temporarily unavailable. I have seen this occur on 3 separate occasions in the last 4 weeks since I started experimenting with GitLab CI, which is rather too often. Xmllint comes from the GNOME 2 gnome-doc-utils.make rules used to build and validate GNOME 2 documentation. Fragment of useful Debian bug report 730688: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730688 --disable-scrollkeeper requieres scrollkeeper installed "You can reproduce the problem in mdbtoools version 0.7.1-1 with no network, and rarian-compat not installed. When the network is available, buildd downloads the DTD for checks. When there is no network, gnome-doc-utils fails. " Fix by: (1) adding the rarian-compat package to the CI Docker images, which provides a local copy of the scrollkeeper-omf.dtd file; (2) adding the xmllint --nonet option to prevent fetching of DTDs remotely. With reference to earlier commit: 0eb9f1fcfb2a438ecd85ad7e526f0ec3d01e2da6 Reduce dependency on scrollkeeper (#743318) That commit allowed GParted to be installed on GNOME 3 desktops without requiring rarian-compat package to be installed. This commit adds rarian-compat to the CI images so that 'make check' can succeed without accessing the Internet. Just the intricate path to continue to build and test a GNOME 2 application in a world of GNOME 3 desktops with beginning to be reduced backward compatibility. Closes #9 - CI test jobs occasionally fail with xmllint not loading external entity http://scrollkeeper.sourceforce.net/dtds/ scrollkeeper-omf-1.0/scrollkeeper-omf.dtd 2018-07-06 Mike Fleetwood Stop parallelising make distcheck in GitLab CI test jobs (!6) Unfortunately parallelising 'make distcheck' causes it to fail like this: $ nproc=`grep -c '^processor' /proc/cpuinfo` || nproc=1 $ echo nproc=$nproc nproc=8 ... $ make -j $nproc distcheck ... make[1]: Entering directory '/builds/mfleetwo/gparted/gparted-0.31.0-git/_build/sub' ERROR: files left after uninstall: ./share/icons/hicolor/icon-theme.cache Makefile:896: recipe for target 'distuninstallcheck' failed make[1]: Leaving directory '/builds/mfleetwo/gparted/gparted-0.31.0-git/_build/sub' make[1]: *** [distuninstallcheck] Error 1 make: *** [distcheck] Error 1 Makefile:840: recipe for target 'distcheck' failed ERROR: Job failed: exit code 1 Therefore go back to serial 'make distcheck'. Closes !6 - Reduce the time taken by the GitLab CI jobs 2018-07-06 Mike Fleetwood Parallelise building GParted in GitLab CI jobs (!6) Reduce the time taken by the GitLab Continuous Integration jobs by parallelising make to use all available CPUs in the Docker CI image when it is building GParted code. This includes 'make diskcheck' because that also does a second build of the GParted code in a separate subdirectory. Closes !6 - Reduce the time taken by the GitLab CI jobs 2018-06-19 Mike Fleetwood Move enum CUSTOM_TEXT into FileSystem.h The CUSTOM_TEXT enumeration is exclusively used as the type of one of the parameters to the functions get_generic_text() and get_custom_text() in the FileSystem class and derived classes. The definition of the enumeration therefore belongs in FileSystem.h. Move it. 2018-06-13 Mike Fleetwood Set FSType when constructing FS in luks::get_filesystem_support() This is functionally identical, but is just to follow established coding pattern [1] of specifying the FSType when constructing struct FS, rather and setting it afterwards. luks.cc was added after the aforementioned commit, but was being developed in parallel so was created [2] following the old coding pattern. [1] 1a4cefb9601de47a1d4fdd31d60be9e37fadda2d Initialise all struct FS members [2] 070d734e57e8c10cfc4264b34e8bd95bba7cf3ff Add busy detection of LUKS mapping (#760080) 2018-07-17 Mike Fleetwood Recognise additional GRUB2 core.img signatures (!5) Bootinfoscript v0.77 (2018-06-10) added additional signatures to recognise GRUB2 core.img by. Commit: https://github.com/arvidjaar/bootinfoscript/commit/9a00c1a8877c9693ef908211f3dfd264c6172986 Add more core.img diskboot signatures Specifically the new signatures are: 5256be63 - trustedgrub2 1.4 5256be56 - diskboot.S with mjg TPM patches (e.g. in openSUSE Tumbleweed) Add those signatures into GParted. Closes !5 - Recognise additional GRUB2 core.img signatures 2018-06-24 Mike Fleetwood Add CI job to test GParted on Ubuntu (!4) Closes !4 - Add GitLab CI jobs to build and test GParted 2018-06-23 Mike Fleetwood Add CI job to build GParted on Ubuntu (!4) Closes !4 - Add GitLab CI jobs to build and test GParted 2018-06-23 Mike Fleetwood Parameterise CI config ready for also using a Ubuntu image (!4) Prepare the GitLab Continuous Integration configuration for also building and testing GParted on a Ubuntu image. The definition of the image and before_script, which so far specify the CentOS Docker image and how to install the required RPM packages, need to move from being top level nodes to being defined per job. Namely within jobs 'centos_build' and 'centos_test'. To avoid duplicating various nodes within multiple jobs, YAML anchors (&LABEL) and references (*LABEL) are used. They are defined in ignored jobs, job names starting with a dot (.). Closes !4 - Add GitLab CI jobs to build and test GParted 2018-06-22 Mike Fleetwood Rename CI jobs to reflect that they use a CentOS Docker image (!4) Ready for adding additional Continuous Integration jobs using different distribution Docker images. Rename thus: build -> centos_build test -> centos_test Closes !4 - Add GitLab CI jobs to build and test GParted 2018-06-22 Mike Fleetwood Exclude unit test which fails in Docker CI image (!4) Fragment of the tests/test-suite.log from the Docker CI image showing details of the unit test failure: Running main() from gtest_main.cc [==========] Running 26 tests from 1 test case. [----------] Global test environment set-up. [----------] 26 tests from BlockSpecialTest ... [ RUN ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches test_BlockSpecial.cc:137: Failure Failed get_link_name(): Failed to open directory '/dev/disk/by-id' test_BlockSpecial.cc:168: Failure Failed follow_link_name(): Failed to resolve symbolic link '' test_BlockSpecial.cc:255: Failure Expected: (lnk.m_name.c_str()) != (bs.m_name.c_str()), actual: "" vs "" [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches (0 ms) ... [==========] 26 tests from 1 test case ran. (1 ms total) [ PASSED ] 25 tests. [ FAILED ] 1 test, listed below: [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches 1 FAILED TEST So the code is trying to find a symbolic link to a block device to use in the test. It is trying to read the directory /dev/disk/by-id to find a symbolic link, but the directory doesn't exist in the Docker CI image. The used directory was recently changed [1] to use one which existed on all distributions. Docker images don't even have the /dev/disk directory. Exclude just this specific test. [1] 7fe41480749c795dfb79daeba7b058cece2dfdd2 Use /dev/disk/by-id/ to get device symlink in test_BlockSpecial Closes !4 - Add GitLab CI jobs to build and test GParted 2018-06-22 Mike Fleetwood Debug unit test failure in CI test job (!4) Recursively list all the files below /dev as part of the 'test' job as certain block device names are needed by the failing test_BlockSpecial unit test. The artifact captures all the files from the directory in which the CI script runs to build and test GParted. It creates a ZIP file which can be downloaded after the job finishes, whether the job succeeds of fails. This is to capture logs from the failure of the test_BlockSpecial unit test. Closes !4 - Add GitLab CI jobs to build and test GParted 2018-06-22 Mike Fleetwood Add CI testing job on CentOS (!4) Add GitLab Continuous Integration job named 'test' which runs the GParted unit tests and distcheck. Note that the job starts from a fresh official CentOS Docker image so also has to rebuild GParted too. So far this job fails on unit test test_BlockSpecial. Fragment of the CI job log: make check-TESTS make[2]: Entering directory `/builds/mfleetwo/gparted/tests' make[3]: Entering directory `/builds/mfleetwo/gparted/tests' PASS: test_dummy FAIL: test_BlockSpecial PASS: test_PasswordRAMStore PASS: test_PipeCapture make[4]: Entering directory `/builds/mfleetwo/gparted/tests' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/builds/mfleetwo/gparted/tests' ============================================================================ Testsuite summary for gparted 0.31.0-git ============================================================================ # TOTAL: 4 # PASS: 3 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 ============================================================================ See tests/test-suite.log Please report to https://bugzilla.gnome.org/enter_bug.cgi?product=gparted ============================================================================ Closes !4 - Add GitLab CI jobs to build and test GParted 2018-06-22 Mike Fleetwood Create initial GitLab CI job which builds on CentOS (!4) Initial GitLab Continuous Integration configuration with a single job named 'build' which just confirms GParted can be built and installed on the latest official CentOS Docker image. Closes !4 - Add GitLab CI jobs to build and test GParted 2018-07-02 Jordi Mas Update Catalan translation 2017-10-09 Jordi Mas Fixes to Catalan translation 2018-06-10 Mike Fleetwood Remove support for obsolete devkit-disks automount inhibitor Back in 2009 devicekit-disks package was renamed to udisks [1]. All supported distributions use udisks (or more recently udisks2). None have the old devkit-disks command. Therefore remove it from the GParted shell wrapper. [1] https://www.freedesktop.org/wiki/Software/DeviceKit-disks/ "Note On December 1st 2009, DeviceKit-disks was renamed to udisks. This release is expected to appear in distributions released in the first half of 2010." 2018-06-22 Daniel Mustieles Updated Spanish translation 2018-06-11 Mike Fleetwood Fix LVM2 PV shrinking with lvm2 2.02.171 and later (#1) Shrinking an LVM2 Physical Volume on CentOS 7 with the latest lvm2 2.02.177 fails like this: Shrink /dev/sda9 from 1.00 GiB to 768.00 MiB * calibrate /dev/sda9 * check file system on /dev/sda9 for errors and (if possib...(SUCCESS) * shrink file system (ERROR) * lvm pvresize -v --setphysicalvolumesize 786432K '/dev/...(ERROR) 0 physical volume(s) resized / 1 physical volume(s) not resized Wiping internal VG cache Wiping cache of LVM-capable devices /dev/sda9: Requested size 712.00 MiB is less than real size 1.00 GiB. Proceed? [y/n]:[n] Physical Volume /dev/sda9 not resized. This upstream change to lvm2 [1] makes pvresize prompt for confirmation whenever the --setphysicalvolumesize option is used. (The change was included in lvm2 2.02.171 and later, which is used in recent distributions. The reporter found the issue on Ubuntu 18.04 LTS and I reproduced the issue on RHEL/CentOS 7.5). The set size option has to be used when shrinking the PV before shrinking the partition therefore fix this issue by adding lvm common option --yes when using the set size option. [1] https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cbc69f8c693edf0d1307c9447e2e66d07a04bfe9 pvresize: Prompt when non-default size supplied. Closes #1 - Can't shrink LVM partition due to pvresize prompt 2018-05-26 Mike Fleetwood Clear previous LUKS unlock failure error before next attempt (#795617) After a failed LUKS unlock attempt the password entry dialog shows the error "Failed to open LUKS encryption". Improve the user experience by clearing that error message at the start of the next attempt to avoid contradictory information with the main windows status of "Opening encryption on $PARTITION" whilst performing the next unlock attempt. Bug 795617 - Implement opening and closing of LUKS mappings 2018-05-25 Mike Fleetwood After LUKS unlock failure select failed password (#795617) When the wrong LUKS password is entered and the [Unlock] button clicked, the wrong password is left in the entry box and focus remains on the [Unlocked] button. Improve the user experience by selecting (highlighting) the whole of the wrong password ready for deletion or retyping and ensuring that the entry box always has focus. Just for completeness also programmatically make the password entry box have focus when the dialog box is created and first displayed, even though it gets this by default. Bug 795617 - Implement opening and closing of LUKS mappings 2018-06-19 Piotr Drąg Avoid unnecessary string change Restore whitespace to previous version, so no translations need to be updated. 2018-05-27 Mike Fleetwood Increment GParted Manual version 2018-05-27 Mike Fleetwood Update SystemRescueCd URL in the GParted Manual http://www.sysresccd.org redirects to http://www.system-rescue-cd.org. Update the GParted Manual to the new address. 2018-05-27 Mike Fleetwood Update URLs in the remaining files to https://gparted.org (#796411) Update URLs in the README file, man page, metadata files and polkit action file. Bug 796411 - Enhancements request - URL links 2018-05-27 Mike Fleetwood Update URLs in the app to https://gparted.org (#796411) We previously migrated our web site from http://gparted.org to https://gparted.org under: bug 786707 - gparted.org does not use HTTPS and updated URLs in the GParted Manual to match in commit: a8172ecb04afabd636e3ad3d6f6665af894516f1 Convert Manual links to HTTPS where possible and update version Now update the URLs displayed in the GParted application too. Bug 796411 - Enhancements request - URL links 2018-05-21 Mike Fleetwood Rework scope of fat16:: and ntfs::Change_UUID_Warning vectors The Change_UUID_Warning vectors were fat16 and ntfs class member variables, but are only ever accessed in the get_custom_text() method. Make them local variables in get_custom_text() instead. Static so that references to them can be returned. 2018-05-19 Mike Fleetwood Move the xfs_db -r flag to the start when reading XFS usage I completely missed that when reading XFS file system size and usage it was using the '-r' read-only flag to xfs_db because it was at the end of the string on the following line of code. Move it to the start of the xfs_db command line, like it is when reading the file system label. 2018-05-16 Mike Fleetwood Simplify from Gtk::Table to HBox in Partition Name dialog Same case as for FileSystem Label dialog before; the Partition Name dialog only has a single line of just 2 widgets. Therefore switch to a simpler horizontal box widget to lay them out. 2018-05-15 Mike Fleetwood Simplify from Gtk::Table to HBox in FileSystem Label dialog The FileSystem Label dialog only has a single line of just 2 widgets; a text label and entry box widget. There is no need to use a multi-line capable table to hold this. Switch to a simpler horizontal box widget. Note that this change is not related to porting to Gtk 3 and stopping using deprecated APIs because both HBox [1] and Table [2] are deprecated in Gtk 3.2 and Gtk 3.4 and replaced by Box with horizontal orientation and Grid respectively. [1] NEWS file from gtkmm 3.2, actually first released in gtkmm 3.1.6 (unstable): https://git.gnome.org/browse/gtkmm/tree/NEWS?h=3.2.0#n91 "Gtk: * All H* or V* specialized classes have been deprecated, to match the deprecations in the GTK+ C API. You should now set the orientation instead. This includes HBox, VBox, HButtonBox, VButtonBox, HPaned, VPaned, HScale, VScale, HSeparator, VSeparator, HScrollbar and VScrollbar." [2] NEWS file from gtkmm 3.4, actually first released in gtkmm 3.3.2 (unstable): https://git.gnome.org/browse/gtkmm/tree/NEWS?h=3.4.0#n162 "* Deprecate Gtk::Table in favour of Gtk::Grid." 2018-01-30 Mike Fleetwood Make get_custom_text() and get_generic_text() return by reference Replace return by value of const strings from FileSystem::get_custom_text() and get_generic_text() because that implies duplication of those strings. Return a reference to constant strings instead. 2018-05-18 Mike Fleetwood Recognise blkid identified BitLocker encrypted partitions (#795127) Future util-linux release after v2.32 will include this commit for blkid to recognise BitLocker encrypted partitions. It is much better than GParted's inbuilt detection. https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=136f89ce5ed8cd159a1c56b5a775dada2363ecd3 libblkid: add BitLocker detection Make GParted also recognise BitLocker encrypted partitions reported by blkid. Bug #795127 - Displayed Name is incorrect for bitlocker encrypted partitions 2018-06-13 Curtis Gedak Add Mike Fleetwood as GParted maintainer 2018-05-25 Mike Fleetwood Add logo.png for automatic GitLab/GitHub project avatar Generated from GParted SVG icon using: rsvg -w 256 -h 256 data/icons/hicolor_apps_scalable_gparted.svg logo.png 2018-05-21 Robert Ancell Fix null pointer check accidentally disabled (#796293) Compiling (with new enough g++) produces this warning: PasswordRAMStore.cc: In member function 'void GParted::PWStore::erase_all()': PasswordRAMStore.cc:177:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if ( protected_mem != NULL ); ^~ PasswordRAMStore.cc:193:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' memset( protected_mem, '\0', ProtectedMemSize ); ^~~~~~ Looks like a stray semicolon... Bug 796293 - Fix null pointer check accidentally disabled 2018-05-06 Piotr Drąg Update Polish translation 2018-05-02 Rafael Fontenelle Update Brazilian Portuguese translation 2018-04-30 Marek Černocký Updated Czech translation 2018-04-23 Mike Fleetwood Change to insert or replace PasswordRAMStore::store() interface (#795617) Replace the insert() method (which reports an error when inserting a password with a key which already exists) with the store() method which replaces or inserts the password depending on whether the key already exists or not respectively. There is also an optimisation that nothing is changed if the password to be replaced is the same as the one already stored. The code in Win_GParted::open_encrypted_partition() is simplified now it doesn't have to implement this pattern of behaviour itself. Bug 795617 - Implement opening and closing of LUKS mappings 2018-03-26 Mike Fleetwood Report LUKS unlock errors into the password dialog (#795617) Reports generic GParted error "Failed to open LUKS encryption" on any failure unlocking the partition. Choosing not to display cryptsetup reported errors because those messages and their translations are not under GParted control. Bug 795617 - Implement opening and closing of LUKS mappings 2018-03-22 Mike Fleetwood Stop copying password into insecure memory when getting entry (#795617) The underlying C coded Gtk Entry widget is careful to zero memory after use, allowing the widget to be safely used for password entry [1]. However the C++ method Gtk::Entry::get_text() just takes the underlying C string from the Gtk Entry widget and copies it when constructing a Glib::ustring for the return value [2]. So directly use the Gtk/C API to get the C string instead. [1] https://git.gnome.org/browse/gtk+/tree/gtk/gtkentrybuffer.c?h=3.22.28#n92 See function trash_area() which zeros memory and its use in gtk_entry_buffer_normal_insert_text(), gtk_entry_buffer_normal_delete_text() and gtk_entry_buffer_finalize(). [2] https://git.gnome.org/browse/gtkmm/tree/gtk/src/entry.hg?h=3.22.2#n104 _WRAP_METHOD(Glib::ustring get_text() const, gtk_entry_get_text) https://git.gnome.org/browse/glibmm/tree/docs/internal/using_gmmproc.txt?h=2.46.1#n53 _WRAP_METHOD(Glib::ustring METHOD const, FUNC) is processed to: Glib::ustring METHOD() const { return Glib::convert_const_gchar_ptr_to_ustring( FUNC(const_cast(gobj()))); } https://git.gnome.org/browse/glibmm/tree/glib/glibmm/utility.h?h=2.46.1#n82 Glib::ustring convert_const_gchar_ptr_to_ustring(const char* str) { return (str) ? Glib::ustring(str) : Glib::ustring(); } So Gtk::Entry::get_text() calls Glib::ustring() constructor which copies the C string to create the Glib::ustring object returned. Bug 795617 - Implement opening and closing of LUKS mappings 2018-02-11 Mike Fleetwood Keep password dialog open until successful unlock or cancellation (#795617) To keep password dialog open, just keep running it in a loop performing LUKS mapping unlock attempts with the entered passphrase until it succeeds or the dialog is cancelled or closed. This is the same model that is already used for the File Support System dialog and how the [Rescan For Supported Actions] button is implemented. Also any error from attempting to open the LUKS mapping is no longer displayed in a separate error dialog or at all. Will add some sort of error reporting into the password entry dialog in a following commit. Creates new method Win_GParted::open_encrypted_partition() which handles the non UI parts of attempting to open an encrypted partition. Running "cryptsetup luksOpen" and updating the stored passphrase as needed. Bug 795617 - Implement opening and closing of LUKS mappings 2017-10-22 Mike Fleetwood Add password entry dialog and attempt LUKS unlock once (#795617) Initial addition of a password entry dialog. Looks like: +------------------------------------------------+ | LUKS Passphrase /dev/sdb1 | +------------------------------------------------+ | Enter LUKS passphrase to open /dev/sdb1 | | Passphrase: [ ] | | | | [ Cancel ] [ Unlock ] | +------------------------------------------------+ A standard Gtk Dialog is used to accept the password once, with any errors displayed in a separate error dialog afterwards. This is poor UI design. A password dialog should remain open for all authentication attempts and only close when successful or the dialog is cancelled or closed. This UI design issue will be improved in following commits. Bug 795617 - Implement opening and closing of LUKS mappings 2017-10-18 Mike Fleetwood Add closing LUKS mappings (#795617) Implement Close Encryption partition menu item. The Open Encryption action is not yet implemented and instead reports an error detailing the open encryption command. A dialog needs to be written to accept the password entry and pass it to the open encryption command. Bug 795617 - Implement opening and closing of LUKS mappings 2016-10-25 Mike Fleetwood Add unimplemented open/close encryption to the partition menu (#795617) Add new item to the partition menu to allow the user to open and close the LUKS mapping. However for now the menu item is always disabled and there is no implementation behind it to actually open or close the LUKS mapping. Fragment of the partition menu is now: ... Format to > ----------------- Open Encryption <- New menu item Mount ----------------- Name Partition ... Has to be two separate menu items to clearly represent to the user that LUKS mappings and file system mounting are two separate busy states. And also in the case of an open but unmounted file system to offer both actions; close encryption and mount file system. The text of the menu item automatically changes similarly to how it does for the Mount/Unmount, Swapon/Swapoff, Activate/Deactivate item depending on the state of the LUKS mapping. For open LUKS mappings it will show "Close Encryption" and for all other cases (closed LUKS mapping or partition is not encrypted) "Open Encryption". Again similar to how the default of "Mount" is shown for unallocated and unknown partitions. Bug 795617 - Implement opening and closing of LUKS mappings 2016-10-25 Mike Fleetwood Rename some Win_GParted members to *toggle_fs_busy* (#795617) In preparation for adding the ability to toggle the encryption busy state (open/close the encryption volume), rename existing members to reflect that they are related to changing the file system state. (Swap and LVM2 Physical Volumes are handled as file systems by GParted). class Win_GParted renaming: MENU_TOGGLE_BUSY -> MENU_TOGGLE_FS_BUSY allow_toggle_busy_state() -> allow_toggle_fs_busy_state() toggle_busy_state() -> toggle_fs_busy_state() check_toggle_busy_allowed() -> check_toggle_fs_busy_allowed() Bug 795617 - Implement opening and closing of LUKS mappings 2017-10-20 Mike Fleetwood Stop using shell when reading jfs file system usage (#795617) Replace echoing "dm" into jfs_debugfs via a shell command to directly writing "dm" to the input of the jfs_debug command. One less use of the shell. Bug 795617 - Implement opening and closing of LUKS mappings 2017-10-20 Mike Fleetwood Add ability for small writes to stdin of child processes (#795617) As discussed in "LUKS password handling, threats and preventative measures" [1] GParted must be able to pass LUKS passphrases to cryptsetup via standard input to avoid having to write passwords to the file system and deal with additional security requirements. Therefore add a way to write input into created child processes. For small amounts of input, writing up to the pipe buffer capacity won't block [2]. This is 64K on versions of Linux in any currently supported distributions. [1] LUKS password handling, threats and preventative measures https://bugzilla.gnome.org/show_bug.cgi?id=627701#c56 GParted must not become a password manage so it must never save LUKS passwords to disk across separate invocations of GParted. ... GParted should avoid writing a temporary file containing the LUKS password as it introduces extra complexity with trying to safely handle and erase file content. Instead GParted must programmatically pass the LUKS password via standard input to the cryptsetup command. [2] pipe(7) manual page: Pipe capacity A pipe has a limited capacity. If the pipe is full, then a write(2) will block or fail, depending on whether the O_NONBLOCK flag is set (see below). ... In Linux versions before 2.6.11, the capacity of a pipe was the same as the system page size (e.g., 4096 bytes on i386). Since Linux 2.6.11, the pipe capacity is 65536 bytes. Bug 795617 - Implement opening and closing of LUKS mappings 2017-11-10 Mike Fleetwood Simplify obtaining address of password memory for unit tests (#795617) Use private access into the PasswordRAMStore class to directly obtain the address of the locked memory, rather than inferring it from the address of the first stored password. This simplifies PasswordRAMStoreTest::SetUpTestCase() and avoids encoding most of the implementation knowledge that the first password will be stored at the start of the protected memory. Bug 795617 - Implement opening and closing of LUKS mappings 2017-11-10 Mike Fleetwood Add unit testing of erasing all passwords (#795617) Test that all passwords are zeroed by PasswordRAMStore::erase_all(), the same method as used in the PasswordRAMStore destructor. Bug 795617 - Implement opening and closing of LUKS mappings 2017-11-08 Mike Fleetwood Split out erasing all passwords into a separate method (#795617) Move zeroing of the locked memory into separate PWStore::erase_all() private method. Then use this in the PWStore destructor. This is so that zeroing of all passwords can be unit tested independently of destructing the singleton PWStore object. Bug 795617 - Implement opening and closing of LUKS mappings 2017-10-09 Mike Fleetwood Add unit tests for PasswordRAMStore module (#795617) As noted in comments: 1) This is white box testing because it uses implementation knowledge to look through the API to the internals of the password store. 2) It is not currently possible to test that the passwords are zeroed when the store is destroyed. However zeroing of memory is being tested when individual passwords are erased. Bug 795617 - Implement opening and closing of LUKS mappings 2017-10-06 Mike Fleetwood Add PasswordRAMStore module (#795617) Application level requirements for secure password management were set out in "LUKS password handling, threats and preventative measures" [1]. The requirements are: 1) Passwords are stored in RAM and are not allowed to be paged to swap. (However hibernating with GParted still running will write all of RAM to swap). 2) Passwords are wiped from RAM when no longer needed. When each password is no longer needed and when GParted closes. 3) Passwords are referenced by unique key. Recommend using LUKS UUIDs as the unique key. (Each LUKS password should only ever need to be entered once for each execution of GParted. Therefore the passwords can't be stored in any of the existing data structures such as Partitions or LUKS_Info cache because all of these are cleared and reloaded on each device refresh). There seems to be two possible implementation methods: use an existing library to provide secure memory handling, or write our own. Libgcrypt [2] and libsodium [3] cryptographic libraries both provide secure memory handling. (Secure memory is quite simple really, some virtual memory locked into RAM which is zeroed when no longer needed). Linking to an encryption library just to provide secure memory seems like using a sledge hammer to crack a nut. Also because of requirement (3) above a module is needed to "own" the pointers to the passwords in the secure memory. Managing the secure memory ourselves is probably no more code that that needed to interface to libgcrypt. Therefore handle the secure memory ourselves. So far the module is only compiled. It is not used anywhere in GParted. [1] LUKS password handling, threats and preventative measures https://bugzilla.gnome.org/show_bug.cgi?id=627701#c56 [2] libgcrypt general purpose cryptographic library, as used in GNU Privacy Guard https://gnupg.org/related_software/libgcrypt/ [3] libsodium crypto library https://download.libsodium.org/doc/ Bug 795617 - Implement opening and closing of LUKS mappings 2018-03-11 Mike Fleetwood Use /dev/disk/by-id/ to get device symlink in test_BlockSpecial Found that older but still supported distributions Debian 8 and Ubuntu 14.04 LTS don't have directory /dev/disk/by-path/. This is used by the BlockSpecial unit test as a source of a symbolic link to a block special device. This causes the unit test to fail like this: $ cd tests $ ./test_BlockSpecial ... [ RUN ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches test_BlockSpecial.cc:137: Failure Failed get_link_name(): Failed to open directory '/dev/disk/by-path' test_BlockSpecial.cc:168: Failure Failed follow_link_name(): Failed to resolve symbolic link '' test_BlockSpecial.cc:255: Failure Expected: (lnk.m_name.c_str()) != (bs.m_name.c_str()), actual: "" vs "" [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches (0 ms) ... [ FAILED ] 1 test, listed below: [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches 1 FAILED TEST Which in turn causes make check and make distcheck to fail. Use directory /dev/disk/by-id/ instead as it always exists. 2018-03-07 Mike Fleetwood Increase minimum required gtkmm to 2.16.0 (#794253) Increase the minimum required version of gtkmm to 2.16.0, thus allowing removal of HAVE_GTK_SHOW_URI autoconf definition and associated fallback code. Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required versions to glibmm 2.14.0 and gtkmm 2.16.0 2018-03-07 Mike Fleetwood Increase minimum required gtkmm to 2.11.1 (#794253) Increase the minimum required version of gtkmm to 2.11.1, thus allowing removal of: * HAVE_SET_DEFAULT_ICON_NAME autoconf definition and associated optional code. * INSTALL_PIXMAPS_DIR automake conditional and associated make instructions. This is reversing these 3 commits, except for the higher minimum gtkmm version: 1) a04210788399736ff7f097cb75650ebcbd0a4950 Only use Gtk::Window::set_default_icon_name method when available (#695279) 2) b09d6035cdca90debb145628b0c62a0213ee1225 Add fallback method for specifying GParted icon (#695279) 3) d6baac254677b7863af413a38f382e9a2e0252bd Only install fallback icon when required (#695279) Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required versions to glibmm 2.14.0 and gtkmm 2.16.0 2018-03-06 Mike Fleetwood Raise minimum required glibmm version to 2.14.0 (#794253) Increase the minimum required version of glibmm to 2.14.0, thus allowing removal of the HAVE_GLIB_REGEX autoconf definition and associated conditional code. This is reversing commit, except for the new glibmm minimum check: 456932846bfbfbd77bbf49165b9eb6c2b84e0da6 Implement fallback if Glib::Regex class is missing (#695279) Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required versions to glibmm 2.14.0 and gtkmm 2.16.0 2018-03-08 Mike Fleetwood Simplify ext2::get_filesystem_support() with regard ext4 support (#794253) E2fsprogs 1.41.0 (from 10 July 2008) first included ext4 support [1]. As RHEL / CentOS 6 is now the oldest supported distribution, and that includes e2fsprogs 1.41.12 (from 22 August 2009) [2] all the e2fs programs support ext4 so it is no longer necessary to also depend on finding mkfs.ext4 before enabling each supported capability for ext4. This makes the ext2::get_filesystem_support() look like all the others in which each supported capability only depends on the presence of the relevant file system specific command. [1] Release notes for the e2fsprogs package / E2fsprogs 1.41.0 http://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.41.0 [2] pkgs.org > CentOS 6 > CentOS x86_64 > e2fsprogs https://centos.pkgs.org/6/centos-x86_64/e2fsprogs-1.41.12-23.el6.x86_64.rpm.html Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required versions to glibmm 2.14.0 and gtkmm 2.16.0 2018-03-08 Mike Fleetwood Remove checks for e4fsprogs commands (#794253) PATCHSET OVERVIEW: As of 31 March 2017 RHEL / CentOS 5 reached the end of their support [1][2]. Therefore remove code which supports them. This makes RHEL / CentOS 6 the oldest supported distribution. So the minimum required versions of glibmm and gtkmm can be increased dropping some autoconf checks and conditional code supporting older versions of these libraries. This will undo the bulk of these these previous bug fixes: * GParted 0.21.0 Bug 738706 - Add support for ext4 on RHEL/CentOS 5.x * GParted 0.16.1 Bug 695279 - Fix GParted doesn't compile on RHEL / CentOS 5.9 [1] Red Hat Enterprise Linux Life Cycle https://access.redhat.com/support/policy/updates/errata#Life_Cycle_Dates [2] Subject: CentOS Linux 5 EOL https://lists.centos.org/pipermail/centos-announce/2017-April/022350.html THIS PATCH: Remove checks for e4fsprogs commands, removing support for ext4 on RHEL / CentOS 5.x. This is reverting earlier commit: f672f68863d36972c5fb28d6592e47ca790708dd Check for e4fsprogs commands for ext4 support on RHEL/CentOS 5.x (#738706) Mkfs_cmd member variable is being kept as a convenience so that it is created once rather than on each use. Also note that as it is a Glib::ustring type object, it's constructor will be called which will initialise it to the empty string so it doesn't need initialising to the empty string in the initialiser list of the ext2() constructor itself. Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required versions to glibmm 2.14.0 and gtkmm 2.16.0 2018-03-19 Andre Klapper Fix broken markup in Romanian user docs translation 2018-03-19 Aurimas Černius Updated Lithuanian translation 2018-03-19 Curtis Gedak Append -git to version for continuing development 2018-03-19 Curtis Gedak ========== gparted-0.31.0 ========== 2018-03-19 Curtis Gedak Update copyright year 2018-03-19 Rūdolfs Mazurs Update Latvian translation 2018-03-18 Milo Casagrande Update Italian translation 2018-03-13 Trần Ngọc Quân Updated Vietnamese translation Signed-off-by: Trần Ngọc Quân 2018-03-12 Claude Paroz Updated French translation 2018-03-11 Anders Jonsson Update Swedish translation 2018-03-10 Alan Mortensen Updated Danish translation 2018-03-10 Mario Blättermann Update German translation 2018-03-04 Balázs Úr Update Hungarian translation 2018-03-03 Baurzhan Muftakhidinov Update Kazakh translation 2018-03-03 Daniel Șerbănescu Update Romanian translation 2018-03-02 GNOME Translation Robot Update Dutch translation 2018-02-24 Piotr Drąg Fix Spanish translation header 2018-02-22 Daniel Mustieles Updated Spanish translation 2018-02-17 Мирослав Николић Updated Serbian translation 2018-02-09 Kukuh Syafaat Update Indonesian translation 2018-02-01 Mike Fleetwood Remove deprecated USE_GNOME2_MACROS from autogen.sh Use of USE_GNOME2_MACROS is deprecated in GNOME 3 and produced this warning: $ ./autogen.sh /usr/bin/gnome-autogen.sh ... ***Warning*** USE_GNOME2_MACROS is deprecated, you may remove it from autogen.sh ... It's use appears to have been removed first from GNOME 2.8 with this commit from 2004: https://git.gnome.org/browse/gnome-common/commit/?id=ea9e85851445efa0135c3f8d08c3d1ea53760d91 delete some files that were unused after the reorganisation The oldest supported distribution is RHEL / CentOS 6 which is using gnome-common-2.28.0 from 2009. Therefore unconditionally remove the USE_GNOME2_MACROS setting. Also confirmed that it makes no difference by running ./autogen.sh with and without USE_GNOME2_MACROS being set. The produced GParted build trees were the same. Therefore the release and executable can't be affected. 2018-01-30 Curtis Gedak Reduce dependency on scrollkeeper (#743318) Scrollkeeper and the associated OMF catalog files are used by the GNOME 2 version of yelp to display the GParted help manual. To see how this works try the following command: yelp ghelp:gparted GNOME version 3 and higher yelp do not require scrollkeeper or the OMF catalog files to properly display the GParted help manual. And in fact GNOME 3 deprecated the GNOME 2 method of building and installing GNOME help documents altogether; including use of GNOME_DOC_INIT autoconf macro, the gnome-doc-utils package and use of scrollkeeper. [GNOME 3] GNOME Goal: Port To New Documentation Infrastructure https://wiki.gnome.org/Initiatives/GnomeGoals/NewDocumentationInfrastructure Further, the next release of Debian, Debian 10 (Buster), will be removing the scrollkeeper / rarian package. rarian: Don't release with Buster https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885657 GParted is still a GNOME 2 app using GNOME 2 documentation build system using autoconf GNOME_DOC_INIT macro. [GNOME 2] Migrating your documentation to gnome-doc-utils https://wiki.gnome.org/Projects/GnomeDocUtils/MigrationHowTo This is needed to build GParted documentation on still supported GNOME 2 distributions RHEL / CentOS 6. So avoid requiring deprecated scrollkeeper on GNOME 3 by automatically disabling scrollkeeper database updates when the scrollkeeper-update command is not available. Executable | Configure option used | Use scrollkeeper scrollkeeper-update | on command line | when building help exists? | | for GParted? --------------------+------------------------+------------------- Yes | | Yes Yes | --enable-scrollkeeper | Yes Yes | --disable-scrollkeeper | No | | No | | No Note that because GParted is still using the GNOME 2 documentation build system it still builds and installs OMF files. It is just that they are not required with GNOME 3 yelp and this commit automatically disables updating the scrollkeeper database when the scrollkeeper-update command is not available. Bug 743318 - configure script missing check for scrollkeeper dependency 2018-01-10 Mike Fleetwood Add comment about needing to compute encryption overhead in activate_format() To explain why just using the size of the LUKS header won't always be correct. 2018-01-18 Mike Fleetwood Move struct FS and FS_Limits into FileSystem.h Struct FS and struct FS_Limits are strongly related to the FileSystem class, both being return values from members and associated with storing file system attributes. Move their definitions from Utils.h into FileSystem.h. 2018-01-02 Mike Fleetwood Rename enum FILESYSTEM to FSType There are too many different types of things named "filesystem" in the GParted code with the potential to cause confusion. Namely: std::vector FILESYSTEMS Vector of file system capabilities. class FileSystem Base class interfacing to file system specific executables for querying and modification. enum FILESYSTEM Symbolic constants representing each file system type. Many recent written or re-written functions already used a variable named fstype. Rename enum FILESYSTEM to enum FSType to clearly distinguish it from the other things with very similar names. Only changing the name of the enumeration, not the name of variables of that type too because that is a lot more lines of code and those can be changed when the relevant code is re-written. 2018-01-17 Mike Fleetwood Fix cannot format error dialog which always reported the file system as encrypted Try to format an existing partition with a file system which doesn't fit. The error dialog reporting the partition as too small or too large always claimed the file system was encrypted, whether it was or not. For example trying to format a 128 MiB partition as btrfs produces this error dialog: (-) Cannot format this file system to [Encrypted] btrfs A [Encrypted] btrfs file system requires a partition of at least 256.00 MiB. [ OK ] This commit: 88136c96d7dd8576963c2e62eb2e9c85f5bff026 Extend functions generating encrypted file system string (#774818) just completely missed handling the case for non-encrypted file systems in Utils::get_filesystem_string(). Add the missed code. 2018-01-15 Mike Fleetwood Extract common code into GParted_Core::get_filesystem_limits() (#787204) There are multiple repetitions of the same code getting a FileSystem object, checking for NULL and then calling the file system specific get_filesystem_limits(). Extract that into a common function. GParted_Core::get_filesystem_limits() can't use the file system from the passed Partition object because that is the current file system which will be different from the intended file system for new and format operations. So would look up the wrong derived FileSystem specific object and call the wrong get_filesystem_limits(). Hence still needing fstype as a separate parameter to pass the intended file system. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-17 Mike Fleetwood Set dynamic UDF file system size limits (#787204) UDF file system minimum and maximum size limits are defined in terms of numbers of file system blocks. So when resizing an existing file system compute the byte size limits from the existing UDF file system's block size. Alternatively when creating a new UDF file system use the device's sector size as the multiplier instead. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-16 Mike Fleetwood Pass Partition object to get_filesystem_limits() (#787204) As described in the previous commit, this is so that file system specific implementations can dynamically determine size limits based on Partition object attributes: such as the device sector size and the file system block size. (Assuming set_used_sectors() sets partition.fs_block_size for the type of file system in question). Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-16 Mike Fleetwood Reorder code in Win_GParted::activate_paste() (#787204) Background information about UDF is that when creating a file system it's block size must match the underlying device's sector size. For optical media like CDs and DVDs that is 2K. For hard drives that is usually 512 bytes or 4K. However if a UDF file system has been copied from a device with a different sector size the UDF block size won't match the sector size. Linux will happily mount such UDF file system. Therefore the derived udf::get_filesystem_limits() will need access to the file system block size when determining the size limits of an existing UDF file system being resized and use the device sector size when a new UDF file system is being created. All this can be queried from an appropriate Partition object passed to get_filesystem_limits(). All the calls to get_filesystem_limits() have an appropriate Partition object available already, except in Win_GParted::activate_reformat() when composing a format operation. Or more correctly activate_reformat() constructs temp_ptn, a suitable Partition object, including with fs_block_size member defaulting to -1 indicating not a resize, but not until after the file system size limits had been checked and get_filesystem_limits() called. Therefore reorder the code in activate_paste() so that the file system size limits are checked after the wanted Partition object has been created. No functional change with this commit. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-15 Mike Fleetwood Remove struct FS members .MIN & .MAX (#787204) All the code has been switched to call get_filesystem_limits() and use struct FS_Limits. Remove struct FS members .MIN & .MAX. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-12 Mike Fleetwood Use struct FS_Limits in Win_GParted::activate_format() (#787204) Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-12 Mike Fleetwood Use struct FS_Limits in GParted_Core::create() (#787204) Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-15 Mike Fleetwood Switch to using struct FS_Limits inside Dialog_Partition_New (#787204) Change Dialog_Partition_New to use a fs_limits rather than struct FS and .MIN and .MAX. No passing of struct FS_Limits required. Just use the FILESYSTEMS vector of struct FS to provide the file system type and look up it's size limits each time the selection changes. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-12 Mike Fleetwood Query and pass struct FS_Limits into Dialog_Partition_Resize_Resize_Move (#787204) Refactor Win_GParted::activate_resize() to query the file system size limits using the new get_filesystem_limits() method and pass those limits into the dialog class as struct FS_Limits. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-12 Mike Fleetwood Switch to using struct FS_Limits inside Dialog_Partition_Resize_Move (#787204) Changes the internal code in Dialog_Partition_Resize_Move to use fs_limits instead of fs.MIN and fs.MAX. The limits are still passed into the constructor via struct FS and it's members .MIN and .MAX but immediately used to assign to fs_limits. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-12 Mike Fleetwood Query and pass struct FS_Limits into Dialog_Partition_Copy (#787204) Refactor Win_GParted::activate_paste() to query the file system size limits using the new get_filesystem_limits() method and pass those limits into the the dialog class as struct FS_Limits. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-12 Mike Fleetwood Switch to using struct FS_Limits inside Dialog_Partition_Copy (#787204) Adds working copy fs_limits member into common Dialog_Base_Partition class. Changes the internal code in Dialog_Partition_Copy class to use fs_limits instead of fs.MIN and fs.MAX. The limits are still passed into the constructor via object of struct FS and it's members .MIN and .MAX but immediately used to assign to the fs_limits member. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-11 Mike Fleetwood Assign to duplicate FS_Limits (#787204) Duplicate the assignment of file system size limits into struct FS_Limits, matching the fixed values currently assigned to struct FS members .MIN and .MAX. Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-11 Mike Fleetwood Create separate file system limits structure and getter method (#787204) PATCH SET OVERVIEW: Currently the supported actions of each file system and their size limits are stored in struct FS objects. These are created by calling file system specific derived implementations of FileSystem::get_filesystem_support(). This happens when GParted is started or when a when a rescan for supported actions is performed. The file system size limits are expressed as a fixed number of bytes. The maximum UDF file system size is specified in terms of file system block size units. Also the file system block size must match the sector size of the underlying device. Typically 2K for optical media and 512 bytes or 4K for hard drives. Therefore GParted can't properly express the true UDF file system size limits because they depend on the block size of an existing UDF file system or the sector size of the device for new UDF file systems. In fact other file systems such as EXT2/3/4 and XFS actually express their maximum file system size in terms of numbers of file system blocks but these tend to always be 4K and don't have to match the sector size of the underlying device, so fixed byte values tend to suffice. To update GParted for this, first separate file system size limits from struct FS into struct FS_Limits and provide new FileSystem::get_filesystem_limits() method to allow the limits to be queried independently of the calls to get_filesystem_support(). Second, pass Partition objects and allow derived get_filesystem_limits() implementations. THIS PATCH: Just creates a separate structure storing fixed value file system minimum and maximum size limits along with getter method get_filesystem_limits(). Bug 787204 - Minimum and maximum size of the UDF partition/disk 2018-01-28 Marek Cernocky Updated Czech translation 2018-01-08 Piotr Drąg Update Polish translation 2018-01-06 Rafael Fontenelle Update Brazilian Portuguese translation 2018-01-04 gogo Update Croatian translation 2018-01-02 Pali Rohár Use external tools udfinfo and udflabel for UDF file system (#792052) Those external tools were introduced in version 2.0 of udftools package and can show or change UDF label, UDF uuid and can provide information needed for counting total/free sectors. Bug 792052 - Add support for changing UDF label/uuid and show disk usage 2017-11-30 Mike Fleetwood Rename function and reword text for rollback of failed file system move To better reflect specifically that it is a failed (internally implemented) file system move which is being rolled back. 2017-12-30 Mike Fleetwood Fix rollback when growing a partition by more than twice fails (#791875) Attempt to grow a partition to more than twice it's size. If committing that change to the partition fails in such a way that the new larger partition boundaries are not written to the disk drive then rolling back will fail with libparted error: Can't have overlapping partitions. Example operation details: Grow /dev/sdb8 from 1.00 GiB to 2.20 GiB * calibrate /dev/sdb8 (SUCCESS) * check file system on /dev/sdb8 for errors and (if poss...(SUCCESS) * grow partition from 1.00 GiB to 2.20 GiB (ERROR) * attempt to rollback failed change to the partition (ERROR) original start: 7350272 original end: 9447423 original size: 2097152 (1.00 GiB) * libparted messages (ERROR) Can't have overlapping partitions. What happened is that resize_move_partition() passed the new Partition object to resize_move_partition_implement() as the source partition for the rollback, and than called ped_disk_partition_by_sector() with a sector in the middle to identify the partition to be changed. However the new partition was never written to the drive so in the middle was outside the old smaller partition. Therefore libparted identified empty space after the partition, rather than the partition itself, as the intended target so when ped_disk_set_partition_geom() was called it reported error "Can't have overlapping partitions" because it thought another partition was being created with the same boundaries as the old partition, rather than the boundaries of the old partition being updated. The same error also occurs when rolling back a failed partition change as part of a move operation when the middle of the new partition falls outside of the boundaries of the old partition. Fix by making a temporary Partition object from the intersection of the old and new partition boundaries just to be used to identify the partition being changed to libparted. As this is only rolling back a single step adjusting the partition boundaries as part of a resize and/or move operation, the old and new partition boundaries must intersect (and in fact that intersection contains the file system data). Bug 791875 - Rollback specific failed partition change steps 2017-12-18 Mike Fleetwood Enable failed partition change rollback for selected steps (#791875) The general rule is that: 1) For a partition change step BEFORE a file system change step, rollback on failure; 2) For a partition change step AFTER a file system change step, don't rollback on failure. Examining every case where resize_move_partition() is called and whether rollback on failure is wanted or not: * In resize_move() Resize / move extended partition. No associated file system change. NO ROLLBACK Just to keep possibly applied operation. * #1 in move() Making all encompassing partition before moving file system. ROLLBACK To restore partition boundaries back to those of the file system. * #2 in move() Recreating original partition boundaries after file system move failed or was cancelled and has been rolled back. NO ROLLBACK To keep updated partition boundaries to match restored file system data. * #3 in move() Replacing all encompassing partition with final partition after successful file system move. NO ROLLBACK Keep new partition boundaries to match moved file system. * #1 in resize_encryption() Making the partition larger before growing closed LUKS encrypted data. ROLLBACK Restore partition boundaries back to those of the closed LUKS encrypted data. * #2 in resize_encryption() Shrinking the partition after open LUKS mapping has been shrunk, but before swap is re-created (smaller). NO ROLLBACK Difficult case because the partition shrink is in the middle of a LUKS shrink and a swap shrink (re-create). If swap was actually shrunk like other types of file system, rather than re-created, then the operation sequence would be (1) shrink swap, (2) shrink LUKS encryption, (3) shrink partition. In this hypothetical case and the actual case no rollback is preferred to try to keep the new partition boundaries match the shrunk open LUKS encryption mapping. * #3 in resize_encryption() Grow the partition before growing open LUKS mapping and re-creating swap larger. ROLLBACK Restore partition boundaries back to those of the smaller open LUKS encryption mapping. * #4 in resize_encryption() Shrink the partition after shrinking the file system and open LUKS encryption mapping. NO ROLLBACK Keep new smaller partition boundaries to match shrunk encrypted file system. * #5 in resize_encryption() Grow the partition before growing the open LUKS encryption mapping and file system. ROLLBACK Restore partition boundaries back to those of the not yet grown encrypted file system. * #1 in resize_plain() Resize partition before re-creating swap a different size. ROLLBACK Restore partition boundaries back to those of the not yet resized (re-created) swap space. * #2 in resize_plain() Shrink partition after shrinking the file system. NO ROLLBACK Keep new smaller partition boundaries to match shrunk file system. * #3 in resize_plain() Grow partition before growing the file system. ROLLBACK Restore partition boundaries back to those of the not yet grown file system. Removes the default value from the rollback_on_fail parameter so rollback or not has to be explicitly specified for every call of resize_move_partition(). Bug 791875 - Rollback specific failed partition change steps 2017-12-08 Mike Fleetwood Implement rollback of failed partition resize/move steps (#791875) Even after implementing a fix for bug 790418 "Unable to inform the kernel of the change message may lead to corrupted partition table" GParted/libparted can still encounter errors informing the kernel of the new partition layout. This has been seen with GParted on CentOS 7 with libparted 3.1. In such a case the partition has been successfully written to the disk but just informing the kernel failed. This is a problem because when a partition is being moved in advance of a file system move step, failure to inform the kernel leaves the partition boundaries not matching the on disk limits of the file system. For a move to the left this leaves the partition reported as unknown, apparently losing the user's data. For example start with a 512 MiB partition containing an XFS file system. This is recognised by blkid and parted, hence also by GParted. # blkid /dev/sdb1 /dev/sdb1: UUID=... TYPE="xfs" PARTUUID="37965980-01" # parted /dev/sdb unit s print Model: ATA VBOX HARDDISK (scsi) Disk /dev/sdb: 16777216s Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1048576s 2097151s 1048576s primary xfs Now move the partition 100 MiB to the left and have it fail to inform the kernel after the first partition change step. Operation details: Move /dev/sdb1 to the left (ERROR) * calibrate /dev/sdb1 (SUCCESS) * check file system on /dev/sdb1 for errors and (if poss...(SUCCESS) * grow partition from 512.00 MiB to 612.00 MiB (ERROR) old start: 1048576 old end: 2097151 old size: 1048576 (512.00 MiB) requested start: 843776 requested end: 2097151 requested size: 1253376 (612.00 MiB) * libparted messages (ERROR) Error informing the kernel about modifications to partition /dev/sdb1 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/sdb1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. Failed to add partition 1 (resource temporarily unavailable) Now because the start of the partition is 100 MiB before the start of the file system, the file system is no longer recognised, and apparently the user's data has been lost. # blkid /dev/sdb1 /dev/sdb1: PARTUUID="37965980-01" # parted /dev/sdb unit s print ... Number Start End Size Type File system Flags 1 843776s 2097151s 1253376s primary It doesn't matter why updating the partition failed, even if it was because of an error writing to the disk. Rollback of the change to the partition should be attempted. The worst case scenario is that rollback of the change fails, which is the equivalent to how the code worked before this patch set. However in other cases where the partition boundaries are being updated after a file system move or shrink step then the partition should be updated to match the new location of the file system itself. And no rollback is wanted. If the failure was only informing the kernel then in fact the partition has actually been updated on disk after all. So each partition resize/move step needs examining on a case by case basis to decide if rolling back the change to the partition is wanted or not. This patch only adds partition change rollback into resize_move_partition(). Rollback remains disabled until all cases are examined in the following patch. Bug 791875 - Rollback specific failed partition change steps 2017-12-28 Mike Fleetwood Extract common code into update_dmraid_entry() (#791875) Extract common code which updates a DMRaid device mapper entry into a sub-function. This will also be needed when adding rollback of a partition change on failure. Bug 791875 - Rollback specific failed partition change steps 2017-12-08 Mike Fleetwood Extract code into resize_move_partition_implement() (#791875) Extract the code which actually implements the partition change into a sub-function ready for adding rollback of the change on failure. Bug 791875 - Rollback specific failed partition change steps 2017-12-27 Christian Kirbach Update German translation 2017-12-20 Daniel Mustieles Updated Spanish translation 2017-12-08 Mike Fleetwood Match up OperationDetail creation and status setting for internal copy (#790842) This is not required, but it is more logical to have an OperationDetail object created and it's final status set in the same function rather than split between caller and callee. So move creation of "copy %1 using a block size of %2" OperationDetail objects into GParted_Core::copy(). Also introduces a couple of variables to remove some recomputation: benchmark_od & remaining_length. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-12-10 Mike Fleetwood Set OperationDetail status last during internal copy benchmarking (#790842) Performing a copy or move operation which uses GParted's internal copy routine triggered the new GParted bug message. Example operation details: Copy /dev/sdb8 to /dev/sdb (start at 4.51 GiB) (SUCESSS) * calibrate /dev/sdb8 (SUCCESS) * check file system on /dev/sdb8 for errors and (if possib...(SUCCESS) * create empty partition (SUCCESS) * set partition type on /dev/sdb9 (SUCCESS) * copy file system from /dev/sdb8 to /dev/sdb9 (SUCCESS) using internal algorithm copy 1.00 GiB * finding optimal block size * copy 16.00 MiB using a block size of 1.00 MiB (SUCCESS) 16.00 MiB of 16.00 MiB copied GParted Bug: Adding more information to the result...(WARNING) 0.797269 seconds * copy 16.00 MiB using a block size of 2.00 MiB (SUCCESS) * copy 16.00 MiB using a block size of 4.00 MiB (SUCCESS) * copy 16.00 MiB using a block size of 8.00 MiB (SUCCESS) * copy 16.00 MiB using a block size of 16.00 MiB (SUCCESS) optimal block size is 1.00 MiB * copy 944.00 MiB using a block size of 1.00 MiB (SUCCESS) This is because when performing the initial benchmarking copies the time taken by each copy is added to the operation detail results in the calling GParted_Core::copy_blocks() after the final status was set in CopyBlocks::copy() with set_success_and_capture_errors(). Fix by setting the final status in the parent function after adding the time to the benchmark copies. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-12-10 Piotr Drąg Update Polish translation 2017-12-08 gogo Update Croatian translation 2017-12-05 Kukuh Syafaat Update Indonesian translation 2017-12-03 Mike Fleetwood Make OperationDetail no_more_children bug message translatable (#790842) To be consistent with all previous bug messages being translatable. Also only mark the bug as a warning instead of an error because the bug doesn't cause any disk drive operations to fail. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-12-03 Piotr Drąg Update Polish translation 2017-11-28 Mike Fleetwood Wait for the kernel and udev to settle partitions for a second time (#790418) There is still another subtle issue. When GParted_Core::commit() closes the device, the kernel initiates a second set of events which removes and re-adds the partitions again. Need to wait for these to complete to prevent any following step failing with missing partition device nodes. Bug 790418 - "Unable to inform the kernel of the change" message may lead to corrupted partition table 2017-11-27 Mike Fleetwood Avoid libparted failing to inform the kernel about partition changes (#790418) Operations involving modifications to a partition are sometimes failing with a libparted error informing the kernel about modifications to partitions. For example I encountered these errors when just creating a fourth partition on CentOS 7 in a VirtualBox VM. Operation results: Create Primary Partition #1 (ext4, 4.73 GiB) on /dev/sdb (ERROR) * create empty partition (ERROR) * libparted messages (ERROR) * Error informing the kernel about modification to partition /dev/sdb1 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/sdb1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. * Failed to add partition 1 (Resource temporarily unavailable) Those two libparted messages were presented in "Libparted Error" dialogs and [Cancel] was selected both times. Libparted Error (-) Error informing the kernel about modifications to partition /dev/sdb1 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/sdb1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. [ Cancel ] [ Ignore ] Libparted Error (-) Failed to add partition 1 (Resource temporarily unavailable) [ Retry ] [ Cancel ] This is the edited output showing GParted print debugging, stracing of GParted and monitoring of udev events for this case. # ./gpartedbin /dev/sdb ====================== libparted : 3.1 ====================== ... 24.541604 +23.923435 create_partition() start (new_partition, optdet, min_size=0) new_partition.device_path="/dev/sdb" 24.556101 +0.014497 create_partition() type=PED_PARTITION_NORMAL 24.556354 +0.000253 commit() start (lp_disk) lp_disk->dev->path="/dev/sdb" D: strace pid 18054. Press [Return] to continue. ^Z [1]+ Stopped ./gpartedbin /dev/sdb # udevadm monitor & [2] 18124 monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent # strace -p 18054 -e open,ioctl,write,close & [3] 18129 strace: Process 18054 attached # fg %1 ./gpartedbin /dev/sdb 128.175811 +103.619457 commit() calling ped_disk_commit_to_dev(lp_disk) ... open("/dev/sdb", O_RDWR) = 6 ioctl(6, BLKFLSBUF) = 0 write(6, "\372\270\0\20\216\320\274\0\260\270\0\0\216\330\216\300\373\276\0|\277\0\6\271\0\2\363\244\352!\6\0"..., 512) = 512 ioctl(6, BLKFLSBUF) = 0 close(6) 128.181352 +0.005542 commit() ped_disk_commit_to_dev(lp_disk) returned true 128.181475 +0.000122 commit_to_os() start (lp_disk, timeout=10) lp_disk->dev->path="/dev/sdb" 128.181527 +0.000052 commit_to_os() calling ped_disk_commit_to_os(lp_disk) ... open("/dev/sdb", O_RDWR) = 6 ioctl(6, BLKFLSBUF) = 0 open("/sys/block/sdb/ext_range", O_RDONLY) = 7 close(7) = 0 KERNEL[1158935.380543] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) KERNEL[1158935.380565] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) KERNEL[1158935.380578] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=1, devname="", volname=""}}) = -1 ENXIO (No such device or address) ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=2, devname="", volname=""}}) = -1 ENXIO (No such device or address) ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=3, devname="", volname=""}}) = -1 ENXIO (No such device or address) ... KERNEL[1158935.380977] change /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb (block) KERNEL[1158935.381296] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) KERNEL[1158935.381367] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) KERNEL[1158935.381432] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) KERNEL[1158935.382992] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block) ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=62, devname="", volname=""}}) = -1 ENXIO (No such device or address) ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=63, devname="", volname=""}}) = -1 ENXIO (No such device or address) ioctl(6, BLKPG, {BLKPG_DEL_PARTITION, flags=0, datalen=152, data={start=0, length=0, pno=64, devname="", volname=""}}) = -1 ENXIO (No such device or address) ioctl(6, BLKPG, {BLKPG_ADD_PARTITION, flags=0, datalen=152, data={start=1048576, length=1073741824, pno=1, devname="/dev/sdb1", volname=""}}) = -1 EBUSY (Device or resource busy) write(2, "Error informing the kernel about"..., 251) = 251 Error informing the kernel about modifications to partition /dev/sdb1 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/sdb1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. UDEV [1158935.384641] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) UDEV [1158935.390203] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) UDEV [1158935.390243] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) UDEV [1158935.462866] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block) UDEV [1158935.469207] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) UDEV [1158935.471512] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) UDEV [1158935.492173] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) write(2, "Failed to add partition 1 (Resou"..., 60) = 60 Failed to add partition 1 (Resource temporarily unavailable) close(6) KERNEL[1158955.730960] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) KERNEL[1158955.731095] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) KERNEL[1158955.731314] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) KERNEL[1158955.731397] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block) KERNEL[1158955.731817] change /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb (block) KERNEL[1158955.731981] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) KERNEL[1158955.732166] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) KERNEL[1158955.732232] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) KERNEL[1158955.733955] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block) 148.533154 +20.351627 commit_to_os() ped_disk_commit_to_os(lp_disk) returned false UDEV [1158955.738262] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) UDEV [1158955.738460] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) UDEV [1158955.738525] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) 148.537648 +0.004494 execute_command() udevadm settle --timeout=10 UDEV [1158955.740864] remove /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block) UDEV [1158955.760192] change /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb (block) UDEV [1158955.801211] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb4 (block) UDEV [1158955.815262] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb3 (block) UDEV [1158955.815314] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb2 (block) UDEV [1158955.828134] add /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/sdb1 (block) 148.630797 +0.093149 execute_command() exit status 0 148.630882 +0.000085 commit_to_os() return false D: stop strace pid 18054. Press [Return] to continue. ^Z [1]+ Stopped ./gpartedbin /dev/sdb # kill %3 strace: Process 18054 detached [3]- Done strace -p 18054 -e open,ioctl,write,close # kill %2 [2] Done udevadm monitor # fg %1 ./gpartedbin /dev/sdb 173.700143 +25.069261 commit() return false 173.700470 +0.000327 create_partition() return false What happens is that GParted calls ped_disk_commit_to_dev() which opens the device, writes the updated partition table and closes the device. When the device closes the kernel initiates asynchronous uevents and user space udev rules which remove and re-add all the partitions. In the mean time GParted calls ped_disk_commit_to_os() to inform the kernel of the changes to the partition table. This involves opening the device, using ioctl() to remove all possible partitions [1] and re-add needed partitions. It finds partitions 1 to 3 already removed and accepts this along with all other non-existent partitions up to 64. When it tries to re-add partition 1 the ioctl() BLKPG_ADD_PARTITION call returns EBUSY. Presumably because the partition is in use by udev which is in the process of running the user space rules associated with removing and re-adding it. Then ped_disk_commit_to_os() closes the device which initiates a second round of asynchronous uevents and user space udev rules removing and re-adding all the partitions again. So in summary the kernel and udev are removing and re-adding the partitions exactly when libparted is trying to do exactly the same thing! [1] The algorithm in libparted 3.1 is to try to remove all possible partitions, 64 for this kernel, followed by re-adding the needed partitions. parted/libparted/arch/linux.c:_disk_sync_part_table() http://git.savannah.gnu.org/cgit/parted.git/tree/libparted/arch/linux.c?h=v3.1#n2541 Partprobe has had exactly the same issue with failing to inform the kernel about modifications to the partition table [2]. This was fixed in libparted post v3.2 release by this commit [3]. [2] rhbz#1339705 - ceph-disk prepare: Error: partprobe /dev/vdb failed : Error: Error informing the kernel about modifications to partition /dev/vdb1 -- Device or resource busy. https://bugzilla.redhat.com/show_bug.cgi?id=1339705 [3] partprobe: Open the device once for probing Previously there were 3 open/close pairs for the device, which may result in triggering extra udev actions. Instead, open it once at the start of process_dev and close it at the end. http://git.savannah.gnu.org/cgit/parted.git/commit/?id=cfafa4394998a11f871a0f8d172b13314f9062c2 Implement the same fix as implemented for partprobe. Hold a file handle open which libparted can use internally to avoid having to open() and close() the device itself twice, once for each of the calls ped_disk_commit_to_dev() and ped_disk_commit_to_os(). This avoids the first close() initiating the kernel and udev to remove and re-add the partitions exactly when ped_disk_commit_to_os() is trying to do the same thing. Bug 790418 - "Unable to inform the kernel of the change" message may lead to corrupted partition table 2017-10-09 Mike Fleetwood Remove left behind #include "ProgressBar.h" The includes were missed being removed by this earlier refactoring commit which reduced direct access to the single ProgressBar object: b1313281bdaa40a7afc19687a14ac96c919f333c Simplify use of the progress bar via OperationDetail (#760709) 2017-11-25 Mike Fleetwood Rename OperationDetailStatus STATUS_N_A to STATUS_WARNING Make the enumeration name match it's use as indicating a warning. Also spell SUCCESS correctly. Follow on to icon variable names too. 2017-11-26 Mike Fleetwood Identify libparted messages as either success or error (#790842) All libparted messages were reported as informational, even for a step which failed. Instead identify libparted messages as either informational or errors depending on whether this step was successful or not respectively. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-26 Mike Fleetwood Set the status last for the OperationDetails in mk/rm_temp_dir() (#790842) Resizing any unmounted file system which has to be mounted to be resized triggered the new GParted bug message. However the operation did complete successfully. Example operation details: Grow /dev/sdb8 from 1.00 GiB to 1.50 GiB (SUCCESS) * calibrate /dev/sdb * check file system on /dev/sdb8 for errors and (if possib...(SUCCESS) * grow partition from 1.00 GiB to 1.50 GiB (SUCCESS) * grow file system to fill the partition (SUCCESS) * mkdir -v /tmp/gparted-wvH0Ez (SUCCESS) * GParted Bug: Adding another child after no_more_chil...(ERROR) * Created directory /tmp/gparted-wvH0Ez * mount -v -t btrfs '/dev/sdb8' '/tmp/gparted-wvH0Ez' (SUCCESS) * btrfs filesystem resize 1:max '/tmp/gparted-wvH0Ez' (SUCCESS) * umount -v '/tmp/gparted-wvH0Ez' (SUCCESS) * rmdir -v /tmp/gparted-wvH0Ez (SUCCESS) * GParted Bug: Adding another child after no_more_chil...(ERROR) * Removed directory /tmp/gparted-wvH0Ez This is because set_success_and_capture_errors() was called first and the child details added after. Reverse this ordering to fix. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-25 Mike Fleetwood Transition other code to callback error collection (#790842) Transition all remaining code, DMRaid and file system code, to use the new method of reporting success of a step and automatic error collection. None of this code calls libparted so can't generate any libparted exceptions. This is just for consistency so all code follows the same pattern using set_success_and_capture_errors(). Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-25 Mike Fleetwood Refactor ntfs resize code (#790842) Refactor nested if-then-else into a sequence of if fail return early. Makes the code simpler to understand and converts separate OperationDetail::set_status() calls for success or error into a single call using ternary conditional matching how it is or was done everywhere else. This is also ready for status and error capture refactoring. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-25 Mike Fleetwood Transition code using libparted to callback error collection (#790842) Transition GParted block copying code and partition manipulation code, which uses libparted API, to the new method of reporting success of a step and automatic error collection. Libparted exceptions are now reported with the step at which they occurred. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-25 Mike Fleetwood Allow child OperationDetails to emit error capture callback too (#790842) Just copies the callback into each newly added child detail. As there are no more uses of set_success_and_capture_errors() yet, libparted errors are still only captured once at the top-level of each operation. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-25 Mike Fleetwood Capture libparted messages via callback at top-level only (#790842) Replace the explicit adding of libparted exception messages with a callback to do it instead, and fire the callback just once per operation by only changing the very top-level OperationDetail to use the new set_success_and_capture_errors(). Therefore this still produces exactly the same operation details with libparted messages at the end of each operation. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-25 Mike Fleetwood Add mechanism to capture exception messages into an OperationDetail (#790842) All code implementing a step of an operation follows this pattern: od.add_child(OperationDetail("Step heading")); od.get_last_child().add_child(OperationDetail("More details")); // Do step success = ... od.get_last_child().set_status(success ? STATUS_SUCCESS : STATUS_ERROR); At this point any libparted messages reported via exceptions need to be added into the OperationDetail tree. Also adding further children into the tree after collecting those errors needs to be prohibited (as much as the previous patch prohibited it). Add a new method which will replace the final set_status() call above like this which set the status, captures the errors and flags that further children shouldn't be added: ... od.get_last_child().set_success_and_capture_errors(status); It emits a callback to capture the errors to provide flexibility and so that the OperationDetail class doesn't have to get into the details of how GParted_Core saves libparted exception messages. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-25 Mike Fleetwood Add mechanism to stop adding more child OperationDetails (#790842) Want functionality to prevent further child details being added to an OperationDetail. This is so that the captured libparted error messages are always the last child in the list, and more details (at that point in the tree) can't be added. For example we want GParted to report like this: Move /dev/sdb3 to the right and shrink it from 1.14 GiB to...(SUCCESS) ... * shrink partition from 1.14 GiB to 1.00 GiB (SUCCESS) * old start: 4464640 old end: 6856703 old size: 2392064 (1.14 GiB) * new start: 4464640 new end: 6561791 new size: 2097152 (1.00 GiB) * libparted messages (INFO) * DEBUG: GParted generated synthetic libparted excepti... and not like this: Move /dev/sdb3 to the right and shrink it from 1.14 GiB to...(SUCCESS) ... * shrink partition from 1.14 GiB to 1.00 GiB (SUCCESS) * old start: 4464640 old end: 6856703 old size: 2392064 (1.14 GiB) * libparted messages (INFO) * DEBUG: GParted generated synthetic libparted excepti... * new start: 4464640 new end: 6561791 new size: 2097152 (1.00 GiB) So actually preventing the addition of more child details would stop users seeing information they should see. So instead just report a bug message into the operation details. This doesn't stop anything, but the bug message will be seen and allow us to fix GParted. So far nothing is enforced. This patch just adds the mechanism to report a bug when a new child detail is added when prohibited. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-24 Mike Fleetwood Also stop OperationDetail execution timer when setting status to N/A (#790842) PATCH SET SUMMARY: Libparted exception messages are reported into the operation details at the end of each separate operation. For operations which involve multiple steps of partition manipulation there is no way to identify which exceptions occurred with which steps. Example resize/move operation in which multiple libparted exceptions were raised: Move /dev/sdb to the right and shrink it from 1.15 GiB to ...(ERROR) * calibrate /dev/sdb3 (SUCCESS) * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS) * e2fsck -f -y -v -C 0 '/dev/sdb3' (SUCCESS) * shrink file system (SUCCESS) * resize2fs -p 'dev/sdb3' 1048576K (SUCCESS) * shrink partition from 1.14 GiB to 1.00 GiB (SUCCESS) * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS) * e2fsck -f -y -v -C 0 '/dev/sdb3' (SUCCESS) * grow partition from 1.00 GiB to 1.12 GiB (SUCCESS) * move file system to the right (SUCCESS) * e2image -ra -p -O 134217728 '/dev/sdb3' (SUCCESS) * shrink partition from 1.12 GiB to 1.00 GiB (ERROR) * libparted messages (INFO) * DEBUG: GParted generated synthetic libparted exception... * Error informing the kernel about modifications to part... * Error informing the kernel about modifications to part... * DEBUG: GParted generated synthetic libparted exception... * DEBUG: GParted generated synthetic libparted exception... But there is no way to know which of the libparted steps: 1 calibrate or 3 partition resize steps encountered which exceptions. Fix this by reporting the libparted messages into the operation details at the point at which they occur. Then the above example would become: Move /dev/sdb to the right and shrink it from 1.15 GiB to ...(ERROR) * calibrate /dev/sdb3 (SUCCESS) * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS) * e2fsck -f -y -v -C 0 '/dev/sdb3' (SUCCESS) * shrink file system (SUCCESS) * resize2fs -p 'dev/sdb3' 1048576K (SUCCESS) * shrink partition from 1.14 GiB to 1.00 GiB (SUCCESS) * libparted messages (INFO) * DEBUG: GParted generated synthetic libparted excepti... * check file system on /dev/sdb3 for errors and (if possib...(SUCCESS) * e2fsck -f -y -v -C 0 '/dev/sdb3' (SUCCESS) * grow partition from 1.00 GiB to 1.12 GiB (SUCCESS) * libparted messages (INFO) * Error informing the kernel about modifications to pa... * Error informing the kernel about modifications to pa... * DEBUG: GParted generated synthetic libparted excepti... * move file system to the right (SUCCESS) * e2image -ra -p -O 134217728 '/dev/sdb3' (SUCCESS) * shrink partition from 1.12 GiB to 1.00 GiB (ERROR) * libparted messages (ERROR) * DEBUG: GParted generated synthetic libparted excepti... THIS PATCH: Small change so that setting the status of an OperationDetail to N/A, warning, also stops the execution timer if it was running. Matching what happens when the status is set to either success or error. This is to avoid having to set status twice, first time just to stop the timer, and second time to set it to the desired status when reporting a warning. Bug 790842 - Report libparted messages into operation details at the point at which they occur 2017-11-11 Ask Hjorth Larsen Updated Danish translation 2017-11-04 Alan Mortensen Updated Danish translation 2017-11-01 Khaled Hosny Update Arabic translation 2017-10-15 Aurimas Černius Updated Lithuanian translation 2017-10-11 Milo Casagrande Update Italian translation 2017-10-10 Curtis Gedak Remove extraneous blank line from NEWS file 2017-10-10 Curtis Gedak Append -git to version for continuing development 2017-10-10 Curtis Gedak ========== gparted-0.30.0 ========== 2017-10-08 Claude Paroz Updated French translation 2017-10-08 Rūdolfs Mazurs Update Latvian translation 2017-10-07 Daniel Șerbănescu Update Romanian translation 2017-10-07 Daniel Șerbănescu Update Romanian translation 2017-10-04 Mario Blättermann Update German translation 2017-10-04 Daniel Mustieles Update Spanish translation 2017-10-04 Daniel Mustieles Update Spanish translation 2017-10-04 Trần Ngọc Quân Updated Vietnamese translation Signed-off-by: Trần Ngọc Quân 2017-10-03 Rafael Fontenelle Update Brazilian Portuguese translation 2017-10-03 Rafael Fontenelle Update Brazilian Portuguese translation 2017-09-26 Mike Fleetwood Extract common code into new method get_lp_partition() 2016-08-20 Mike Fleetwood Calibrate whole disk device partitions again (#788308) Fix up following switch from whole_device flag to TYPE_UNPARTITIONED. Also calibrate the type for whole disk device partitions. Bug 788308 - Remove whole_device partition flag 2016-08-20 Mike Fleetwood Restore Information dialog display of whole disk devices (#788308) So they display as previously; as all grey in the graphic and with only the correct attributes shown. Fix up following switch from whole_device flag to TYPE_UNPARTITIONED. Bug 788308 - Remove whole_device partition flag 2016-08-20 Mike Fleetwood Disallow formatting of unrecognised whole disk devices again (#788308) Fix up following switch from whole_device flag to TYPE_UNPARTITIONED. Bug 788308 - Remove whole_device partition flag 2016-08-20 Mike Fleetwood Allow Partition > New on unallocated whole disk devices again (#788308) Fix up following switch from whole_device flag to TYPE_UNPARTITIONED. Again use FS_UNALLOCATED to determine if a partition represents unallocated space and creation of a new partition should be allowed. This is so that trying to create a new partition on a whole disk device shows the "No partition table found on device /dev/DEV" warning again. Bug 788308 - Remove whole_device partition flag 2016-08-20 Mike Fleetwood Select unallocated whole disk devices again (#788308) After the change from whole_device flag to TYPE_UNPARTITIONED, unallocated whole disk devices are no longer automatically selected because the partition type is no longer TYPE_UNALLOCATED. Fix by checking for file system type FS_UNALLOCATED when identifying the largest unallocated space. Bug 788308 - Remove whole_device partition flag 2016-08-20 Mike Fleetwood Display unrecognised whole disk devices as all grey again (#788308) Following the switch from whole_device flag to TYPE_UNPARTITIONED, unallocated space can be found in two partition types: TYPE_UNALLOCATED TYPE_UNPARTITIONED (only when filesystem == FS_UNALLOCATED) As the file system in both cases is FS_UNALLOCATED check for that when determining whether a partition is unallocated or not. Bug 788308 - Remove whole_device partition flag 2016-08-19 Mike Fleetwood Switch from whole_device flag to TYPE_UNPARTITIONED (#788308) Remove whole_device flag and replace with new partition type TYPE_UNPARTITIONED. Minimally adapt the remaining code to compile and run. Bug 788308 - Remove whole_device partition flag 2016-08-13 Mike Fleetwood Add TYPE_UNPARTITIONED partition type (#788308) Just adds the enumeration. Using it will follow. Bug 788308 - Remove whole_device partition flag 2016-08-19 Mike Fleetwood Update partition related checks in set_valid_operations() (#788308) Update the partition can be named and partition flags can be managed checks from being disallowed on unallocated partition types, to being allowed on primary, logical and extended partition types. This is in preparation for the introduction of new unallocated partition type. Bug 788308 - Remove whole_device partition flag 2016-08-19 Mike Fleetwood Add FILESYSTEM_MAP[FS_EXTENDED] entry Now when refreshing the devices, GParted_Core::read_label() calls GParted_Core::get_fs() with parameter FS_EXTENDED. Before this change, get_fs() would fail to find file system capabilities set for FS_EXTENDED and construct a not supported capabilities set and return that. Afterwards, find_supported_filesystems() creates a not supported capabilities set from the NULL pointer for FS_EXTENDED and adds this entry into the FILESYSTEMS vector. Then get_fs() finds that not supported capabilities set for FS_EXTENDED in the FILESYSTEMS vector and returns that. This makes no functional difference. It just seems right as other unsupported but used file system types have entries in FILESYSTEM_MAP. See this earlier commit doing the same thing: 7870a92b8097b3b8067cc87b891451d5164e9b74 Add FILESYSTEM_MAP[FS_UNALLOCATED] entry 2016-08-19 Mike Fleetwood Remove some unnecessary extended partition checks from GParted_Core (#788308) For example GParted_Core::read_label() is already called for empty partitions where .filesystem = FS_UNKNOWN. In that case get_fs() returns an unsupported capability set with all capabilities set to FS::NONE. The same would be true extended partitions where .filesystem = FS_EXTENDED too; get_fs() would return an unsupported capability set with all capabilities set to FS::NONE. Therefore the if not extended partition condition around the switch statements is not necessary in GParted_Core::read_label(), read_uuid(), label_filesystem() and change_uuid(). Remove. This also achieves removal of some uses of partition type enumerations in advance of the introduction of new partition type TYPE_UNPARTITIONED. Bug 788308 - Remove whole_device partition flag 2016-08-13 Mike Fleetwood Add and use Partition::set_unpartitioned() method (#788308) PATCHSET OVERVIEW: When unpartitioned drive read-write support was added this commit added a whole_device flag: 5098744f9aa958ba18d2a4657ea4345e275c885b Add whole_device flag to the partition object (#743181) Using a whole_device flags now seems not the correct way to model unpartitioned drives. GParted models an uninitialised drive as: .path = _("uninitialized") .type = TYPE_UNALLOCATED .whole_device = true .filesystem = FS_UNALLOCATED and a whole drive file system, using ext4 for example, as: .path = "/dev/sdb" .type = TYPE_PRIMARY .whole_device = true .filesystem = FS_EXT4 No partitioning changed yet the type of the partition in the model changed between TYPE_UNALLOCATED and TYPE_PRIMARY depending on whether the whole drive contains a recognised file system or not. The partition object describing a file system within a LUKS encryption mapping is another case of the model not matching reality. .path = /dev/mapper/crypt_sdb1_crypt .type = TYPE_PRIMARY .whole_device = true .filesystem = FS_EXT4 There is no partition table within the encryption mapping, the file system fills it, but GParted records it as a primary partition. Make TYPE_UNALLOCATED and TYPE_PRIMARY be reserved for representing unallocated space and primary partitions within a partitioned disk drive and introduce new TYPE_UNPARTITIONED for all cases of an unpartitioned whole disk drive. The GParted UI does differentiate between an unallocated whole disk device and anything else by requiring a partition table to be created first, even if that is just the loop partition table. That determination can simply look for the partition object containing file system type FS_UNALLOCATED instead. THIS PATCH: Create set_unpartitioned() helper method to set a partition object to represent a whole disk drive and use everywhere such an object is modelled. This matches what existing methods Set_Unallocated() and indeed Set() do for unallocated space and any type of partition respectively. For now the partition type is still set to either TYPE_UNALLOCATED or TYPE_PRIMARY so the rest of the code base remains the same. TYPE_UNPARTITIONED will be introduced later. Bug 788308 - Remove whole_device partition flag 2017-10-02 Mario Blättermann Update German translation 2017-09-30 Dušan Kazik Update Slovak translation 2017-09-28 Anders Jonsson Update Swedish translation 2017-09-25 Marek Cernocky Updated Czech translation 2017-09-25 Curtis Gedak Convert Manual links to HTTPS where possible and update version 2017-09-16 Mike Fleetwood Describe Create New Partition / Partition name field in the Manual Missed when adding partition naming at creation time in enhancement: Bug 746214 - Partition naming enhancements starting with this commit: f804bc3244c1ee4509fe02b66990709566b69d08 Allow partition naming on busy partitions (#746214) 2017-09-19 Mike Fleetwood Pass string literals directly to execute_command() There were a few cases of creating a local string variable from a literal and then passing the variable to execute_command() like this: Glib::ustring cmd = "whatever"; Utils::execute_command( cmd, ... ); This creates an unnecessary local variable. Instead pass the string literal directly to Utils::execute_command() like this: Utils::execute_command( "whatever", ... ); This also make the code a little bit more grep friendly. 2017-09-21 Mike Fleetwood Stop nicing external commands run by the DMRaid module (#788007) No other commands run by GParted are niced, so stop nicing commands run from the DMRaid module. I think nicing of possibly long running file system modification commands would have made virtually no difference because "nice -n 19" lowered the CPU priority, but such command would be I/O bound. History: Nicing of file system modification commands was added by this commit from 2006-08-21: 82e6f6b132fd7960950a71a2af2db6ef93fde583 added nice -n 19, so that all extensive filesystem operations will be Nicing of DMRaid operations was copied into the DMRaid module when it was added here in 2009-03-14: 5865c92dc054dc87739e6a70b21f91825f214c9e Added new class for dmraid support Nicing was removed from file system modification commands with this commit from 2013-02-22: 52a2a9b00a32996921ace055e71d0e09fb33c5fe Reduce threading (#685740) Bug 788007 - Remove minor bits of legacy from DMRaid module 2017-09-21 Mike Fleetwood Remove backward compatibility for dmraid without -P option (#788007) The -P option was first added to dmraid-1.0.0.rc15 released 2006-09-17 [1]. dmraid-1.0.0.rc16 (a later release) was included in Debian 6 and Ubunbu 12.04 LTS. dmraid-1.0.0.rc13 was included in RedHat/CentOS 5 however the -P option was back ported into RedHat/CentOS 5.1. All of these distributions are so old as to be no longer supported and yet they provided the dmraid -P option. Therefore backward compatibility for dmraid without the -P option is no longer required. So remove it. [1] old dmraid source code releases http://people.redhat.com/heinzm/sw/dmraid/src/old/ Bug 788007 - Remove minor bits of legacy from DMRaid module 2017-09-25 Andre Klapper Fix typo in Romanian user docs translation 2017-09-25 Andre Klapper Fix typo in pt_BR user docs translation 2017-09-03 Pali Rohár Correctly quote and escape arguments passed to external commands (#787203) Trying to set a file system label to (including the double quotes): " --help " fails. For example labelling an ext4 file system would try to run this command: # e2label /dev/sdb1 "" --help "" Usage: e2label device [newlabel] # echo $? 1 Alternatively trying to create a file system with a label of just a double quote also fails. The Applying Pending Operations dialog waits forever and won't cancel or force cancel. Have to use the window manager close window button to close the dialog. Also GParted reports this error to the console: (gpartedbin:9648): glibmm-CRITICAL **: unhandled exception (type Glib::Error) in signal handler: domain: g-shell-error-quark code : 0 what : Text ended before matching quote was found for ". (The text was 'mkfs.xfs -f -L """ /dev/sdb2') Command strings are parsed and split into argv array by function Glib::shell_parse_argv() which calls internal glib function tokenize_command_line() for shell tokenization. It expects the command string to be properly quoted and escaped and after tokenization, calls g_shell_unquote() on every parsed argument. So to prevent constructing incorrect commands, every non-static string needs to be properly quoted. GParted only puts labels and mount points into double quotes, but has not escaped special characters in those values itself. This patch fixes all these problems by using Glib::shell_quote() on all variable values. Labels, mount points, paths and all others too. Probably a better solution would be to use a new function which takes argv array instead of one string with all the, correctly quoted and escaped, arguments concatenated together. Bug 787203 - Correctly quote and escape arguments of external programs passed to execute_command() 2017-09-03 Pali Rohár Correctly quote and escape command line argument passed to "sh -c" (#787203) Shell fragments must be properly quoted and escaped to prevent execution of unintended commands derived from user controllable data. For example: $ printf '#!/bin/sh\necho test > out\n' > script.sh $ chmod +x script.sh $ truncate -s 20M 'jfs;script.sh' $ mkfs.jfs -q 'jfs;script.sh' $ ls -l out ls: cannot access out: No such file or directory $ sudo PATH=$PWD:$PATH /usr/local/bin/gparted 'jfs;script.sh' $ sudo PATH=$PWD:$PATH /usr/local/bin/gparted 'jfs;script.sh' $ ls -l out -rw-r--r-- 1 root root 5 Sep 12 23:11 out $ cat out test What is happening is that jfs::set_used_sectors() is using the device name 'jfs;script.sh' without quoting it and passing it to the shell to execute like this: sh -c 'echo dm | jfs_debugfs jfs;script.sh' which the shell duly executes as these two commands: echo dm | jfs_debugfs jfs script.sh This could be a security related issue as "sh -c" is able to execute arbitrary shell commands from the argument if if contains shell special characters. Use Glib::shell_quote() [1] to quote and escape file names and whole commands passed to the shell. [1] Glib::shell_quote(const std::string & unquoted_string) https://developer.gnome.org/glibmm/stable/group__ShellUtils.html "Quotes a string so that the shell (/bin/sh) will interpret the quoted string to mean unquoted_string. If you pass a filename to the shell, for example, you should first quote it with this function." Bug 787203 - Correctly quote and escape arguments of external programs passed to execute_command() 2017-09-02 Pali Rohár Make sure that FS_Info cache is loaded for all named paths (#787181) Naming a file system image file on the command line is shown by GParted as unknown. $ truncate -s 100M /tmp/fat.img $ mkfs.vfat /tmp/fat.img $ sudo ./gpartedbin /tmp/fat.img Currently the FS_Info cache is loaded for all devices reported by blkid (plus all whole disk devices identified from /proc/partitions even if blkid reports nothing). However file system images named on the command line are not queried so GParted can't identify them. Fix by ensuring that the FS_Info blkid cache is loaded for all named devices, including named file system image files. Note that Mount_Info::load_cache() depends on the contents of the FS_Info cache to lookup UUID= and LABEL= device names from /etc/fstab. However only file systems in block devices can be mounted like this, and never file system image files, so the fact that the cache may be extended afterwards by FS_Info::load_cache_for_paths() does not matter. History Prior to version 0.22.0, when unpartitioned drive support was added, GParted could recognise some file system image files using loop partition handling in libparted. However libparted before version 3.2 reported the loop partition name as the whole disk device name appended with "1" so all the query commands were provided a non-existent name to use. Therefore no file system usage or the label was displayed. Bug 787181 - Fix detection of file system images 2017-09-10 Anders Jonsson Update Swedish translation 2017-09-09 Daniel Șerbănescu Update Romanian translation 2017-09-07 gogo Update Croatian translation 2017-09-03 Pali Rohár Update list of prohibited fat label characters (#787202) Add double quote (") to the list of prohibited FAT label characters, previously missed [1][2]. Also add single quote (') because mlabel encoded it in a way that both Windows and blkid don't understand, although mlabel can correctly decode it itself. # export MTOOLS_SKIP_CHECK=1 # mlabel ::"MIKE'S" -i /dev/sdf1 # mlabel -s :: -i /dev/sdf1 Volume label is MIKE'S (abbr=MIKE_S~1???) # blkid -o value -s LABEL /dev/sdf1 MIKE_S~1??? (8-bit characters in the above output have been replaced with question marks (?) just to keep this commit message as 7-bit ASCII). Finally exclude ASCII control characters below SPACE (0x00 to 0x1F) as they also cause mlabel to ask a question and wait for input in the same way that prohibited characters do. As discussed in the previous commit [1] the only way to stop GParted waiting forever is to manually kill mlabel with signal 9 (KILL). # mlabel ::"^A" -i /dev/sdf1 Long file name "^A" contains illegal character(s). a)utorename A)utorename-all r)ename R)ename-all s)kip S)kip-all q)uit (aArRsSq): [1] 584137b32b4deed2c20022628baaee6b38570fa5 Remove prohibited characters from FAT16/32 labels (#755608) [2] Microsoft TechNet: Label https://technet.microsoft.com/en-us/library/bb490925.aspx Bug 787202 - Update list of prohibited fat label characters 2017-09-05 Balázs Úr Update Hungarian translation 2017-09-04 Marek Cernocky Updated Czech translation 2017-09-03 Piotr Drąg Update Polish translation 2017-08-28 Mike Fleetwood Support /etc/fstab using Unicode labels as mount points (#786502) So far GParted is still loading the default non-reversible encoded labels from blkid in the initial loading of the FS_Info module cache. This encoded label is used to match LABEL=