diff options
author | Antoine Viallon | 2019-03-16 20:47:09 +0000 |
---|---|---|
committer | Antoine Viallon | 2019-03-16 20:49:35 +0000 |
commit | d47a23f16634e6d2246c692333fc7dd95db29f02 (patch) | |
tree | db169e1f19246c58ada1180beb7424cfc63f9e31 | |
download | aur-d47a23f16634e6d2246c692333fc7dd95db29f02.tar.gz |
Initialisation of the repo
-rw-r--r-- | .SRCINFO | 36 | ||||
-rw-r--r-- | PKGBUILD | 58 | ||||
-rw-r--r-- | f2fs-verify-resize.patch | 148 |
3 files changed, 242 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..fe84569769c5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,36 @@ +pkgbase = gparted-f2fs-patch + pkgdesc = A Partition Magic clone, frontend to GNU Parted. Patched with experimental F2FS features. + pkgver = 0.33.0 + pkgrel = 1 + url = http://gparted.sourceforge.net + arch = x86_64 + license = GPL + makedepends = intltool + makedepends = pkg-config + makedepends = gnome-doc-utils + makedepends = polkit + depends = parted + depends = gtkmm + optdepends = dosfstools: for FAT16 and FAT32 partitions + optdepends = jfsutils: for jfs partitions + optdepends = f2fs-tools: for Flash-Friendly File System + optdepends = btrfs-progs: for btrfs partitions + optdepends = exfat-utils: for exFAT partitions + optdepends = ntfs-3g: for ntfs partitions + optdepends = reiserfsprogs: for reiser partitions + optdepends = udftools: for UDF file system support + optdepends = xfsprogs: for xfs partitions + optdepends = nilfs-utils: for nilfs2 support + optdepends = polkit: to run gparted from application menu + optdepends = gpart: for recovering corrupt partition tables + optdepends = mtools: utilities to access MS-DOS disks + provides = gparted + conflicts = gparted + source = https://downloads.sourceforge.net/project/gparted/gparted/gparted-0.33.0/gparted-0.33.0.tar.gz + source = https://downloads.sourceforge.net/project/gparted/gparted/gparted-0.33.0/gparted-0.33.0.tar.gz.sig + validpgpkeys = BB09FFB87563FA2E1A22146817A6D3FF338C9570 + sha256sums = 5023b8c983f88a22e65bf6f09a12ea09369defc008981b52ee8b96a3879f81d6 + sha256sums = SKIP + +pkgname = gparted-f2fs-patch + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5f66e5ae1115 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: Antoine Viallon <antoine.viallon@gmail.com> + +pkgname=gparted-f2fs-patch +_pkgname=gparted +pkgver=0.33.0 +norigpkgver=0.33.0 +pkgrel=1 +pkgdesc="A Partition Magic clone, frontend to GNU Parted. Patched with experimental F2FS features." +arch=('x86_64') +url="http://gparted.sourceforge.net" +license=('GPL') +provides=('gparted') +conflicts=('gparted') +depends=('parted' 'gtkmm') +makedepends=('intltool' 'pkg-config' 'gnome-doc-utils' 'polkit') +optdepends=('dosfstools: for FAT16 and FAT32 partitions' + 'jfsutils: for jfs partitions' + 'f2fs-tools: for Flash-Friendly File System' + 'btrfs-progs: for btrfs partitions' + 'exfat-utils: for exFAT partitions' + 'ntfs-3g: for ntfs partitions' + 'reiserfsprogs: for reiser partitions' + 'udftools: for UDF file system support' + 'xfsprogs: for xfs partitions' + 'nilfs-utils: for nilfs2 support' + 'polkit: to run gparted from application menu' + 'gpart: for recovering corrupt partition tables' + 'mtools: utilities to access MS-DOS disks') +validpgpkeys=('BB09FFB87563FA2E1A22146817A6D3FF338C9570') # "Curtis Gedak <gedakc@gmail.com>" +source=("https://downloads.sourceforge.net/project/${_pkgname}/${_pkgname}/${_pkgname}-${pkgver}/${_pkgname}-${pkgver}.tar.gz"{,.sig}) +sha256sums=('5023b8c983f88a22e65bf6f09a12ea09369defc008981b52ee8b96a3879f81d6' + 'SKIP') + +build() { + cd "${srcdir}/${_pkgname}-${pkgver}" + + patch -Np1 < ../../f2fs-verify-resize.patch + #patch -Np1 < "${srcdir}/${_pkgname}-${pkgver}/f2fs-verify-resize.patch" + + ./configure --prefix=/usr \ + --sbindir=/usr/bin \ + --enable-online-resize \ + --enable-libparted-dmraid \ + --enable-xhost-root + + CFLAGS="$CFLAGS -Wparentheses" CXXFLAGS="$CXXFLAGS -Wparentheses" make +} + +package() { + cd "${srcdir}/${_pkgname}-${pkgver}" + + make DESTDIR="${pkgdir}" install + + # Install policy file + install -D -m0644 org.gnome.gparted.policy \ + "${pkgdir}"/usr/share/polkit-1/actions/org.gnome.gparted.policy + +} diff --git a/f2fs-verify-resize.patch b/f2fs-verify-resize.patch new file mode 100644 index 000000000000..674e3345850f --- /dev/null +++ b/f2fs-verify-resize.patch @@ -0,0 +1,148 @@ +diff --git a/include/f2fs.h b/include/f2fs.h +index a7b6cb0c..e2de221d 100644 +--- a/include/f2fs.h ++++ b/include/f2fs.h +@@ -29,6 +29,10 @@ class f2fs : public FileSystem + public: + FS get_filesystem_support() ; + bool create( const Partition & new_partition, OperationDetail & operationdetail ) ; ++ bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition ); ++ bool check_repair( const Partition & partition, OperationDetail & operationdetail ); ++ void set_used_sectors( Partition & partition ) ; ++ void read_label( Partition & partition ); + }; + + } //GParted +diff --git a/src/f2fs.cc b/src/f2fs.cc +index 9bb945c3..704bb71e 100644 +--- a/src/f2fs.cc ++++ b/src/f2fs.cc +@@ -37,6 +37,26 @@ FS f2fs::get_filesystem_support() + fs.create_with_label = FS::EXTERNAL; + } + ++ if ( ! Glib::find_program_in_path( "resize.f2fs" ).empty() ) ++ { ++ fs.grow = FS::EXTERNAL; ++ ++ } ++ ++ if ( ! Glib::find_program_in_path( "fsck.f2fs" ).empty() ) ++ fs.check = FS::EXTERNAL; ++ ++ if ( ! Glib::find_program_in_path( "dump.f2fs").empty() ) ++ { ++ fs.read = FS::EXTERNAL; ++ } ++ ++ if ( ! Glib::find_program_in_path( "blkid" ).empty() ) ++ { ++ fs.read_label = FS::EXTERNAL; ++ //fs.write_label = FS::EXTERNAL; ++ } ++ + fs .copy = FS::GPARTED ; + fs .move = FS::GPARTED ; + fs .online_read = FS::GPARTED ; +@@ -44,6 +64,76 @@ FS f2fs::get_filesystem_support() + return fs ; + } + ++void f2fs::read_label( Partition & partition ) ++{ ++ if ( ! Utils::execute_command( "blkid -s LABEL " + Glib::shell_quote( partition.get_path() ), ++ output, error, true ) ) ++ { ++ partition.set_filesystem_label( Utils::regexp_label( output, "LABEL=\"(\\w*)\"" ) ); ++ } ++ else ++ { ++ if ( ! output .empty() ) ++ partition.push_back_message( output ); ++ ++ if ( ! error .empty() ) ++ partition.push_back_message( error ); ++ } ++} ++ ++void f2fs::set_used_sectors( Partition & partition ) ++{ ++ // Try to get an estimation on how many free "segments" there is. It seems to be proportional. ++ if ( ! Utils::execute_command( "dump.f2fs -d 1 " + Glib::shell_quote( partition.get_path() ), output, error, true )) ++ { ++ ++ if ( partition .busy ) ++ { ++ Byte_Value ignored ; ++ Byte_Value fs_free ; ++ if ( Utils::get_mounted_filesystem_usage( partition .get_mountpoint(), ++ ignored, fs_free, error ) == 0 ) ++ { ++ N = fs_free / S; ++ } ++ else ++ { ++ N = -1 ; ++ partition.push_back_message( error ); ++ } ++ } else { ++ Glib::ustring temp; ++ temp = Utils::regexp_label( output, "segment_count\\s+\\[0x\\s+[0-9a-f]+ : ([0-9]+)\\]" ) ; ++ sscanf( temp.c_str(), "%lld", &T ); ++ temp = Utils::regexp_label( output, "free_segment_count\\s+\\[0x\\s+[0-9a-f]+ : ([0-9]+)\\]" ) ; ++ sscanf( temp.c_str(), "%lld", &N ); ++ temp = Utils::regexp_label( output, "sector size = ([0-9]+)" ) ; ++ sscanf( temp.c_str(), "%lld", &S ); ++ ++ T = T * S * 8; ++ N = N * S * 8; ++ partition.sector_size = S; ++ } ++ ++ if ( T > -1 && N > -1 && S > -1 ) ++ { ++ T = Utils::round( T * ( S / double(partition.sector_size) ) ); ++ N = Utils::round( N * ( S / double(partition.sector_size) ) ); ++ ++ partition .set_sector_usage( T, N ); ++ partition.fs_block_size = S; ++ } ++ } ++ else ++ { ++ if ( ! output .empty() ) ++ partition.push_back_message( output ); ++ ++ if ( ! error .empty() ) ++ partition.push_back_message( error ); ++ } ++} ++ + bool f2fs::create( const Partition & new_partition, OperationDetail & operationdetail ) + { + return ! execute_command( "mkfs.f2fs -l " + Glib::shell_quote( new_partition.get_filesystem_label() ) + +@@ -51,4 +141,24 @@ bool f2fs::create( const Partition & new_partition, OperationDetail & operationd + operationdetail, EXEC_CHECK_STATUS ); + } + ++bool f2fs::resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition ) ++{ ++ Glib::ustring str_temp = "resize.f2fs " + Glib::shell_quote( partition_new.get_path() ); ++ ++ if ( ! fill_partition ) ++ str_temp += " -t " + Utils::num_to_str( floor( Utils::sector_to_unit( ++ partition_new .get_sector_length(), partition_new .sector_size, UNIT_KIB ) ) ); ++ ++ return ! execute_command( str_temp, operationdetail, EXEC_CHECK_STATUS ); ++} ++ ++bool f2fs::check_repair( const Partition & partition, OperationDetail & operationdetail ) ++{ ++ exit_status = execute_command( "fsck.f2fs -f -y -a " + Glib::shell_quote( partition.get_path() ), ++ operationdetail, EXEC_CANCEL_SAFE ); ++ bool success = ( exit_status == 0 || exit_status == 1 || exit_status == 2 ); ++ set_status( operationdetail, success ); ++ return success; ++} ++ + } //GParted |