Make btrfs support a normal part of gparted

Remove need to configure with the --enable-btrfs option in order
to include btrfs support in gparted.
This commit is contained in:
Curtis Gedak 2010-10-18 15:26:07 -06:00
parent f7a5ecfc08
commit b0e36132b0
7 changed files with 10 additions and 68 deletions

View File

@ -170,24 +170,6 @@ fi
AM_CONDITIONAL([DISABLE_DOC], [test ${enable_doc} = no])
dnl ******************************
dnl Optional btrfs support
dnl ******************************
with_btrfs="no"
AC_ARG_ENABLE( btrfs,
AS_HELP_STRING([--enable-btrfs], [enable experimental btrfs support (disabled by default)]),
with_btrfs=$enableval,
with_btrfs=no)
if test "x$with_btrfs" = "xyes"; then
with_btrfs="yes"
AC_DEFINE(BTRFS_SUPPORT,1,[Build in btrfs support])
else
with_btrfs="no"
fi
AM_CONDITIONAL(BTRFS_SUPPORT, test "x$with_btrfs" = "xyes")
AC_CONFIG_FILES([
Makefile
@ -212,8 +194,6 @@ echo ""
echo "================ Final configuration ==================="
echo " Installing into prefix : $prefix"
echo ""
echo " Enable btrfs support? : $with_btrfs"
echo ""
echo " Build documentation? : $enable_doc"
echo ""
echo " Need part table re-read work around? : $need_pt_reread_work_around"

View File

@ -1,9 +1,5 @@
gparted_includedir = $(pkgincludedir)
if BTRFS_SUPPORT
btrfs_source = btrfs.h
endif
EXTRA_DIST = \
Device.h \
Dialog_Base_Partition.h \
@ -38,6 +34,7 @@ EXTRA_DIST = \
TreeView_Detail.h \
Utils.h \
Win_GParted.h \
btrfs.h \
ext2.h \
ext3.h \
ext4.h \
@ -52,5 +49,4 @@ EXTRA_DIST = \
reiser4.h \
reiserfs.h \
ufs.h \
xfs.h \
$(btrfs_source)
xfs.h

View File

@ -113,9 +113,6 @@ void DialogFeatures::load_filesystems( const std::vector<FS> & FILESYSTEMS )
{
//Skip luks, lvm2, and unknown because these are not file systems
if (
#ifndef BTRFS_SUPPORT
FILESYSTEMS[ t ] .filesystem == GParted::FS_BTRFS ||
#endif
FILESYSTEMS[ t ] .filesystem == GParted::FS_LUKS ||
FILESYSTEMS[ t ] .filesystem == GParted::FS_LVM2 ||
FILESYSTEMS[ t ] .filesystem == GParted::FS_UNKNOWN

View File

@ -27,8 +27,8 @@
#include "../include/OperationFormat.h"
#include "../include/OperationResizeMove.h"
#include "../include/OperationLabelPartition.h"
#include "../config.h"
#include "../include/btrfs.h"
#include "../include/ext2.h"
#include "../include/ext3.h"
#include "../include/ext4.h"
@ -43,9 +43,6 @@
#include "../include/hfsplus.h"
#include "../include/reiser4.h"
#include "../include/ufs.h"
#ifdef BTRFS_SUPPORT
#include "../include/btrfs.h"
#endif
#include <set>
#include <cerrno>
#include <cstring>
@ -90,14 +87,9 @@ void GParted_Core::find_supported_filesystems()
FILESYSTEMS .clear() ;
FS fs_notsupp;
#ifdef BTRFS_SUPPORT
btrfs fs_btrfs;
FILESYSTEMS .push_back( fs_btrfs .get_filesystem_support() ) ;
#else
//btrfs FIXME: Add full support when on-disk-format stabilized
fs_notsupp.filesystem = GParted::FS_BTRFS;
FILESYSTEMS .push_back( fs_notsupp ) ;
#endif
ext2 fs_ext2;
FILESYSTEMS .push_back( fs_ext2 .get_filesystem_support() ) ;
@ -1204,11 +1196,6 @@ GParted::FILESYSTEM GParted_Core::get_filesystem()
if ( 0 == memcmp( magic1, BTRFS_SIGNATURE, strlen(BTRFS_SIGNATURE) ) )
{
#ifndef BTRFS_SUPPORT
temp = _( "BTRFS is not yet supported." ) ;
temp += "\n" ;
partition_temp .messages .push_back( temp ) ;
#endif
return GParted::FS_BTRFS ;
}
@ -1312,9 +1299,6 @@ void GParted_Core::set_mountpoints( std::vector<Partition> & partitions )
partitions[ t ] .filesystem != GParted::FS_LINUX_SWAP &&
partitions[ t ] .filesystem != GParted::FS_LVM2 &&
partitions[ t ] .filesystem != GParted::FS_LUKS
#ifndef BTRFS_SUPPORT
&& partitions[ t ] .filesystem != GParted::FS_BTRFS
#endif
)
{
if ( partitions[ t ] .busy )
@ -1375,9 +1359,6 @@ void GParted_Core::set_used_sectors( std::vector<Partition> & partitions )
for ( unsigned int t = 0 ; t < partitions .size() ; t++ )
{
if ( partitions[ t ] .filesystem != GParted::FS_LINUX_SWAP &&
#ifndef BTRFS_SUPPORT
partitions[ t ] .filesystem != GParted::FS_BTRFS &&
#endif
partitions[ t ] .filesystem != GParted::FS_LUKS &&
partitions[ t ] .filesystem != GParted::FS_LVM2 &&
partitions[ t ] .filesystem != GParted::FS_UNKNOWN
@ -2887,6 +2868,7 @@ bool GParted_Core::set_proper_filesystem( const FILESYSTEM & filesystem )
switch( filesystem )
{
case FS_BTRFS : p_filesystem = new btrfs() ; break ;
case FS_EXT2 : p_filesystem = new ext2() ; break ;
case FS_EXT3 : p_filesystem = new ext3() ; break ;
case FS_EXT4 : p_filesystem = new ext4() ; break ;
@ -2901,9 +2883,6 @@ bool GParted_Core::set_proper_filesystem( const FILESYSTEM & filesystem )
case FS_HFS : p_filesystem = new hfs() ; break ;
case FS_HFSPLUS : p_filesystem = new hfsplus() ; break ;
case FS_UFS : p_filesystem = new ufs() ; break ;
#ifdef BTRFS_SUPPORT
case FS_BTRFS : p_filesystem = new btrfs() ; break ;
#endif
default : p_filesystem = NULL ;
}

View File

@ -7,10 +7,6 @@ AM_CFLAGS = -Wall
AM_CXXFLAGS = -Wall
if BTRFS_SUPPORT
btrfs_source = btrfs.cc
endif
sbin_PROGRAMS = gpartedbin
gpartedbin_SOURCES = \
@ -47,6 +43,7 @@ gpartedbin_SOURCES = \
TreeView_Detail.cc \
Utils.cc \
Win_GParted.cc \
btrfs.cc \
ext2.cc \
ext3.cc \
ext4.cc \
@ -61,9 +58,8 @@ gpartedbin_SOURCES = \
reiser4.cc \
reiserfs.cc \
ufs.cc \
xfs.cc \
$(btrfs_source)
xfs.cc
gpartedbin_LDFLAGS = -lparted -lgthread-2.0
gpartedbin_LDADD = $(GTKMM_LIBS)

View File

@ -17,7 +17,6 @@
*/
#include "../include/Utils.h"
#include "../config.h"
#include <sstream>
#include <iomanip>
@ -166,6 +165,7 @@ Glib::ustring Utils::get_filesystem_software( FILESYSTEM filesystem )
{
switch( filesystem )
{
case FS_BTRFS : return "btrfs-tools" ;
case FS_EXT2 : return "e2fsprogs" ;
case FS_EXT3 : return "e2fsprogs" ;
case FS_EXT4 : return "e2fsprogs v1.41+" ;
@ -179,9 +179,6 @@ Glib::ustring Utils::get_filesystem_software( FILESYSTEM filesystem )
case FS_REISER4 : return "reiser4progs" ;
case FS_REISERFS : return "reiserfsprogs" ;
case FS_UFS : return "" ;
#ifdef BTRFS_SUPPORT
case FS_BTRFS : return "btrfs-tools" ;
#endif
case FS_XFS : return "xfsprogs" ;
default : return "" ;

View File

@ -393,11 +393,8 @@ Gtk::Menu * Win_GParted::create_format_menu()
for ( unsigned int t =0; t < gparted_core .get_filesystems() .size() ; t++ )
{
//Skip btrfs, luks, lvm2, and unknown because these are not file systems
//Skip luks, lvm2, and unknown because these are not file systems
if (
#ifndef BTRFS_SUPPORT
gparted_core .get_filesystems()[ t ] .filesystem == GParted::FS_BTRFS ||
#endif
gparted_core .get_filesystems()[ t ] .filesystem == GParted::FS_LUKS ||
gparted_core .get_filesystems()[ t ] .filesystem == GParted::FS_LVM2 ||
gparted_core .get_filesystems()[ t ] .filesystem == GParted::FS_UNKNOWN