Compare commits

...

27 Commits

Author SHA1 Message Date
Theodore Ts'o 1944d8c53d debian-packaging: add build reproducibility fixups
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-02 00:54:21 -04:00
Theodore Ts'o 20cdfde28f Merge branch 'debian' into debian-packaging 2016-09-02 00:52:46 -04:00
Theodore Ts'o 24c6cf26e5 Merge branch 'next' into debian 2016-09-02 00:51:41 -04:00
Theodore Ts'o 4829ce0958 Merge branch 'debian' into debian-packaging 2016-09-01 15:59:48 -04:00
Theodore Ts'o 02765bf7d3 Merge branch 'next' into debian 2016-09-01 15:59:17 -04:00
Theodore Ts'o 25c4a206a4 Add debian packaging for patches/enable-metadata_csum-by-default
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-08 18:11:27 -04:00
Theodore Ts'o 023e1d403b Reset debian-packaging branch for v1.43.1 2016-06-08 17:39:09 -04:00
Theodore Ts'o 89351df69d Revert "mke2fs.conf: don't enable metadata_csum by default"
This reverts commit 0da058af9f.

For debian testing let's be more aggressive about testing the
metadata_csum feature.
2016-06-08 17:37:51 -04:00
Theodore Ts'o e6fcb8f09f Reset debian branch to v1.43.1 2016-06-08 16:38:10 -04:00
Theodore Ts'o 12147857a0 Synchronize debian packaging with next
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 23:54:12 -04:00
Theodore Ts'o 39e05c5672 Merge branch 'next' into debian-packaging 2016-05-25 00:31:53 -04:00
Theodore Ts'o cdf396a039 debugfs: fix "set_bg <bg num> checksum calc" on 64-bit file systems
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 612f775362)
2016-05-25 00:31:27 -04:00
Theodore Ts'o c59935dc92 e2fsck: improve error messages when the journal sb is corrupt
If the journal superblock is corrupt and the user declines to fix it
(or runs e2fsck -n), make sure the error messages are clear and
explain that e2fsck cannot (safely) proceed.

Addresses-Debian-Bug: #768162

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit d37026ea07)
2016-05-25 00:31:13 -04:00
Theodore Ts'o 4fa126b596 Merge branch 'next' into debian-packaging 2016-05-24 15:42:03 -04:00
Theodore Ts'o 89615d3ad1 Synchronize debian packaging with next
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 15:07:13 -04:00
Theodore Ts'o 602432f38c Merge branch 'debian' into debian-packaging 2016-05-24 13:40:10 -04:00
Theodore Ts'o d04897df10 Add --enable-hardening which builds e2fsprogs with security hardening
Enable the following security features: stack protection, fortify,
read-only relocation tables, immediate dynamic symbol binding, and
text segment ASLR by enabling position independent executable
(PIE).

Special handling is provided for shared library and statically linked
executables.  For all the gory details please see:

   https://lists.debian.org/debian-devel/2016/05/msg00302.html

Distributions who want to do their own special thing can set CFLAGS,
CFLAGS_SHLIB, CLFAGS_STLIB, LDFLAGS, LDFLAGS_SHLIB and LDFLAGS_STATIC
as appropriate.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 13:38:05 -04:00
Theodore Ts'o 97c76e0f09 e2fsck: fix project quota support
Use a large_inode so that when e2fsck is fixing a file system with
project quota enabled, the correct project id's quota is adjusted when
a corrupted inode is deleted.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 13:37:53 -04:00
Theodore Ts'o 64f5a8f084 mke2fs: fix project quota creation
Creating a file system with project quotas can fail if mke2fs is built
using hardening options.  This is because quota_compute_usage() used
ext2fs_get_next_inode() instead of ext2fs_get_inode_full(), and a
small inode was passed into quota_data_add, when a large inode needs
to be used.  As a result get_dq() would end up dereferencing undefined
space in the stack.  Without the hardening options, this would be
zero, so "mke2fs -t ext4 -O project.quota -I 256 test.img" would work
essentially by accident.

Fix this by using ext2fs_get_inode_full() so that a large inode is
available to quota_data_inodes().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 13:37:45 -04:00
Theodore Ts'o e31b4e03ee e2fsck: use com_err error codes instead of EBADMSG and EUCLEAN
Some operating systems may not define EBADMSG and EUCLEAN, so for
better portability use our own private error code numbers.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 13:37:29 -04:00
Theodore Ts'o 8fce6511d9 Clean up spelling errors and other nits in man pages
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 13:37:21 -04:00
Theodore Ts'o c414e897ef tests: fix filter.sed to filter out version numbers of the form 1.43
The regular expression worked for version numbers such as 1.42.12, but
not if there isn't a third component in the version number.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 13:37:07 -04:00
Theodore Ts'o d3a2ca5cde debian: remove unused and deprecated substitution variables
Replace "Source-Version" with "binary:Version" in
e2fsprogs.shlibs.local, and e2fsck-static doesn't have any shared
libraries dependency so remove the ${shlibs:Depends} from the Depends.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit a4d77554fe)
2016-05-21 00:19:28 -04:00
Theodore Ts'o 3e53f0f427 debian: backup/restore the po files which get modified during the build
Before running "make update-gmo", backup the po/*.gmo and po/*.po
files so they can be restored when "make -f debian/rules clean" is
run.  This allows the Debian source tree to built and rebuilt.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 2c0e8c7aac)
2016-05-21 00:19:21 -04:00
Theodore Ts'o 73fb183d03 Merge branch 'next' into debian-packaging 2016-05-20 15:38:47 -04:00
Theodore Ts'o 350497fe84 Add debian packaging for patches/enable-metadata_csum-by-default
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-17 01:50:16 -04:00
Theodore Ts'o 79ac4caa77 Revert "mke2fs.conf: don't enable metadata_csum by default"
This reverts commit 0da058af9f.

For debian testing let's be more aggressive about testing the
metadata_csum feature.
2016-05-17 01:40:19 -04:00
5 changed files with 287 additions and 3 deletions

1
.gitignore vendored
View File

@ -5,7 +5,6 @@ build.static
FILES
^core
*~
patches
Makefile
*.bak
*.diff

View File

@ -0,0 +1,21 @@
Description: Enable metadata_csum by default
For debian testing let's be more aggressive about testing the
metadata_csum feature.
From: Theodore Y. Ts'o <tytso@mit.edu>
--- e2fsprogs-1.43.orig/misc/mke2fs.conf.in
+++ e2fsprogs-1.43/misc/mke2fs.conf.in
@@ -11,11 +11,11 @@
features = has_journal
}
ext4 = {
- features = has_journal,extent,huge_file,flex_bg,64bit,dir_nlink,extra_isize
+ features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
inode_size = 256
}
ext4dev = {
- features = has_journal,extent,huge_file,flex_bg,inline_data,64bit,dir_nlink,extra_isize
+ features = has_journal,extent,huge_file,flex_bg,metadata_csum,inline_data,64bit,dir_nlink,extra_isize
inode_size = 256
options = test_fs=1
}

View File

@ -0,0 +1,262 @@
Description: Fix build reproducibility for mk_cmds and compile_et
The mk_cmds and compile_et scripts include the build directory, which
breaks the build reproducibility goal of Debian.
From: Theodore Ts'o <tytso@mit.edu>
diff --git a/configure b/configure
index 03e24d1..0ac5dcb 100755
--- a/configure
+++ b/configure
@@ -633,8 +633,6 @@ BUILD_CFLAGS
MKINSTALLDIRS
INCLUDES
DO_TEST_SUITE
-ET_DIR
-SS_DIR
LDFLAGS_STATIC
root_sysconfdir
root_libdir
@@ -13805,10 +13803,6 @@ $as_echo "#define _INTL_REDIRECT_MACROS 1" >>confdefs.h
;;
esac
-SS_DIR=`cd ${srcdir}/lib/ss; pwd`
-ET_DIR=`cd ${srcdir}/lib/et; pwd`
-
-
if test "$cross_compiling" = yes ; then
DO_TEST_SUITE=
else
diff --git a/configure.ac b/configure.ac
index a387dfd..1c73301 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1400,13 +1400,6 @@ darwin*)
;;
esac
dnl
-dnl Make the ss and et directories work correctly.
-dnl
-SS_DIR=`cd ${srcdir}/lib/ss; pwd`
-ET_DIR=`cd ${srcdir}/lib/et; pwd`
-AC_SUBST(SS_DIR)
-AC_SUBST(ET_DIR)
-dnl
dnl Only try to run the test suite if we're not cross compiling.
dnl
if test "$cross_compiling" = yes ; then
diff --git a/debugfs/Makefile.in b/debugfs/Makefile.in
index c22b8c0..a3fe13e 100644
--- a/debugfs/Makefile.in
+++ b/debugfs/Makefile.in
@@ -14,7 +14,7 @@ INSTALL = @INSTALL@
PROGS= debugfs
MANPAGES= debugfs.8
-MK_CMDS= _SS_DIR_OVERRIDE=../lib/ss ../lib/ss/mk_cmds
+MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir)/../lib/ss ../lib/ss/mk_cmds
DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \
diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in
index 06d9f55..6f626f4 100644
--- a/e2fsck/Makefile.in
+++ b/e2fsck/Makefile.in
@@ -34,7 +34,7 @@ PROFILED_DEPLIBS= $(DEPPROFILED_LIBSUPPORT) $(PROFILED_LIBEXT2FS) \
$(DEPPROFILED_LIBCOM_ERR) $(DEPPROFILED_LIBBLKID) \
$(DEPPROFILED_LIBUUID) $(DEPPROFILED_LIBE2P)
-COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
+COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../lib/et/et ../lib/et/compile_et
.c.o:
$(E) " CC $<"
diff --git a/lib/et/Makefile.in b/lib/et/Makefile.in
index cb75ab8..476f189 100644
--- a/lib/et/Makefile.in
+++ b/lib/et/Makefile.in
@@ -140,7 +140,7 @@ uninstall::
check:: compile_et
for i in $(srcdir)/test_cases/*.et ; do \
t=`basename $$i | sed -e 's/.et//'`; \
- ./compile_et --build-tree $$i ; \
+ _ET_DIR_OVERRIDE=$(srcdir) ./compile_et $$i ; \
diff -c $(srcdir)/test_cases/$$t.c $$t.c > $$t.failed; \
if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \
diff -c $(srcdir)/test_cases/$$t.h $$t.h >> $$t.failed; \
diff --git a/lib/et/compile_et.sh.in b/lib/et/compile_et.sh.in
index c2861f4..4c4ba17 100644
--- a/lib/et/compile_et.sh.in
+++ b/lib/et/compile_et.sh.in
@@ -4,8 +4,7 @@
datarootdir=@datarootdir@
AWK=@AWK@
-DIR="${DIR-@datadir@/et}"
-ET_DIR="${ET_DIR-@ET_DIR@}"
+DIR=@datadir@/et
if test "$1" = "--build-tree" ; then
shift;
@@ -29,13 +28,13 @@ do
fi
done
+if test -n "$_ET_DIR_OVERRIDE" ; then
+ DIR="$_ET_DIR_OVERRIDE";
+fi
+
if test ! -f "$DIR/et_h.awk" || test ! -f "$DIR/et_c.awk" ; then
- DIR="$ET_DIR"
-# echo "Falling back to $DIR..."
- if test ! -f "$DIR/et_h.awk" || test ! -f "$DIR/et_c.awk" ; then
- echo "compile_et: Couldn't find compile_et's template files."
- exit 1
- fi
+ echo "compile_et: Couldn't find compile_et's template files."
+ exit 1
fi
ROOT=`echo $1 | sed -e s/.et$//`
diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in
index 461920c..6a3656d 100644
--- a/lib/ext2fs/Makefile.in
+++ b/lib/ext2fs/Makefile.in
@@ -13,7 +13,8 @@ DEBUGFS_CFLAGS = -I$(srcdir)/../../e2fsck $(ALL_CFLAGS) -DDEBUGFS
@DEBUGFS_CMT@DEBUGFS_LIB_OBJS = bb_compat.o inode_io.o write_bb_file.o
-MK_CMDS= _SS_DIR_OVERRIDE=../ss ../ss/mk_cmds
+MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir)/../ss ../ss/mk_cmds
+COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
@RESIZER_CMT@RESIZE_LIB_OBJS = dupfs.o
@TEST_IO_CMT@TEST_IO_LIB_OBJS = test_io.o
@@ -254,8 +255,6 @@ all:: ext2fs.pc
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $<
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
-COMPILE_ET=../et/compile_et --build-tree
-
DISTFILES= Makefile *.c *.h image
ext2_err.et: $(DEP_SUBSTITUTE) $(srcdir)/ext2_err.et.in
diff --git a/lib/ss/Makefile.in b/lib/ss/Makefile.in
index 255b58b..f4953f0 100644
--- a/lib/ss/Makefile.in
+++ b/lib/ss/Makefile.in
@@ -28,8 +28,8 @@ BSDLIB_MYDIR = ss
BSDLIB_INSTALL_DIR = $(root_libdir)
TAGS=etags
-COMPILE_ET=../et/compile_et --build-tree
-MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
+MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir) ./mk_cmds
+COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
.c.o:
$(E) " CC $<"
diff --git a/lib/ss/mk_cmds.sh.in b/lib/ss/mk_cmds.sh.in
index a8976a4..0abc19d 100644
--- a/lib/ss/mk_cmds.sh.in
+++ b/lib/ss/mk_cmds.sh.in
@@ -3,8 +3,7 @@
#
datarootdir=@datarootdir@
-DIR="${DIR-@datadir@/ss}"
-SS_DIR="@SS_DIR@"
+DIR=@datadir@/ss
AWK=@AWK@
SED=@SED@
@@ -30,12 +29,8 @@ if test -n "$_SS_DIR_OVERRIDE" ; then
fi
if test ! -f $DIR/ct_c.sed || test ! -f $DIR/ct_c.awk ; then
- DIR="$SS_DIR"
-# echo "Falling back to $DIR..."
- if test ! -f "$DIR/ct_c.sed" || test ! -f "$DIR/ct_c.awk" ; then
- echo "mk_cmds: Couldn't find mk_cmds's template files."
- exit 1
- fi
+ echo "mk_cmds: Couldn't find mk_cmds's template files."
+ exit 1
fi
FILE="$1"
diff --git a/lib/support/Makefile.in b/lib/support/Makefile.in
index 5beaaac..112ba24 100644
--- a/lib/support/Makefile.in
+++ b/lib/support/Makefile.in
@@ -41,7 +41,7 @@ LIBDIR= support
@MAKEFILE_LIBRARY@
@MAKEFILE_PROFILE@
-COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
+COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
.c.o:
$(E) " CC $<"
diff --git a/misc/Makefile.in b/misc/Makefile.in
index e487692..d6436c2 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -115,7 +115,7 @@ STATIC_DEPLIBS= $(DEPLIBSUPPORT) $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR)
LIBS_E2P= $(LIBE2P) $(LIBCOM_ERR)
DEPLIBS_E2P= $(LIBE2P) $(DEPLIBCOM_ERR)
-COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
+COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../lib/et/et ../lib/et/compile_et
# This nastyness is needed because of jfs_user.h hackery; when we finally
# clean up this mess, we should be able to drop it
diff --git a/tests/progs/Makefile.in b/tests/progs/Makefile.in
index 22d9417..f6a31b9 100644
--- a/tests/progs/Makefile.in
+++ b/tests/progs/Makefile.in
@@ -11,7 +11,7 @@ INSTALL = @INSTALL@
@MCONFIG@
-MK_CMDS= _SS_DIR_OVERRIDE=../../lib/ss ../../lib/ss/mk_cmds
+MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir)/../../lib/ss ../../lib/ss/mk_cmds
PROGS= test_icount crcsum
diff --git a/util/gen-android-files b/util/gen-android-files
index 994337b..ebd8778 100755
--- a/util/gen-android-files
+++ b/util/gen-android-files
@@ -14,8 +14,8 @@ ANDROID_GENERATED_FILES="lib/ext2fs/ext2_err.c lib/ext2fs/ext2_err.h \
SS_DIR=$(pwd)/lib/ss
MK_CMDS=/tmp/mk_cmds$$.sh
-sed -e "s;@SS_DIR@;$SS_DIR;" < $SS_DIR/mk_cmds.sh.in \
- | sed -e "s/@AWK@/awk/" | sed -e "s/@SED@/sed/" > $MK_CMDS
+sed -e "s/@AWK@/awk/" < $SS_DIR/mk_cmds.sh.in \
+ | sed -e "s/@SED@/sed/" > $MK_CMDS
sed -e "s/@E2FSPROGS_VERSION@/$(git describe)/" < lib/ext2fs/ext2_err.et.in > lib/ext2fs/ext2_err.et
@@ -29,7 +29,7 @@ done
for i in lib/ss/std_rqs debugfs/debug_cmds debugfs/ro_debug_cmds \
debugfs/extent_cmds
do
- /bin/sh $MK_CMDS $i.ct
+ _SS_DIR_OVERRIDE=lib/ss /bin/sh $MK_CMDS $i.ct
mv -f $(basename $i).c $i.c
done
diff --git a/util/subst.conf.in b/util/subst.conf.in
index ada11e7..fbc044d 100644
--- a/util/subst.conf.in
+++ b/util/subst.conf.in
@@ -1,7 +1,5 @@
AWK @AWK@
SED @SED@
-ET_DIR @ET_DIR@
-SS_DIR @SS_DIR@
E2FSPROGS_MONTH @E2FSPROGS_MONTH@
E2FSPROGS_YEAR @E2FSPROGS_YEAR@
E2FSPROGS_VERSION @E2FSPROGS_VERSION@

2
debian/patches/series vendored Normal file
View File

@ -0,0 +1,2 @@
enable-metadata_csum-by-default
fix-build-reproducibility-in-mk_cmds-and-compile_et

View File

@ -11,11 +11,11 @@
features = has_journal
}
ext4 = {
features = has_journal,extent,huge_file,flex_bg,64bit,dir_nlink,extra_isize
features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
inode_size = 256
}
ext4dev = {
features = has_journal,extent,huge_file,flex_bg,inline_data,64bit,dir_nlink,extra_isize
features = has_journal,extent,huge_file,flex_bg,metadata_csum,inline_data,64bit,dir_nlink,extra_isize
inode_size = 256
options = test_fs=1
}