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] 8b42bab1ee
    modern-gtk2: Require Gtkmm version 2.24 (!17)

Closes !22 - Increase minimums to libparted 2.2 and glibmm 2.32
This commit is contained in:
Mike Fleetwood 2018-12-18 17:34:35 +00:00 committed by Curtis Gedak
parent 1467ea8189
commit 8df975c7d1
2 changed files with 1 additions and 44 deletions

View file

@ -70,7 +70,7 @@ dnl Check for minimum required libparted version.
dnl 1) Check using pkg-config.
dnl (Older distros tend to not provide pkg-config information for libparted).
dnl 2) Check by linking and running a program to report libparted version directly.
LIBPARTED_REQUIRED_VERSION='1.7.1'
LIBPARTED_REQUIRED_VERSION='2.2'
AC_MSG_CHECKING([for libparted >= $LIBPARTED_REQUIRED_VERSION (querying pkg-config)])
LIBPARTED_REQUIRED_INT=`echo "$LIBPARTED_REQUIRED_VERSION" |
$AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
@ -141,26 +141,6 @@ else
fi
dnl Check for libparted >= 2.2 for improved informing the kernel to
dnl re-read the partition table code and support of larger sector sizes
dnl (> 512 bytes).
LIBPARTED_WANTED_VERSION='2.2'
AC_MSG_CHECKING([for libparted >= $LIBPARTED_WANTED_VERSION (improved pt re-read)])
LIBPARTED_WANTED_INT=`echo "$LIBPARTED_WANTED_VERSION" |
$AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
if test "$LIBPARTED_FOUND_INT" -ge "$LIBPARTED_WANTED_INT"; then
AC_DEFINE([USE_LIBPARTED_LARGE_SECTOR_SUPPORT], 1,
[Define to 1 to use libparted large sector support])
need_pt_reread_workaround=no; support_large_sector_sizes=yes
AC_MSG_RESULT([(cached) yes])
else
AC_DEFINE([ENABLE_PT_REREAD_WORKAROUND], 1,
[Define to 1 to enable partition re-read workaround])
need_pt_reread_workaround=yes; support_large_sector_sizes=no
AC_MSG_RESULT([(cached) no])
fi
dnl Check for ped_file_system_resize() function to determine the existence
dnl of the API in the original parted library. Available in parted <= 2.4.
dnl

View file

@ -4236,19 +4236,6 @@ bool GParted_Core::useable_device( PedDevice * lp_device )
{
g_assert( lp_device != NULL ); // Bug: Not initialised by call to ped_device_get() or ped_device_get_next()
#ifndef USE_LIBPARTED_LARGE_SECTOR_SUPPORT
if ( lp_device->sector_size != 512 )
{
/* TO TRANSLATORS: looks like Ignoring device /dev/sde with logical sector size of 2048 bytes. */
Glib::ustring msg = String::ucompose ( _("Ignoring device %1 with logical sector size of %2 bytes."),
lp_device ->path, lp_device ->sector_size );
msg += "\n";
msg += _("GParted requires libparted version 2.2 or higher to support devices with sector sizes larger than 512 bytes.");
std::cout << msg << std::endl << std::endl;
return false;
}
#endif
char * buf = static_cast<char *>( malloc( lp_device->sector_size ) );
if ( ! buf )
return false;
@ -4385,16 +4372,6 @@ bool GParted_Core::commit_to_os( PedDisk* lp_disk, std::time_t timeout )
{
#endif
succes = ped_disk_commit_to_os( lp_disk ) ;
#ifdef ENABLE_PT_REREAD_WORKAROUND
//Work around to try to alleviate problems caused by
// bug #604298 - Failure to inform kernel of partition changes
// If not successful the first time, try one more time.
if ( ! succes )
{
sleep( 1 ) ;
succes = ped_disk_commit_to_os( lp_disk ) ;
}
#endif
#ifndef USE_LIBPARTED_DMRAID
}
#endif