[extundelete] Add patches from debian for new e2fsprogs

Hicham HAOUARI hicham at fedoraproject.org
Thu Jan 26 14:59:36 UTC 2012


commit fbffe91a0714874c0505509e5aa4ccc9e4c8abd8
Author: Hicham HAOUARI <hicham.haouari at gmail.com>
Date:   Thu Jan 26 14:59:00 2012 +0000

    Add patches from debian for new e2fsprogs

 01_output_dir.patch                               |   57 +++++++++++++++++++++
 02_fix_reserved2_checksum_lo_compile_issue.patch  |   18 +++++++
 03_fix_opaque_ext2_group_desc_compile_error.patch |   18 +++++++
 04_fix_frags_per_group_compile_error.patch        |   22 ++++++++
 extundelete.spec                                  |   14 +++++-
 5 files changed, 128 insertions(+), 1 deletions(-)
---
diff --git a/01_output_dir.patch b/01_output_dir.patch
new file mode 100644
index 0000000..2829e67
--- /dev/null
+++ b/01_output_dir.patch
@@ -0,0 +1,57 @@
+Description: create an additional option: --output-dir
+ This allows restore files in a output specific directory
+ instead  default directory ./RESTORE_FILES
+Forwarded: yes
+Author: Elías Alejandro Año Mendoza <ealmdz at gmail.com>
+Last-Update: 2010-10-25
+
+===================================================================
+--- extundelete.orig/src/extundelete.cc	2010-10-25 11:50:25.000000000 -0500
++++ extundelete/src/extundelete.cc	2010-10-25 12:01:12.000000000 -0500
+@@ -466,6 +466,8 @@
+   os << "  --restore-files 'path' Will restore files which are listed in the file 'path'.\n";
+   os << "                         Each filename should be in the same format as an option\n";
+   os << "                         to --restore-file, and there should be one per line.\n";
++  os << "  --output-dir 'path'    Restore files in the output dir 'path'.\n";
++  os << "                         By default the restored files are created under current directory 'RECOVERED_FILES'.\n";
+   os << "  --restore-all          Attempts to restore everything.\n";
+   os << "  -j journal             Reads an external journal from the named file.\n";
+   os << "  -b blocknumber         Uses the backup superblock at blocknumber when opening\n";
+@@ -601,6 +603,7 @@
+ 		opt_show_journal_inodes,
+ 		opt_restore_file,
+ 		opt_restore_files,
++		opt_output_dir,
+ 		opt_restore_directory,
+ 		opt_restore_inode,
+ 		opt_restore_all,
+@@ -626,6 +629,7 @@
+ 		{"restore-inode", 1, &long_option, opt_restore_inode},
+ 		{"restore-file", 1, &long_option, opt_restore_file},
+ 		{"restore-files", 1, &long_option, opt_restore_files},
++		{"output-dir", 1, &long_option, opt_output_dir},
+ 		{"restore-directory", 1, &long_option, opt_restore_directory},
+ 		{"restore-all", 0, &long_option, opt_restore_all},
+ 		{"show-hardlinks", 0, &long_option, opt_show_hardlinks},
+@@ -688,6 +692,21 @@
+ 			case opt_restore_files:
+ 				commandline_restore_files = optarg;
+ 				break;
++			case opt_output_dir:
++				{
++				std::string optarg1 = optarg;
++				int subcad = optarg1.find_last_of("/");
++				std::string res = optarg1.substr(subcad+1);
++					if(res!="")
++						{
++						outputdir = optarg1 + "/RECOVERED_FILES/";
++						}
++					else
++						{
++						outputdir = optarg1 + "RECOVERED_FILES/";
++						}
++				}
++				break;
+ 			case opt_restore_directory:
+ 				commandline_restore_directory = optarg;
+ 				break;
diff --git a/02_fix_reserved2_checksum_lo_compile_issue.patch b/02_fix_reserved2_checksum_lo_compile_issue.patch
new file mode 100644
index 0000000..606e5f7
--- /dev/null
+++ b/02_fix_reserved2_checksum_lo_compile_issue.patch
@@ -0,0 +1,18 @@
+Description: fix compile error regarding linux2.l_i_reserved2 deprecation
+  See git commit 89efc88e65136ece22708cc28ec4124a33feeecd
+  "libext2fs: add metadata checksum and snapshot feature flags"
+  in upstreams e2fsprogs repository
+Forwarded: yes
+Author: Michael Prokop <mika at debian.org>
+Last-Update: 2011-01-11
+
+--- a/src/extundelete.cc
++++ b/src/extundelete.cc
+@@ -2611,5 +2611,6 @@ void parse_inode_block(struct ext2_inode *inode, const char *buf, ext2_ino_t ino
+   //FIXME: need to change behavior depending on the fs operating system
+ 	inode->osd2.linux2.l_i_uid_high = le16_to_cpu( (uint16_t *) &inodebuf[item*58] );
+ 	inode->osd2.linux2.l_i_gid_high = le16_to_cpu( (uint16_t *) &inodebuf[item*60] );
+-	inode->osd2.linux2.l_i_reserved2 = le32_to_cpu( (uint32_t *) &inodebuf[item*62] );
++	inode->osd2.linux2.l_i_checksum_lo = le16_to_cpu( (uint16_t *) &inodebuf[item*62] );
++	inode->osd2.linux2.l_i_reserved = le16_to_cpu( (uint16_t *) &inodebuf[item*63] );
+ }
diff --git a/03_fix_opaque_ext2_group_desc_compile_error.patch b/03_fix_opaque_ext2_group_desc_compile_error.patch
new file mode 100644
index 0000000..d81d807
--- /dev/null
+++ b/03_fix_opaque_ext2_group_desc_compile_error.patch
@@ -0,0 +1,18 @@
+Description: fix FTBFS of #634401 regarding opaque_ext2_group_desc
+  extundelete: FTBFS: extundelete.cc:963:47: error:
+   invalid use of incomplete type 'struct opaque_ext2_group_desc'
+Forwarded: yes
+Author: Eric Sandeen <sandeen at redhat.com>
+Last-Update: 2011-01-11
+
+--- a/src/extundelete.cc
++++ b/src/extundelete.cc
+@@ -941,7 +941,7 @@ int load_super_block(ext2_filsys fs)
+ 	group_descriptor_table = new ext2_group_desc[groups_];
+ 	for (uint32_t n = 0; n < fs->group_desc_count; n++)
+ 	{
+-		group_descriptor_table[n] = fs->group_desc[n];
++		group_descriptor_table[n] = *ext2fs_group_desc(fs, fs->group_desc, n);
+ 	}
+ 	return errcode;
+ }
diff --git a/04_fix_frags_per_group_compile_error.patch b/04_fix_frags_per_group_compile_error.patch
new file mode 100644
index 0000000..55291ec
--- /dev/null
+++ b/04_fix_frags_per_group_compile_error.patch
@@ -0,0 +1,22 @@
+Description: fix compile error in insertionops.cc regarding rename of s_frags_per_group
+  Fixes:
+    insertionops.cc: In function 'std::ostream& operator<<(std::ostream&, const ext2_super_block*)':
+    insertionops.cc:66:47: error: 'const struct ext2_super_block' has no member named 's_frags_per_group'
+  See git commit 412376efff3c0e0c2fea00666c2457e6f2ae1878
+  "Add basic BIGALLOC support for cluster-based allocation" in
+  upstreams e2fsprogs repository
+Forwarded: yes
+Author: Michael Prokop <mika at debian.org>
+Last-Update: 2011-01-11
+
+--- a/src/insertionops.cc
++++ b/src/insertionops.cc
+@@ -63,7 +63,7 @@ std::ostream& operator<<(std::ostream& os, const ext2_super_block* const s_block
+   os << "Block size: " << EXT2_BLOCK_SIZE(s_block) << std::endl;
+   os << "Fragment size: " << EXT2_FRAG_SIZE(s_block) << std::endl;
+   os << "# Blocks per group: " << s_block->s_blocks_per_group << std::endl;
+-  os << "# Fragments per group: " << s_block->s_frags_per_group << std::endl;
++  os << "# Fragments per group: " << s_block->s_clusters_per_group << std::endl;
+   os << "# Inodes per group: " << s_block->s_inodes_per_group << std::endl;
+   os << "Mount time: " << s_block->s_mtime << std::endl;
+   os << "Write time: " << s_block->s_wtime << std::endl;
diff --git a/extundelete.spec b/extundelete.spec
index 43ff942..78d0f5b 100644
--- a/extundelete.spec
+++ b/extundelete.spec
@@ -1,6 +1,6 @@
 Name:           extundelete
 Version:        0.2.0
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        An ext3 and ext4 file system undeletion utility
 
 Group:          Applications/System
@@ -11,6 +11,11 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  e2fsprogs-devel
 
+Patch0:         01_output_dir.patch
+Patch1:         02_fix_reserved2_checksum_lo_compile_issue.patch
+Patch2:         03_fix_opaque_ext2_group_desc_compile_error.patch
+Patch3:         04_fix_frags_per_group_compile_error.patch
+
 %description
 extundelete is a utility that can recover deleted files from an ext3 or ext4
 partition. extundelete uses the information stored in the partition's journal
@@ -21,6 +26,10 @@ recovering your files!
 
 %prep
 %setup -q
+%patch0 -p1 -b .output-dir
+%patch1 -p1 -b .fix-reserved2-checksum-lo-compile-issue
+%patch2 -p1 -b .fix-opaque-ext2-group-desc-compile-error
+%patch3 -p1 -b .fix-frags-per-group-compile-error
 
 %build
 %configure
@@ -43,6 +52,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jan 26 2012 Hicham HAOUARI <hicham.haouari at gmail.com> - 0.2.0-4
+- Add patches from debian for e2fsprogs changes 
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.2.0-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list